diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-03-01 06:47:58 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-01 06:47:58 -0500 |
commit | 55f2b78995826d549401bdf20abeac1832636bb6 (patch) | |
tree | 931b31f3b6e0879df0f9a1d58ffd040d9a652f2e /arch/powerpc | |
parent | f5c1aa1537be39d8b9bb5279b5881d81898fd3cd (diff) | |
parent | 92b9af9e4f144535c65aee673cfad309f25fa465 (diff) |
Merge branch 'x86/urgent' into x86/pat
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/align.c | 29 | ||||
-rw-r--r-- | arch/powerpc/lib/copyuser_64.S | 38 | ||||
-rw-r--r-- | arch/powerpc/lib/memcpy_64.S | 26 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_pci.c | 17 |
4 files changed, 81 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index ada06924a423..73cb6a3229ae 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
@@ -367,27 +367,24 @@ static int emulate_multiple(struct pt_regs *regs, unsigned char __user *addr, | |||
367 | static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg, | 367 | static int emulate_fp_pair(unsigned char __user *addr, unsigned int reg, |
368 | unsigned int flags) | 368 | unsigned int flags) |
369 | { | 369 | { |
370 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 370 | char *ptr0 = (char *) ¤t->thread.TS_FPR(reg); |
371 | int i, ret; | 371 | char *ptr1 = (char *) ¤t->thread.TS_FPR(reg+1); |
372 | int i, ret, sw = 0; | ||
372 | 373 | ||
373 | if (!(flags & F)) | 374 | if (!(flags & F)) |
374 | return 0; | 375 | return 0; |
375 | if (reg & 1) | 376 | if (reg & 1) |
376 | return 0; /* invalid form: FRS/FRT must be even */ | 377 | return 0; /* invalid form: FRS/FRT must be even */ |
377 | if (!(flags & SW)) { | 378 | if (flags & SW) |
378 | /* not byte-swapped - easy */ | 379 | sw = 7; |
379 | if (!(flags & ST)) | 380 | ret = 0; |
380 | ret = __copy_from_user(ptr, addr, 16); | 381 | for (i = 0; i < 8; ++i) { |
381 | else | 382 | if (!(flags & ST)) { |
382 | ret = __copy_to_user(addr, ptr, 16); | 383 | ret |= __get_user(ptr0[i^sw], addr + i); |
383 | } else { | 384 | ret |= __get_user(ptr1[i^sw], addr + i + 8); |
384 | /* each FPR value is byte-swapped separately */ | 385 | } else { |
385 | ret = 0; | 386 | ret |= __put_user(ptr0[i^sw], addr + i); |
386 | for (i = 0; i < 16; ++i) { | 387 | ret |= __put_user(ptr1[i^sw], addr + i + 8); |
387 | if (!(flags & ST)) | ||
388 | ret |= __get_user(ptr[i^7], addr + i); | ||
389 | else | ||
390 | ret |= __put_user(ptr[i^7], addr + i); | ||
391 | } | 388 | } |
392 | } | 389 | } |
393 | if (ret) | 390 | if (ret) |
diff --git a/arch/powerpc/lib/copyuser_64.S b/arch/powerpc/lib/copyuser_64.S index 70693a5c12a1..693b14a778fa 100644 --- a/arch/powerpc/lib/copyuser_64.S +++ b/arch/powerpc/lib/copyuser_64.S | |||
@@ -62,18 +62,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
62 | 72: std r8,8(r3) | 62 | 72: std r8,8(r3) |
63 | beq+ 3f | 63 | beq+ 3f |
64 | addi r3,r3,16 | 64 | addi r3,r3,16 |
65 | 23: ld r9,8(r4) | ||
66 | .Ldo_tail: | 65 | .Ldo_tail: |
67 | bf cr7*4+1,1f | 66 | bf cr7*4+1,1f |
68 | rotldi r9,r9,32 | 67 | 23: lwz r9,8(r4) |
68 | addi r4,r4,4 | ||
69 | 73: stw r9,0(r3) | 69 | 73: stw r9,0(r3) |
70 | addi r3,r3,4 | 70 | addi r3,r3,4 |
71 | 1: bf cr7*4+2,2f | 71 | 1: bf cr7*4+2,2f |
72 | rotldi r9,r9,16 | 72 | 44: lhz r9,8(r4) |
73 | addi r4,r4,2 | ||
73 | 74: sth r9,0(r3) | 74 | 74: sth r9,0(r3) |
74 | addi r3,r3,2 | 75 | addi r3,r3,2 |
75 | 2: bf cr7*4+3,3f | 76 | 2: bf cr7*4+3,3f |
76 | rotldi r9,r9,8 | 77 | 45: lbz r9,8(r4) |
77 | 75: stb r9,0(r3) | 78 | 75: stb r9,0(r3) |
78 | 3: li r3,0 | 79 | 3: li r3,0 |
79 | blr | 80 | blr |
@@ -141,11 +142,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
141 | 6: cmpwi cr1,r5,8 | 142 | 6: cmpwi cr1,r5,8 |
142 | addi r3,r3,32 | 143 | addi r3,r3,32 |
143 | sld r9,r9,r10 | 144 | sld r9,r9,r10 |
144 | ble cr1,.Ldo_tail | 145 | ble cr1,7f |
145 | 34: ld r0,8(r4) | 146 | 34: ld r0,8(r4) |
146 | srd r7,r0,r11 | 147 | srd r7,r0,r11 |
147 | or r9,r7,r9 | 148 | or r9,r7,r9 |
148 | b .Ldo_tail | 149 | 7: |
150 | bf cr7*4+1,1f | ||
151 | rotldi r9,r9,32 | ||
152 | 94: stw r9,0(r3) | ||
153 | addi r3,r3,4 | ||
154 | 1: bf cr7*4+2,2f | ||
155 | rotldi r9,r9,16 | ||
156 | 95: sth r9,0(r3) | ||
157 | addi r3,r3,2 | ||
158 | 2: bf cr7*4+3,3f | ||
159 | rotldi r9,r9,8 | ||
160 | 96: stb r9,0(r3) | ||
161 | 3: li r3,0 | ||
162 | blr | ||
149 | 163 | ||
150 | .Ldst_unaligned: | 164 | .Ldst_unaligned: |
151 | PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ | 165 | PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */ |
@@ -218,7 +232,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
218 | 121: | 232 | 121: |
219 | 132: | 233 | 132: |
220 | addi r3,r3,8 | 234 | addi r3,r3,8 |
221 | 123: | ||
222 | 134: | 235 | 134: |
223 | 135: | 236 | 135: |
224 | 138: | 237 | 138: |
@@ -226,6 +239,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
226 | 140: | 239 | 140: |
227 | 141: | 240 | 141: |
228 | 142: | 241 | 142: |
242 | 123: | ||
243 | 144: | ||
244 | 145: | ||
229 | 245 | ||
230 | /* | 246 | /* |
231 | * here we have had a fault on a load and r3 points to the first | 247 | * here we have had a fault on a load and r3 points to the first |
@@ -309,6 +325,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
309 | 187: | 325 | 187: |
310 | 188: | 326 | 188: |
311 | 189: | 327 | 189: |
328 | 194: | ||
329 | 195: | ||
330 | 196: | ||
312 | 1: | 331 | 1: |
313 | ld r6,-24(r1) | 332 | ld r6,-24(r1) |
314 | ld r5,-8(r1) | 333 | ld r5,-8(r1) |
@@ -329,7 +348,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
329 | .llong 72b,172b | 348 | .llong 72b,172b |
330 | .llong 23b,123b | 349 | .llong 23b,123b |
331 | .llong 73b,173b | 350 | .llong 73b,173b |
351 | .llong 44b,144b | ||
332 | .llong 74b,174b | 352 | .llong 74b,174b |
353 | .llong 45b,145b | ||
333 | .llong 75b,175b | 354 | .llong 75b,175b |
334 | .llong 24b,124b | 355 | .llong 24b,124b |
335 | .llong 25b,125b | 356 | .llong 25b,125b |
@@ -347,6 +368,9 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
347 | .llong 79b,179b | 368 | .llong 79b,179b |
348 | .llong 80b,180b | 369 | .llong 80b,180b |
349 | .llong 34b,134b | 370 | .llong 34b,134b |
371 | .llong 94b,194b | ||
372 | .llong 95b,195b | ||
373 | .llong 96b,196b | ||
350 | .llong 35b,135b | 374 | .llong 35b,135b |
351 | .llong 81b,181b | 375 | .llong 81b,181b |
352 | .llong 36b,136b | 376 | .llong 36b,136b |
diff --git a/arch/powerpc/lib/memcpy_64.S b/arch/powerpc/lib/memcpy_64.S index fe2d34e5332d..e178922b2c21 100644 --- a/arch/powerpc/lib/memcpy_64.S +++ b/arch/powerpc/lib/memcpy_64.S | |||
@@ -53,18 +53,19 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
53 | 3: std r8,8(r3) | 53 | 3: std r8,8(r3) |
54 | beq 3f | 54 | beq 3f |
55 | addi r3,r3,16 | 55 | addi r3,r3,16 |
56 | ld r9,8(r4) | ||
57 | .Ldo_tail: | 56 | .Ldo_tail: |
58 | bf cr7*4+1,1f | 57 | bf cr7*4+1,1f |
59 | rotldi r9,r9,32 | 58 | lwz r9,8(r4) |
59 | addi r4,r4,4 | ||
60 | stw r9,0(r3) | 60 | stw r9,0(r3) |
61 | addi r3,r3,4 | 61 | addi r3,r3,4 |
62 | 1: bf cr7*4+2,2f | 62 | 1: bf cr7*4+2,2f |
63 | rotldi r9,r9,16 | 63 | lhz r9,8(r4) |
64 | addi r4,r4,2 | ||
64 | sth r9,0(r3) | 65 | sth r9,0(r3) |
65 | addi r3,r3,2 | 66 | addi r3,r3,2 |
66 | 2: bf cr7*4+3,3f | 67 | 2: bf cr7*4+3,3f |
67 | rotldi r9,r9,8 | 68 | lbz r9,8(r4) |
68 | stb r9,0(r3) | 69 | stb r9,0(r3) |
69 | 3: ld r3,48(r1) /* return dest pointer */ | 70 | 3: ld r3,48(r1) /* return dest pointer */ |
70 | blr | 71 | blr |
@@ -133,11 +134,24 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD) | |||
133 | cmpwi cr1,r5,8 | 134 | cmpwi cr1,r5,8 |
134 | addi r3,r3,32 | 135 | addi r3,r3,32 |
135 | sld r9,r9,r10 | 136 | sld r9,r9,r10 |
136 | ble cr1,.Ldo_tail | 137 | ble cr1,6f |
137 | ld r0,8(r4) | 138 | ld r0,8(r4) |
138 | srd r7,r0,r11 | 139 | srd r7,r0,r11 |
139 | or r9,r7,r9 | 140 | or r9,r7,r9 |
140 | b .Ldo_tail | 141 | 6: |
142 | bf cr7*4+1,1f | ||
143 | rotldi r9,r9,32 | ||
144 | stw r9,0(r3) | ||
145 | addi r3,r3,4 | ||
146 | 1: bf cr7*4+2,2f | ||
147 | rotldi r9,r9,16 | ||
148 | sth r9,0(r3) | ||
149 | addi r3,r3,2 | ||
150 | 2: bf cr7*4+3,3f | ||
151 | rotldi r9,r9,8 | ||
152 | stb r9,0(r3) | ||
153 | 3: ld r3,48(r1) /* return dest pointer */ | ||
154 | blr | ||
141 | 155 | ||
142 | .Ldst_unaligned: | 156 | .Ldst_unaligned: |
143 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 | 157 | PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7 |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 77fae5f64f2e..5558d932b4d5 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -204,6 +204,23 @@ static int __init ppc4xx_setup_one_pci_PMM(struct pci_controller *hose, | |||
204 | { | 204 | { |
205 | u32 ma, pcila, pciha; | 205 | u32 ma, pcila, pciha; |
206 | 206 | ||
207 | /* Hack warning ! The "old" PCI 2.x cell only let us configure the low | ||
208 | * 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit | ||
209 | * address are actually hard wired to a value that appears to depend | ||
210 | * on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx. | ||
211 | * | ||
212 | * The trick here is we just crop those top bits and ignore them when | ||
213 | * programming the chip. That means the device-tree has to be right | ||
214 | * for the specific part used (we don't print a warning if it's wrong | ||
215 | * but on the other hand, you'll crash quickly enough), but at least | ||
216 | * this code should work whatever the hard coded value is | ||
217 | */ | ||
218 | plb_addr &= 0xffffffffull; | ||
219 | |||
220 | /* Note: Due to the above hack, the test below doesn't actually test | ||
221 | * if you address is above 4G, but it tests that address and | ||
222 | * (address + size) are both contained in the same 4G | ||
223 | */ | ||
207 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || | 224 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || |
208 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { | 225 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { |
209 | printk(KERN_WARNING "%s: Resource out of range\n", | 226 | printk(KERN_WARNING "%s: Resource out of range\n", |