diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 16:28:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 16:28:01 -0400 |
commit | 82aff107f8c9194586f68e86412246629d05670a (patch) | |
tree | c4336e8bbd453235dafecba6b8dca24c8cbcb2e5 /arch/powerpc/lib | |
parent | d974d905cbfc1039a73ba0c7eea3f4d4e13c0624 (diff) | |
parent | 208b3a4c196e733b9cec006dc132cfc149b2810a (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (152 commits)
powerpc: Fix hard CPU IDs detection
powerpc/pmac: Update via-pmu to new syscore_ops
powerpc/kvm: Fix the build for 32-bit Book 3S (classic) processors
powerpc/kvm: Fix kvmppc_core_pending_dec
powerpc: Remove last piece of GEMINI
powerpc: Fix for Pegasos keyboard and mouse
powerpc: Make early memory scan more resilient to out of order nodes
powerpc/pseries/iommu: Cleanup ddw naming
powerpc/pseries/iommu: Find windows after kexec during boot
powerpc/pseries/iommu: Remove ddw property when destroying window
powerpc/pseries/iommu: Add additional checks when changing iommu mask
powerpc/pseries/iommu: Use correct return type in dupe_ddw_if_already_created
powerpc: Remove unused/obsolete CONFIG_XICS
misc: Add CARMA DATA-FPGA Programmer support
misc: Add CARMA DATA-FPGA Access Driver
powerpc: Make IRQ_NOREQUEST last to clear, first to set
powerpc: Integrated Flash controller device tree bindings
powerpc/85xx: Create dts of each core in CAMP mode for P1020RDB
powerpc/85xx: Fix PCIe IDSEL for Px020RDB
powerpc/85xx: P2020 DTS: re-organize dts files
...
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r-- | arch/powerpc/lib/alloc.c | 8 | ||||
-rw-r--r-- | arch/powerpc/lib/copypage_64.S | 7 | ||||
-rw-r--r-- | arch/powerpc/lib/devres.c | 6 | ||||
-rw-r--r-- | arch/powerpc/lib/sstep.c | 61 |
4 files changed, 34 insertions, 48 deletions
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c index f53e09c7dac7..13b676c20d12 100644 --- a/arch/powerpc/lib/alloc.c +++ b/arch/powerpc/lib/alloc.c | |||
@@ -6,14 +6,6 @@ | |||
6 | 6 | ||
7 | #include <asm/system.h> | 7 | #include <asm/system.h> |
8 | 8 | ||
9 | void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask) | ||
10 | { | ||
11 | if (mem_init_done) | ||
12 | return kmalloc(size, mask); | ||
13 | else | ||
14 | return alloc_bootmem(size); | ||
15 | } | ||
16 | |||
17 | void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) | 9 | void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask) |
18 | { | 10 | { |
19 | void *p; | 11 | void *p; |
diff --git a/arch/powerpc/lib/copypage_64.S b/arch/powerpc/lib/copypage_64.S index 4d4eeb900486..53dcb6b1b708 100644 --- a/arch/powerpc/lib/copypage_64.S +++ b/arch/powerpc/lib/copypage_64.S | |||
@@ -6,6 +6,7 @@ | |||
6 | * as published by the Free Software Foundation; either version | 6 | * as published by the Free Software Foundation; either version |
7 | * 2 of the License, or (at your option) any later version. | 7 | * 2 of the License, or (at your option) any later version. |
8 | */ | 8 | */ |
9 | #include <asm/page.h> | ||
9 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
10 | #include <asm/ppc_asm.h> | 11 | #include <asm/ppc_asm.h> |
11 | #include <asm/asm-offsets.h> | 12 | #include <asm/asm-offsets.h> |
@@ -15,9 +16,9 @@ PPC64_CACHES: | |||
15 | .tc ppc64_caches[TC],ppc64_caches | 16 | .tc ppc64_caches[TC],ppc64_caches |
16 | .section ".text" | 17 | .section ".text" |
17 | 18 | ||
18 | 19 | _GLOBAL(copy_page) | |
19 | _GLOBAL(copy_4K_page) | 20 | lis r5,PAGE_SIZE@h |
20 | li r5,4096 /* 4K page size */ | 21 | ori r5,r5,PAGE_SIZE@l |
21 | BEGIN_FTR_SECTION | 22 | BEGIN_FTR_SECTION |
22 | ld r10,PPC64_CACHES@toc(r2) | 23 | ld r10,PPC64_CACHES@toc(r2) |
23 | lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */ | 24 | lwz r11,DCACHEL1LOGLINESIZE(r10) /* log2 of cache line size */ |
diff --git a/arch/powerpc/lib/devres.c b/arch/powerpc/lib/devres.c index deac4d30daf4..e91615abae66 100644 --- a/arch/powerpc/lib/devres.c +++ b/arch/powerpc/lib/devres.c | |||
@@ -9,11 +9,11 @@ | |||
9 | 9 | ||
10 | #include <linux/device.h> /* devres_*(), devm_ioremap_release() */ | 10 | #include <linux/device.h> /* devres_*(), devm_ioremap_release() */ |
11 | #include <linux/gfp.h> | 11 | #include <linux/gfp.h> |
12 | #include <linux/io.h> /* ioremap_flags() */ | 12 | #include <linux/io.h> /* ioremap_prot() */ |
13 | #include <linux/module.h> /* EXPORT_SYMBOL() */ | 13 | #include <linux/module.h> /* EXPORT_SYMBOL() */ |
14 | 14 | ||
15 | /** | 15 | /** |
16 | * devm_ioremap_prot - Managed ioremap_flags() | 16 | * devm_ioremap_prot - Managed ioremap_prot() |
17 | * @dev: Generic device to remap IO address for | 17 | * @dev: Generic device to remap IO address for |
18 | * @offset: BUS offset to map | 18 | * @offset: BUS offset to map |
19 | * @size: Size of map | 19 | * @size: Size of map |
@@ -31,7 +31,7 @@ void __iomem *devm_ioremap_prot(struct device *dev, resource_size_t offset, | |||
31 | if (!ptr) | 31 | if (!ptr) |
32 | return NULL; | 32 | return NULL; |
33 | 33 | ||
34 | addr = ioremap_flags(offset, size, flags); | 34 | addr = ioremap_prot(offset, size, flags); |
35 | if (addr) { | 35 | if (addr) { |
36 | *ptr = addr; | 36 | *ptr = addr; |
37 | devres_add(dev, ptr); | 37 | devres_add(dev, ptr); |
diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c index f73daa6f3970..9a52349874ee 100644 --- a/arch/powerpc/lib/sstep.c +++ b/arch/powerpc/lib/sstep.c | |||
@@ -46,6 +46,18 @@ extern int do_stxvd2x(int rn, unsigned long ea); | |||
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Emulate the truncation of 64 bit values in 32-bit mode. | ||
50 | */ | ||
51 | static unsigned long truncate_if_32bit(unsigned long msr, unsigned long val) | ||
52 | { | ||
53 | #ifdef __powerpc64__ | ||
54 | if ((msr & MSR_64BIT) == 0) | ||
55 | val &= 0xffffffffUL; | ||
56 | #endif | ||
57 | return val; | ||
58 | } | ||
59 | |||
60 | /* | ||
49 | * Determine whether a conditional branch instruction would branch. | 61 | * Determine whether a conditional branch instruction would branch. |
50 | */ | 62 | */ |
51 | static int __kprobes branch_taken(unsigned int instr, struct pt_regs *regs) | 63 | static int __kprobes branch_taken(unsigned int instr, struct pt_regs *regs) |
@@ -91,11 +103,8 @@ static unsigned long __kprobes dform_ea(unsigned int instr, struct pt_regs *regs | |||
91 | if (instr & 0x04000000) /* update forms */ | 103 | if (instr & 0x04000000) /* update forms */ |
92 | regs->gpr[ra] = ea; | 104 | regs->gpr[ra] = ea; |
93 | } | 105 | } |
94 | #ifdef __powerpc64__ | 106 | |
95 | if (!(regs->msr & MSR_SF)) | 107 | return truncate_if_32bit(regs->msr, ea); |
96 | ea &= 0xffffffffUL; | ||
97 | #endif | ||
98 | return ea; | ||
99 | } | 108 | } |
100 | 109 | ||
101 | #ifdef __powerpc64__ | 110 | #ifdef __powerpc64__ |
@@ -114,9 +123,8 @@ static unsigned long __kprobes dsform_ea(unsigned int instr, struct pt_regs *reg | |||
114 | if ((instr & 3) == 1) /* update forms */ | 123 | if ((instr & 3) == 1) /* update forms */ |
115 | regs->gpr[ra] = ea; | 124 | regs->gpr[ra] = ea; |
116 | } | 125 | } |
117 | if (!(regs->msr & MSR_SF)) | 126 | |
118 | ea &= 0xffffffffUL; | 127 | return truncate_if_32bit(regs->msr, ea); |
119 | return ea; | ||
120 | } | 128 | } |
121 | #endif /* __powerpc64 */ | 129 | #endif /* __powerpc64 */ |
122 | 130 | ||
@@ -137,11 +145,8 @@ static unsigned long __kprobes xform_ea(unsigned int instr, struct pt_regs *regs | |||
137 | if (do_update) /* update forms */ | 145 | if (do_update) /* update forms */ |
138 | regs->gpr[ra] = ea; | 146 | regs->gpr[ra] = ea; |
139 | } | 147 | } |
140 | #ifdef __powerpc64__ | 148 | |
141 | if (!(regs->msr & MSR_SF)) | 149 | return truncate_if_32bit(regs->msr, ea); |
142 | ea &= 0xffffffffUL; | ||
143 | #endif | ||
144 | return ea; | ||
145 | } | 150 | } |
146 | 151 | ||
147 | /* | 152 | /* |
@@ -467,7 +472,7 @@ static void __kprobes set_cr0(struct pt_regs *regs, int rd) | |||
467 | 472 | ||
468 | regs->ccr = (regs->ccr & 0x0fffffff) | ((regs->xer >> 3) & 0x10000000); | 473 | regs->ccr = (regs->ccr & 0x0fffffff) | ((regs->xer >> 3) & 0x10000000); |
469 | #ifdef __powerpc64__ | 474 | #ifdef __powerpc64__ |
470 | if (!(regs->msr & MSR_SF)) | 475 | if (!(regs->msr & MSR_64BIT)) |
471 | val = (int) val; | 476 | val = (int) val; |
472 | #endif | 477 | #endif |
473 | if (val < 0) | 478 | if (val < 0) |
@@ -488,7 +493,7 @@ static void __kprobes add_with_carry(struct pt_regs *regs, int rd, | |||
488 | ++val; | 493 | ++val; |
489 | regs->gpr[rd] = val; | 494 | regs->gpr[rd] = val; |
490 | #ifdef __powerpc64__ | 495 | #ifdef __powerpc64__ |
491 | if (!(regs->msr & MSR_SF)) { | 496 | if (!(regs->msr & MSR_64BIT)) { |
492 | val = (unsigned int) val; | 497 | val = (unsigned int) val; |
493 | val1 = (unsigned int) val1; | 498 | val1 = (unsigned int) val1; |
494 | } | 499 | } |
@@ -571,8 +576,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
571 | if ((instr & 2) == 0) | 576 | if ((instr & 2) == 0) |
572 | imm += regs->nip; | 577 | imm += regs->nip; |
573 | regs->nip += 4; | 578 | regs->nip += 4; |
574 | if ((regs->msr & MSR_SF) == 0) | 579 | regs->nip = truncate_if_32bit(regs->msr, regs->nip); |
575 | regs->nip &= 0xffffffffUL; | ||
576 | if (instr & 1) | 580 | if (instr & 1) |
577 | regs->link = regs->nip; | 581 | regs->link = regs->nip; |
578 | if (branch_taken(instr, regs)) | 582 | if (branch_taken(instr, regs)) |
@@ -605,13 +609,9 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
605 | imm -= 0x04000000; | 609 | imm -= 0x04000000; |
606 | if ((instr & 2) == 0) | 610 | if ((instr & 2) == 0) |
607 | imm += regs->nip; | 611 | imm += regs->nip; |
608 | if (instr & 1) { | 612 | if (instr & 1) |
609 | regs->link = regs->nip + 4; | 613 | regs->link = truncate_if_32bit(regs->msr, regs->nip + 4); |
610 | if ((regs->msr & MSR_SF) == 0) | 614 | imm = truncate_if_32bit(regs->msr, imm); |
611 | regs->link &= 0xffffffffUL; | ||
612 | } | ||
613 | if ((regs->msr & MSR_SF) == 0) | ||
614 | imm &= 0xffffffffUL; | ||
615 | regs->nip = imm; | 615 | regs->nip = imm; |
616 | return 1; | 616 | return 1; |
617 | case 19: | 617 | case 19: |
@@ -619,11 +619,8 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
619 | case 16: /* bclr */ | 619 | case 16: /* bclr */ |
620 | case 528: /* bcctr */ | 620 | case 528: /* bcctr */ |
621 | imm = (instr & 0x400)? regs->ctr: regs->link; | 621 | imm = (instr & 0x400)? regs->ctr: regs->link; |
622 | regs->nip += 4; | 622 | regs->nip = truncate_if_32bit(regs->msr, regs->nip + 4); |
623 | if ((regs->msr & MSR_SF) == 0) { | 623 | imm = truncate_if_32bit(regs->msr, imm); |
624 | regs->nip &= 0xffffffffUL; | ||
625 | imm &= 0xffffffffUL; | ||
626 | } | ||
627 | if (instr & 1) | 624 | if (instr & 1) |
628 | regs->link = regs->nip; | 625 | regs->link = regs->nip; |
629 | if (branch_taken(instr, regs)) | 626 | if (branch_taken(instr, regs)) |
@@ -1617,11 +1614,7 @@ int __kprobes emulate_step(struct pt_regs *regs, unsigned int instr) | |||
1617 | return 0; /* invoke DSI if -EFAULT? */ | 1614 | return 0; /* invoke DSI if -EFAULT? */ |
1618 | } | 1615 | } |
1619 | instr_done: | 1616 | instr_done: |
1620 | regs->nip += 4; | 1617 | regs->nip = truncate_if_32bit(regs->msr, regs->nip + 4); |
1621 | #ifdef __powerpc64__ | ||
1622 | if ((regs->msr & MSR_SF) == 0) | ||
1623 | regs->nip &= 0xffffffffUL; | ||
1624 | #endif | ||
1625 | return 1; | 1618 | return 1; |
1626 | 1619 | ||
1627 | logical_done: | 1620 | logical_done: |