diff options
Diffstat (limited to 'arch/powerpc/include/asm/kvm_para.h')
-rw-r--r-- | arch/powerpc/include/asm/kvm_para.h | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index c18916bff689..9365860fb7f6 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h | |||
@@ -16,77 +16,11 @@ | |||
16 | * | 16 | * |
17 | * Authors: Hollis Blanchard <hollisb@us.ibm.com> | 17 | * Authors: Hollis Blanchard <hollisb@us.ibm.com> |
18 | */ | 18 | */ |
19 | |||
20 | #ifndef __POWERPC_KVM_PARA_H__ | 19 | #ifndef __POWERPC_KVM_PARA_H__ |
21 | #define __POWERPC_KVM_PARA_H__ | 20 | #define __POWERPC_KVM_PARA_H__ |
22 | 21 | ||
23 | #include <linux/types.h> | 22 | #include <uapi/asm/kvm_para.h> |
24 | 23 | ||
25 | /* | ||
26 | * Additions to this struct must only occur at the end, and should be | ||
27 | * accompanied by a KVM_MAGIC_FEAT flag to advertise that they are present | ||
28 | * (albeit not necessarily relevant to the current target hardware platform). | ||
29 | * | ||
30 | * Struct fields are always 32 or 64 bit aligned, depending on them being 32 | ||
31 | * or 64 bit wide respectively. | ||
32 | * | ||
33 | * See Documentation/virtual/kvm/ppc-pv.txt | ||
34 | */ | ||
35 | struct kvm_vcpu_arch_shared { | ||
36 | __u64 scratch1; | ||
37 | __u64 scratch2; | ||
38 | __u64 scratch3; | ||
39 | __u64 critical; /* Guest may not get interrupts if == r1 */ | ||
40 | __u64 sprg0; | ||
41 | __u64 sprg1; | ||
42 | __u64 sprg2; | ||
43 | __u64 sprg3; | ||
44 | __u64 srr0; | ||
45 | __u64 srr1; | ||
46 | __u64 dar; /* dear on BookE */ | ||
47 | __u64 msr; | ||
48 | __u32 dsisr; | ||
49 | __u32 int_pending; /* Tells the guest if we have an interrupt */ | ||
50 | __u32 sr[16]; | ||
51 | __u32 mas0; | ||
52 | __u32 mas1; | ||
53 | __u64 mas7_3; | ||
54 | __u64 mas2; | ||
55 | __u32 mas4; | ||
56 | __u32 mas6; | ||
57 | __u32 esr; | ||
58 | __u32 pir; | ||
59 | |||
60 | /* | ||
61 | * SPRG4-7 are user-readable, so we can only keep these consistent | ||
62 | * between the shared area and the real registers when there's an | ||
63 | * intervening exit to KVM. This also applies to SPRG3 on some | ||
64 | * chips. | ||
65 | * | ||
66 | * This suffices for access by guest userspace, since in PR-mode | ||
67 | * KVM, an exit must occur when changing the guest's MSR[PR]. | ||
68 | * If the guest kernel writes to SPRG3-7 via the shared area, it | ||
69 | * must also use the shared area for reading while in kernel space. | ||
70 | */ | ||
71 | __u64 sprg4; | ||
72 | __u64 sprg5; | ||
73 | __u64 sprg6; | ||
74 | __u64 sprg7; | ||
75 | }; | ||
76 | |||
77 | #define KVM_SC_MAGIC_R0 0x4b564d21 /* "KVM!" */ | ||
78 | #define HC_VENDOR_KVM (42 << 16) | ||
79 | #define HC_EV_SUCCESS 0 | ||
80 | #define HC_EV_UNIMPLEMENTED 12 | ||
81 | |||
82 | #define KVM_FEATURE_MAGIC_PAGE 1 | ||
83 | |||
84 | #define KVM_MAGIC_FEAT_SR (1 << 0) | ||
85 | |||
86 | /* MASn, ESR, PIR, and high SPRGs */ | ||
87 | #define KVM_MAGIC_FEAT_MAS0_TO_SPRG7 (1 << 1) | ||
88 | |||
89 | #ifdef __KERNEL__ | ||
90 | 24 | ||
91 | #ifdef CONFIG_KVM_GUEST | 25 | #ifdef CONFIG_KVM_GUEST |
92 | 26 | ||
@@ -211,6 +145,4 @@ static inline bool kvm_check_and_clear_guest_paused(void) | |||
211 | return false; | 145 | return false; |
212 | } | 146 | } |
213 | 147 | ||
214 | #endif /* __KERNEL__ */ | ||
215 | |||
216 | #endif /* __POWERPC_KVM_PARA_H__ */ | 148 | #endif /* __POWERPC_KVM_PARA_H__ */ |