diff options
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/binfmt_aout32.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 5 | ||||
-rw-r--r-- | arch/sparc64/kernel/head.S | 35 | ||||
-rw-r--r-- | arch/sparc64/kernel/irq.c | 27 | ||||
-rw-r--r-- | arch/sparc64/kernel/mdesc.c | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci.c | 14 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 18 | ||||
-rw-r--r-- | arch/sparc64/kernel/prom.c | 9 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/trampoline.S | 33 | ||||
-rw-r--r-- | arch/sparc64/kernel/vio.c | 29 |
12 files changed, 150 insertions, 36 deletions
diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c index f205fc7cbcd0..d208cc7804f2 100644 --- a/arch/sparc64/kernel/binfmt_aout32.c +++ b/arch/sparc64/kernel/binfmt_aout32.c | |||
@@ -177,7 +177,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr | |||
177 | get_user(c,p++); | 177 | get_user(c,p++); |
178 | } while (c); | 178 | } while (c); |
179 | } | 179 | } |
180 | put_user(NULL,argv); | 180 | put_user(0,argv); |
181 | current->mm->arg_end = current->mm->env_start = (unsigned long) p; | 181 | current->mm->arg_end = current->mm->env_start = (unsigned long) p; |
182 | while (envc-->0) { | 182 | while (envc-->0) { |
183 | char c; | 183 | char c; |
@@ -186,7 +186,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr | |||
186 | get_user(c,p++); | 186 | get_user(c,p++); |
187 | } while (c); | 187 | } while (c); |
188 | } | 188 | } |
189 | put_user(NULL,envp); | 189 | put_user(0,envp); |
190 | current->mm->env_end = (unsigned long) p; | 190 | current->mm->env_end = (unsigned long) p; |
191 | return sp; | 191 | return sp; |
192 | } | 192 | } |
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index bc9ae36f7a43..04ab81cb4f48 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c | |||
@@ -375,7 +375,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de | |||
375 | dev->num_addrs = 0; | 375 | dev->num_addrs = 0; |
376 | dev->num_irqs = 0; | 376 | dev->num_irqs = 0; |
377 | } else { | 377 | } else { |
378 | (void) of_get_property(dp, "reg", &len); | 378 | const int *regs = of_get_property(dp, "reg", &len); |
379 | |||
380 | if (!regs) | ||
381 | len = 0; | ||
379 | dev->num_addrs = len / sizeof(struct linux_prom_registers); | 382 | dev->num_addrs = len / sizeof(struct linux_prom_registers); |
380 | 383 | ||
381 | for (i = 0; i < dev->num_addrs; i++) | 384 | for (i = 0; i < dev->num_addrs; i++) |
diff --git a/arch/sparc64/kernel/head.S b/arch/sparc64/kernel/head.S index 63144ad476f6..c4147ad8677b 100644 --- a/arch/sparc64/kernel/head.S +++ b/arch/sparc64/kernel/head.S | |||
@@ -98,7 +98,7 @@ sparc64_boot: | |||
98 | .globl prom_boot_mapped_pc, prom_boot_mapping_mode | 98 | .globl prom_boot_mapped_pc, prom_boot_mapping_mode |
99 | .globl prom_boot_mapping_phys_high, prom_boot_mapping_phys_low | 99 | .globl prom_boot_mapping_phys_high, prom_boot_mapping_phys_low |
100 | .globl prom_compatible_name, prom_cpu_path, prom_cpu_compatible | 100 | .globl prom_compatible_name, prom_cpu_path, prom_cpu_compatible |
101 | .globl is_sun4v, sun4v_chip_type | 101 | .globl is_sun4v, sun4v_chip_type, prom_set_trap_table_name |
102 | prom_peer_name: | 102 | prom_peer_name: |
103 | .asciz "peer" | 103 | .asciz "peer" |
104 | prom_compatible_name: | 104 | prom_compatible_name: |
@@ -121,6 +121,8 @@ prom_map_name: | |||
121 | .asciz "map" | 121 | .asciz "map" |
122 | prom_unmap_name: | 122 | prom_unmap_name: |
123 | .asciz "unmap" | 123 | .asciz "unmap" |
124 | prom_set_trap_table_name: | ||
125 | .asciz "SUNW,set-trap-table" | ||
124 | prom_sun4v_name: | 126 | prom_sun4v_name: |
125 | .asciz "sun4v" | 127 | .asciz "sun4v" |
126 | prom_niagara_prefix: | 128 | prom_niagara_prefix: |
@@ -691,15 +693,38 @@ setup_trap_table: | |||
691 | sethi %hi(kern_base), %g3 | 693 | sethi %hi(kern_base), %g3 |
692 | ldx [%g3 + %lo(kern_base)], %g3 | 694 | ldx [%g3 + %lo(kern_base)], %g3 |
693 | add %g2, %g3, %o1 | 695 | add %g2, %g3, %o1 |
696 | sethi %hi(sparc64_ttable_tl0), %o0 | ||
694 | 697 | ||
695 | call prom_set_trap_table_sun4v | 698 | set prom_set_trap_table_name, %g2 |
696 | sethi %hi(sparc64_ttable_tl0), %o0 | 699 | stx %g2, [%sp + 2047 + 128 + 0x00] |
700 | mov 2, %g2 | ||
701 | stx %g2, [%sp + 2047 + 128 + 0x08] | ||
702 | mov 0, %g2 | ||
703 | stx %g2, [%sp + 2047 + 128 + 0x10] | ||
704 | stx %o0, [%sp + 2047 + 128 + 0x18] | ||
705 | stx %o1, [%sp + 2047 + 128 + 0x20] | ||
706 | sethi %hi(p1275buf), %g2 | ||
707 | or %g2, %lo(p1275buf), %g2 | ||
708 | ldx [%g2 + 0x08], %o1 | ||
709 | call %o1 | ||
710 | add %sp, (2047 + 128), %o0 | ||
697 | 711 | ||
698 | ba,pt %xcc, 2f | 712 | ba,pt %xcc, 2f |
699 | nop | 713 | nop |
700 | 714 | ||
701 | 1: call prom_set_trap_table | 715 | 1: sethi %hi(sparc64_ttable_tl0), %o0 |
702 | sethi %hi(sparc64_ttable_tl0), %o0 | 716 | set prom_set_trap_table_name, %g2 |
717 | stx %g2, [%sp + 2047 + 128 + 0x00] | ||
718 | mov 1, %g2 | ||
719 | stx %g2, [%sp + 2047 + 128 + 0x08] | ||
720 | mov 0, %g2 | ||
721 | stx %g2, [%sp + 2047 + 128 + 0x10] | ||
722 | stx %o0, [%sp + 2047 + 128 + 0x18] | ||
723 | sethi %hi(p1275buf), %g2 | ||
724 | or %g2, %lo(p1275buf), %g2 | ||
725 | ldx [%g2 + 0x08], %o1 | ||
726 | call %o1 | ||
727 | add %sp, (2047 + 128), %o0 | ||
703 | 728 | ||
704 | /* Start using proper page size encodings in ctx register. */ | 729 | /* Start using proper page size encodings in ctx register. */ |
705 | 2: sethi %hi(sparc64_kern_pri_context), %g3 | 730 | 2: sethi %hi(sparc64_kern_pri_context), %g3 |
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 384abf410cf0..23956096b3bf 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -217,8 +217,27 @@ struct irq_handler_data { | |||
217 | void (*pre_handler)(unsigned int, void *, void *); | 217 | void (*pre_handler)(unsigned int, void *, void *); |
218 | void *pre_handler_arg1; | 218 | void *pre_handler_arg1; |
219 | void *pre_handler_arg2; | 219 | void *pre_handler_arg2; |
220 | |||
221 | u32 msi; | ||
220 | }; | 222 | }; |
221 | 223 | ||
224 | void sparc64_set_msi(unsigned int virt_irq, u32 msi) | ||
225 | { | ||
226 | struct irq_handler_data *data = get_irq_chip_data(virt_irq); | ||
227 | |||
228 | if (data) | ||
229 | data->msi = msi; | ||
230 | } | ||
231 | |||
232 | u32 sparc64_get_msi(unsigned int virt_irq) | ||
233 | { | ||
234 | struct irq_handler_data *data = get_irq_chip_data(virt_irq); | ||
235 | |||
236 | if (data) | ||
237 | return data->msi; | ||
238 | return 0xffffffff; | ||
239 | } | ||
240 | |||
222 | static inline struct ino_bucket *virt_irq_to_bucket(unsigned int virt_irq) | 241 | static inline struct ino_bucket *virt_irq_to_bucket(unsigned int virt_irq) |
223 | { | 242 | { |
224 | unsigned int real_irq = virt_to_real_irq(virt_irq); | 243 | unsigned int real_irq = virt_to_real_irq(virt_irq); |
@@ -308,7 +327,7 @@ static void sun4u_irq_disable(unsigned int virt_irq) | |||
308 | 327 | ||
309 | if (likely(data)) { | 328 | if (likely(data)) { |
310 | unsigned long imap = data->imap; | 329 | unsigned long imap = data->imap; |
311 | u32 tmp = upa_readq(imap); | 330 | unsigned long tmp = upa_readq(imap); |
312 | 331 | ||
313 | tmp &= ~IMAP_VALID; | 332 | tmp &= ~IMAP_VALID; |
314 | upa_writeq(tmp, imap); | 333 | upa_writeq(tmp, imap); |
@@ -741,7 +760,7 @@ unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, | |||
741 | break; | 760 | break; |
742 | } | 761 | } |
743 | if (devino >= msi_end) | 762 | if (devino >= msi_end) |
744 | return 0; | 763 | return -ENOSPC; |
745 | 764 | ||
746 | sysino = sun4v_devino_to_sysino(devhandle, devino); | 765 | sysino = sun4v_devino_to_sysino(devhandle, devino); |
747 | bucket = &ivector_table[sysino]; | 766 | bucket = &ivector_table[sysino]; |
@@ -755,8 +774,8 @@ unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, | |||
755 | 774 | ||
756 | data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC); | 775 | data = kzalloc(sizeof(struct irq_handler_data), GFP_ATOMIC); |
757 | if (unlikely(!data)) { | 776 | if (unlikely(!data)) { |
758 | prom_printf("IRQ: kzalloc(irq_handler_data) failed.\n"); | 777 | virt_irq_free(*virt_irq_p); |
759 | prom_halt(); | 778 | return -ENOMEM; |
760 | } | 779 | } |
761 | set_irq_chip_data(bucket->virt_irq, data); | 780 | set_irq_chip_data(bucket->virt_irq, data); |
762 | 781 | ||
diff --git a/arch/sparc64/kernel/mdesc.c b/arch/sparc64/kernel/mdesc.c index 9f22e4ff6015..856659bb1311 100644 --- a/arch/sparc64/kernel/mdesc.c +++ b/arch/sparc64/kernel/mdesc.c | |||
@@ -777,8 +777,12 @@ void __devinit mdesc_fill_in_cpu_data(cpumask_t mask) | |||
777 | cpuid = *id; | 777 | cpuid = *id; |
778 | 778 | ||
779 | #ifdef CONFIG_SMP | 779 | #ifdef CONFIG_SMP |
780 | if (cpuid >= NR_CPUS) | 780 | if (cpuid >= NR_CPUS) { |
781 | printk(KERN_WARNING "Ignoring CPU %d which is " | ||
782 | ">= NR_CPUS (%d)\n", | ||
783 | cpuid, NR_CPUS); | ||
781 | continue; | 784 | continue; |
785 | } | ||
782 | if (!cpu_isset(cpuid, mask)) | 786 | if (!cpu_isset(cpuid, mask)) |
783 | continue; | 787 | continue; |
784 | #else | 788 | #else |
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index 3d93e9203ba2..e8dac81d8a0d 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -393,7 +393,6 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm, | |||
393 | sd->host_controller = pbm; | 393 | sd->host_controller = pbm; |
394 | sd->prom_node = node; | 394 | sd->prom_node = node; |
395 | sd->op = of_find_device_by_node(node); | 395 | sd->op = of_find_device_by_node(node); |
396 | sd->msi_num = 0xffffffff; | ||
397 | 396 | ||
398 | sd = &sd->op->dev.archdata; | 397 | sd = &sd->op->dev.archdata; |
399 | sd->iommu = pbm->iommu; | 398 | sd->iommu = pbm->iommu; |
@@ -745,7 +744,7 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, | |||
745 | { | 744 | { |
746 | struct device_node *child; | 745 | struct device_node *child; |
747 | const u32 *reg; | 746 | const u32 *reg; |
748 | int reglen, devfn; | 747 | int reglen, devfn, prev_devfn; |
749 | struct pci_dev *dev; | 748 | struct pci_dev *dev; |
750 | 749 | ||
751 | if (ofpci_verbose) | 750 | if (ofpci_verbose) |
@@ -753,14 +752,25 @@ static void __devinit pci_of_scan_bus(struct pci_pbm_info *pbm, | |||
753 | node->full_name, bus->number); | 752 | node->full_name, bus->number); |
754 | 753 | ||
755 | child = NULL; | 754 | child = NULL; |
755 | prev_devfn = -1; | ||
756 | while ((child = of_get_next_child(node, child)) != NULL) { | 756 | while ((child = of_get_next_child(node, child)) != NULL) { |
757 | if (ofpci_verbose) | 757 | if (ofpci_verbose) |
758 | printk(" * %s\n", child->full_name); | 758 | printk(" * %s\n", child->full_name); |
759 | reg = of_get_property(child, "reg", ®len); | 759 | reg = of_get_property(child, "reg", ®len); |
760 | if (reg == NULL || reglen < 20) | 760 | if (reg == NULL || reglen < 20) |
761 | continue; | 761 | continue; |
762 | |||
762 | devfn = (reg[0] >> 8) & 0xff; | 763 | devfn = (reg[0] >> 8) & 0xff; |
763 | 764 | ||
765 | /* This is a workaround for some device trees | ||
766 | * which list PCI devices twice. On the V100 | ||
767 | * for example, device number 3 is listed twice. | ||
768 | * Once as "pm" and once again as "lomp". | ||
769 | */ | ||
770 | if (devfn == prev_devfn) | ||
771 | continue; | ||
772 | prev_devfn = devfn; | ||
773 | |||
764 | /* create a new pci_dev for this device */ | 774 | /* create a new pci_dev for this device */ |
765 | dev = of_create_pci_dev(pbm, child, bus, devfn, 0); | 775 | dev = of_create_pci_dev(pbm, child, bus, devfn, 0); |
766 | if (!dev) | 776 | if (!dev) |
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 2f61c4b12596..c76bfbb7da08 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c | |||
@@ -264,7 +264,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, | |||
264 | unsigned int func = PCI_FUNC(devfn); | 264 | unsigned int func = PCI_FUNC(devfn); |
265 | unsigned long ret; | 265 | unsigned long ret; |
266 | 266 | ||
267 | if (bus_dev == pbm->pci_bus && devfn == 0x00) | 267 | if (!bus && devfn == 0x00) |
268 | return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where, | 268 | return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where, |
269 | size, value); | 269 | size, value); |
270 | if (config_out_of_range(pbm, bus, devfn, where)) { | 270 | if (config_out_of_range(pbm, bus, devfn, where)) { |
@@ -300,7 +300,7 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, | |||
300 | unsigned int func = PCI_FUNC(devfn); | 300 | unsigned int func = PCI_FUNC(devfn); |
301 | unsigned long ret; | 301 | unsigned long ret; |
302 | 302 | ||
303 | if (bus_dev == pbm->pci_bus && devfn == 0x00) | 303 | if (!bus && devfn == 0x00) |
304 | return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where, | 304 | return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where, |
305 | size, value); | 305 | size, value); |
306 | if (config_out_of_range(pbm, bus, devfn, where)) { | 306 | if (config_out_of_range(pbm, bus, devfn, where)) { |
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 466f4aa8fc82..da724b13e89e 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -940,13 +940,13 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p, | |||
940 | if (msi_num < 0) | 940 | if (msi_num < 0) |
941 | return msi_num; | 941 | return msi_num; |
942 | 942 | ||
943 | devino = sun4v_build_msi(pbm->devhandle, virt_irq_p, | 943 | err = sun4v_build_msi(pbm->devhandle, virt_irq_p, |
944 | pbm->msiq_first_devino, | 944 | pbm->msiq_first_devino, |
945 | (pbm->msiq_first_devino + | 945 | (pbm->msiq_first_devino + |
946 | pbm->msiq_num)); | 946 | pbm->msiq_num)); |
947 | err = -ENOMEM; | 947 | if (err < 0) |
948 | if (!devino) | ||
949 | goto out_err; | 948 | goto out_err; |
949 | devino = err; | ||
950 | 950 | ||
951 | msiqid = ((devino - pbm->msiq_first_devino) + | 951 | msiqid = ((devino - pbm->msiq_first_devino) + |
952 | pbm->msiq_first); | 952 | pbm->msiq_first); |
@@ -971,7 +971,7 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p, | |||
971 | if (pci_sun4v_msi_setvalid(pbm->devhandle, msi_num, HV_MSIVALID_VALID)) | 971 | if (pci_sun4v_msi_setvalid(pbm->devhandle, msi_num, HV_MSIVALID_VALID)) |
972 | goto out_err; | 972 | goto out_err; |
973 | 973 | ||
974 | pdev->dev.archdata.msi_num = msi_num; | 974 | sparc64_set_msi(*virt_irq_p, msi_num); |
975 | 975 | ||
976 | if (entry->msi_attrib.is_64) { | 976 | if (entry->msi_attrib.is_64) { |
977 | msg.address_hi = pbm->msi64_start >> 32; | 977 | msg.address_hi = pbm->msi64_start >> 32; |
@@ -993,8 +993,6 @@ static int pci_sun4v_setup_msi_irq(unsigned int *virt_irq_p, | |||
993 | 993 | ||
994 | out_err: | 994 | out_err: |
995 | free_msi(pbm, msi_num); | 995 | free_msi(pbm, msi_num); |
996 | sun4v_destroy_msi(*virt_irq_p); | ||
997 | *virt_irq_p = 0; | ||
998 | return err; | 996 | return err; |
999 | 997 | ||
1000 | } | 998 | } |
@@ -1006,7 +1004,7 @@ static void pci_sun4v_teardown_msi_irq(unsigned int virt_irq, | |||
1006 | unsigned long msiqid, err; | 1004 | unsigned long msiqid, err; |
1007 | unsigned int msi_num; | 1005 | unsigned int msi_num; |
1008 | 1006 | ||
1009 | msi_num = pdev->dev.archdata.msi_num; | 1007 | msi_num = sparc64_get_msi(virt_irq); |
1010 | err = pci_sun4v_msi_getmsiq(pbm->devhandle, msi_num, &msiqid); | 1008 | err = pci_sun4v_msi_getmsiq(pbm->devhandle, msi_num, &msiqid); |
1011 | if (err) { | 1009 | if (err) { |
1012 | printk(KERN_ERR "%s: getmsiq gives error %lu\n", | 1010 | printk(KERN_ERR "%s: getmsiq gives error %lu\n", |
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index d1a78c976cef..a246e962e5a7 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c | |||
@@ -1046,7 +1046,8 @@ static void __init irq_trans_init(struct device_node *dp) | |||
1046 | if (!strcmp(dp->name, "fhc") && | 1046 | if (!strcmp(dp->name, "fhc") && |
1047 | !strcmp(dp->parent->name, "central")) | 1047 | !strcmp(dp->parent->name, "central")) |
1048 | return central_irq_trans_init(dp); | 1048 | return central_irq_trans_init(dp); |
1049 | if (!strcmp(dp->name, "virtual-devices")) | 1049 | if (!strcmp(dp->name, "virtual-devices") || |
1050 | !strcmp(dp->name, "niu")) | ||
1050 | return sun4v_vdev_irq_trans_init(dp); | 1051 | return sun4v_vdev_irq_trans_init(dp); |
1051 | } | 1052 | } |
1052 | 1053 | ||
@@ -1583,8 +1584,12 @@ static void __init of_fill_in_cpu_data(void) | |||
1583 | ncpus_probed++; | 1584 | ncpus_probed++; |
1584 | 1585 | ||
1585 | #ifdef CONFIG_SMP | 1586 | #ifdef CONFIG_SMP |
1586 | if (cpuid >= NR_CPUS) | 1587 | if (cpuid >= NR_CPUS) { |
1588 | printk(KERN_WARNING "Ignoring CPU %d which is " | ||
1589 | ">= NR_CPUS (%d)\n", | ||
1590 | cpuid, NR_CPUS); | ||
1587 | continue; | 1591 | continue; |
1592 | } | ||
1588 | #else | 1593 | #else |
1589 | /* On uniprocessor we only want the values for the | 1594 | /* On uniprocessor we only want the values for the |
1590 | * real physical cpu the kernel booted onto, however | 1595 | * real physical cpu the kernel booted onto, however |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index b84c49e3697c..c73b7a48b036 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -353,6 +353,8 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu) | |||
353 | int timeout, ret; | 353 | int timeout, ret; |
354 | 354 | ||
355 | p = fork_idle(cpu); | 355 | p = fork_idle(cpu); |
356 | if (IS_ERR(p)) | ||
357 | return PTR_ERR(p); | ||
356 | callin_flag = 0; | 358 | callin_flag = 0; |
357 | cpu_new_thread = task_thread_info(p); | 359 | cpu_new_thread = task_thread_info(p); |
358 | 360 | ||
diff --git a/arch/sparc64/kernel/trampoline.S b/arch/sparc64/kernel/trampoline.S index 9533a25ce5d2..04e81dda13d0 100644 --- a/arch/sparc64/kernel/trampoline.S +++ b/arch/sparc64/kernel/trampoline.S | |||
@@ -345,7 +345,7 @@ after_lock_tlb: | |||
345 | sethi %hi(tramp_stack), %g1 | 345 | sethi %hi(tramp_stack), %g1 |
346 | or %g1, %lo(tramp_stack), %g1 | 346 | or %g1, %lo(tramp_stack), %g1 |
347 | add %g1, TRAMP_STACK_SIZE, %g1 | 347 | add %g1, TRAMP_STACK_SIZE, %g1 |
348 | sub %g1, STACKFRAME_SZ + STACK_BIAS, %sp | 348 | sub %g1, STACKFRAME_SZ + STACK_BIAS + 256, %sp |
349 | mov 0, %fp | 349 | mov 0, %fp |
350 | 350 | ||
351 | /* Put garbage in these registers to trap any access to them. */ | 351 | /* Put garbage in these registers to trap any access to them. */ |
@@ -411,15 +411,38 @@ after_lock_tlb: | |||
411 | sethi %hi(kern_base), %g3 | 411 | sethi %hi(kern_base), %g3 |
412 | ldx [%g3 + %lo(kern_base)], %g3 | 412 | ldx [%g3 + %lo(kern_base)], %g3 |
413 | add %g2, %g3, %o1 | 413 | add %g2, %g3, %o1 |
414 | sethi %hi(sparc64_ttable_tl0), %o0 | ||
414 | 415 | ||
415 | call prom_set_trap_table_sun4v | 416 | set prom_set_trap_table_name, %g2 |
416 | sethi %hi(sparc64_ttable_tl0), %o0 | 417 | stx %g2, [%sp + 2047 + 128 + 0x00] |
418 | mov 2, %g2 | ||
419 | stx %g2, [%sp + 2047 + 128 + 0x08] | ||
420 | mov 0, %g2 | ||
421 | stx %g2, [%sp + 2047 + 128 + 0x10] | ||
422 | stx %o0, [%sp + 2047 + 128 + 0x18] | ||
423 | stx %o1, [%sp + 2047 + 128 + 0x20] | ||
424 | sethi %hi(p1275buf), %g2 | ||
425 | or %g2, %lo(p1275buf), %g2 | ||
426 | ldx [%g2 + 0x08], %o1 | ||
427 | call %o1 | ||
428 | add %sp, (2047 + 128), %o0 | ||
417 | 429 | ||
418 | ba,pt %xcc, 2f | 430 | ba,pt %xcc, 2f |
419 | nop | 431 | nop |
420 | 432 | ||
421 | 1: call prom_set_trap_table | 433 | 1: sethi %hi(sparc64_ttable_tl0), %o0 |
422 | sethi %hi(sparc64_ttable_tl0), %o0 | 434 | set prom_set_trap_table_name, %g2 |
435 | stx %g2, [%sp + 2047 + 128 + 0x00] | ||
436 | mov 1, %g2 | ||
437 | stx %g2, [%sp + 2047 + 128 + 0x08] | ||
438 | mov 0, %g2 | ||
439 | stx %g2, [%sp + 2047 + 128 + 0x10] | ||
440 | stx %o0, [%sp + 2047 + 128 + 0x18] | ||
441 | sethi %hi(p1275buf), %g2 | ||
442 | or %g2, %lo(p1275buf), %g2 | ||
443 | ldx [%g2 + 0x08], %o1 | ||
444 | call %o1 | ||
445 | add %sp, (2047 + 128), %o0 | ||
423 | 446 | ||
424 | 2: ldx [%l0], %g6 | 447 | 2: ldx [%l0], %g6 |
425 | ldx [%g6 + TI_TASK], %g4 | 448 | ldx [%g6 + TI_TASK], %g4 |
diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c index 1550ac5673da..0c1ee619d814 100644 --- a/arch/sparc64/kernel/vio.c +++ b/arch/sparc64/kernel/vio.c | |||
@@ -292,7 +292,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, | |||
292 | } | 292 | } |
293 | vdev->dp = dp; | 293 | vdev->dp = dp; |
294 | 294 | ||
295 | printk(KERN_ERR "VIO: Adding device %s\n", vdev->dev.bus_id); | 295 | printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id); |
296 | 296 | ||
297 | err = device_register(&vdev->dev); | 297 | err = device_register(&vdev->dev); |
298 | if (err) { | 298 | if (err) { |
@@ -342,8 +342,33 @@ static struct mdesc_notifier_client vio_device_notifier = { | |||
342 | .node_name = "virtual-device-port", | 342 | .node_name = "virtual-device-port", |
343 | }; | 343 | }; |
344 | 344 | ||
345 | /* We are only interested in domain service ports under the | ||
346 | * "domain-services" node. On control nodes there is another port | ||
347 | * under "openboot" that we should not mess with as aparently that is | ||
348 | * reserved exclusively for OBP use. | ||
349 | */ | ||
350 | static void vio_add_ds(struct mdesc_handle *hp, u64 node) | ||
351 | { | ||
352 | int found; | ||
353 | u64 a; | ||
354 | |||
355 | found = 0; | ||
356 | mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) { | ||
357 | u64 target = mdesc_arc_target(hp, a); | ||
358 | const char *name = mdesc_node_name(hp, target); | ||
359 | |||
360 | if (!strcmp(name, "domain-services")) { | ||
361 | found = 1; | ||
362 | break; | ||
363 | } | ||
364 | } | ||
365 | |||
366 | if (found) | ||
367 | (void) vio_create_one(hp, node, &root_vdev->dev); | ||
368 | } | ||
369 | |||
345 | static struct mdesc_notifier_client vio_ds_notifier = { | 370 | static struct mdesc_notifier_client vio_ds_notifier = { |
346 | .add = vio_add, | 371 | .add = vio_add_ds, |
347 | .remove = vio_remove, | 372 | .remove = vio_remove, |
348 | .node_name = "domain-services-port", | 373 | .node_name = "domain-services-port", |
349 | }; | 374 | }; |