Bug#639949: linux-image-3.0.0-1-sparc64-smp: Kernel fails to boot with illegal instruction on ultrasparc V240
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 01 Sep 2011 04:45:34 +0100
> So anyway, this CPU doesn't implement popc and is wrongly being detected
> as doing so.
I posted a fix for this already yesterday and it's in Linus's tree
and queued up in Greg's -stable tree as well:
>From 1a8e0da5937a6c87807083baa318cf8f98dac9aa Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Mon, 29 Aug 2011 21:14:29 -0700
Subject: [PATCH] sparc64: Only Panther cheetah+ chips have POPC.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
arch/sparc/kernel/setup_64.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 3e9daea..3c5bb78 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -440,8 +440,14 @@ static void __init init_sparc64_elf_hwcap(void)
cap |= AV_SPARC_VIS;
if (tlb_type == cheetah || tlb_type == cheetah_plus)
cap |= AV_SPARC_VIS | AV_SPARC_VIS2;
- if (tlb_type == cheetah_plus)
- cap |= AV_SPARC_POPC;
+ if (tlb_type == cheetah_plus) {
+ unsigned long impl, ver;
+
+ __asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
+ impl = ((ver >> 32) & 0xffff);
+ if (impl == PANTHER_IMPL)
+ cap |= AV_SPARC_POPC;
+ }
if (tlb_type == hypervisor) {
if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1)
cap |= AV_SPARC_ASI_BLK_INIT;
--
1.7.6.401.g6a319
Reply to: