[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/vmx: Avoid pausing on HVM_PARAM_IDENT_PT in additional cases



commit 1bb05cbdf6505ba7b47c0c54ab95de6d8baea3ef
Author:     Teddy Astie <teddy.astie@xxxxxxxxxx>
AuthorDate: Thu Oct 1 09:58:37 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Oct 1 09:58:37 2026 +0200

    x86/vmx: Avoid pausing on HVM_PARAM_IDENT_PT in additional cases
    
    When settings HVM_PARAM_IDENT_PT, skip domain pausing when :
    - there is no vcpu
    - unrestricted guest capability is used
    
    Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d62f0b3866..ef9c7cd057 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4240,10 +4240,22 @@ static int hvm_set_param(struct domain *d, uint32_t 
index, uint64_t value)
         break;
     case HVM_PARAM_IDENT_PT:
         /*
-         * Only actually required for VT-x lacking unrestricted_guest
-         * capabilities.  Short circuit the pause if possible.
+         * IDENT_PT is needed only for Nehalem-era VT-x, where EPT is
+         * available but Unrestricted Guest is not.
+         *
+         * The identity pagetable is configured by the toolstack or hvmloader,
+         * and the param needs to move in the migration stream in case the VM
+         * lands on an EPT && !Unrestricted system.
+         *
+         * Nothing, besides recording the value, needs to happen other than
+         * for VT-x EPT && !Unrestricted VMs.
+         *
+         * TODO: Unrestricted Guest should be a domain property not a vCPU
+         * property.
          */
-        if ( paging_mode_shadow(d) || !using_vmx() )
+        v = domain_vcpu(d, 0);
+        if ( !using_vmx() || paging_mode_shadow(d) || !v ||
+             vmx_unrestricted_guest(v) )
             break;
 
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.