]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: permit HVM_PARAM_IDENT_PT to be set more than once
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 11 May 2015 08:42:35 +0000 (10:42 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 11 May 2015 08:42:35 +0000 (10:42 +0200)
There is no conceptual problem with setting this parameter more than once.
Checkpointed migration streams will typically set it once per checkpoint to
the same value.

The parameter is only actually needed on early-generation VT-x which lacked
the unrestricted guest capability, although it could plausibly be used on
newer VT-x with unusual execution control settings.  Short circuit the
expensive operations on non VT-x hardware.

The parameter itself must always be latched to avoid issues if the VM
eventually migrates to a host which needs to use the pagetable.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/hvm.c

index 78b0efb8bf5146a7569f08531898eb55fa9bec4f..689e402e0f818751ced9a16e4e1bdd9465c972f1 100644 (file)
@@ -5712,13 +5712,15 @@ static int hvmop_set_param(
             rc = -EINVAL;
         break;
     case HVM_PARAM_IDENT_PT:
-        rc = -EINVAL;
-        if ( d->arch.hvm_domain.params[a.index] != 0 )
-            break;
-
-        rc = 0;
-        if ( !paging_mode_hap(d) )
+        /*
+         * Only actually required for VT-x lacking unrestricted_guest
+         * capabilities.  Short circuit the pause if possible.
+         */
+        if ( !paging_mode_hap(d) || !cpu_has_vmx )
+        {
+            d->arch.hvm_domain.params[a.index] = a.value;
             break;
+        }
 
         /*
          * Update GUEST_CR3 in each VMCS to point at identity map.