From nobody Wed Nov 27 13:00:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1699348968; cv=none; d=zohomail.com; s=zohoarc; b=YQnE3+rby7x5Sh400hLx9qHtn13/7LxuNznvuVgF9jNE1A5CmbzEFtp5xKUV+VuCarNssIy8jqzOrzYlleoWjYG2pRnyKUCN1uCTKfIIRdOpvbx0A7ayigkRM+xnvUGxX98Z5SwoZ7W6+I4Hzq8RM3umTPSiuDWMY5PjXzmAT/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1699348968; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ldaWM+gDHfd6Xp3v91LJNro28chXyp7v9vtW0DR3dbc=; b=irU056JFkvGolFU2SohSSiMyPoB4I774Bc2VBeQeXAbuRArijJMExSBoJV6fbWrYjcPvSMF6v8uGyP7e02shKO3Bq2APWF/5f3lU6/ZSwOOcM/SfZYc6T9uxJSW1WqI0bqVV4b7QWlKm7cXv9hz9eCKPZxWFqUqLIICl2G24a+Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1699348968986136.19239573802588; Tue, 7 Nov 2023 01:22:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.628632.980298 (Exim 4.92) (envelope-from ) id 1r0IHt-0002JY-Ay; Tue, 07 Nov 2023 09:22:21 +0000 Received: by outflank-mailman (output) from mailman id 628632.980298; Tue, 07 Nov 2023 09:22:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r0IHt-0002IH-4S; Tue, 07 Nov 2023 09:22:21 +0000 Received: by outflank-mailman (input) for mailman id 628632; Tue, 07 Nov 2023 09:22:19 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1r0IHr-0001Vh-3F for xen-devel@lists.xenproject.org; Tue, 07 Nov 2023 09:22:19 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 25737f0f-7d4f-11ee-98da-6d05b1d4d9a1; Tue, 07 Nov 2023 10:22:18 +0100 (CET) Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0IHN-00BPkL-8r; Tue, 07 Nov 2023 09:21:50 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96.2 #2 (Red Hat Linux)) id 1r0IHN-001hJy-1u; Tue, 07 Nov 2023 09:21:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list X-Inumbo-ID: 25737f0f-7d4f-11ee-98da-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=ldaWM+gDHfd6Xp3v91LJNro28chXyp7v9vtW0DR3dbc=; b=gouk68fGVvphc3/EDuizxqyQeK cxUOdHrGYObAyuFtxTt/yJnJgqnlKCdULHugUzAYTDZgle8QVMO2s5PbzF7JS6zAud0GoU959sQBV UTKwzvFcr2JMA8+bkQ993tVL/cY0Uij7Mi98UAYm3QLd+svft7DbLxBCvB2tYX4CLespbBUG17aNi GxgBI97FhaII5LrL90cZgmtYABfmERe9Oi6utyar8YmUtD0uhGUd8PYD3iKlbQwcRS2x2Ub6wxxim CLIIT3M3wl+xMhpEtNm8lwi3ei//PMU/I5maGL3Sv7UI9zmNbErOcRiF5U9GZuEdOyqlCgySZur/W Oef8hnvQ==; From: David Woodhouse To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Kevin Wolf , Hanna Reitz , Stefano Stabellini , Anthony Perard , Paul Durrant , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost , Jason Wang , Marcelo Tosatti , qemu-block@nongnu.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org Subject: [PULL 02/15] hw/xen: Clean up event channel 'type_val' handling to use union Date: Tue, 7 Nov 2023 09:21:34 +0000 Message-ID: <20231107092149.404842-3-dwmw2@infradead.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231107092149.404842-1-dwmw2@infradead.org> References: <20231107092149.404842-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-ZohoMail-DKIM: pass (identity @infradead.org) X-ZM-MESSAGEID: 1699348969328100002 Content-Type: text/plain; charset="utf-8" From: David Woodhouse A previous implementation of this stuff used a 64-bit field for all of the port information (vcpu/type/type_val) and did atomic exchanges on them. When I implemented that in Qemu I regretted my life choices and just kept it simple with locking instead. So there's no need for the XenEvtchnPort to be so simplistic. We can use a union for the pirq/virq/interdomain information, which lets us keep a separate bit for the 'remote domain' in interdomain ports. A single bit is enough since the only possible targets are loopback or qemu itself. So now we can ditch PORT_INFO_TYPEVAL_REMOTE_QEMU and the horrid manual masking, although the in-memory representation is identical so there's no change in the saved state ABI. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 151 ++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 81 deletions(-) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index b2b4be9983..02b8cbf8df 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -58,7 +58,15 @@ OBJECT_DECLARE_SIMPLE_TYPE(XenEvtchnState, XEN_EVTCHN) typedef struct XenEvtchnPort { uint32_t vcpu; /* Xen/ACPI vcpu_id */ uint16_t type; /* EVTCHNSTAT_xxxx */ - uint16_t type_val; /* pirq# / virq# / remote port according to type */ + union { + uint16_t val; /* raw value for serialization etc. */ + uint16_t pirq; + uint16_t virq; + struct { + uint16_t port:15; + uint16_t to_qemu:1; /* Only two targets; qemu or loopback */ + } interdomain; + } u; } XenEvtchnPort; =20 /* 32-bit compatibility definitions, also used natively in 32-bit build */ @@ -105,14 +113,6 @@ struct xenevtchn_handle { int fd; }; =20 -/* - * For unbound/interdomain ports there are only two possible remote - * domains; self and QEMU. Use a single high bit in type_val for that, - * and the low bits for the remote port number (or 0 for unbound). - */ -#define PORT_INFO_TYPEVAL_REMOTE_QEMU 0x8000 -#define PORT_INFO_TYPEVAL_REMOTE_PORT_MASK 0x7FFF - /* * These 'emuirq' values are used by Xen in the LM stream... and yes, I am * insane enough to think about guest-transparent live migration from actu= al @@ -210,16 +210,16 @@ static int xen_evtchn_post_load(void *opaque, int ver= sion_id) XenEvtchnPort *p =3D &s->port_table[i]; =20 if (p->type =3D=3D EVTCHNSTAT_pirq) { - assert(p->type_val); - assert(p->type_val < s->nr_pirqs); + assert(p->u.pirq); + assert(p->u.pirq < s->nr_pirqs); =20 /* * Set the gsi to IRQ_UNBOUND; it may be changed to an actual * GSI# below, or to IRQ_MSI_EMU when the MSI table snooping * catches up with it. */ - s->pirq[p->type_val].gsi =3D IRQ_UNBOUND; - s->pirq[p->type_val].port =3D i; + s->pirq[p->u.pirq].gsi =3D IRQ_UNBOUND; + s->pirq[p->u.pirq].port =3D i; } } /* Rebuild s->pirq[].gsi mapping */ @@ -243,7 +243,7 @@ static const VMStateDescription xen_evtchn_port_vmstate= =3D { .fields =3D (VMStateField[]) { VMSTATE_UINT32(vcpu, XenEvtchnPort), VMSTATE_UINT16(type, XenEvtchnPort), - VMSTATE_UINT16(type_val, XenEvtchnPort), + VMSTATE_UINT16(u.val, XenEvtchnPort), VMSTATE_END_OF_LIST() } }; @@ -605,14 +605,13 @@ static void unbind_backend_ports(XenEvtchnState *s) =20 for (i =3D 1; i < s->nr_ports; i++) { p =3D &s->port_table[i]; - if (p->type =3D=3D EVTCHNSTAT_interdomain && - (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU)) { - evtchn_port_t be_port =3D p->type_val & PORT_INFO_TYPEVAL_REMO= TE_PORT_MASK; + if (p->type =3D=3D EVTCHNSTAT_interdomain && p->u.interdomain.to_q= emu) { + evtchn_port_t be_port =3D p->u.interdomain.port; =20 if (s->be_handles[be_port]) { /* This part will be overwritten on the load anyway. */ p->type =3D EVTCHNSTAT_unbound; - p->type_val =3D PORT_INFO_TYPEVAL_REMOTE_QEMU; + p->u.interdomain.port =3D 0; =20 /* Leave the backend port open and unbound too. */ if (kvm_xen_has_cap(EVTCHN_SEND)) { @@ -650,30 +649,22 @@ int xen_evtchn_status_op(struct evtchn_status *status) =20 switch (p->type) { case EVTCHNSTAT_unbound: - if (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU) { - status->u.unbound.dom =3D DOMID_QEMU; - } else { - status->u.unbound.dom =3D xen_domid; - } + status->u.unbound.dom =3D p->u.interdomain.to_qemu ? DOMID_QEMU + : xen_domid; break; =20 case EVTCHNSTAT_interdomain: - if (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU) { - status->u.interdomain.dom =3D DOMID_QEMU; - } else { - status->u.interdomain.dom =3D xen_domid; - } - - status->u.interdomain.port =3D p->type_val & - PORT_INFO_TYPEVAL_REMOTE_PORT_MASK; + status->u.interdomain.dom =3D p->u.interdomain.to_qemu ? DOMID_QEMU + : xen_domid; + status->u.interdomain.port =3D p->u.interdomain.port; break; =20 case EVTCHNSTAT_pirq: - status->u.pirq =3D p->type_val; + status->u.pirq =3D p->u.pirq; break; =20 case EVTCHNSTAT_virq: - status->u.virq =3D p->type_val; + status->u.virq =3D p->u.virq; break; } =20 @@ -989,7 +980,7 @@ static int clear_port_pending(XenEvtchnState *s, evtchn= _port_t port) static void free_port(XenEvtchnState *s, evtchn_port_t port) { s->port_table[port].type =3D EVTCHNSTAT_closed; - s->port_table[port].type_val =3D 0; + s->port_table[port].u.val =3D 0; s->port_table[port].vcpu =3D 0; =20 if (s->nr_ports =3D=3D port + 1) { @@ -1012,7 +1003,7 @@ static int allocate_port(XenEvtchnState *s, uint32_t = vcpu, uint16_t type, if (s->port_table[p].type =3D=3D EVTCHNSTAT_closed) { s->port_table[p].vcpu =3D vcpu; s->port_table[p].type =3D type; - s->port_table[p].type_val =3D val; + s->port_table[p].u.val =3D val; =20 *port =3D p; =20 @@ -1053,15 +1044,15 @@ static int close_port(XenEvtchnState *s, evtchn_por= t_t port, return -ENOENT; =20 case EVTCHNSTAT_pirq: - s->pirq[p->type_val].port =3D 0; - if (s->pirq[p->type_val].is_translated) { + s->pirq[p->u.pirq].port =3D 0; + if (s->pirq[p->u.pirq].is_translated) { *flush_kvm_routes =3D true; } break; =20 case EVTCHNSTAT_virq: - kvm_xen_set_vcpu_virq(virq_is_global(p->type_val) ? 0 : p->vcpu, - p->type_val, 0); + kvm_xen_set_vcpu_virq(virq_is_global(p->u.virq) ? 0 : p->vcpu, + p->u.virq, 0); break; =20 case EVTCHNSTAT_ipi: @@ -1071,8 +1062,8 @@ static int close_port(XenEvtchnState *s, evtchn_port_= t port, break; =20 case EVTCHNSTAT_interdomain: - if (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU) { - uint16_t be_port =3D p->type_val & ~PORT_INFO_TYPEVAL_REMOTE_Q= EMU; + if (p->u.interdomain.to_qemu) { + uint16_t be_port =3D p->u.interdomain.port; struct xenevtchn_handle *xc =3D s->be_handles[be_port]; if (xc) { if (kvm_xen_has_cap(EVTCHN_SEND)) { @@ -1082,14 +1073,15 @@ static int close_port(XenEvtchnState *s, evtchn_por= t_t port, } } else { /* Loopback interdomain */ - XenEvtchnPort *rp =3D &s->port_table[p->type_val]; - if (!valid_port(p->type_val) || rp->type_val !=3D port || + XenEvtchnPort *rp =3D &s->port_table[p->u.interdomain.port]; + if (!valid_port(p->u.interdomain.port) || + rp->u.interdomain.port !=3D port || rp->type !=3D EVTCHNSTAT_interdomain) { error_report("Inconsistent state for interdomain unbind"); } else { /* Set the other end back to unbound */ rp->type =3D EVTCHNSTAT_unbound; - rp->type_val =3D 0; + rp->u.interdomain.port =3D 0; } } break; @@ -1214,7 +1206,7 @@ int xen_evtchn_bind_vcpu_op(struct evtchn_bind_vcpu *= vcpu) if (p->type =3D=3D EVTCHNSTAT_interdomain || p->type =3D=3D EVTCHNSTAT_unbound || p->type =3D=3D EVTCHNSTAT_pirq || - (p->type =3D=3D EVTCHNSTAT_virq && virq_is_global(p->type_val))) { + (p->type =3D=3D EVTCHNSTAT_virq && virq_is_global(p->u.virq))) { /* * unmask_port() with do_unmask=3D=3Dfalse will just raise the eve= nt * on the new vCPU if the port was already pending. @@ -1359,19 +1351,15 @@ int xen_evtchn_bind_ipi_op(struct evtchn_bind_ipi *= ipi) int xen_evtchn_bind_interdomain_op(struct evtchn_bind_interdomain *interdo= main) { XenEvtchnState *s =3D xen_evtchn_singleton; - uint16_t type_val; int ret; =20 if (!s) { return -ENOTSUP; } =20 - if (interdomain->remote_dom =3D=3D DOMID_QEMU) { - type_val =3D PORT_INFO_TYPEVAL_REMOTE_QEMU; - } else if (interdomain->remote_dom =3D=3D DOMID_SELF || - interdomain->remote_dom =3D=3D xen_domid) { - type_val =3D 0; - } else { + if (interdomain->remote_dom !=3D DOMID_QEMU && + interdomain->remote_dom !=3D DOMID_SELF && + interdomain->remote_dom !=3D xen_domid) { return -ESRCH; } =20 @@ -1382,8 +1370,8 @@ int xen_evtchn_bind_interdomain_op(struct evtchn_bind= _interdomain *interdomain) qemu_mutex_lock(&s->port_lock); =20 /* The newly allocated port starts out as unbound */ - ret =3D allocate_port(s, 0, EVTCHNSTAT_unbound, type_val, - &interdomain->local_port); + ret =3D allocate_port(s, 0, EVTCHNSTAT_unbound, 0, &interdomain->local= _port); + if (ret) { goto out; } @@ -1408,7 +1396,8 @@ int xen_evtchn_bind_interdomain_op(struct evtchn_bind= _interdomain *interdomain) assign_kernel_eventfd(lp->type, xc->guest_port, xc->fd); } lp->type =3D EVTCHNSTAT_interdomain; - lp->type_val =3D PORT_INFO_TYPEVAL_REMOTE_QEMU | interdomain->remo= te_port; + lp->u.interdomain.to_qemu =3D 1; + lp->u.interdomain.port =3D interdomain->remote_port; ret =3D 0; } else { /* Loopback */ @@ -1416,19 +1405,18 @@ int xen_evtchn_bind_interdomain_op(struct evtchn_bi= nd_interdomain *interdomain) XenEvtchnPort *lp =3D &s->port_table[interdomain->local_port]; =20 /* - * The 'remote' port for loopback must be an unbound port allocate= d for - * communication with the local domain (as indicated by rp->type_v= al - * being zero, not PORT_INFO_TYPEVAL_REMOTE_QEMU), and must *not* = be - * the port that was just allocated for the local end. + * The 'remote' port for loopback must be an unbound port allocated + * for communication with the local domain, and must *not* be the + * port that was just allocated for the local end. */ if (interdomain->local_port !=3D interdomain->remote_port && - rp->type =3D=3D EVTCHNSTAT_unbound && rp->type_val =3D=3D 0) { + rp->type =3D=3D EVTCHNSTAT_unbound && !rp->u.interdomain.to_qe= mu) { =20 rp->type =3D EVTCHNSTAT_interdomain; - rp->type_val =3D interdomain->local_port; + rp->u.interdomain.port =3D interdomain->local_port; =20 lp->type =3D EVTCHNSTAT_interdomain; - lp->type_val =3D interdomain->remote_port; + lp->u.interdomain.port =3D interdomain->remote_port; } else { ret =3D -EINVAL; } @@ -1447,7 +1435,6 @@ int xen_evtchn_bind_interdomain_op(struct evtchn_bind= _interdomain *interdomain) int xen_evtchn_alloc_unbound_op(struct evtchn_alloc_unbound *alloc) { XenEvtchnState *s =3D xen_evtchn_singleton; - uint16_t type_val; int ret; =20 if (!s) { @@ -1458,18 +1445,20 @@ int xen_evtchn_alloc_unbound_op(struct evtchn_alloc= _unbound *alloc) return -ESRCH; } =20 - if (alloc->remote_dom =3D=3D DOMID_QEMU) { - type_val =3D PORT_INFO_TYPEVAL_REMOTE_QEMU; - } else if (alloc->remote_dom =3D=3D DOMID_SELF || - alloc->remote_dom =3D=3D xen_domid) { - type_val =3D 0; - } else { + if (alloc->remote_dom !=3D DOMID_QEMU && + alloc->remote_dom !=3D DOMID_SELF && + alloc->remote_dom !=3D xen_domid) { return -EPERM; } =20 qemu_mutex_lock(&s->port_lock); =20 - ret =3D allocate_port(s, 0, EVTCHNSTAT_unbound, type_val, &alloc->port= ); + ret =3D allocate_port(s, 0, EVTCHNSTAT_unbound, 0, &alloc->port); + + if (!ret && alloc->remote_dom =3D=3D DOMID_QEMU) { + XenEvtchnPort *p =3D &s->port_table[alloc->port]; + p->u.interdomain.to_qemu =3D 1; + } =20 qemu_mutex_unlock(&s->port_lock); =20 @@ -1496,12 +1485,12 @@ int xen_evtchn_send_op(struct evtchn_send *send) =20 switch (p->type) { case EVTCHNSTAT_interdomain: - if (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU) { + if (p->u.interdomain.to_qemu) { /* * This is an event from the guest to qemu itself, which is * serving as the driver domain. */ - uint16_t be_port =3D p->type_val & ~PORT_INFO_TYPEVAL_REMOTE_Q= EMU; + uint16_t be_port =3D p->u.interdomain.port; struct xenevtchn_handle *xc =3D s->be_handles[be_port]; if (xc) { eventfd_write(xc->fd, 1); @@ -1511,7 +1500,7 @@ int xen_evtchn_send_op(struct evtchn_send *send) } } else { /* Loopback interdomain ports; just a complex IPI */ - set_port_pending(s, p->type_val); + set_port_pending(s, p->u.interdomain.port); } break; =20 @@ -1553,8 +1542,7 @@ int xen_evtchn_set_port(uint16_t port) =20 /* QEMU has no business sending to anything but these */ if (p->type =3D=3D EVTCHNSTAT_virq || - (p->type =3D=3D EVTCHNSTAT_interdomain && - (p->type_val & PORT_INFO_TYPEVAL_REMOTE_QEMU))) { + (p->type =3D=3D EVTCHNSTAT_interdomain && p->u.interdomain.to_qemu= )) { set_port_pending(s, port); ret =3D 0; } @@ -2064,7 +2052,7 @@ int xen_be_evtchn_bind_interdomain(struct xenevtchn_h= andle *xc, uint32_t domid, switch (gp->type) { case EVTCHNSTAT_interdomain: /* Allow rebinding after migration, preserve port # if possible */ - be_port =3D gp->type_val & ~PORT_INFO_TYPEVAL_REMOTE_QEMU; + be_port =3D gp->u.interdomain.port; assert(be_port !=3D 0); if (!s->be_handles[be_port]) { s->be_handles[be_port] =3D xc; @@ -2085,7 +2073,8 @@ int xen_be_evtchn_bind_interdomain(struct xenevtchn_h= andle *xc, uint32_t domid, } =20 gp->type =3D EVTCHNSTAT_interdomain; - gp->type_val =3D be_port | PORT_INFO_TYPEVAL_REMOTE_QEMU; + gp->u.interdomain.to_qemu =3D 1; + gp->u.interdomain.port =3D be_port; xc->guest_port =3D guest_port; if (kvm_xen_has_cap(EVTCHN_SEND)) { assign_kernel_eventfd(gp->type, guest_port, xc->fd); @@ -2130,7 +2119,7 @@ int xen_be_evtchn_unbind(struct xenevtchn_handle *xc,= evtchn_port_t port) /* This should never *not* be true */ if (gp->type =3D=3D EVTCHNSTAT_interdomain) { gp->type =3D EVTCHNSTAT_unbound; - gp->type_val =3D PORT_INFO_TYPEVAL_REMOTE_QEMU; + gp->u.interdomain.port =3D 0; } =20 if (kvm_xen_has_cap(EVTCHN_SEND)) { @@ -2284,11 +2273,11 @@ EvtchnInfoList *qmp_xen_event_list(Error **errp) =20 info->type =3D p->type; if (p->type =3D=3D EVTCHNSTAT_interdomain) { - info->remote_domain =3D g_strdup((p->type_val & PORT_INFO_TYPE= VAL_REMOTE_QEMU) ? + info->remote_domain =3D g_strdup(p->u.interdomain.to_qemu ? "qemu" : "loopback"); - info->target =3D p->type_val & PORT_INFO_TYPEVAL_REMOTE_PORT_M= ASK; + info->target =3D p->u.interdomain.port; } else { - info->target =3D p->type_val; + info->target =3D p->u.val; /* pirq# or virq# */ } info->vcpu =3D p->vcpu; info->pending =3D test_bit(i, pending); --=20 2.41.0