Skip to contentSkip to conversation

KVM: PPC: Book3S HV: Fix typo in saving DSCR

PATCH In review Paul Mackerras 3 participants 3 messages Sep 20, 2013 – Oct 7, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Book3S HV: Fix typo in saving DSCR

This fixes a typo in the code that saves the guest DSCR (Data Stream Control Register) into the kvm_vcpu_arch struct on guest exit. The effect of the typo was that the DSCR value was saved in the wrong place, so changes to the DSCR by the guest didn't persist across guest exit and entry, and some host kernel memory got corrupted.

---
Please send this upstream to Linus for inclusion in 3.12.

 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 -1
index 8e0f28f..852e694 100644
@@ -1190,7 +1190,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
 BEGIN_FTR_SECTION
 	mfspr	r8, SPRN_DSCR
 	ld	r7, HSTATE_DSCR(r13)
-	std	r8, VCPU_DSCR(r7)
+	std	r8, VCPU_DSCR(r9)
 	mtspr	SPRN_DSCR, r7
 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)
 
Signature · 1 line
1.8.4.rc3
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Paul Mackerras

This fixes a typo in the code that saves the guest DSCR (Data Stream Control Register) into the kvm_vcpu_arch struct on guest exit. The effect of the typo was that the DSCR value was saved in the wrong place, so changes to the DSCR by the guest didn't persist across guest exit and entry, and some host kernel memory got corrupted.

Gleb, Paolo, can you please queue this directly?

Alex

Quoted 22 lines

---
Please send this upstream to Linus for inclusion in 3.12.

arch/powerpc/kvm/book3s_hv_rmhandlers.S | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +0 -0
index 8e0f28f..852e694 100644
@@ -1190,7 +1190,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)

BEGIN_FTR_SECTION

	mfspr	r8, SPRN_DSCR
	ld	r7, HSTATE_DSCR(r13)
arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 -1
-	std	r8, VCPU_DSCR(r7)
+	std	r8, VCPU_DSCR(r9)

mtspr SPRN_DSCR, r7
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206)

Signature · 1 line
1.8.4.rc3
maintainer
#2 lore raw

Il 04/10/2013 15:10, Alexander Graf ha scritto:

Quoted 9 lines · Paul Mackerras
Quoted 7 lines

This fixes a typo in the code that saves the guest DSCR (Data Stream Control Register) into the kvm_vcpu_arch struct on guest exit. The effect of the typo was that the DSCR value was saved in the wrong place, so changes to the DSCR by the guest didn't persist across guest exit and entry, and some host kernel memory got corrupted.

Quoted 6 lines
Quoted 2 lines

Gleb, Paolo, can you please queue this directly?

Sure. I'll wait for feedback on the other patch though.

Paolo