RE: [PATCH 21/31] nVMX: vmcs12 checks on nested entry

2011-05-25 Thread Tian, Kevin
 From: Nadav Har'El [mailto:n...@math.technion.ac.il]
 Sent: Wednesday, May 25, 2011 1:38 PM
 
 On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 21/31] nVMX:
 vmcs12 checks on nested entry:
   + if (vmcs12-launch_state == launch) {
   + nested_vmx_failValid(vcpu,
   + launch ? VMXERR_VMLAUNCH_NONCLEAR_VMCS
   +: VMXERR_VMRESUME_NONLAUNCHED_VMCS);
   + return 1;
   + }
 
  from SDM:
  ELSIF (VMLAUNCH and launch state of current VMCS is not clear)
  THEN VMfailValid(VMLAUNCH with non-clear VMCS);
  ELSIF (VMRESUME and launch state of current VMCS is not launched)
  THEN VMfailValid(VMRESUME with non-launched VMCS);
 
  So it's legal to use VMLAUNCH on a launched VMCS. However here you
  changes this behavior. On the other hand, do you want to add a 'clear' state
  along with L1 VMCLEAR to catch the failure here?
 
 I don't understand: I always understood the spec to mean that clear and
 launched the two opposite states of the launch state bit? If it isn't,
 what does clear mean?
 
 Is it really legal to use a VMLAUNCH on a launched VMCS?
 If it is, why does KVM, for example, go to great lengths to VMLAUNCH the
 first time, and VMRESUME all subsequent times?
 

You're correct. I've got my head messed on this point. :-)

Thanks
Kevin
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 21/31] nVMX: vmcs12 checks on nested entry

2011-05-24 Thread Nadav Har'El
On Wed, May 25, 2011, Tian, Kevin wrote about RE: [PATCH 21/31] nVMX: vmcs12 
checks on nested entry:
  +   if (vmcs12-launch_state == launch) {
  +   nested_vmx_failValid(vcpu,
  +   launch ? VMXERR_VMLAUNCH_NONCLEAR_VMCS
  +  : VMXERR_VMRESUME_NONLAUNCHED_VMCS);
  +   return 1;
  +   }
 
 from SDM:
   ELSIF (VMLAUNCH and launch state of current VMCS is not clear)
   THEN VMfailValid(VMLAUNCH with non-clear VMCS);
   ELSIF (VMRESUME and launch state of current VMCS is not launched)
   THEN VMfailValid(VMRESUME with non-launched VMCS);
 
 So it's legal to use VMLAUNCH on a launched VMCS. However here you
 changes this behavior. On the other hand, do you want to add a 'clear' state
 along with L1 VMCLEAR to catch the failure here?

I don't understand: I always understood the spec to mean that clear and
launched the two opposite states of the launch state bit? If it isn't,
what does clear mean?

Is it really legal to use a VMLAUNCH on a launched VMCS?
If it is, why does KVM, for example, go to great lengths to VMLAUNCH the
first time, and VMRESUME all subsequent times?

-- 
Nadav Har'El|Wednesday, May 25 2011, 21 Iyyar 5771
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |If a million Shakespeares tried to write
http://nadav.harel.org.il   |together, they would write like a monkey.
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html