mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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> Reviewed-by: Paul Durrant <paul@xen.org>
This commit is contained in:
parent
c412ba47b2
commit
f80fad16af
11 changed files with 50 additions and 26 deletions
|
@ -52,7 +52,7 @@ void xen_be_set_max_grant_refs(struct XenLegacyDevice *xendev,
|
|||
void *xen_be_map_grant_refs(struct XenLegacyDevice *xendev, uint32_t *refs,
|
||||
unsigned int nr_refs, int prot);
|
||||
void xen_be_unmap_grant_refs(struct XenLegacyDevice *xendev, void *ptr,
|
||||
unsigned int nr_refs);
|
||||
uint32_t *refs, unsigned int nr_refs);
|
||||
|
||||
int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev,
|
||||
bool to_domain, XenGrantCopySegment segs[],
|
||||
|
@ -65,9 +65,9 @@ static inline void *xen_be_map_grant_ref(struct XenLegacyDevice *xendev,
|
|||
}
|
||||
|
||||
static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev,
|
||||
void *ptr)
|
||||
void *ptr, uint32_t ref)
|
||||
{
|
||||
return xen_be_unmap_grant_refs(xendev, ptr, 1);
|
||||
return xen_be_unmap_grant_refs(xendev, ptr, &ref, 1);
|
||||
}
|
||||
|
||||
/* actual backend drivers */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue