[PATCH 08/27] KVM: PPC: Add fields to shadow vcpu

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander Graf
Date: Thursday, April 15, 2010 - 3:11 pm

After a lot of thought on how to make the entry / exit code easier,
I figured it'd be clever to put even more register state into the
shadow vcpu. That way we have more registers available to use, making
the code easier to read.

So this patch adds a few new fields to that shadow vcpu. Later on we
will remove the originals from the vcpu and paca.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/include/asm/kvm_book3s_asm.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s_asm.h b/arch/powerpc/include/asm/kvm_book3s_asm.h
index 183461b..e915e7d 100644
--- a/arch/powerpc/include/asm/kvm_book3s_asm.h
+++ b/arch/powerpc/include/asm/kvm_book3s_asm.h
@@ -63,12 +63,33 @@ struct kvmppc_book3s_shadow_vcpu {
 	ulong gpr[14];
 	u32 cr;
 	u32 xer;
+
+	u32 fault_dsisr;
+	u32 last_inst;
+	ulong ctr;
+	ulong lr;
+	ulong pc;
+	ulong shadow_srr1;
+	ulong fault_dar;
+
 	ulong host_r1;
 	ulong host_r2;
 	ulong handler;
 	ulong scratch0;
 	ulong scratch1;
 	ulong vmhandler;
+	u8 in_guest;
+
+#ifdef CONFIG_PPC_BOOK3S_32
+	u32     sr[16];			/* Guest SRs */
+#endif
+#ifdef CONFIG_PPC_BOOK3S_64
+	u8 slb_max;			/* highest used guest slb entry */
+	struct  {
+		u64     esid;
+		u64     vsid;
+	} slb[64];			/* guest SLB */
+#endif
 };
 
 #endif /*__ASSEMBLY__ */
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/27] Book3S_32 (PPC32) KVM support, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 01/27] KVM: PPC: Name generic 64-bit code generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 02/27] KVM: PPC: Add host MMU Support, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 03/27] KVM: PPC: Add SR swapping code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 04/27] KVM: PPC: Add generic segment switching code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 05/27] PPC: Split context init/destroy functions, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 06/27] KVM: PPC: Add kvm_book3s_64.h, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 07/27] KVM: PPC: Add kvm_book3s_32.h, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 08/27] KVM: PPC: Add fields to shadow vcpu, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 09/27] KVM: PPC: Improve indirect svcpu accessors, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 10/27] KVM: PPC: Use KVM_BOOK3S_HANDLER, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 11/27] KVM: PPC: Use CONFIG_PPC_BOOK3S define, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 12/27] PPC: Add STLU, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 13/27] KVM: PPC: Use now shadowed vcpu fields, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 14/27] KVM: PPC: Extract MMU init, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 15/27] KVM: PPC: Make real mode handler generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 16/27] KVM: PPC: Make highmem code generic, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 18/27] KVM: PPC: Release clean pages as clean, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 19/27] KVM: PPC: Remove fetch fail code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 20/27] KVM: PPC: Add SVCPU to Book3S_32, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 21/27] KVM: PPC: Emulate segment fault, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 22/27] KVM: PPC: Add Book3S compatibility code, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 24/27] PPC: Export SWITCH_FRAME_SIZE, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 25/27] KVM: PPC: Check max IRQ prio, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 26/27] KVM: PPC: Add KVM intercept handlers, Alexander Graf, (Thu Apr 15, 3:11 pm)
[PATCH 27/27] KVM: PPC: Enable Book3S_32 KVM building, Alexander Graf, (Thu Apr 15, 3:11 pm)
Re: [PATCH 05/27] PPC: Split context init/destroy functions, Benjamin Herrenschmidt, (Thu Apr 15, 11:46 pm)
Re: [PATCH 12/27] PPC: Add STLU, Benjamin Herrenschmidt, (Thu Apr 15, 11:47 pm)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Benjamin Herrenschmidt, (Thu Apr 15, 11:47 pm)
Re: [PATCH 24/27] PPC: Export SWITCH_FRAME_SIZE, Benjamin Herrenschmidt, (Thu Apr 15, 11:48 pm)
Re: [PATCH 26/27] KVM: PPC: Add KVM intercept handlers, Benjamin Herrenschmidt, (Thu Apr 15, 11:48 pm)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:07 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Benjamin Herrenschmidt, (Fri Apr 16, 2:22 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:25 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 2:31 am)
Re: [PATCH 23/27] KVM: PPC: Export MMU variables, Alexander Graf, (Fri Apr 16, 4:18 am)
Re: [PATCH 00/27] Book3S_32 (PPC32) KVM support, Avi Kivity, (Wed Apr 21, 2:42 am)