[PATCH] Don't access HID registers if running on a Hypervisor.
Jimi Xenidis
jimix at watson.ibm.com
Thu Jun 22 09:15:55 EST 2006
The following patch avoids accessing Hypervisor privilege HID
registers when running on a Hypervisor (MSR[HV]=0).
Signed-off-by: Jimi Xenidis <jimix at watson.ibm.com>
diff -r 87d019e8edc2 arch/powerpc/kernel/cpu_setup_power4.S
--- a/arch/powerpc/kernel/cpu_setup_power4.S Tue Jun 20 13:50:49 2006 -0400
+++ b/arch/powerpc/kernel/cpu_setup_power4.S Wed Jun 21 19:10:22 2006 -0400
@@ -149,7 +149,12 @@ _GLOBAL(__save_cpu_setup)
cmpwi r0,0x44
bne 2f
-1: /* Save HID0,1,4 and 5 */
+1: /* skip if not running in HV mode */
+ mfmsr r0
+ rldicl. r0,r0,4,63
+ beq 2f
+
+ /* Save HID0,1,4 and 5 */
mfspr r3,SPRN_HID0
std r3,CS_HID0(r5)
mfspr r3,SPRN_HID1
@@ -183,7 +188,12 @@ _GLOBAL(__restore_cpu_setup)
cmpwi r0,0x44
bnelr
-1: /* Before accessing memory, we make sure rm_ci is clear */
+1: /* skip if not running in HV mode */
+ mfmsr r0
+ rldicl. r0,r0,4,63
+ beqlr
+
+ /* Before accessing memory, we make sure rm_ci is clear */
li r0,0
mfspr r3,SPRN_HID4
rldimi r3,r0,40,23 /* clear bit 23 (rm_ci) */
More information about the Linuxppc-dev
mailing list