WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] WRITE_MSR

To: "Dong, Eddie" <eddie.dong@xxxxxxxxx>, "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] WRITE_MSR
From: "Kaushik Barde" <Kaushik_Barde@xxxxxxxxxxx>
Date: Sat, 30 Jun 2007 11:02:29 -0700
Delivery-date: Sat, 30 Jun 2007 11:00:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <10EA09EFD8728347A513008B6B0DA77A016ABA62@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <6bc632150705090216i413b7740saf49a56e448e9583@xxxxxxxxxxxxxx> <10EA09EFD8728347A513008B6B0DA77A016ABA62@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AceSGrxqECW6c94qSz2zmSSLBogIhQA+oO0gCgkvTrA=
Thread-topic: [Xen-devel] WRITE_MSR
Setting values by default may not be a good coding practice, if you want to do that you find a common place and set it once. Of course, if you are always sure of a result and still want to compare before setting also is quite unnecessary.
 
-Kaushik
 


From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Dong, Eddie
Sent: Thursday, May 10, 2007 8:12 AM
To: xen-devel
Subject: [Xen-devel] WRITE_MSR

Not sure why we do test_bit and then set_bit rather than set_bit directly. Any comments?
 
 
 
 
diff -r 3ef0510e44d0 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c        Tue May 08 10:21:23 2007 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c        Thu May 10 23:09:19 2007 +0800
@@ -103,8 +103,7 @@ static void vmx_save_host_msrs(void)
 
 #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);    \
+        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
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • RE: [Xen-devel] WRITE_MSR, Kaushik Barde <=