aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/prom_init.c60
-rw-r--r--arch/powerpc/kernel/signal_32.c11
-rw-r--r--arch/powerpc/kernel/signal_64.c2
-rw-r--r--arch/powerpc/kernel/systbl.S2
4 files changed, 70 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 078fb5533541..f70bd090dacd 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -822,6 +822,7 @@ static void __init prom_send_capabilities(void)
822 /* try calling the ibm,client-architecture-support method */ 822 /* try calling the ibm,client-architecture-support method */
823 if (call_prom_ret("call-method", 3, 2, &ret, 823 if (call_prom_ret("call-method", 3, 2, &ret,
824 ADDR("ibm,client-architecture-support"), 824 ADDR("ibm,client-architecture-support"),
825 root,
825 ADDR(ibm_architecture_vec)) == 0) { 826 ADDR(ibm_architecture_vec)) == 0) {
826 /* the call exists... */ 827 /* the call exists... */
827 if (ret) 828 if (ret)
@@ -1622,6 +1623,15 @@ static int __init prom_find_machine_type(void)
1622 if (strstr(p, RELOC("Power Macintosh")) || 1623 if (strstr(p, RELOC("Power Macintosh")) ||
1623 strstr(p, RELOC("MacRISC"))) 1624 strstr(p, RELOC("MacRISC")))
1624 return PLATFORM_POWERMAC; 1625 return PLATFORM_POWERMAC;
1626#ifdef CONFIG_PPC64
1627 /* We must make sure we don't detect the IBM Cell
1628 * blades as pSeries due to some firmware issues,
1629 * so we do it here.
1630 */
1631 if (strstr(p, RELOC("IBM,CBEA")) ||
1632 strstr(p, RELOC("IBM,CPBW-1.0")))
1633 return PLATFORM_GENERIC;
1634#endif /* CONFIG_PPC64 */
1625 i += sl + 1; 1635 i += sl + 1;
1626 } 1636 }
1627 } 1637 }
@@ -1636,7 +1646,7 @@ static int __init prom_find_machine_type(void)
1636 compat, sizeof(compat)-1); 1646 compat, sizeof(compat)-1);
1637 if (len <= 0) 1647 if (len <= 0)
1638 return PLATFORM_GENERIC; 1648 return PLATFORM_GENERIC;
1639 if (strncmp(compat, RELOC("chrp"), 4)) 1649 if (strcmp(compat, RELOC("chrp")))
1640 return PLATFORM_GENERIC; 1650 return PLATFORM_GENERIC;
1641 1651
1642 /* Default to pSeries. We need to know if we are running LPAR */ 1652 /* Default to pSeries. We need to know if we are running LPAR */
@@ -2057,10 +2067,45 @@ static void __init flatten_device_tree(void)
2057 2067
2058} 2068}
2059 2069
2060 2070#ifdef CONFIG_PPC_MAPLE
2061static void __init fixup_device_tree(void) 2071/* PIBS Version 1.05.0000 04/26/2005 has an incorrect /ht/isa/ranges property.
2072 * The values are bad, and it doesn't even have the right number of cells. */
2073static void __init fixup_device_tree_maple(void)
2062{ 2074{
2075 phandle isa;
2076 u32 isa_ranges[6];
2077
2078 isa = call_prom("finddevice", 1, 1, ADDR("/ht@0/isa@4"));
2079 if (!PHANDLE_VALID(isa))
2080 return;
2081
2082 if (prom_getprop(isa, "ranges", isa_ranges, sizeof(isa_ranges))
2083 == PROM_ERROR)
2084 return;
2085
2086 if (isa_ranges[0] != 0x1 ||
2087 isa_ranges[1] != 0xf4000000 ||
2088 isa_ranges[2] != 0x00010000)
2089 return;
2090
2091 prom_printf("fixing up bogus ISA range on Maple...\n");
2092
2093 isa_ranges[0] = 0x1;
2094 isa_ranges[1] = 0x0;
2095 isa_ranges[2] = 0x01002000; /* IO space; PCI device = 4 */
2096 isa_ranges[3] = 0x0;
2097 isa_ranges[4] = 0x0;
2098 isa_ranges[5] = 0x00010000;
2099 prom_setprop(isa, "/ht@0/isa@4", "ranges",
2100 isa_ranges, sizeof(isa_ranges));
2101}
2102#else
2103#define fixup_device_tree_maple()
2104#endif
2105
2063#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC) 2106#if defined(CONFIG_PPC64) && defined(CONFIG_PPC_PMAC)
2107static void __init fixup_device_tree_pmac(void)
2108{
2064 phandle u3, i2c, mpic; 2109 phandle u3, i2c, mpic;
2065 u32 u3_rev; 2110 u32 u3_rev;
2066 u32 interrupts[2]; 2111 u32 interrupts[2];
@@ -2097,9 +2142,16 @@ static void __init fixup_device_tree(void)
2097 parent = (u32)mpic; 2142 parent = (u32)mpic;
2098 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent", 2143 prom_setprop(i2c, "/u3@0,f8000000/i2c@f8001000", "interrupt-parent",
2099 &parent, sizeof(parent)); 2144 &parent, sizeof(parent));
2100#endif
2101} 2145}
2146#else
2147#define fixup_device_tree_pmac()
2148#endif
2102 2149
2150static void __init fixup_device_tree(void)
2151{
2152 fixup_device_tree_maple();
2153 fixup_device_tree_pmac();
2154}
2103 2155
2104static void __init prom_find_boot_cpu(void) 2156static void __init prom_find_boot_cpu(void)
2105{ 2157{
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index 01e3c08cb550..8fdeca2d4597 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -803,10 +803,13 @@ static int do_setcontext(struct ucontext __user *ucp, struct pt_regs *regs, int
803 if (__get_user(cmcp, &ucp->uc_regs)) 803 if (__get_user(cmcp, &ucp->uc_regs))
804 return -EFAULT; 804 return -EFAULT;
805 mcp = (struct mcontext __user *)(u64)cmcp; 805 mcp = (struct mcontext __user *)(u64)cmcp;
806 /* no need to check access_ok(mcp), since mcp < 4GB */
806 } 807 }
807#else 808#else
808 if (__get_user(mcp, &ucp->uc_regs)) 809 if (__get_user(mcp, &ucp->uc_regs))
809 return -EFAULT; 810 return -EFAULT;
811 if (!access_ok(VERIFY_READ, mcp, sizeof(*mcp)))
812 return -EFAULT;
810#endif 813#endif
811 restore_sigmask(&set); 814 restore_sigmask(&set);
812 if (restore_user_regs(regs, mcp, sig)) 815 if (restore_user_regs(regs, mcp, sig))
@@ -908,13 +911,14 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
908{ 911{
909 struct sig_dbg_op op; 912 struct sig_dbg_op op;
910 int i; 913 int i;
914 unsigned char tmp;
911 unsigned long new_msr = regs->msr; 915 unsigned long new_msr = regs->msr;
912#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 916#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
913 unsigned long new_dbcr0 = current->thread.dbcr0; 917 unsigned long new_dbcr0 = current->thread.dbcr0;
914#endif 918#endif
915 919
916 for (i=0; i<ndbg; i++) { 920 for (i=0; i<ndbg; i++) {
917 if (__copy_from_user(&op, dbg, sizeof(op))) 921 if (copy_from_user(&op, dbg + i, sizeof(op)))
918 return -EFAULT; 922 return -EFAULT;
919 switch (op.dbg_type) { 923 switch (op.dbg_type) {
920 case SIG_DBG_SINGLE_STEPPING: 924 case SIG_DBG_SINGLE_STEPPING:
@@ -959,6 +963,11 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
959 current->thread.dbcr0 = new_dbcr0; 963 current->thread.dbcr0 = new_dbcr0;
960#endif 964#endif
961 965
966 if (!access_ok(VERIFY_READ, ctx, sizeof(*ctx))
967 || __get_user(tmp, (u8 __user *) ctx)
968 || __get_user(tmp, (u8 __user *) (ctx + 1) - 1))
969 return -EFAULT;
970
962 /* 971 /*
963 * If we get a fault copying the context into the kernel's 972 * If we get a fault copying the context into the kernel's
964 * image of the user's registers, we can't just return -EFAULT 973 * image of the user's registers, we can't just return -EFAULT
diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c
index 27f65b95184d..c2db642f4cdd 100644
--- a/arch/powerpc/kernel/signal_64.c
+++ b/arch/powerpc/kernel/signal_64.c
@@ -182,6 +182,8 @@ static long restore_sigcontext(struct pt_regs *regs, sigset_t *set, int sig,
182 err |= __get_user(msr, &sc->gp_regs[PT_MSR]); 182 err |= __get_user(msr, &sc->gp_regs[PT_MSR]);
183 if (err) 183 if (err)
184 return err; 184 return err;
185 if (v_regs && !access_ok(VERIFY_READ, v_regs, 34 * sizeof(vector128)))
186 return -EFAULT;
185 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */ 187 /* Copy 33 vec registers (vr0..31 and vscr) from the stack */
186 if (v_regs != 0 && (msr & MSR_VEC) != 0) 188 if (v_regs != 0 && (msr & MSR_VEC) != 0)
187 err |= __copy_from_user(current->thread.vr, v_regs, 189 err |= __copy_from_user(current->thread.vr, v_regs,
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
index cf56a1d499ff..26ed1f5ef16e 100644
--- a/arch/powerpc/kernel/systbl.S
+++ b/arch/powerpc/kernel/systbl.S
@@ -338,6 +338,8 @@ SYSCALL(symlinkat)
338SYSCALL(readlinkat) 338SYSCALL(readlinkat)
339SYSCALL(fchmodat) 339SYSCALL(fchmodat)
340SYSCALL(faccessat) 340SYSCALL(faccessat)
341COMPAT_SYS(get_robust_list)
342COMPAT_SYS(set_robust_list)
341 343
342/* 344/*
343 * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c 345 * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c