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] [PATCH] Proper use of VMX execution controls MSR.

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Proper use of VMX execution controls MSR.
From: "Li, Xin B" <xin.b.li@xxxxxxxxx>
Date: Thu, 29 Mar 2007 16:37:46 +0800
Delivery-date: Thu, 29 Mar 2007 01:36:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C2312C2D.51A2%Keir.Fraser@xxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdxUQOcmZ2ehsIdTvOT1iiVu1vOEgAEiiMSAA+9sZAADN/eOAAAdMgw
Thread-topic: [Xen-devel] [PATCH] Proper use of VMX execution controls MSR.
>Okay, I see. Well, that makes sense but I think we should have two
masks for
>each control word -- the bits we would like to set, and the bits we
must be
>able to set. Also your previous patch added an unnecessary AND 
>with 'msr_hi XOR msr_lo'.

No, it's necessary. According to Intel Spec:
If the bit in msr_lo is 1, then the control bit written to VMCS must be
1
If the bit in msr_hi is 0, then the control bit written to VMCS must be
0 

The msr_lo and msr_hi combinations are:
1) L = 0 and H = 0: the adjusted control bit is 0, no matter what's the
input control value, that's why we need AND msr_hi.
2) L = 0 and H = 1: the adjusted control bit can be 0 or 1, depends on
if we support it.
3) L = 1 and H = 0: INVALID combination!!!
4) L = 1 and H = 1: the adjusted control bit is 1, no matter what's the
input control value, that's why we need OR msr_lo.

Specially for case 2, 
if we have the feature support in Xen, we should set the input control
bit, and expect the adjusted value to be 1;
if we don't have the feature support in Xen, we should clear the input
control bit, and expect adjusted value to be 0;
That's meaning the adjusted output is determined by the input control.
So the expression should be "AND (msr_hi XOR msr_lo)".

-Xin

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