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

Re: [Xen-devel] [PATCH RFC v12 08/21] pvh: vmx-specific changes



On Tue, 17 Sep 2013 09:48:08 +0100
George Dunlap <george.dunlap@xxxxxxxxxxxxx> wrote:

> On 09/17/2013 12:12 AM, Mukesh Rathor wrote:
> > On Fri, 13 Sep 2013 17:38:41 +0100
> > George Dunlap <george.dunlap@xxxxxxxxxxxxx> wrote:
> >
> >> On 13/09/13 17:25, George Dunlap wrote:
> >>> Changes:
> >>> * Enforce HAP mode for now
> >>> * Disable exits related to virtual interrupts or emulated APICs
> >>> * Disable changing paging mode
> >>>    - "unrestricted guest" (i.e., real mode for EPT) disabled
> > ........
> >>> +        ASSERT(v->arch.hvm_vmx.exec_control &
> >>> CPU_BASED_ACTIVATE_MSR_BITMAP);
> >>> +        ASSERT(!(v->arch.hvm_vmx.exec_control &
> >>> CPU_BASED_RDTSC_EXITING)); +
> >>> +        /*
> >>> +         * Note: we run with default VM_ENTRY_LOAD_DEBUG_CTLS of
> >>> 1, which means
> >>> +         * upon vmentry, the cpu reads/loads VMCS.DR7 and
> >>> VMCS.DEBUGCTLS, and not
> >>> +         * use the host values. 0 would cause it to not use the
> >>> VMCS values.
> >>> +         */
> >>> +
> >>> +        /* PVH: I don't think these are necessary */
> >>> +        v->arch.hvm_vmx.exec_control &=
> >>> ~CPU_BASED_VIRTUAL_NMI_PENDING;
> >>> +        vmentry_ctl &= ~VM_ENTRY_LOAD_GUEST_EFER;
> >>> +        vmentry_ctl &= ~VM_ENTRY_SMM;
> >>> +        vmentry_ctl &= ~VM_ENTRY_DEACT_DUAL_MONITOR;
> >>
> >> Mukesh, I couldn't figure out why you had set these.  What are
> >> these about, and are they really necessary?
> >
> > We clear those because:
> >    - VM_ENTRY_LOAD_GUEST_EFER: "Intel sdm 23.3.2.1 Loading Guest
> > Control...." states that setting to 0 would cause the LMA to be
> > loaded from VM_ENTRY_IA32E_MODE.
> 
> OK -- but if we just set the LMA properly in the vmcs or wherever,
> and prevent the guest from changing it, then it will DTRT, won't it?

Hmm.. I gathered reading the SDMs that the LMA is set via
VM_ENTRY_IA32E_MODE. We start the guest in Long mode. May be there are
other ways, I am not sure.

> >    - VM_ENTRY_SMM: also according to the SDM must be 0 if not
> > entering from SMM.
> >    - VM_ENTRY_DEACT_DUAL_MONITOR: same, must be 0 for entry outside
> > SMM.
> 
> But those have nothing to do with PVH -- Plain HVM guests needs that
> as well.  So they're already being cleared (or never being set) -- we
> don't need to add these lines in a PVH-specific section.

Right. Initially PVH was separate from HVM, hence these lines.

thaks
mukesh


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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