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

RE: [Xen-devel] [PATCH] Proper use of VMX execution controls MSR.


  • To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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


 


Rackspace

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