]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/pv: untie issuing FLUSH_ROOT_PGTBL from XPTI
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 14 Jun 2024 10:41:04 +0000 (12:41 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Tue, 25 Jun 2024 09:16:34 +0000 (11:16 +0200)
The current logic gates issuing flush TLB requests with the FLUSH_ROOT_PGTBL
flag to XPTI being enabled.

In preparation for FLUSH_ROOT_PGTBL also being needed when not using XPTI,
untie it from the xpti domain boolean and instead introduce a new flush_root_pt
field.

No functional change intended, as flush_root_pt == xpti.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/include/asm/domain.h
xen/arch/x86/include/asm/flushtlb.h
xen/arch/x86/mm.c
xen/arch/x86/pv/domain.c

index f5daeb182baaa6426aad94faa2f0bcfb25243648..9dd2e047f4dec410d849d84009a153e9458c2772 100644 (file)
@@ -283,6 +283,8 @@ struct pv_domain
     bool pcid;
     /* Mitigate L1TF with shadow/crashing? */
     bool check_l1tf;
+    /* Issue FLUSH_ROOT_PGTBL for root page-table changes. */
+    bool flush_root_pt;
 
     /* map_domain_page() mapping cache. */
     struct mapcache_domain mapcache;
index bb0ad58db49bddddad4de1bb647d297ae4b9a9e6..1b98d03decdc7a45e7770c2a25cb826597362fef 100644 (file)
@@ -177,7 +177,7 @@ void flush_area_mask(const cpumask_t *mask, const void *va,
 
 #define flush_root_pgtbl_domain(d)                                       \
 {                                                                        \
-    if ( is_pv_domain(d) && (d)->arch.pv.xpti )                          \
+    if ( is_pv_domain(d) && (d)->arch.pv.flush_root_pt )                 \
         flush_mask((d)->dirty_cpumask, FLUSH_ROOT_PGTBL);                \
 }
 
index 648d6dd475baa00b716ceda569f95e5469c38628..53ecce676ae96870dabc9b16b73ba0c82e70fc1f 100644 (file)
@@ -4162,7 +4162,7 @@ long do_mmu_update(
                                       cmd == MMU_PT_UPDATE_PRESERVE_AD, v);
                     if ( !rc )
                         flush_linear_pt = true;
-                    if ( !rc && pt_owner->arch.pv.xpti )
+                    if ( !rc && pt_owner->arch.pv.flush_root_pt )
                     {
                         bool local_in_use = false;
 
index 2a445bb17b99ea4c3bad5f9ea544e313ac56015f..08ffc0ed97d5c4d51af319c033de75c0e61b6eca 100644 (file)
@@ -384,6 +384,7 @@ int pv_domain_initialise(struct domain *d)
     d->arch.ctxt_switch = &pv_csw;
 
     d->arch.pv.xpti = is_hardware_domain(d) ? opt_xpti_hwdom : opt_xpti_domu;
+    d->arch.pv.flush_root_pt = d->arch.pv.xpti;
 
     if ( !is_pv_32bit_domain(d) && use_invpcid && cpu_has_pcid )
         switch ( ACCESS_ONCE(opt_pcid) )