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

Re: [future abi] [RFC PATCH V3] xen/gnttab: Store frame GFN in struct page_info on Arm


  • To: Julien Grall <julien@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 24 Sep 2021 18:10:30 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=O8nMueq38I2p+lvETxLMhIuc2Rdsh+z6aiNM5xAQUpE=; b=Y+pOPCmr5CQVBsJgVtHEQPEMysjRUDFgs025dC7iz19VYohXJLusX9465i3iHGNbma444Ce0F1rwO9bRHbzENhlzhLblWO1wVOiuz9L/3WaCwEiOkCgAVye5YA6EUPchSH3X48PJNDP6EQqgP/4zaI3eGcHIbNCG1jYAA6TlPkGhIOmV2Dv1JchuCOto6cci/qN2jxil+Q0qL/FUd3JV3bFmr8Z68yw+IRGmAfkPiAsx16eU2x6vqbuzJAlg7Q4uUfbxlmO1X0Z5qd65lMTh8jvVO26ekmuA2dP8ND3qJwNqSIhvakMqMeiKEJFdsTMONytFPgRyPjlDS58N4sDzhQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AyaZYfWqBEjCHMFJC3/Hs5wAdk4CKDaAYEcysPbMu7Am+PnaYHXCgEWMjkVnxl9KXCDPCVY75b2FT8sUsYZwf+748hHRKN+bCeY180QFL8b/Wq+yyVW+IjdA8PCtEKwOhnQ7YVi/Q+IOKgaVeBClM/KzBDqbcCRZs+896m6AS9Q9fkATZ9ubpkHYK6bLBfEr5uIc8pjQ6dd1QGLtPh4ArnOkq42S2LDxnvvIc4PH2KVau47ZcVbSFKBO8nCvwqjR9h+3/MygeOGsvyiiZDULrFKTdopiOqNIv9tcqvmmH/DWPommXKxE1XhF+L+SWi3avTXlRltrLK1vJ74qy3nr6A==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Fri, 24 Sep 2021 16:10:43 +0000
  • Ironport-data: A9a23:OpyUj6t1cnOjUGNtDEt/HUzV5+fnVDRYMUV32f8akzHdYApBsoF/q tZmKWGEOK7ZMGPxLd9+bYvn9BhT78XQy9EwTFBkrSAxHy4S+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZQP0VOZigHtIQMsadUsxKbVIiGHpJZS5LwbZj29Y524ThWWthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ NpllraOcz4WDvH32+kvCV5jDxhjJJwF9+qSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY250VQq2DO 5VxhTxHTS7eRyARZAssV58FzOixnGHOTmNakQfAzUYwyzeKl1EguFT3C/LUZd6iVchThlyfp G/N4yL+GB5yHOKYzT2J43e9nNjllCn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f8xslBMaRR8Y7X3khyIhcxgjEhlsLPFp kHyZMTmASBw4l9ZTEp9TmDpS
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Sep 24, 2021 at 07:52:24PM +0500, Julien Grall wrote:
> Hi Roger,
> 
> On 24/09/2021 13:41, Roger Pau Monné wrote:
> > On Thu, Sep 23, 2021 at 09:59:26PM +0100, Andrew Cooper wrote:
> > > On 23/09/2021 20:32, Oleksandr Tyshchenko wrote:
> > > > Suggested-by: Julien Grall <jgrall@xxxxxxxxxx>
> > > > Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>
> > > > ---
> > > > You can find the related discussions at:
> > > > https://lore.kernel.org/xen-devel/93d0df14-2c8a-c2e3-8c51-54412190171c@xxxxxxx/
> > > > https://lore.kernel.org/xen-devel/1628890077-12545-1-git-send-email-olekstysh@xxxxxxxxx/
> > > > https://lore.kernel.org/xen-devel/1631652245-30746-1-git-send-email-olekstysh@xxxxxxxxx/
> > > > 
> > > > ! Please note, there is still unresolved locking question here for which
> > > > I failed to find a suitable solution. So, it is still an RFC !
> > > 
> > > Just FYI, I thought I'd share some of the plans for ABI v2.  Obviously
> > > these plans are future work and don't solve the current problem.
> > > 
> > > Guests mapping Xen pages is backwards.  There are reasons why it was
> > > used for x86 PV guests, but the entire interface should have been design
> > > differently for x86 HVM.
> > > 
> > > In particular, Xen should be mapping guest RAM, rather than the guest
> > > manipulating the 2nd stage tables to map Xen RAM.  Amongst other things,
> > > its far far lower overhead.
> > > 
> > > 
> > > A much better design is one where the grant table looks like an MMIO
> > > device.  The domain builder decides the ABI (v1 vs v2 - none of this
> > > dynamic switch at runtime nonsense), and picks a block of guest physical
> > > addresses, which are registered with Xen.  This forms the grant table,
> > > status table (v2 only), and holes to map into.
> > 
> > I think this could be problematic for identity mapped Arm dom0, as
> > IIRC in that case grants are mapped so that gfn == mfn in order to
> > account for the lack of an IOMMU. You could use a bounce buffer, but
> > that would introduce a big performance penalty.
> 
> Or you could find a hole that is outside of the RAM regions. This is not
> trivial but not impossible (see [1]).

I certainly not familiar with the Arm identity map.

If you map them at random areas (so no longer identity mapped), how do
you pass the addresses to the physical devices for DMA operations? I
assume there must be some kind of translation then that converts from
gfn to mfn in order to cope with the lack of an IOMMU, and because
dom0 doesn't know the mfn of the grant reference in order to map it at
the same gfn.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.