public inbox for kvm-ppc@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc <kvm-ppc@vger.kernel.org>
Cc: kvm list <kvm@vger.kernel.org>, Avi Kivity <avi@redhat.com>,
	Mihai Caraman <mihai.caraman@freescale.com>
Subject: [PATCH 08/16] KVM: PPC: bookehv: Use lwz/stw instead of PPC_LL/PPC_STL for 32-bit fields
Date: Sun, 06 May 2012 14:20:52 +0000	[thread overview]
Message-ID: <1336314060-32640-9-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1336314060-32640-1-git-send-email-agraf@suse.de>

From: Mihai Caraman <mihai.caraman@freescale.com>

Interrupt code used PPC_LL/PPC_STL macros to load/store some of u32 fields
which led to memory overflow on 64-bit. Use lwz/stw instead.

Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kvm/bookehv_interrupts.S |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index b7608ac..06750cc 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -87,9 +87,9 @@
 	mfspr	r8, SPRN_TBRL
 	mfspr	r9, SPRN_TBRU
 	cmpw	r9, r7
-	PPC_STL	r8, VCPU_TIMING_EXIT_TBL(r4)
+	stw	r8, VCPU_TIMING_EXIT_TBL(r4)
 	bne-	1b
-	PPC_STL	r9, VCPU_TIMING_EXIT_TBU(r4)
+	stw	r9, VCPU_TIMING_EXIT_TBU(r4)
 #endif
 
 	oris	r8, r6, MSR_CE@h
@@ -216,7 +216,7 @@ _GLOBAL(kvmppc_handler_\intno\()_\srr1)
 	PPC_STL	r4, VCPU_GPR(r4)(r11)
 	PPC_LL	r4, THREAD_NORMSAVE(0)(r10)
 	PPC_STL	r5, VCPU_GPR(r5)(r11)
-	PPC_STL	r13, VCPU_CR(r11)
+	stw	r13, VCPU_CR(r11)
 	mfspr	r5, \srr0
 	PPC_STL	r3, VCPU_GPR(r10)(r11)
 	PPC_LL	r3, THREAD_NORMSAVE(2)(r10)
@@ -243,7 +243,7 @@ _GLOBAL(kvmppc_handler_\intno\()_\srr1)
 	PPC_STL	r4, VCPU_GPR(r4)(r11)
 	PPC_LL	r4, GPR9(r8)
 	PPC_STL	r5, VCPU_GPR(r5)(r11)
-	PPC_STL	r9, VCPU_CR(r11)
+	stw	r9, VCPU_CR(r11)
 	mfspr	r5, \srr0
 	PPC_STL	r3, VCPU_GPR(r8)(r11)
 	PPC_LL	r3, GPR10(r8)
@@ -315,7 +315,7 @@ _GLOBAL(kvmppc_resume_host)
 	mfspr	r6, SPRN_SPRG4
 	PPC_STL	r5, VCPU_LR(r4)
 	mfspr	r7, SPRN_SPRG5
-	PPC_STL	r3, VCPU_VRSAVE(r4)
+	stw	r3, VCPU_VRSAVE(r4)
 	PPC_STD(r6, VCPU_SHARED_SPRG4, r11)
 	mfspr	r8, SPRN_SPRG6
 	PPC_STD(r7, VCPU_SHARED_SPRG5, r11)
@@ -551,7 +551,7 @@ lightweight_exit:
 	PPC_LL	r3, VCPU_LR(r4)
 	PPC_LL	r5, VCPU_XER(r4)
 	PPC_LL	r6, VCPU_CTR(r4)
-	PPC_LL	r7, VCPU_CR(r4)
+	lwz	r7, VCPU_CR(r4)
 	PPC_LL	r8, VCPU_PC(r4)
 	PPC_LD(r9, VCPU_SHARED_MSR, r11)
 	PPC_LL	r0, VCPU_GPR(r0)(r4)
@@ -574,9 +574,9 @@ lightweight_exit:
 	mfspr	r9, SPRN_TBRL
 	mfspr	r8, SPRN_TBRU
 	cmpw	r8, r6
-	PPC_STL	r9, VCPU_TIMING_LAST_ENTER_TBL(r4)
+	stw	r9, VCPU_TIMING_LAST_ENTER_TBL(r4)
 	bne	1b
-	PPC_STL	r8, VCPU_TIMING_LAST_ENTER_TBU(r4)
+	stw	r8, VCPU_TIMING_LAST_ENTER_TBU(r4)
 #endif
 
 	/*
-- 
1.6.0.2


  parent reply	other threads:[~2012-05-06 14:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-06 14:20 [PULL 00/16] ppc patch queue 2012-05-06 Alexander Graf
2012-05-06 14:20 ` [PATCH 01/16] KVM: Use minimum and maximum address mapped by TLB1 Alexander Graf
2012-05-06 14:20 ` [PATCH 02/16] KVM: PPC: Use clockevent multiplier and shifter for decrementer Alexander Graf
2012-05-06 14:20 ` [PATCH 03/16] KVM: PPC: bookehv: Use a Macro for saving/restoring guest registers to/from their 64 b Alexander Graf
2012-05-06 14:20 ` [PATCH 04/16] KVM: PPC: Restrict PPC_[L|ST]D macro to asm code Alexander Graf
2012-05-06 14:20 ` [PATCH 05/16] KVM: PPC: booke(hv): Fix save/restore of guest accessible SPRGs Alexander Graf
2012-05-06 14:20 ` [PATCH 06/16] KVM: PPC: Book3S: PR: Optimize entry path Alexander Graf
2012-05-06 14:20 ` [PATCH 07/16] KVM: PPC: Book3S: PR: No isync in slbie path Alexander Graf
2012-05-06 14:20 ` Alexander Graf [this message]
2012-05-06 14:20 ` [PATCH 09/16] KVM: PPC: Fix stbux emulation Alexander Graf
2012-05-06 14:20 ` [PATCH 10/16] KVM: PPC: Fix PR KVM on POWER7 bare metal Alexander Graf
2012-05-06 14:20 ` [PATCH 11/16] KVM: PPC: Book3S: Enable IRQs during exit handling Alexander Graf
2012-05-06 14:20 ` [PATCH 12/16] KVM: PPC: bookehv: Fix r8/r13 storing in level exception handler Alexander Graf
2012-05-06 14:20 ` [PATCH 13/16] kvm/book3s: Make kernel emulated H_PUT_TCE available for "PR" KVM Alexander Graf
2012-05-06 14:20 ` [PATCH 14/16] kvm/powerpc: Add new ioctl to retreive server MMU infos Alexander Graf
2012-05-06 14:20 ` [PATCH 15/16] KVM: PPC: Emulator: clean up instruction parsing Alexander Graf
2012-05-06 14:21 ` [PATCH 16/16] KVM: PPC: Emulator: clean up SPR reads and writes Alexander Graf
2012-05-08 14:01 ` [PULL 00/16] ppc patch queue 2012-05-06 Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336314060-32640-9-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=avi@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mihai.caraman@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox