[PATCH] x86/MSR: use latched "current"

Jan Beulich posted 1 patch 1 year, 3 months ago
Failed in applying to current master (apply log)
[PATCH] x86/MSR: use latched "current"
Posted by Jan Beulich 1 year, 3 months ago
There's no need to recalculate / refetch the value from the stack
(pointer).

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -417,7 +417,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t
          * out of hardware.
          */
 #ifdef CONFIG_HVM
-        if ( v == current && is_hvm_domain(d) && v->arch.hvm.flag_dr_dirty )
+        if ( v == curr && is_hvm_domain(d) && v->arch.hvm.flag_dr_dirty )
             rdmsrl(msr, *val);
         else
 #endif
@@ -639,7 +639,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t
         {
             uint64_t xcr0 = get_xcr0();
 
-            if ( v != current ||
+            if ( v != curr ||
                  handle_xsetbv(XCR_XFEATURE_ENABLED_MASK,
                                xcr0 | X86_XCR0_BNDREGS | X86_XCR0_BNDCSR) )
                 goto gp_fault;
Re: [PATCH] x86/MSR: use latched "current"
Posted by Andrew Cooper 1 year, 3 months ago
On 29/11/2022 14:49, Jan Beulich wrote:
> There's no need to recalculate / refetch the value from the stack
> (pointer).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>