diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-04-16 18:24:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:24:36 -0400 |
commit | 187335a4ec72c9bc7f3f168d6858a41fcfb63302 (patch) | |
tree | d5f1ae0d320e6325ed056469773e855fc635c53d /arch/ppc64/kernel/traps.c | |
parent | 547ee84cea37696d25c93306e909378a87db2f66 (diff) |
[PATCH] ppc64: Detect altivec via firmware on unknown CPUs
This patch adds detection of the Altivec capability of the CPU via the
firmware in addition to the cpu table. This allows newer CPUs that aren't
in the table to still have working altivec support in the kernel.
It also fixes a problem where if a CPU isn't recognized as having altivec
features, and takes an altivec unavailable exception due to userland
issuing altivec instructions, the kernel would happily enable it and
context switch the registers ... but not all of them (it would basically
forget vrsave). With this patch, the kernel will refuse to enable altivec
when the feature isn't detected for the CPU (SIGILL).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc64/kernel/traps.c')
-rw-r--r-- | arch/ppc64/kernel/traps.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/ppc64/kernel/traps.c b/arch/ppc64/kernel/traps.c index 10fc61f3f6a4..7e52cb2605e0 100644 --- a/arch/ppc64/kernel/traps.c +++ b/arch/ppc64/kernel/traps.c | |||
@@ -450,14 +450,12 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs) | |||
450 | 450 | ||
451 | void altivec_unavailable_exception(struct pt_regs *regs) | 451 | void altivec_unavailable_exception(struct pt_regs *regs) |
452 | { | 452 | { |
453 | #ifndef CONFIG_ALTIVEC | ||
454 | if (user_mode(regs)) { | 453 | if (user_mode(regs)) { |
455 | /* A user program has executed an altivec instruction, | 454 | /* A user program has executed an altivec instruction, |
456 | but this kernel doesn't support altivec. */ | 455 | but this kernel doesn't support altivec. */ |
457 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); | 456 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); |
458 | return; | 457 | return; |
459 | } | 458 | } |
460 | #endif | ||
461 | printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception " | 459 | printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception " |
462 | "%lx at %lx\n", regs->trap, regs->nip); | 460 | "%lx at %lx\n", regs->trap, regs->nip); |
463 | die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); | 461 | die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT); |