Skip to content

Commit 32c7dbf

Browse files
committed
KVM: PPC: Book3S: PR: Fix hsrr code
When jumping back into the kernel to code that knows that it would be using HSRR registers instead of SRR registers, we need to make sure we pass it all information on where to jump to in HSRR registers. Unfortunately, we used r10 to store the information to distinguish between the HSRR and SRR case. That register got clobbered in between though, rendering the later comparison invalid. Instead, let's use cr1 to store this information. That way we don't need yet another register and everyone's happy. This fixes PR KVM on POWER7 bare metal for me. Signed-off-by: Alexander Graf <[email protected]>
1 parent 56e13db commit 32c7dbf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/powerpc/kvm/book3s_segment.S

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ kvmppc_interrupt:
197197
/* Save guest PC and MSR */
198198
#ifdef CONFIG_PPC64
199199
BEGIN_FTR_SECTION
200-
mr r10, r12
201-
andi. r0,r12,0x2
200+
andi. r0, r12, 0x2
201+
cmpwi cr1, r0, 0
202202
beq 1f
203203
mfspr r3,SPRN_HSRR0
204204
mfspr r4,SPRN_HSRR1
@@ -345,8 +345,7 @@ no_dcbz32_off:
345345

346346
#ifdef CONFIG_PPC64
347347
BEGIN_FTR_SECTION
348-
andi. r0,r10,0x2
349-
beq 1f
348+
beq cr1, 1f
350349
mtspr SPRN_HSRR1, r6
351350
mtspr SPRN_HSRR0, r8
352351
END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)

0 commit comments

Comments
 (0)