x86/nestedhvm: init nv_vvmcxaddr in hvm_vcpu_initialise()
authorSergey Dyasli <sergey.dyasli@citrix.com>
Wed, 14 Nov 2018 10:23:16 +0000 (10:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Nov 2018 18:42:48 +0000 (18:42 +0000)
This allows to safely use nestedhvm functions that rely on the values
inside struct nestedvcpu independently of the nested virtualisation
(HVM_PARAM_NESTEDHVM) status of a domain.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 5d263c4090dba5ec66d7fd8cf14ce3fe370aa051..c0a3db5858a66425959b2d8252f5cc244f2b625b 100644 (file)
@@ -1516,6 +1516,8 @@ int hvm_vcpu_initialise(struct vcpu *v)
     if ( rc != 0 )
         goto fail4;
 
+    vcpu_nestedhvm(v).nv_vvmcxaddr = INVALID_PADDR;
+
     if ( nestedhvm_enabled(d)
          && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) /* teardown: nestedhvm_vcpu_destroy */
         goto fail5;