From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: "kvm@vger.kernel.org mailing list" <kvm@vger.kernel.org>,
Gleb Natapov <gleb@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Bharat Bhushan <Bharat.Bhushan@freescale.com>,
Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [PATCH 09/12] KVM: PPC: booke: use vcpu reference from thread_struct
Date: Fri, 15 Feb 2013 00:16:25 +0000 [thread overview]
Message-ID: <1360887388-6586-10-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1360887388-6586-1-git-send-email-agraf@suse.de>
From: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Like other places, use thread_struct to get vcpu reference.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
arch/powerpc/include/asm/reg.h | 2 --
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/kvm/booke_interrupts.S | 6 ++----
3 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index 97d3727..11ae3d8 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -919,8 +919,6 @@
#define SPRN_SPRG_RSCRATCH_DBG SPRN_SPRG9
#define SPRN_SPRG_WSCRATCH_DBG SPRN_SPRG9
#endif
-#define SPRN_SPRG_RVCPU SPRN_SPRG1
-#define SPRN_SPRG_WVCPU SPRN_SPRG1
#endif
#ifdef CONFIG_8xx
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 4e23ba2..46f6afd 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -117,7 +117,7 @@ int main(void)
#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu));
#endif
-#ifdef CONFIG_KVM_BOOKE_HV
+#if defined(CONFIG_KVM) && defined(CONFIG_BOOKE)
DEFINE(THREAD_KVM_VCPU, offsetof(struct thread_struct, kvm_vcpu));
#endif
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index bb46b32..ca16d57 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -56,7 +56,8 @@
_GLOBAL(kvmppc_handler_\ivor_nr)
/* Get pointer to vcpu and record exit number. */
mtspr \scratch , r4
- mfspr r4, SPRN_SPRG_RVCPU
+ mfspr r4, SPRN_SPRG_THREAD
+ lwz r4, THREAD_KVM_VCPU(r4)
stw r3, VCPU_GPR(R3)(r4)
stw r5, VCPU_GPR(R5)(r4)
stw r6, VCPU_GPR(R6)(r4)
@@ -402,9 +403,6 @@ lightweight_exit:
lwz r8, kvmppc_booke_handlers@l(r8)
mtspr SPRN_IVPR, r8
- /* Save vcpu pointer for the exception handlers. */
- mtspr SPRN_SPRG_WVCPU, r4
-
lwz r5, VCPU_SHARED(r4)
/* Can't switch the stack pointer until after IVPR is switched,
--
1.6.0.2
next prev parent reply other threads:[~2013-02-15 0:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 0:16 [PULL 00/14] ppc patch queue 2013-02-15 Alexander Graf
2013-02-15 0:16 ` [PATCH 01/12] KVM: PPC: E500: Move write_stlbe higher Alexander Graf
2013-02-15 0:16 ` [PATCH 02/12] KVM: PPC: E500: Explicitly mark shadow maps invalid Alexander Graf
2013-02-15 19:45 ` Scott Wood
2013-02-15 0:16 ` [PATCH 03/12] KVM: PPC: E500: Propagate errors when shadow mapping Alexander Graf
2013-02-15 0:16 ` [PATCH 04/12] KVM: PPC: e500: Call kvmppc_mmu_map for initial mapping Alexander Graf
2013-02-15 0:16 ` [PATCH 05/12] KVM: PPC: E500: Split host and guest MMU parts Alexander Graf
2013-02-15 0:16 ` [PATCH 06/12] KVM: PPC: e500: Implement TLB1-in-TLB0 mapping Alexander Graf
2013-02-15 0:16 ` [PATCH 07/12] KVM: PPC: E500: Make clear_tlb_refs and clear_tlb1_bitmap static Alexander Graf
2013-02-15 0:16 ` [PATCH 08/12] KVM: PPC: E500: Remove kvmppc_e500_tlbil_all usage from guest TLB code Alexander Graf
2013-02-15 0:16 ` Alexander Graf [this message]
2013-02-15 0:16 ` [PATCH 10/12] KVM: PPC: booke: Allow multiple exception types Alexander Graf
2013-02-15 0:16 ` [PATCH 11/12] booke: Added DBCR4 SPR number Alexander Graf
2013-02-15 0:16 ` [PATCH 12/12] KVM: PPC: BookE: Handle alignment interrupts Alexander Graf
2013-02-19 0:15 ` [PULL 00/14] ppc patch queue 2013-02-15 Marcelo Tosatti
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=1360887388-6586-10-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=Bharat.Bhushan@freescale.com \
--cc=gleb@redhat.com \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.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