diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-20 16:53:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-20 16:53:16 -0500 |
commit | 198d2f63a6096fe575b696b13ba61b62c620266f (patch) | |
tree | d0c2b0697370cc670029cd1eb2a80c35c71eac60 /arch/sparc | |
parent | 0da2b300b91ddeb9944c3fb4faaf78c1c482c0af (diff) | |
parent | 1f474646fdc36b457606bbcd6a3592e6cbd31ac4 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/kstack.h | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/of_device_32.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/pci.c | 7 | ||||
-rw-r--r-- | arch/sparc/kernel/process_32.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 8 | ||||
-rw-r--r-- | arch/sparc/kernel/signal32.c | 10 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 6 | ||||
-rw-r--r-- | arch/sparc/kernel/signal_64.c | 8 | ||||
-rw-r--r-- | arch/sparc/kernel/tsb.S | 6 |
9 files changed, 36 insertions, 17 deletions
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h index 4248d969272f..5247283d1c03 100644 --- a/arch/sparc/kernel/kstack.h +++ b/arch/sparc/kernel/kstack.h | |||
@@ -11,6 +11,10 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp) | |||
11 | { | 11 | { |
12 | unsigned long base = (unsigned long) tp; | 12 | unsigned long base = (unsigned long) tp; |
13 | 13 | ||
14 | /* Stack pointer must be 16-byte aligned. */ | ||
15 | if (sp & (16UL - 1)) | ||
16 | return false; | ||
17 | |||
14 | if (sp >= (base + sizeof(struct thread_info)) && | 18 | if (sp >= (base + sizeof(struct thread_info)) && |
15 | sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) | 19 | sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) |
16 | return true; | 20 | return true; |
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c index 4c26eb59e742..53a58b349849 100644 --- a/arch/sparc/kernel/of_device_32.c +++ b/arch/sparc/kernel/of_device_32.c | |||
@@ -105,7 +105,7 @@ static unsigned long of_bus_sbus_get_flags(const u32 *addr, unsigned long flags) | |||
105 | 105 | ||
106 | static int of_bus_ambapp_match(struct device_node *np) | 106 | static int of_bus_ambapp_match(struct device_node *np) |
107 | { | 107 | { |
108 | return !strcmp(np->name, "ambapp"); | 108 | return !strcmp(np->type, "ambapp"); |
109 | } | 109 | } |
110 | 110 | ||
111 | static void of_bus_ambapp_count_cells(struct device_node *child, | 111 | static void of_bus_ambapp_count_cells(struct device_node *child, |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index 539e83f8e087..592b03d85167 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -247,6 +247,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
247 | struct pci_bus *bus, int devfn) | 247 | struct pci_bus *bus, int devfn) |
248 | { | 248 | { |
249 | struct dev_archdata *sd; | 249 | struct dev_archdata *sd; |
250 | struct pci_slot *slot; | ||
250 | struct of_device *op; | 251 | struct of_device *op; |
251 | struct pci_dev *dev; | 252 | struct pci_dev *dev; |
252 | const char *type; | 253 | const char *type; |
@@ -286,6 +287,11 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
286 | dev->dev.bus = &pci_bus_type; | 287 | dev->dev.bus = &pci_bus_type; |
287 | dev->devfn = devfn; | 288 | dev->devfn = devfn; |
288 | dev->multifunction = 0; /* maybe a lie? */ | 289 | dev->multifunction = 0; /* maybe a lie? */ |
290 | set_pcie_port_type(dev); | ||
291 | |||
292 | list_for_each_entry(slot, &dev->bus->slots, list) | ||
293 | if (PCI_SLOT(dev->devfn) == slot->number) | ||
294 | dev->slot = slot; | ||
289 | 295 | ||
290 | dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); | 296 | dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); |
291 | dev->device = of_getintprop_default(node, "device-id", 0xffff); | 297 | dev->device = of_getintprop_default(node, "device-id", 0xffff); |
@@ -322,6 +328,7 @@ static struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
322 | 328 | ||
323 | dev->current_state = 4; /* unknown power state */ | 329 | dev->current_state = 4; /* unknown power state */ |
324 | dev->error_state = pci_channel_io_normal; | 330 | dev->error_state = pci_channel_io_normal; |
331 | dev->dma_mask = 0xffffffff; | ||
325 | 332 | ||
326 | if (!strcmp(node->name, "pci")) { | 333 | if (!strcmp(node->name, "pci")) { |
327 | /* a PCI-PCI bridge */ | 334 | /* a PCI-PCI bridge */ |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index 2830b415e214..c49865b30719 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -526,7 +526,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, | |||
526 | * Set some valid stack frames to give to the child. | 526 | * Set some valid stack frames to give to the child. |
527 | */ | 527 | */ |
528 | childstack = (struct sparc_stackf __user *) | 528 | childstack = (struct sparc_stackf __user *) |
529 | (sp & ~0x7UL); | 529 | (sp & ~0xfUL); |
530 | parentstack = (struct sparc_stackf __user *) | 530 | parentstack = (struct sparc_stackf __user *) |
531 | regs->u_regs[UREG_FP]; | 531 | regs->u_regs[UREG_FP]; |
532 | 532 | ||
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index c3f1cce0e95e..cb70476bd8f5 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -398,11 +398,11 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) | |||
398 | } else | 398 | } else |
399 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); | 399 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); |
400 | 400 | ||
401 | /* Now 8-byte align the stack as this is mandatory in the | 401 | /* Now align the stack as this is mandatory in the Sparc ABI |
402 | * Sparc ABI due to how register windows work. This hides | 402 | * due to how register windows work. This hides the |
403 | * the restriction from thread libraries etc. -DaveM | 403 | * restriction from thread libraries etc. |
404 | */ | 404 | */ |
405 | csp &= ~7UL; | 405 | csp &= ~15UL; |
406 | 406 | ||
407 | distance = fp - psp; | 407 | distance = fp - psp; |
408 | rval = (csp - distance); | 408 | rval = (csp - distance); |
diff --git a/arch/sparc/kernel/signal32.c b/arch/sparc/kernel/signal32.c index ba5b09ad6666..ea22cd373c64 100644 --- a/arch/sparc/kernel/signal32.c +++ b/arch/sparc/kernel/signal32.c | |||
@@ -120,8 +120,8 @@ struct rt_signal_frame32 { | |||
120 | }; | 120 | }; |
121 | 121 | ||
122 | /* Align macros */ | 122 | /* Align macros */ |
123 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 7) & (~7))) | 123 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame32) + 15) & (~15))) |
124 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 7) & (~7))) | 124 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame32) + 15) & (~15))) |
125 | 125 | ||
126 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | 126 | int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) |
127 | { | 127 | { |
@@ -420,15 +420,17 @@ static void __user *get_sigframe(struct sigaction *sa, struct pt_regs *regs, uns | |||
420 | sp = current->sas_ss_sp + current->sas_ss_size; | 420 | sp = current->sas_ss_sp + current->sas_ss_size; |
421 | } | 421 | } |
422 | 422 | ||
423 | sp -= framesize; | ||
424 | |||
423 | /* Always align the stack frame. This handles two cases. First, | 425 | /* Always align the stack frame. This handles two cases. First, |
424 | * sigaltstack need not be mindful of platform specific stack | 426 | * sigaltstack need not be mindful of platform specific stack |
425 | * alignment. Second, if we took this signal because the stack | 427 | * alignment. Second, if we took this signal because the stack |
426 | * is not aligned properly, we'd like to take the signal cleanly | 428 | * is not aligned properly, we'd like to take the signal cleanly |
427 | * and report that. | 429 | * and report that. |
428 | */ | 430 | */ |
429 | sp &= ~7UL; | 431 | sp &= ~15UL; |
430 | 432 | ||
431 | return (void __user *)(sp - framesize); | 433 | return (void __user *) sp; |
432 | } | 434 | } |
433 | 435 | ||
434 | static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) | 436 | static int save_fpu_state32(struct pt_regs *regs, __siginfo_fpu_t __user *fpu) |
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 7ce1a1005b1d..9882df92ba0a 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -267,15 +267,17 @@ static inline void __user *get_sigframe(struct sigaction *sa, struct pt_regs *re | |||
267 | sp = current->sas_ss_sp + current->sas_ss_size; | 267 | sp = current->sas_ss_sp + current->sas_ss_size; |
268 | } | 268 | } |
269 | 269 | ||
270 | sp -= framesize; | ||
271 | |||
270 | /* Always align the stack frame. This handles two cases. First, | 272 | /* Always align the stack frame. This handles two cases. First, |
271 | * sigaltstack need not be mindful of platform specific stack | 273 | * sigaltstack need not be mindful of platform specific stack |
272 | * alignment. Second, if we took this signal because the stack | 274 | * alignment. Second, if we took this signal because the stack |
273 | * is not aligned properly, we'd like to take the signal cleanly | 275 | * is not aligned properly, we'd like to take the signal cleanly |
274 | * and report that. | 276 | * and report that. |
275 | */ | 277 | */ |
276 | sp &= ~7UL; | 278 | sp &= ~15UL; |
277 | 279 | ||
278 | return (void __user *)(sp - framesize); | 280 | return (void __user *) sp; |
279 | } | 281 | } |
280 | 282 | ||
281 | static inline int | 283 | static inline int |
diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c index 647afbda7ae1..9fa48c30037e 100644 --- a/arch/sparc/kernel/signal_64.c +++ b/arch/sparc/kernel/signal_64.c | |||
@@ -353,7 +353,7 @@ segv: | |||
353 | /* Checks if the fp is valid */ | 353 | /* Checks if the fp is valid */ |
354 | static int invalid_frame_pointer(void __user *fp, int fplen) | 354 | static int invalid_frame_pointer(void __user *fp, int fplen) |
355 | { | 355 | { |
356 | if (((unsigned long) fp) & 7) | 356 | if (((unsigned long) fp) & 15) |
357 | return 1; | 357 | return 1; |
358 | return 0; | 358 | return 0; |
359 | } | 359 | } |
@@ -396,15 +396,17 @@ static inline void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs * | |||
396 | sp = current->sas_ss_sp + current->sas_ss_size; | 396 | sp = current->sas_ss_sp + current->sas_ss_size; |
397 | } | 397 | } |
398 | 398 | ||
399 | sp -= framesize; | ||
400 | |||
399 | /* Always align the stack frame. This handles two cases. First, | 401 | /* Always align the stack frame. This handles two cases. First, |
400 | * sigaltstack need not be mindful of platform specific stack | 402 | * sigaltstack need not be mindful of platform specific stack |
401 | * alignment. Second, if we took this signal because the stack | 403 | * alignment. Second, if we took this signal because the stack |
402 | * is not aligned properly, we'd like to take the signal cleanly | 404 | * is not aligned properly, we'd like to take the signal cleanly |
403 | * and report that. | 405 | * and report that. |
404 | */ | 406 | */ |
405 | sp &= ~7UL; | 407 | sp &= ~15UL; |
406 | 408 | ||
407 | return (void __user *)(sp - framesize); | 409 | return (void __user *) sp; |
408 | } | 410 | } |
409 | 411 | ||
410 | static inline void | 412 | static inline void |
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S index 8c91d9b29a2f..db15d123f054 100644 --- a/arch/sparc/kernel/tsb.S +++ b/arch/sparc/kernel/tsb.S | |||
@@ -191,10 +191,12 @@ tsb_dtlb_load: | |||
191 | 191 | ||
192 | tsb_itlb_load: | 192 | tsb_itlb_load: |
193 | /* Executable bit must be set. */ | 193 | /* Executable bit must be set. */ |
194 | 661: andcc %g5, _PAGE_EXEC_4U, %g0 | 194 | 661: sethi %hi(_PAGE_EXEC_4U), %g4 |
195 | .section .sun4v_1insn_patch, "ax" | 195 | andcc %g5, %g4, %g0 |
196 | .section .sun4v_2insn_patch, "ax" | ||
196 | .word 661b | 197 | .word 661b |
197 | andcc %g5, _PAGE_EXEC_4V, %g0 | 198 | andcc %g5, _PAGE_EXEC_4V, %g0 |
199 | nop | ||
198 | .previous | 200 | .previous |
199 | 201 | ||
200 | be,pn %xcc, tsb_do_fault | 202 | be,pn %xcc, tsb_do_fault |