diff options
Diffstat (limited to 'arch/x86/kvm/hyperv.h')
-rw-r--r-- | arch/x86/kvm/hyperv.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/x86/kvm/hyperv.h b/arch/x86/kvm/hyperv.h index 9483d49a5afa..d5d8217c59bb 100644 --- a/arch/x86/kvm/hyperv.h +++ b/arch/x86/kvm/hyperv.h | |||
@@ -24,21 +24,29 @@ | |||
24 | #ifndef __ARCH_X86_KVM_HYPERV_H__ | 24 | #ifndef __ARCH_X86_KVM_HYPERV_H__ |
25 | #define __ARCH_X86_KVM_HYPERV_H__ | 25 | #define __ARCH_X86_KVM_HYPERV_H__ |
26 | 26 | ||
27 | static inline struct kvm_vcpu_hv_synic *vcpu_to_synic(struct kvm_vcpu *vcpu) | 27 | static inline struct kvm_vcpu_hv *vcpu_to_hv_vcpu(struct kvm_vcpu *vcpu) |
28 | { | 28 | { |
29 | return &vcpu->arch.hyperv.synic; | 29 | return &vcpu->arch.hyperv; |
30 | } | 30 | } |
31 | 31 | ||
32 | static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic) | 32 | static inline struct kvm_vcpu *hv_vcpu_to_vcpu(struct kvm_vcpu_hv *hv_vcpu) |
33 | { | 33 | { |
34 | struct kvm_vcpu_hv *hv; | ||
35 | struct kvm_vcpu_arch *arch; | 34 | struct kvm_vcpu_arch *arch; |
36 | 35 | ||
37 | hv = container_of(synic, struct kvm_vcpu_hv, synic); | 36 | arch = container_of(hv_vcpu, struct kvm_vcpu_arch, hyperv); |
38 | arch = container_of(hv, struct kvm_vcpu_arch, hyperv); | ||
39 | return container_of(arch, struct kvm_vcpu, arch); | 37 | return container_of(arch, struct kvm_vcpu, arch); |
40 | } | 38 | } |
41 | 39 | ||
40 | static inline struct kvm_vcpu_hv_synic *vcpu_to_synic(struct kvm_vcpu *vcpu) | ||
41 | { | ||
42 | return &vcpu->arch.hyperv.synic; | ||
43 | } | ||
44 | |||
45 | static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic) | ||
46 | { | ||
47 | return hv_vcpu_to_vcpu(container_of(synic, struct kvm_vcpu_hv, synic)); | ||
48 | } | ||
49 | |||
42 | int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host); | 50 | int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host); |
43 | int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); | 51 | int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); |
44 | 52 | ||