kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: kvm-ppc@vger.kernel.org
Cc: kvm@vger.kernel.org, Bharat Bhushan <Bharat.Bhushan@freescale.com>
Subject: [PULL 41/63] KVM: PPC: Booke-hv: Add one reg interface for SPRG9
Date: Fri,  1 Aug 2014 11:18:12 +0200	[thread overview]
Message-ID: <1406884714-33099-42-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1406884714-33099-1-git-send-email-agraf@suse.de>

From: Bharat Bhushan <Bharat.Bhushan@freescale.com>

We now support SPRG9 for guest, so also add a one reg interface for same
Note: Changes are in bookehv code only as we do not have SPRG9 on booke-pr.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/uapi/asm/kvm.h |  1 +
 arch/powerpc/kvm/e500mc.c           | 22 ++++++++++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h
index 2bc4a94..0e56d9e 100644
--- a/arch/powerpc/include/uapi/asm/kvm.h
+++ b/arch/powerpc/include/uapi/asm/kvm.h
@@ -555,6 +555,7 @@ struct kvm_get_htab_header {
 
 #define KVM_REG_PPC_DABRX	(KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8)
 #define KVM_REG_PPC_WORT	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9)
+#define KVM_REG_PPC_SPRG9	(KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba)
 
 /* Transactional Memory checkpointed state:
  * This is all GPRs, all VSX regs and a subset of SPRs
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
index 690499d..164bad2 100644
--- a/arch/powerpc/kvm/e500mc.c
+++ b/arch/powerpc/kvm/e500mc.c
@@ -267,14 +267,32 @@ static int kvmppc_core_set_sregs_e500mc(struct kvm_vcpu *vcpu,
 static int kvmppc_get_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id,
 			      union kvmppc_one_reg *val)
 {
-	int r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val);
+	int r = 0;
+
+	switch (id) {
+	case KVM_REG_PPC_SPRG9:
+		*val = get_reg_val(id, vcpu->arch.sprg9);
+		break;
+	default:
+		r = kvmppc_get_one_reg_e500_tlb(vcpu, id, val);
+	}
+
 	return r;
 }
 
 static int kvmppc_set_one_reg_e500mc(struct kvm_vcpu *vcpu, u64 id,
 			      union kvmppc_one_reg *val)
 {
-	int r = kvmppc_set_one_reg_e500_tlb(vcpu, id, val);
+	int r = 0;
+
+	switch (id) {
+	case KVM_REG_PPC_SPRG9:
+		vcpu->arch.sprg9 = set_reg_val(id, *val);
+		break;
+	default:
+		r = kvmppc_set_one_reg_e500_tlb(vcpu, id, val);
+	}
+
 	return r;
 }
 
-- 
1.8.1.4


  parent reply	other threads:[~2014-08-01  9:18 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01  9:17 [PULL 00/63] ppc patch queue 2014-08-01 Alexander Graf
2014-08-01  9:17 ` [PULL 01/63] KVM: PPC: BOOK3S: PR: Fix PURR and SPURR emulation Alexander Graf
2014-08-01  9:17 ` [PULL 02/63] KVM: PPC: BOOK3S: PR: Emulate virtual timebase register Alexander Graf
2014-08-01  9:17 ` [PULL 03/63] KVM: PPC: BOOK3S: PR: Emulate instruction counter Alexander Graf
2014-08-01  9:17 ` [PULL 04/63] KVM: PPC: Book3s PR: Disable AIL mode with OPAL Alexander Graf
2014-08-01  9:17 ` [PULL 05/63] KVM: PPC: Book3s HV: Fix tlbie compile error Alexander Graf
2014-08-01  9:17 ` [PULL 06/63] KVM: PPC: Book3S PR: Handle hyp doorbell exits Alexander Graf
2014-08-01  9:17 ` [PULL 07/63] KVM: PPC: Book3S HV: Fix ABIv2 indirect branch issue Alexander Graf
2014-08-01  9:17 ` [PULL 08/63] KVM: PPC: Assembly functions exported to modules need _GLOBAL_TOC() Alexander Graf
2014-08-01  9:17 ` [PULL 09/63] KVM: PPC: Book3S PR: Fix ABIv2 on LE Alexander Graf
2014-08-01  9:17 ` [PULL 10/63] KVM: PPC: Book3S PR: Fix sparse endian checks Alexander Graf
2014-08-01  9:17 ` [PULL 11/63] KVM: PPC: e500mc: Enhance tlb invalidation condition on vcpu schedule Alexander Graf
2014-08-01  9:17 ` [PULL 12/63] KVM: PPC: Book3S: Controls for in-kernel sPAPR hypercall handling Alexander Graf
2014-08-01  9:17 ` [PULL 13/63] KVM: PPC: Book3S: Allow only implemented hcalls to be enabled or disabled Alexander Graf
2014-08-01  9:17 ` [PULL 14/63] KVM: PPC: Book3S HV: Add H_SET_MODE hcall handling Alexander Graf
2014-08-01  9:17 ` [PULL 15/63] KVM: PPC: e500: Fix default tlb for victim hint Alexander Graf
2014-08-01  9:17 ` [PULL 16/63] PPC: Add asm helpers for BE 32bit load/store Alexander Graf
2014-08-01 10:19   ` Benjamin Herrenschmidt
2014-08-01  9:17 ` [PULL 17/63] KVM: PPC: Book3S HV: Make HTAB code LE host aware Alexander Graf
2014-08-01  9:17 ` [PULL 18/63] KVM: PPC: Book3S HV: Access guest VPA in BE Alexander Graf
2014-08-01  9:17 ` [PULL 19/63] KVM: PPC: Book3S HV: Access host lppaca and shadow slb " Alexander Graf
2014-08-01  9:17 ` [PULL 20/63] KVM: PPC: Book3S HV: Access XICS " Alexander Graf
2014-08-01  9:17 ` [PULL 21/63] KVM: PPC: Book3S HV: Fix ABIv2 on LE Alexander Graf
2014-08-01  9:17 ` [PULL 22/63] KVM: PPC: Book3S HV: Enable for little endian hosts Alexander Graf
2014-08-01  9:17 ` [PULL 23/63] KVM: PPC: e500: Emulate power management control SPR Alexander Graf
2014-08-01  9:17 ` [PULL 24/63] KVM: PPC: Book3S: Move vcore definition to end of kvm_arch struct Alexander Graf
2014-08-01  9:17 ` [PULL 25/63] KVM: PPC: Deflect page write faults properly in kvmppc_st Alexander Graf
2014-08-01  9:17 ` [PULL 26/63] KVM: PPC: Book3S: Stop PTE lookup on write errors Alexander Graf
2014-08-01  9:17 ` [PULL 27/63] KVM: PPC: Book3S: Add hack for split real mode Alexander Graf
2014-08-01  9:17 ` [PULL 28/63] KVM: PPC: Book3S: Make magic page properly 4k mappable Alexander Graf
2014-08-01  9:18 ` [PULL 29/63] kvm: ppc: bookehv: Added wrapper macros for shadow registers Alexander Graf
2014-08-01  9:18 ` [PULL 30/63] kvm: ppc: booke: Use the shared struct helpers of SRR0 and SRR1 Alexander Graf
2014-08-01  9:18 ` [PULL 31/63] kvm: ppc: booke: Use the shared struct helpers of SPRN_DEAR Alexander Graf
2014-08-01  9:18 ` [PULL 32/63] kvm: ppc: booke: Add shared struct helpers of SPRN_ESR Alexander Graf
2014-08-01  9:18 ` [PULL 33/63] kvm: ppc: booke: Use the shared struct helpers for SPRN_SPRG0-7 Alexander Graf
2014-08-01  9:18 ` [PULL 34/63] kvm: ppc: Add SPRN_EPR get helper function Alexander Graf
2014-08-01  9:18 ` [PULL 35/63] KVM: PPC: e500mc: Revert "add load inst fixup" Alexander Graf
2014-08-01  9:18 ` [PULL 36/63] KVM: PPC: Book3e: Add TLBSEL/TSIZE defines for MAS0/1 Alexander Graf
2014-08-01  9:18 ` [PULL 37/63] KVM: PPC: Book3s: Remove kvmppc_read_inst() function Alexander Graf
2014-08-01  9:18 ` [PULL 38/63] KVM: PPC: Allow kvmppc_get_last_inst() to fail Alexander Graf
2014-08-01  9:18 ` [PULL 39/63] KVM: PPC: Bookehv: Get vcpu's last instruction for emulation Alexander Graf
2014-08-01  9:18 ` [PULL 40/63] kvm: ppc: bookehv: Save restore SPRN_SPRG9 on guest entry exit Alexander Graf
2014-08-01  9:18 ` Alexander Graf [this message]
2014-08-01  9:18 ` [PULL 42/63] KVM: PPC: Remove comment saying SPRG1 is used for vcpu pointer Alexander Graf
2014-08-01  9:18 ` [PULL 43/63] KVM: PPC: Remove 440 support Alexander Graf
2014-08-01  9:18 ` [PULL 44/63] KVM: PPC: Book3S: Fix LPCR one_reg interface Alexander Graf
2014-08-01  9:18 ` [PULL 45/63] KVM: PPC: Book3S PR: Take SRCU read lock around RTAS kvm_read_guest() call Alexander Graf
2014-08-01  9:18 ` [PULL 46/63] KVM: PPC: Book3S: Make kvmppc_ld return a more accurate error indication Alexander Graf
2014-08-01  9:18 ` [PULL 47/63] Split out struct kvmppc_vcore creation to separate function Alexander Graf
2014-08-01  9:18 ` [PULL 48/63] Use the POWER8 Micro Partition Prefetch Engine in KVM HV on POWER8 Alexander Graf
2014-08-01  9:18 ` [PULL 49/63] KVM: Rename and add argument to check_extension Alexander Graf
2014-08-01  9:18 ` [PULL 50/63] KVM: Allow KVM_CHECK_EXTENSION on the vm fd Alexander Graf
2014-08-01  9:18 ` [PULL 51/63] KVM: PPC: Book3S: Provide different CAPs based on HV or PR mode Alexander Graf
2014-08-01  9:18 ` [PULL 52/63] KVM: PPC: BOOK3S: HV: Update compute_tlbie_rb to handle 16MB base page Alexander Graf
2014-08-01  9:18 ` [PULL 53/63] KVM: PPC: Implement kvmppc_xlate for all targets Alexander Graf
2014-08-01  9:18 ` [PULL 54/63] KVM: PPC: Move kvmppc_ld/st to common code Alexander Graf
2014-08-01  9:18 ` [PULL 55/63] KVM: PPC: Remove kvmppc_bad_hva() Alexander Graf
2014-08-01  9:18 ` [PULL 56/63] KVM: PPC: Use kvm_read_guest in kvmppc_ld Alexander Graf
2014-08-01  9:18 ` [PULL 57/63] KVM: PPC: Handle magic page in kvmppc_ld/st Alexander Graf
2014-08-01  9:18 ` [PULL 58/63] KVM: PPC: Separate loadstore emulation from priv emulation Alexander Graf
2014-08-01  9:18 ` [PULL 59/63] KVM: PPC: Expose helper functions for data/inst faults Alexander Graf
2014-08-01  9:18 ` [PULL 60/63] KVM: PPC: Remove DCR handling Alexander Graf
2014-08-01  9:18 ` [PULL 61/63] KVM: PPC: BOOKEHV: rename e500hv_spr to bookehv_spr Alexander Graf
2014-08-01  9:18 ` [PULL 62/63] KVM: PPC: HV: Remove generic instruction emulation Alexander Graf
2014-08-01  9:18 ` [PULL 63/63] KVM: PPC: PR: Handle FSCR feature deselects Alexander Graf

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=1406884714-33099-42-git-send-email-agraf@suse.de \
    --to=agraf@suse.de \
    --cc=Bharat.Bhushan@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).