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

login
register
mail settings
Submitter Paul Mackerras
Date Sept. 20, 2013, 11:53 p.m.
Message ID <20130920235328.GA5083@iris.ozlabs.ibm.com>
Download mbox | patch
Permalink /patch/276820/
State New
Headers show

Comments

Paul Mackerras - Sept. 20, 2013, 11:53 p.m.
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.

Cc: stable@vger.kernel.org [v3.1+]
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
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(-)
Alexander Graf - Oct. 4, 2013, 1:10 p.m.
On 21.09.2013, at 01:53, Paul Mackerras wrote:

> 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.
> 
> Cc: stable@vger.kernel.org [v3.1+]
> Signed-off-by: Paul Mackerras <paulus@samba.org>

Acked-by: Alexander Graf <agraf@suse.de>

Gleb, Paolo, can you please queue this directly?


Alex

> ---
> 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(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> index 8e0f28f..852e694 100644
> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> @@ -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)
> 
> -- 
> 1.8.4.rc3
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini - Oct. 7, 2013, 12:07 p.m.
Il 04/10/2013 15:10, Alexander Graf ha scritto:
> 
> On 21.09.2013, at 01:53, Paul Mackerras wrote:
> 
>> 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.
>>
>> Cc: stable@vger.kernel.org [v3.1+]
>> Signed-off-by: Paul Mackerras <paulus@samba.org>
> 
> Acked-by: Alexander Graf <agraf@suse.de>
> 
> Gleb, Paolo, can you please queue this directly?

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

Paolo

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
index 8e0f28f..852e694 100644
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -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)