From nobody Tue Feb 10 10:03:50 2026 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=1678213683; cv=none; d=zohomail.com; s=zohoarc; b=UiJI8Dah/LgCrmGoRFW8JUGVaichwK+VAWsRP8q2SpbhPKtP58F8AnYwkSp1jW7EEpOLopvTlzQWalRHVtcLzVYUaZuQb1nCm3rgnsw/8ZWyiqJ5rR1nkZMmAJSjCgIuitcRMHZ72K9QmR8tdpQadvVREWovwlMIV72sAcDeb7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678213683; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=82Q+BiWXMrz+wFyySB5DKlF6CrKphRlXsFH1yff2od4=; b=cANgspXZtixF/ZwnBh/5dgDaTI10MoTHUqf9EDTwAttInighMbbdjDyreJKdCibafg1CgkKmkaNd+tKjoD3FbrHVvLTmkA7bx4bdy64iFAdpPeMIzZKZCjugZdpiUAa3x5/B7QOdOAP4C1uJXecFWWi5uNkoIeYrvCCDZ7Xz09g= 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 1678213683538583.7040623680888; Tue, 7 Mar 2023 10:28:03 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.507791.781909 (Exim 4.92) (envelope-from ) id 1pZc2E-0006WM-PP; Tue, 07 Mar 2023 18:27:38 +0000 Received: by outflank-mailman (output) from mailman id 507791.781909; Tue, 07 Mar 2023 18:27:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZc2D-0006Ma-8d; Tue, 07 Mar 2023 18:27:37 +0000 Received: by outflank-mailman (input) for mailman id 507791; Tue, 07 Mar 2023 18:27:28 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pZc24-0002MP-6z for xen-devel@lists.xenproject.org; Tue, 07 Mar 2023 18:27:28 +0000 Received: from casper.infradead.org (casper.infradead.org [2001:8b0:10b:1236::1]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id b22c53d1-bd15-11ed-a550-8520e6686977; Tue, 07 Mar 2023 19:27:20 +0100 (CET) Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZc1n-006deN-Ug; Tue, 07 Mar 2023 18:27:12 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pZc1n-009e9b-35; Tue, 07 Mar 2023 18:27:11 +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: b22c53d1-bd15-11ed-a550-8520e6686977 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=82Q+BiWXMrz+wFyySB5DKlF6CrKphRlXsFH1yff2od4=; b=kXMKa/9hW0SY2tX9lcrSMb7UcW GfxqeCkFPhE83DL36Q5wviYfGXSVmPFP0Fh7OGZQZTdopWeGtK7ENw6Ik0HUH1MmThw5jqkaxhnaA zUuVWhYupoXKGOcxDt83+YOdCouYvsktZjaHpit71oNK5Q4qsfLIgqlyZnrXcLO+gxWXOzGZz2WM0 AuMvt+DrhKLx7iNk96YIarusgOlYOUeQ14YpRyKDerWlOAqGz5sDgLOacYuxg+UOT/z21jV2XD/Qc FchRCzj6gp+JNIbjGNudgUdewYA73vf5JNQ/pOZPfHQ8QXpnEHDmYgKtYiQYGCE9AVuqDolKnsnkm rBlmWyFA==; From: David Woodhouse To: Peter Maydell Cc: qemu-devel@nongnu.org, Paolo Bonzini , Paul Durrant , Joao Martins , Ankur Arora , Stefano Stabellini , vikram.garhwal@amd.com, Anthony Perard , xen-devel@lists.xenproject.org, Juan Quintela , "Dr . David Alan Gilbert" Subject: [PULL 20/27] hw/xen: Hook up emulated implementation for event channel operations Date: Tue, 7 Mar 2023 18:27:00 +0000 Message-Id: <20230307182707.2298618-21-dwmw2@infradead.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230307182707.2298618-1-dwmw2@infradead.org> References: <20230307182707.2298618-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: 1678213684577100009 Content-Type: text/plain; charset="utf-8" From: David Woodhouse We provided the backend-facing evtchn functions very early on as part of the core Xen platform support, since things like timers and xenstore need to use them. By what may or may not be an astonishing coincidence, those functions just *happen* all to have exactly the right function prototypes to slot into the evtchn_backend_ops table and be called by the PV backends. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_evtchn.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c index 886fbf6b3b..98a7b85047 100644 --- a/hw/i386/kvm/xen_evtchn.c +++ b/hw/i386/kvm/xen_evtchn.c @@ -34,6 +34,7 @@ #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/irq.h" +#include "hw/xen/xen_backend_ops.h" =20 #include "xen_evtchn.h" #include "xen_overlay.h" @@ -278,6 +279,17 @@ static const TypeInfo xen_evtchn_info =3D { .class_init =3D xen_evtchn_class_init, }; =20 +static struct evtchn_backend_ops emu_evtchn_backend_ops =3D { + .open =3D xen_be_evtchn_open, + .bind_interdomain =3D xen_be_evtchn_bind_interdomain, + .unbind =3D xen_be_evtchn_unbind, + .close =3D xen_be_evtchn_close, + .get_fd =3D xen_be_evtchn_fd, + .notify =3D xen_be_evtchn_notify, + .unmask =3D xen_be_evtchn_unmask, + .pending =3D xen_be_evtchn_pending, +}; + static void gsi_assert_bh(void *opaque) { struct vcpu_info *vi =3D kvm_xen_get_vcpu_info_hva(0); @@ -318,6 +330,9 @@ void xen_evtchn_create(void) s->nr_pirq_inuse_words =3D DIV_ROUND_UP(s->nr_pirqs, 64); s->pirq_inuse_bitmap =3D g_new0(uint64_t, s->nr_pirq_inuse_words); s->pirq =3D g_new0(struct pirq_info, s->nr_pirqs); + + /* Set event channel functions for backend drivers to use */ + xen_evtchn_ops =3D &emu_evtchn_backend_ops; } =20 void xen_evtchn_connect_gsis(qemu_irq *system_gsis) --=20 2.39.0