From: Tim Deegan Subject: Re: [PATCH 4/4] amd iommu: Large io page support - implementation Date: Wed, 8 Dec 2010 10:03:18 +0000 Message-ID: <20101208100318.GA9912@whitby.uk.xensource.com> References: <201012071220.03624.wei.wang2@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Wei Wang2 , "xen-devel@lists.xensource.com" , "Kay, Allen M" List-Id: xen-devel@lists.xenproject.org Hi,=20 At 18:00 +0000 on 07 Dec (1291744845), Keir Fraser wrote: > Cc'ing Tim -- he could advise how plausible it is to find other availab= le > bits to move the p2m types to. PAE Xen we need to use bits 9-11 because there are no other bits available. On 64-bit we could just shift all the type bits up by three; I think there's plenty of space above bit 52 for all the types we need. Even on PAE we really only need to store a p2m type in leaf nodes (l1 entries and superpage entries) so bits 9-11 are free on internal nodes. I don't understand why the iommu tables have a level stored in every entry, though - is that a hardware requirement? > Also I'm not sure whether the p2m tables ever > get used as host pagetables these days (e.g., when guest has CR0.PG=3D0= ). That > could affect how difficult it is to mess with the p2m format. They never get used for PG=3D0 any more, we have a page in the firmware with a 1-1 4GB mapping instead. But they do get used as pagetables in order to use a linear mapping to read the p2m quickly.=20 > If it's possible, though, it's probably worth pursuing. Sharing the tab= les > uses less memory, and could be less complicated code too. Yep, sounds like a great idea.=20 Cheers, Tim. > On 07/12/2010 11:20, "Wei Wang2" wrote: >=20 > > Hi Allen, > > Actually, each amd iommu pde entry uses bit 9-11 to encode next page = table > > level, but these bits are also used as AVL bits by p2m table to encod= e > > different page types...So, it might not be quite easy to share NPT ta= ble with > > amd iommu unless we change p2m table encoding for this first. > > Thanks, > > Wei > >=20 > > On Tuesday 07 December 2010 01:47:22 Kay, Allen M wrote: > >> Hi Wei, > >>=20 > >> My understanding is that both EPT/NPT already supports 2M and 1G pag= e > >> sizes. If this is true and if NPT supports the same page table form= at as > >> AMD iommu, shouldn't iommu 2M and 1G support just a matter of pointi= ng > >> iommu page table pointer to NPT page table of the same guest OS thus > >> sharing the same page table between NPT and AMD iommu? > >>=20 > >> This should save a lot code changes in iommu code. We just need to = flush > >> iommu page table in IOTLB at appropriate places. > >>=20 > >> Allen > >>=20 > >> -----Original Message----- > >> From: xen-devel-bounces@lists.xensource.com > >> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Wei Wang= 2 Sent: > >> Friday, December 03, 2010 8:04 AM > >> To: xen-devel@lists.xensource.com > >> Subject: [Xen-devel] [PATCH 4/4] amd iommu: Large io page support - > >> implementation > >>=20 > >> This is the implementation. > >>=20 > >> Thanks, > >> We > >> Signed-off-by: Wei Wang > >> -- > >> Legal Information: > >> Advanced Micro Devices GmbH > >> Sitz: Dornach, Gemeinde Aschheim, > >> Landkreis M=FCnchen Registergericht M=FCnchen, HRB Nr. 43632 > >> Gesch=E4ftsf=FChrer: > >> Alberto Bozzo, Andrew Bowd > >=20 > >=20 > >=20 > >=20 > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xensource.com > > http://lists.xensource.com/xen-devel >=20 >=20 --=20 Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)