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

Re: [RFC PATCH v1 12/25] hw/xen: Add foreignmem operations to allow redirection to internal emulation



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

Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
Signed-off-by: Paul Durrant <pdurrant@xxxxxxxxxx>
---
  hw/char/xen_console.c            |  8 +++---
  hw/display/xenfb.c               | 20 +++++++-------
  hw/xen/xen-operations.c          | 45 ++++++++++++++++++++++++++++++++
  include/hw/xen/xen_backend_ops.h | 26 ++++++++++++++++++
  include/hw/xen/xen_common.h      | 13 ---------
  softmmu/globals.c                |  1 +
  tests/unit/test-xs-node.c        |  1 +
  7 files changed, 88 insertions(+), 26 deletions(-)

[snip]
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index d4d10d3ff1..632ce617cc 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -32,19 +32,6 @@ typedef xc_interface xenforeignmemory_handle;
  #define xenforeignmemory_open(l, f) xen_xc
  #define xenforeignmemory_close(h)
-static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
-                                         int prot, size_t pages,
-                                         const xen_pfn_t arr[/*pages*/],
-                                         int err[/*pages*/])
-{
-    if (err)
-        return xc_map_foreign_bulk(h, dom, prot, arr, err, pages);
-    else
-        return xc_map_foreign_pages(h, dom, prot, arr, pages);
-}
-
-#define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
-

Actually, probably best 'static inline' that, or at least put brackets round the 'p' and 's' for safety.

With either one of those options chosen...

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®.