[Devel] [PATCH RHEL7 COMMIT] ms/kvm/x86: Added Hyper-V vcpu_to_hv_vcpu()/hv_vcpu_to_vcpu() helpers
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Feb 16 01:50:21 PST 2016
The commit is pushed to "branch-rh7-3.10.0-327.4.5.vz7.11.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.4.5.vz7.11.2
------>
commit fddb555274ee0f609f5f2d2a0ff0af1e5ca984c4
Author: Andrey Smetanin <asmetanin at virtuozzo.com>
Date: Tue Feb 16 13:50:21 2016 +0400
ms/kvm/x86: Added Hyper-V vcpu_to_hv_vcpu()/hv_vcpu_to_vcpu() helpers
ms commit - 0ae80384b257b0a1ffa4e5d9eab2eb559bb063c5.
Signed-off-by: Andrey Smetanin <asmetanin at virtuozzo.com>
Reviewed-by: Roman Kagan <rkagan at virtuozzo.com>
CC: Gleb Natapov <gleb at kernel.org>
CC: Paolo Bonzini <pbonzini at redhat.com>
CC: "K. Y. Srinivasan" <kys at microsoft.com>
CC: Haiyang Zhang <haiyangz at microsoft.com>
CC: Vitaly Kuznetsov <vkuznets at redhat.com>
CC: Roman Kagan <rkagan at virtuozzo.com>
CC: Denis V. Lunev <den at openvz.org>
CC: qemu-devel at nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
arch/x86/kvm/hyperv.h | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/hyperv.h b/arch/x86/kvm/hyperv.h
index 9483d49..d5d8217 100644
--- a/arch/x86/kvm/hyperv.h
+++ b/arch/x86/kvm/hyperv.h
@@ -24,21 +24,29 @@
#ifndef __ARCH_X86_KVM_HYPERV_H__
#define __ARCH_X86_KVM_HYPERV_H__
-static inline struct kvm_vcpu_hv_synic *vcpu_to_synic(struct kvm_vcpu *vcpu)
+static inline struct kvm_vcpu_hv *vcpu_to_hv_vcpu(struct kvm_vcpu *vcpu)
{
- return &vcpu->arch.hyperv.synic;
+ return &vcpu->arch.hyperv;
}
-static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic)
+static inline struct kvm_vcpu *hv_vcpu_to_vcpu(struct kvm_vcpu_hv *hv_vcpu)
{
- struct kvm_vcpu_hv *hv;
struct kvm_vcpu_arch *arch;
- hv = container_of(synic, struct kvm_vcpu_hv, synic);
- arch = container_of(hv, struct kvm_vcpu_arch, hyperv);
+ arch = container_of(hv_vcpu, struct kvm_vcpu_arch, hyperv);
return container_of(arch, struct kvm_vcpu, arch);
}
+static inline struct kvm_vcpu_hv_synic *vcpu_to_synic(struct kvm_vcpu *vcpu)
+{
+ return &vcpu->arch.hyperv.synic;
+}
+
+static inline struct kvm_vcpu *synic_to_vcpu(struct kvm_vcpu_hv_synic *synic)
+{
+ return hv_vcpu_to_vcpu(container_of(synic, struct kvm_vcpu_hv, synic));
+}
+
int kvm_hv_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data, bool host);
int kvm_hv_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata);
More information about the Devel
mailing list