diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-10 13:59:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-10 13:59:39 -0400 |
commit | d90d2c385d4d832428d1e51c2a7edeef39c822f5 (patch) | |
tree | 979edd96372170564f8b0f9b2e230dc0cde85794 | |
parent | 128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff) | |
parent | 133dda1e4f757e036fa838cba6804d0344931c4a (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
[PATCH] powerpc: Fix cell blade detection
[PATCH] powerpc: Fix call to ibm,client-architecture-support
powerpc: Fix machine check problem on 32-bit kernels
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 11 | ||||
-rw-r--r-- | arch/powerpc/kernel/signal_64.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/setup.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 8 |
5 files changed, 35 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 41e9ab40cd54..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 | } |
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/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index 6574b22b3cf3..fd3e5609e3e0 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -125,14 +125,13 @@ static void __init cell_init_early(void) | |||
125 | 125 | ||
126 | static int __init cell_probe(void) | 126 | static int __init cell_probe(void) |
127 | { | 127 | { |
128 | /* XXX This is temporary, the Cell maintainer will come up with | ||
129 | * more appropriate detection logic | ||
130 | */ | ||
131 | unsigned long root = of_get_flat_dt_root(); | 128 | unsigned long root = of_get_flat_dt_root(); |
132 | if (!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) | ||
133 | return 0; | ||
134 | 129 | ||
135 | return 1; | 130 | if (of_flat_dt_is_compatible(root, "IBM,CBEA") || |
131 | of_flat_dt_is_compatible(root, "IBM,CPBW-1.0")) | ||
132 | return 1; | ||
133 | |||
134 | return 0; | ||
136 | } | 135 | } |
137 | 136 | ||
138 | /* | 137 | /* |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 5f79f01c44f2..3ba87835757e 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -389,6 +389,7 @@ static int __init pSeries_probe_hypertas(unsigned long node, | |||
389 | 389 | ||
390 | static int __init pSeries_probe(void) | 390 | static int __init pSeries_probe(void) |
391 | { | 391 | { |
392 | unsigned long root = of_get_flat_dt_root(); | ||
392 | char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), | 393 | char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(), |
393 | "device_type", NULL); | 394 | "device_type", NULL); |
394 | if (dtype == NULL) | 395 | if (dtype == NULL) |
@@ -396,6 +397,13 @@ static int __init pSeries_probe(void) | |||
396 | if (strcmp(dtype, "chrp")) | 397 | if (strcmp(dtype, "chrp")) |
397 | return 0; | 398 | return 0; |
398 | 399 | ||
400 | /* Cell blades firmware claims to be chrp while it's not. Until this | ||
401 | * is fixed, we need to avoid those here. | ||
402 | */ | ||
403 | if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0") || | ||
404 | of_flat_dt_is_compatible(root, "IBM,CBEA")) | ||
405 | return 0; | ||
406 | |||
399 | DBG("pSeries detected, looking for LPAR capability...\n"); | 407 | DBG("pSeries detected, looking for LPAR capability...\n"); |
400 | 408 | ||
401 | /* Now try to figure out if we are running on LPAR */ | 409 | /* Now try to figure out if we are running on LPAR */ |