[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: Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Thu, 23 Sep 2021 21:59:26 +0100
  • 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=16Ef2jl80sOM5zhrzx/z6n+coMQrh2Uz54KD8xBEkPY=; b=eLuzP/VefyjfW4p0g1AG8pCtBZOJxkqLLxgCQKKKNvDtLcv15qR9w5fr9zV5PaWyh/oAwS3+NSi9RcMWhSNnj0E+pFEy8RSLsj8BrrXKmpIVg3de6nEXXUI+UrdXdV0FBLrnUQ7hAgdi77HyNjv3a2sETOnVnkfURcQfJngfNqh1Hcyyb1ztdhGKRq81G7Yo9081+qt9z5M9FFGhteI0lOHvbDga+32dBOCwNgkiGTmrZVxRBQ0sZdO9zFiIqWpBiuHi1Pgl2exs1Wg7uyKU7ksasRBWPH2LHFVCPa2j+WONf/3uou5OlPpHnnzvJ0PMfLkd0OE7SIqFSKuRkZmzww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fxQinuiTKGoB4ZGWEWVzXfuQ5XrtakgHAWZiJvox3JZ9/PCRj4tcV5haall2nheFhkqxFS8oyEDCOMAer5pPH7Qp4jrXHqwZ/QwP5z+miE61mmXC7axzViTCm1Es52lBX+KUoDpjuKFKt9V865tmu4TMz6jlQ5BDNkbhHE7oJwN23kDYqUMATxwRyCq4unIqmM0bjt+mc6YVAR0DgnlnH+iUTzSlWeg/d3YuXNifCvJP5GaCyQ94nZfr/BA5hQzmHCemIhqzDD+FOsDiZuotxzLYh//olThRTw2tJUziqEmWnqovu1bUNfaeUvTQWxBnfpSMXf7paByN9OGcJf37SA==
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 23 Sep 2021 20:59:45 +0000
  • Ironport-data: A9a23:SnN8k64KSKgLovPOyZyUPgxRtFHBchMFZxGqfqrLsTDasY5as4F+v jQaX27UOKzea2fwedskO42/80gE6sOGmIVqSwNorCo2Hi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuV3zyIQUBUjclkfJKlYAL/En03FVIMpBsJ00o5wrZo2NUw27BVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z5 8hDtp2CRw0TYYLJhelFWh10A3xZBPgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALBc/nJo4A/FpnyinUF60OSpHfWaTao9Rf2V/cg+gTRq6OP JpCNlKDajzpRSEIFAwxBKsau8z4qV/1LQZY+FG88P9fD2/7k1UqjemF3MDuUtuOSMZOl0CUv FXa7n/5CREXMt+Y4Ted+3fqjejK9QvgQ54b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tlQoSHXyG4z43BryPea6DjW6fEra 08vKLa7QyaUbMSr41wKbLHsY
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.  Details can be conveyed
via ACPI table or DT, as applicable

Xen maps the RAM (which is now accounted to the guest, an improvement
over today) forming the grant and status tables, and grant map/unmap
hypercalls simplify massively to just {src domid, gref, flags} => slot,
which also solves the "is the same grant mapped elsewhere?" problem.

There is never a need for HVM guests to map the same grant twice (as it
controls the first stage tables and can create whatever alias it
desires), but there's also no need to allow the guest to pick where the
mapping occurs.  This vastly simplifies both the Xen and guest kernel
implementations.

~Andrew




 


Rackspace

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