]> www.infradead.org Git - users/dwmw2/qemu.git/commit
hw/xen: Pass grant ref to gnttab unmap operation
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 10 Jan 2023 00:03:49 +0000 (00:03 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 2 Mar 2023 13:52:09 +0000 (13:52 +0000)
commit0b0a36f8b9934c89dc436cc519e9a000401f0f5a
tree30192b62ba1fb5d00a27b98bb2cfe034828dc22d
parentee3c946b6125b9f801c2b9040d791157ffc93f5b
hw/xen: Pass grant ref to gnttab unmap operation

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
hw/block/dataplane/xen-block.c
hw/char/xen_console.c
hw/net/xen_nic.c
hw/usb/xen-usb.c
hw/xen/xen-bus.c
hw/xen/xen-legacy-backend.c
hw/xen/xen-operations.c
include/hw/xen/xen-bus.h
include/hw/xen/xen-legacy-backend.h
include/hw/xen/xen_backend_ops.h