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

Re: [RFC PATCH v1 11/25] hw/xen: Pass grant ref to gnttab unmap operation



On 02/03/2023 15:34, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>

The previous commit introduced redirectable gnttab operations fairly
much like-for-like, with the exception of the extra arguments to the
->open() call which were always NULL/0 anyway.

This *changes* the arguments to the ->unmap() operation to include the
original ref# that was mapped. Under real Xen it isn't necessary; all we
need to do from QEMU is munmap(), then the kernel will release the grant,
and Xen does the tracking/refcounting for the guest.

When we have emulated grant tables though, we need to do all that for
ourselves. So let's have the back ends keep track of what they mapped
and pass it in to the ->unmap() method for us.

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
  hw/9pfs/xen-9p-backend.c            |  7 ++++---
  hw/block/dataplane/xen-block.c      |  1 +
  hw/char/xen_console.c               |  2 +-
  hw/net/xen_nic.c                    | 13 ++++++++-----
  hw/usb/xen-usb.c                    | 21 ++++++++++++++++-----
  hw/xen/xen-bus.c                    |  4 ++--
  hw/xen/xen-legacy-backend.c         |  4 ++--
  hw/xen/xen-operations.c             |  9 ++++++++-
  include/hw/xen/xen-bus.h            |  2 +-
  include/hw/xen/xen-legacy-backend.h |  6 +++---
  include/hw/xen/xen_backend_ops.h    |  7 ++++---
  11 files changed, 50 insertions(+), 26 deletions(-)


Reviewed-by: Paul Durrant <paul@xxxxxxx>




 


Rackspace

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