qemu-devel
[Top][All Lists]
Advanced

[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 operatio


From: Paul Durrant
Subject: Re: [RFC PATCH v1 11/25] hw/xen: Pass grant ref to gnttab unmap operation
Date: Tue, 7 Mar 2023 14:30:29 +0000
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 02/03/2023 15:34, David Woodhouse wrote:
From: David Woodhouse <dwmw@amazon.co.uk>

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@amazon.co.uk>
---
  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@xen.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]