File xen.trc-ioreq_server_map_io_range.patch of Package xen
From: Olaf Hering <olaf@aepfle.de>
Date: Thu, 15 Jun 2023 08:43:16 +0000
Subject: trc ioreq_server_map_io_range
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
xen/common/ioreq.c | 10 +++++++++
1 file changed, 10 insertions(+)
--- a/xen/common/ioreq.c
+++ b/xen/common/ioreq.c
@@ -1017,24 +1017,31 @@ int ioreq_server_get_frame(struct domain *d, ioservid_t id,
TRACE_trc(TRC_IOREQ_ioreq_server_get_frame);
return rc;
}
static int ioreq_server_map_io_range(struct domain *d, ioservid_t id,
uint32_t type, uint64_t start,
uint64_t end)
{
struct ioreq_server *s;
struct rangeset *r;
int rc;
+ trc_ioreq_server_map_io_range_t trc = {
+ .d = d->domain_id,
+ .id = id,
+ .type = type,
+ .start = start,
+ .end = end,
+ };
if ( start > end )
return -EINVAL;
rspin_lock(&d->ioreq_server.lock);
s = get_ioreq_server(d, id);
rc = -ENOENT;
if ( !s )
goto out;
@@ -1059,24 +1066,27 @@ static int ioreq_server_map_io_range(struct domain *d, ioservid_t id,
if ( !r )
goto out;
rc = -EEXIST;
if ( rangeset_overlaps_range(r, start, end) )
goto out;
rc = rangeset_add_range(r, start, end);
out:
rspin_unlock(&d->ioreq_server.lock);
+ if (rc)
+ trc.rc = -rc;
+ TRACE_trc(TRC_IOREQ_ioreq_server_map_io_range);
return rc;
}
static int ioreq_server_unmap_io_range(struct domain *d, ioservid_t id,
uint32_t type, uint64_t start,
uint64_t end)
{
struct ioreq_server *s;
struct rangeset *r;
int rc;
if ( start > end )