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

Re: [Xen-devel] [PATCH v14 07/17] pvh: vmx-specific changes



>>> On 04.11.13 at 13:14, George Dunlap <george.dunlap@xxxxxxxxxxxxx> wrote:
> @@ -887,7 +949,32 @@ static int construct_vmcs(struct vcpu *v)
>      /* Do not enable Monitor Trap Flag unless start single step debug */
>      v->arch.hvm_vmx.exec_control &= ~CPU_BASED_MONITOR_TRAP_FLAG;
>  
> +    if ( is_pvh_domain(d) )
> +    {
> +        /* Disable virtual apics, TPR */
> +        v->arch.hvm_vmx.secondary_exec_control &= 
> +            ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES
> +              | SECONDARY_EXEC_APIC_REGISTER_VIRT
> +              | SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY);
> +        v->arch.hvm_vmx.exec_control &= ~CPU_BASED_TPR_SHADOW;
> +
> +        /* Disable wbinvd (only necessary for MMIO),
> +         * unrestricted guest (real mode for EPT) */
> +        v->arch.hvm_vmx.secondary_exec_control &= 
> +            ~(SECONDARY_EXEC_UNRESTRICTED_GUEST
> +              | SECONDARY_EXEC_WBINVD_EXITING);

I think I commented on this before - when a PVH guest has a
physical  device assigned, why is WBINVD interception then
not necessary just like it would be for HVM?

> @@ -1041,12 +1143,29 @@ static int construct_vmcs(struct vcpu *v)
>                | (1U << TRAP_no_device);
>      vmx_update_exception_bitmap(v);
>  
> +    /* In HVM domains, this happens on the realmode->paging
> +     * transition.  Since PVH never goes through this transition, we
> +     * need to do it at start-of-day. */
> +    if ( is_pvh_domain(d) )
> +        vmx_update_debug_state(v);
> +
>      v->arch.hvm_vcpu.guest_cr[0] = X86_CR0_PE | X86_CR0_ET;
> +
> +    /* PVH domains always start in paging mode */
> +    if ( is_pvh_domain(d) )
> +        v->arch.hvm_vcpu.guest_cr[0] |= X86_CR0_PG | X86_CR0_NE | X86_CR0_WP;
> +
>      hvm_update_guest_cr(v, 0);
>  
> -    v->arch.hvm_vcpu.guest_cr[4] = 0;
> +    v->arch.hvm_vcpu.guest_cr[4] = is_pvh_domain(d) ?
> +        (real_cr4_to_pv_guest_cr4(mmu_cr4_features) 
> +         & ~HVM_CR4_GUEST_RESERVED_BITS(v))
> +        : 0;
>      hvm_update_guest_cr(v, 4);
>  
> +    if ( is_pvh_domain(d) )
> +        v->arch.hvm_vmx.vmx_realmode = 0;

Rather than doing this here, wouldn't it be more clean to suppress
this getting set to 1 in the first place?

Jan


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