summaryrefslogtreecommitdiff
path: root/kvm_vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'kvm_vmx.c')
-rw-r--r--kvm_vmx.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/kvm_vmx.c b/kvm_vmx.c
index c66ec7a..c999041 100644
--- a/kvm_vmx.c
+++ b/kvm_vmx.c
@@ -178,13 +178,8 @@ typedef struct vcpu_vmx {
static struct vcpu_vmx *
to_vmx(struct kvm_vcpu *vcpu)
{
-#ifdef XXX_KVM_DOESNTCOMPILE
- return (container_of(vcpu, struct vcpu_vmx, vcpu));
-#else
- /* assumes vcpu is first field in vcpu_vmx */
- /* because gcc with kernel flags complains about container_of */
- return ((struct vcpu_vmx *)vcpu);
-#endif
+ return ((struct vcpu_vmx *)((uintptr_t)vcpu -
+ offsetof(struct vcpu_vmx, vcpu)));
}
typedef struct vmcs_config {