diff options
author | Alexander Graf <agraf@suse.de> | 2010-01-07 20:58:03 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:48 -0500 |
commit | 7e57cba06074da84d7c24d8c3f44040d2d8c88ac (patch) | |
tree | e99519ca301b887de4d689421e7a954f1c7792e4 /arch/powerpc/include/asm/kvm_book3s_64_asm.h | |
parent | 992b5b29b5ae254c416c62faf98d59a6cf970027 (diff) |
KVM: PPC: Use PACA backed shadow vcpu
We're being horribly racy right now. All the entry and exit code hijacks
random fields from the PACA that could easily be used by different code in
case we get interrupted, for example by a #MC or even page fault.
After discussing this with Ben, we figured it's best to reserve some more
space in the PACA and just shove off some vcpu state to there.
That way we can drastically improve the readability of the code, make it
less racy and less complex.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_book3s_64_asm.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s_64_asm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s_64_asm.h b/arch/powerpc/include/asm/kvm_book3s_64_asm.h index 2e06ee8184e..fca9404c1a7 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64_asm.h +++ b/arch/powerpc/include/asm/kvm_book3s_64_asm.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_KVM_BOOK3S_ASM_H__ | 20 | #ifndef __ASM_KVM_BOOK3S_ASM_H__ |
21 | #define __ASM_KVM_BOOK3S_ASM_H__ | 21 | #define __ASM_KVM_BOOK3S_ASM_H__ |
22 | 22 | ||
23 | #ifdef __ASSEMBLY__ | ||
24 | |||
23 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER | 25 | #ifdef CONFIG_KVM_BOOK3S_64_HANDLER |
24 | 26 | ||
25 | #include <asm/kvm_asm.h> | 27 | #include <asm/kvm_asm.h> |
@@ -55,4 +57,21 @@ kvmppc_resume_\intno: | |||
55 | 57 | ||
56 | #endif /* CONFIG_KVM_BOOK3S_64_HANDLER */ | 58 | #endif /* CONFIG_KVM_BOOK3S_64_HANDLER */ |
57 | 59 | ||
60 | #else /*__ASSEMBLY__ */ | ||
61 | |||
62 | struct kvmppc_book3s_shadow_vcpu { | ||
63 | ulong gpr[14]; | ||
64 | u32 cr; | ||
65 | u32 xer; | ||
66 | ulong host_r1; | ||
67 | ulong host_r2; | ||
68 | ulong handler; | ||
69 | ulong scratch0; | ||
70 | ulong scratch1; | ||
71 | ulong vmhandler; | ||
72 | ulong rmhandler; | ||
73 | }; | ||
74 | |||
75 | #endif /*__ASSEMBLY__ */ | ||
76 | |||
58 | #endif /* __ASM_KVM_BOOK3S_ASM_H__ */ | 77 | #endif /* __ASM_KVM_BOOK3S_ASM_H__ */ |