From 187335a4ec72c9bc7f3f168d6858a41fcfb63302 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sat, 16 Apr 2005 15:24:36 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/ppc64/kernel/head.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/ppc64/kernel/head.S') diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index fe05f3fbf9d0..92a744c31ab1 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S @@ -922,7 +922,9 @@ fp_unavailable_common: altivec_unavailable_common: EXCEPTION_PROLOG_COMMON(0xf20, PACA_EXGEN) #ifdef CONFIG_ALTIVEC +BEGIN_FTR_SECTION bne .load_up_altivec /* if from user, just load it up */ +END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) #endif bl .save_nvgprs addi r3,r1,STACK_FRAME_OVERHEAD -- cgit