[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] vmx: Replace pointless test-then-set with set.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1178970386 -3600
# Node ID 174995130550a7c8d69bb22cf8036cb4f9f13f71
# Parent  e33cce8fa400fa4c9b678de563672b2854b139db
vmx: Replace pointless test-then-set with set.
Spotted by Eddie Dong.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmx.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff -r e33cce8fa400 -r 174995130550 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Sat May 12 12:44:20 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Sat May 12 12:46:26 2007 +0100
@@ -101,12 +101,11 @@ static void vmx_save_host_msrs(void)
         rdmsrl(msr_index[i], host_msr_state->msrs[i]);
 }
 
-#define WRITE_MSR(address)                                                  \
-        guest_msr_state->msrs[VMX_INDEX_MSR_ ## address] = msr_content;     \
-        if ( !test_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags) )\
-            set_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags);    \
-        wrmsrl(MSR_ ## address, msr_content);                               \
-        set_bit(VMX_INDEX_MSR_ ## address, &host_msr_state->flags);         \
+#define WRITE_MSR(address)                                              \
+        guest_msr_state->msrs[VMX_INDEX_MSR_ ## address] = msr_content; \
+        set_bit(VMX_INDEX_MSR_ ## address, &guest_msr_state->flags);    \
+        wrmsrl(MSR_ ## address, msr_content);                           \
+        set_bit(VMX_INDEX_MSR_ ## address, &host_msr_state->flags);     \
         break
 
 static inline int long_mode_do_msr_read(struct cpu_user_regs *regs)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.