@@ -72,6 +72,29 @@ int xendevicemodel_get_ioreq_server_info(
evtchn_port_t *bufioreq_port);
/**
+ * This function retrieves the necessary information to allow an
+ * emulator to use an IOREQ Server, including feature flags.
+ *
+ * @parm dmod a handle to an open devicemodel interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm ioreq_gfn pointer to a xen_pfn_t to receive the synchronous ioreq
+ * gfn. (May be NULL if not required)
+ * @parm bufioreq_gfn pointer to a xen_pfn_t to receive the buffered ioreq
+ * gfn. (May be NULL if not required)
+ * @parm bufioreq_port pointer to a evtchn_port_t to receive the buffered
+ * ioreq event channel. (May be NULL if not required)
+ * @parm flags pointer to receive flags bitmask, see hvm/dm_op.h for details.
+ * (May be NULL if not required)
+ * @return 0 on success, -1 on failure.
+ */
+int xendevicemodel_get_ioreq_server_info_ext(
+ xendevicemodel_handle *dmod, domid_t domid, ioservid_t id,
+ xen_pfn_t *ioreq_gfn, xen_pfn_t *bufioreq_gfn,
+ evtchn_port_t *bufioreq_port,
+ unsigned int *flags);
+
+/**
* This function registers a range of memory or I/O ports for emulation.
*
* @parm dmod a handle to an open devicemodel interface.
@@ -189,10 +189,10 @@ int xendevicemodel_create_ioreq_server(
return 0;
}
-int xendevicemodel_get_ioreq_server_info(
+int xendevicemodel_get_ioreq_server_info_ext(
xendevicemodel_handle *dmod, domid_t domid, ioservid_t id,
xen_pfn_t *ioreq_gfn, xen_pfn_t *bufioreq_gfn,
- evtchn_port_t *bufioreq_port)
+ evtchn_port_t *bufioreq_port, unsigned int *flags)
{
struct xen_dm_op op;
struct xen_dm_op_get_ioreq_server_info *data;
@@ -226,9 +226,21 @@ int xendevicemodel_get_ioreq_server_info(
if (bufioreq_port)
*bufioreq_port = data->bufioreq_port;
+ if (flags)
+ *flags = data->flags;
+
return 0;
}
+int xendevicemodel_get_ioreq_server_info(
+ xendevicemodel_handle *dmod, domid_t domid, ioservid_t id,
+ xen_pfn_t *ioreq_gfn, xen_pfn_t *bufioreq_gfn,
+ evtchn_port_t *bufioreq_port)
+{
+ return xendevicemodel_get_ioreq_server_info_ext(
+ dmod, domid, id, ioreq_gfn, bufioreq_gfn, bufioreq_port, NULL);
+}
+
int xendevicemodel_map_io_range_to_ioreq_server(
xendevicemodel_handle *dmod, domid_t domid, ioservid_t id, int is_mmio,
uint64_t start, uint64_t end)
Add xendevicemodel_get_ioreq_server_info_ext() which additionally returns output flags that XEN_DMOP_get_ioreq_server_info can now return. Do not change signature of existing xendevicemodel_get_ioreq_server_info() so existing users will not need to be changed. This advertises behavior change of "x86/msi: passthrough all MSI-X vector ctrl writes to device model" patch. Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> --- v3: - new patch Should there be some HAVE_* #define in the header? Does this change require soname bump (I hope it doesn't...). --- tools/include/xendevicemodel.h | 23 +++++++++++++++++++++++ tools/libs/devicemodel/core.c | 16 ++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-)