direct-io.hg

changeset 15049:174995130550

vmx: Replace pointless test-then-set with set.
Spotted by Eddie Dong.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Sat May 12 12:46:26 2007 +0100 (2007-05-12)
parents e33cce8fa400
children 05c128b0188a
files xen/arch/x86/hvm/vmx/vmx.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Sat May 12 12:44:20 2007 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Sat May 12 12:46:26 2007 +0100
     1.3 @@ -101,12 +101,11 @@ static void vmx_save_host_msrs(void)
     1.4          rdmsrl(msr_index[i], host_msr_state->msrs[i]);
     1.5  }
     1.6  
     1.7 -#define WRITE_MSR(address)                                                  \
     1.8 -        guest_msr_state->msrs[VMX_INDEX_MSR_ ## address] = msr_content;     \
     1.9 -        if ( !test_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags) )\
    1.10 -            set_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags);    \
    1.11 -        wrmsrl(MSR_ ## address, msr_content);                               \
    1.12 -        set_bit(VMX_INDEX_MSR_ ## address, &host_msr_state->flags);         \
    1.13 +#define WRITE_MSR(address)                                              \
    1.14 +        guest_msr_state->msrs[VMX_INDEX_MSR_ ## address] = msr_content; \
    1.15 +        set_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags);    \
    1.16 +        wrmsrl(MSR_ ## address, msr_content);                           \
    1.17 +        set_bit(VMX_INDEX_MSR_ ## address, &host_msr_state->flags);     \
    1.18          break
    1.19  
    1.20  static inline int long_mode_do_msr_read(struct cpu_user_regs *regs)