WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [bug] 'VT-d 1G super page' feature is blocked

To: Yongjie Ren <yongjie.ren@xxxxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, Allen M Kay <allen.m.kay@xxxxxxxxx>, Xin Li <xin.li@xxxxxxxxx>
Subject: Re: [Xen-devel] [bug] 'VT-d 1G super page' feature is blocked
From: Tim Deegan <tim@xxxxxxx>
Date: Mon, 15 Aug 2011 11:11:59 +0100
Cc:
Delivery-date: Mon, 15 Aug 2011 03:12:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110810162534.GB11708@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CE59C043D0EC3349B2BF41C0EC72229B12D21111F0@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110730081145.GA45723@xxxxxxxxxxxxxxxxxxxxx> <CE59C043D0EC3349B2BF41C0EC72229B12D21111FB@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <CE59C043D0EC3349B2BF41C0EC72229B12D216E382@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110803171239.GA71832@xxxxxxxxxxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D5301EA1F3274@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4E3FAF0F0200007800050178@xxxxxxxxxxxxxxxxxxxx> <20110808151150.GB5845@xxxxxxxxxxxxxxxxxxxxx> <20110810162534.GB11708@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
At 17:25 +0100 on 10 Aug (1312997134), Tim Deegan wrote:
> This turns out not to work.  Allen, how about the attached patch
> instead?

So this breaks on dom0 boot, but that's a symptom of a deeper illness. 
By chance, the old code (before 23247) only actually enabled EPT-sharing
when the first HVM domain tried to use it.  23247 pulled that enabling
up to boot time, and exposed the bug that PV guests aren't properly
supported.  AFAICS the code just tries to share the P2M table without
making sure there is one there to share. :(

Tim.


> diff -r 1f08b380d438 xen/drivers/passthrough/vtd/iommu.c
> --- a/xen/drivers/passthrough/vtd/iommu.c     Wed Aug 10 14:43:34 2011 +0100
> +++ b/xen/drivers/passthrough/vtd/iommu.c     Wed Aug 10 17:24:19 2011 +0100
> @@ -1731,15 +1731,15 @@ void iommu_pte_flush(struct domain *d, u
>  
>  static int vtd_ept_page_compatible(struct iommu *iommu)
>  {
> -    u64 cap = iommu->cap;
> +    u64 ept_cap, vtd_cap = iommu->cap;
>  
> -    if ( ept_has_2mb(cpu_has_vmx_ept_2mb) != cap_sps_2mb(cap) )
> +    /* EPT is not initialised yet, so we must check the capability in
> +     * the MSR explicitly rather than use cpu_has_vmx_ept_*() */
> +    if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) 
>          return 0;
>  
> -    if ( ept_has_1gb(cpu_has_vmx_ept_1gb) != cap_sps_1gb(cap) )
> -        return 0;
> -
> -    return 1;
> +    return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) 
> +             && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) );
>  }
>  
>  /*

> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


-- 
Tim Deegan <tim@xxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel