diff mbox series

x86/MSR: use latched "current"

Message ID d26b6ce0-3abb-2dac-282f-4ea5ed089950@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/MSR: use latched "current" | expand

Commit Message

Jan Beulich Nov. 29, 2022, 2:49 p.m. UTC
There's no need to recalculate / refetch the value from the stack
(pointer).

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

Comments

Andrew Cooper Nov. 29, 2022, 8:37 p.m. UTC | #1
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>
diff mbox series

Patch

--- 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;