[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 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.
  - 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.

sorry, looking at hard copy so can't cut and paste.

> > +    /* PVH: Why is ET not set? */
> > +    v->arch.hvm_vcpu.guest_cr[0] = is_pvh_domain(d) ?
> > +        ( X86_CR0_PG | X86_CR0_NE | X86_CR0_PE | X86_CR0_WP )
> > +        : ( X86_CR0_PE | X86_CR0_ET );
> 
> I also couldn't figure out why CR0_ET wasn't set for PVH vms; is it
> not set for PV vms?

I was confused reading the section on it in the SDM, it appeared it
was not relevant after 486. But reading more, like Jan said, we
 should just set it.

thanks
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®.