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] [PATCH][VTD] fixing vt-d/ept page table sharing in xen-4

To: Tim Deegan <tim@xxxxxxx>
Subject: RE: [Xen-devel] [PATCH][VTD] fixing vt-d/ept page table sharing in xen-4.1
From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Date: Tue, 23 Aug 2011 10:40:56 -0700
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Ren, Yongjie" <yongjie.ren@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "keir@xxxxxxx" <keir@xxxxxxx>, "Hao, Xudong" <xudong.hao@xxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>, "Li, Xin" <xin.li@xxxxxxxxx>
Delivery-date: Tue, 23 Aug 2011 10:41:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110823095845.GC96414@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: <20110803171239.GA71832@xxxxxxxxxxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D5301EA1F3274@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4E3FAF0F0200007800050178@xxxxxxxxxxxxxxxxxxxx> <20110808151150.GB5845@xxxxxxxxxxxxxxxxxxxxx> <20110810162534.GB11708@xxxxxxxxxxxxxxxxxxxxx> <20110815101159.GG11708@xxxxxxxxxxxxxxxxxxxxx> <20110815104059.GH11708@xxxxxxxxxxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D5301EA3F8905@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110816091320.GL11708@xxxxxxxxxxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D5301EA531481@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110823095845.GC96414@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acxhe0O+nmZ4D2y2QJWnLvwobV7fsgAP/oqQ
Thread-topic: [Xen-devel] [PATCH][VTD] fixing vt-d/ept page table sharing in xen-4.1
This patch works.  Can you also back port it to xen-4.1-test?  Given this 
feature is pretty mature now, we should turn it on by default to minimize 
future regressions.

---

Attached patch turns on EPT/VT-d page table sharing by default.  Iommu 
parameter "no-sharept" turns off sharing.

Signed-off-by: Allen Kay <allen.m.kay@xxxxxxxxx>

-----Original Message-----
From: Tim Deegan [mailto:tim@xxxxxxx] 
Sent: Tuesday, August 23, 2011 2:59 AM
To: Kay, Allen M
Cc: keir@xxxxxxx; Ren, Yongjie; xen-devel@xxxxxxxxxxxxxxxxxxx; Hao, Xudong; Li, 
Xin; Jan Beulich
Subject: Re: [Xen-devel] [PATCH][VTD] fixing vt-d/ept page table sharing in 
xen-4.1

At 18:47 -0700 on 19 Aug (1313779670), Kay, Allen M wrote:
> 1) moving "d->arch.paging.mode = mode | PG_HAP_enable" before calling
> p2m_alloc_table().  Otherwise, the call to iommu_use_hap_pt() in
> iommu_set_pgd() will not return TRUE.

Ah.  This problem is there in the xen-unstable patches (which I just
pushed) as well, isn't it?  Oops.  The correct answer is to use
hap_enabled(d) in the test (see 22924:86000076dcee).  Third time lucky? :)

--- 

Passthrough: fix iommu_use_hap_pt() to use hap_enabled()

In line with 22924:86000076dcee, paging_mode_hap(d) shouldn't be 
used in HAP internals that are called during HAP setup. 

Signed-off-by: Tim Deegan <tim@xxxxxxx>

diff -r 9d2a8912597d -r e511a9e3c68d xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h   Tue Aug 23 10:43:25 2011 +0100
+++ b/xen/include/xen/iommu.h   Tue Aug 23 10:52:37 2011 +0100
@@ -35,7 +35,7 @@ extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
 
 /* Does this domain have a P2M table we can use as its IOMMU pagetable? */
-#define iommu_use_hap_pt(d) (paging_mode_hap(d) && iommu_hap_pt_share)
+#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
 
 extern struct rangeset *mmio_ro_ranges;
 

Attachment: share0823.patch
Description: share0823.patch

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