sparc32: fix cpuid_patch run-time patching
PATCH 1/2 sparc32: fix cpuid_patch run-time patching
From eecbbe31067e738d4342dee9709f14086cd4fbad Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
Date: Sun, 20 May 2012 17:24:20 +0200
Subject: [PATCH 1/2] sparc32: fix cpuid_patch run-time patching
We hang forever when trying to do run-time patching of instructions identified by the cpuid_patch section
---
I tested this by replacing all sun4d code with sun4m code, and I then modified the sun4m code to be wrong.
With no patching the kernel failed to boot.
With patching the kernel was able to boot after this little fix.
The bug was found when testing the flushi variant in the following patch - but the bug-fix warranted a dedicated patch.
Sam
arch/sparc/kernel/setup_32.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/sparc/kernel/setup_32.c +2 -0
@@ -229,6 +229,8 @@ static void __init per_cpu_patch(void) *(unsigned int *) (addr +0 ) = insns[0 ]; *(unsigned int *) (addr +4 ) = insns[1 ]; *(unsigned int *) (addr +8 ) = insns[2 ]; + + p++; }#ifdef CONFIG_SMP local_ops->cache_all ();
Signature · 1 line
1.6.0.6
David Miller
maintainerFrom: Sam Ravnborg <[email protected]>
Date: Sun, 20 May 2012 17:31:40 +0200
Quoted 9 lines
Quoted 1 line
From
eecbbe31067e738d4342dee9709f14086cd4fbadMon Sep 17 00:00:00 2001From: Sam Ravnborg <[email protected]>
Date: Sun, 20 May 2012 17:24:20 +0200
Subject: [PATCH 1/2] sparc32: fixcpuid_patchrun-time patchingWe hang forever when trying to do run-time patching of instructions identified by the
cpuid_patchsectionSigned-off-by Sam Ravnborg <[email protected]>
Yikes, good catch, applied.