kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR
@ 2013-09-20 23:53 Paul Mackerras
  2013-10-04 13:10 ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2013-09-20 23:53 UTC (permalink / raw)
  To: Alexander Graf, kvm; +Cc: kvm-ppc

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(-)

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR
  2013-09-20 23:53 [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR Paul Mackerras
@ 2013-10-04 13:10 ` Alexander Graf
  2013-10-07 12:07   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2013-10-04 13:10 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: kvm@vger.kernel.org mailing list, kvm-ppc, Gleb Natapov,
	Paolo Bonzini


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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR
  2013-10-04 13:10 ` Alexander Graf
@ 2013-10-07 12:07   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2013-10-07 12:07 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Paul Mackerras, kvm@vger.kernel.org mailing list, kvm-ppc,
	Gleb Natapov

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-07 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-20 23:53 [PATCH] KVM: PPC: Book3S HV: Fix typo in saving DSCR Paul Mackerras
2013-10-04 13:10 ` Alexander Graf
2013-10-07 12:07   ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).