]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: do actually init nested HVM state for VCPUs
authorTim Deegan <Tim.Deegan@citrix.com>
Thu, 7 Apr 2011 10:39:35 +0000 (11:39 +0100)
committerTim Deegan <Tim.Deegan@citrix.com>
Thu, 7 Apr 2011 10:39:35 +0000 (11:39 +0100)
when nested HVM is enabled after VCPus are allocated.
The previous patch would fail because the call to
nestedhvm_vcpu_initialise() in the HVM param set code
happens before nestedhvm_enabled(v->domain) is true.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/nestedhvm.c

index 669330fbdad09d1119948a9f3c141864beb011cb..1ae4df98f013a34687bd69589dc7b01526b93a03 100644 (file)
@@ -967,7 +967,8 @@ int hvm_vcpu_initialise(struct vcpu *v)
     if ( (rc = hvm_funcs.vcpu_initialise(v)) != 0 )
         goto fail2;
 
-    if ( (rc = nestedhvm_vcpu_initialise(v)) < 0 ) 
+    if ( nestedhvm_enabled(v->domain) 
+         && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) 
         goto fail3;
 
     /* Create ioreq event channel. */
index 298f34ae1b20831e1f7461c20d5db4ae558b0a03..ef9a867527fab4b99a53e409a26b93bfacc13377 100644 (file)
@@ -74,9 +74,6 @@ nestedhvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
 
-    if ( !nestedhvm_enabled(v->domain) )
-        return 0;
-
     if ( (rc = nhvm_vcpu_initialise(v)) )
     {
         nhvm_vcpu_destroy(v);