]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM: PPC: Add SVCPU to Book3S_32
authorAlexander Graf <agraf@suse.de>
Thu, 15 Apr 2010 22:11:51 +0000 (00:11 +0200)
committerAvi Kivity <avi@redhat.com>
Mon, 17 May 2010 09:18:43 +0000 (12:18 +0300)
We need to keep the pointer to the shadow vcpu somewhere accessible from
within really early interrupt code. The best fit I found was the thread
struct, as that resides in an SPRG.

So let's put a pointer to the shadow vcpu in the thread struct and add
an asm-offset so we can find it.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/processor.h
arch/powerpc/kernel/asm-offsets.c

index 221ba62404644d598ae2e9a6d20db6a3322656d0..7492fe8ad6e400e43f80faf6da0c62c6226d8db2 100644 (file)
@@ -229,6 +229,9 @@ struct thread_struct {
        unsigned long   spefscr;        /* SPE & eFP status */
        int             used_spe;       /* set if process has used spe */
 #endif /* CONFIG_SPE */
+#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
+       void*           kvm_shadow_vcpu; /* KVM internal data */
+#endif /* CONFIG_KVM_BOOK3S_32_HANDLER */
 };
 
 #define ARCH_MIN_TASKALIGN 16
index e8003ff81eef218478318e2e1692bd0521632630..1804c2cd1dfd55c964fb9ff32ee4ff2201d9c3eb 100644 (file)
@@ -108,6 +108,9 @@ int main(void)
        DEFINE(THREAD_USED_SPE, offsetof(struct thread_struct, used_spe));
 #endif /* CONFIG_SPE */
 #endif /* CONFIG_PPC64 */
+#ifdef CONFIG_KVM_BOOK3S_32_HANDLER
+       DEFINE(THREAD_KVM_SVCPU, offsetof(struct thread_struct, kvm_shadow_vcpu));
+#endif
 
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
        DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags));