]> xenbits.xensource.com Git - xen.git/commitdiff
x86/mm: Introduce a local domain variable to write_ptbase()
authorRoger Pau Monne <roger.pau@citrix.com>
Fri, 26 Jul 2024 15:21:50 +0000 (17:21 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 30 Jul 2024 16:36:51 +0000 (17:36 +0100)
This reduces the repeated accessing of v->domain.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index 38e0bfec4331b0f04b3a1203bf0d10e630372e9a..e9c86208b092c5587092dae053c14c624b8a6844 100644 (file)
@@ -517,13 +517,14 @@ void make_cr3(struct vcpu *v, mfn_t mfn)
 
 void write_ptbase(struct vcpu *v)
 {
+    const struct domain *d = v->domain;
     struct cpu_info *cpu_info = get_cpu_info();
     unsigned long new_cr4;
 
-    new_cr4 = (is_pv_vcpu(v) && !is_idle_vcpu(v))
+    new_cr4 = (is_pv_domain(d) && !is_idle_domain(d))
               ? pv_make_cr4(v) : mmu_cr4_features;
 
-    if ( is_pv_vcpu(v) && v->domain->arch.pv.xpti )
+    if ( is_pv_domain(d) && d->arch.pv.xpti )
     {
         cpu_info->root_pgt_changed = true;
         cpu_info->pv_cr3 = __pa(this_cpu(root_pgt));