From nobody Mon Feb 9 23:39:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569850457; cv=none; d=zoho.com; s=zohoarc; b=lpBlPidV85CbccuFb/wJH6TvbMiqUwUc8to/oAEJbuUDYbd45EpoTdPio5e42UPNNYkyTx57Ug4mxZSTHD+NduYJ0mNFu63rDeyiKazujuZTL0Yh+yxo7SepO5aHB0y9JQu3wuJNNrYsli9GYpmQbZFZhlg8y/ZnE93kNqmZ35w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569850457; h=Content-Type: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:ARC-Authentication-Results; bh=fZmVBRafmD7M2qUBajuDcetgh6/me4owiVCZtg3Uges=; b=P7hUyPRpaRsLe1M9V2nWCFej1o8mzIRmaa+PXe/VyEfAzg0WVDHLU5DRjx3j7CedTyCMPDPMs6h0Cl0NIXTbN7jJLmoScFQrlr0zeMRroUGTWFSS8vyGhHOpXSDsnd2loh/TE+I580Hjxwu9xcl5HRN8Se5ggSBjMGywMGucvFc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) 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 156985045763727.11299276368254; Mon, 30 Sep 2019 06:34:17 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEvnf-0005PL-Ut; Mon, 30 Sep 2019 13:33:15 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEvne-0005P8-DS for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 13:33:14 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by localhost (Halon) with ESMTPS id d983b632-e386-11e9-96d2-12813bfff9fa; Mon, 30 Sep 2019 13:33:13 +0000 (UTC) X-Inumbo-ID: d983b632-e386-11e9-96d2-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1569850393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wJuOA8I65W5rXxtgxu2eoW29fdQ5R2Fu93hXN1/y6WU=; b=TImEeOvjh7MkGMkwLyD1TWF6SxwMSQsuSf+/R4D4CR2mqiDx4PJE4rTL a7Ph34sJxOuQytNLChVs4psQuW2Z9NmQQKKxQo3gOnTsc5rbFFb4mvmnu 9N/Musn/tKcZQvefQVPs+AVmjxP/d529muSEZoZyhmu44yrWPqEraKmvj Q=; Authentication-Results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Fsy52a2/oE2xnXQHnuFLJNIttLkYZKG8uqKAYkwSCREazbQBAR4SDGQAa+usyqZLZmT6DGe5eQ e674HAbTuTbMUZohQ0e/s3KvmiOlwotvKw+7GEhwZlKN0hhX967QLG+cDIEdcIDq3xxbrt/zD2 4JlU37Q4bzutwTKCrrFPLRswv//er/I92J7SftyIg3z1IXyodrYNo0ugOyhhFuTLrU+IukSV0u ffHWW8v9r2Khsr3UYhra23Rk5DD/C7jJbGUO5cR557+jOvDIZdAeSzHnKtpAWygtVToIr1KLT4 aAQ= X-SBRS: 2.7 X-MesageID: 6602530 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,567,1559534400"; d="scan'208";a="6602530" From: Roger Pau Monne To: Date: Mon, 30 Sep 2019 15:32:31 +0200 Message-ID: <20190930133238.49868-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190930133238.49868-1-roger.pau@citrix.com> References: <20190930133238.49868-1-roger.pau@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v3 03/10] ioreq: add fields to allow internal ioreq servers X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Paul Durrant , Wei Liu , Jan Beulich , Roger Pau Monne Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Internal ioreq servers are plain function handlers implemented inside of the hypervisor. Note that most fields used by current (external) ioreq servers are not needed for internal ones, and hence have been placed inside of a struct and packed in an union together with the only internal specific field, a function pointer to a handler. This is required in order to have PCI config accesses forwarded to external ioreq servers or to internal ones (ie: QEMU emulated devices vs vPCI passthrough), and is the first step in order to allow unprivileged domains to use vPCI. Signed-off-by: Roger Pau Monn=C3=A9 Reviewed-by: Paul Durrant Acked-by: Jan Beulich --- Changes since v2: - Drop the vcpu parameter from the handler. Changes since v1: - Do not add an internal field to the ioreq server struct, whether a server is internal or external can already be inferred from the id. - Add an extra parameter to the internal handler in order to pass user-provided opaque data to the handler. --- xen/include/asm-x86/hvm/domain.h | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/dom= ain.h index bcc5621797..56a32e3e35 100644 --- a/xen/include/asm-x86/hvm/domain.h +++ b/xen/include/asm-x86/hvm/domain.h @@ -52,21 +52,29 @@ struct hvm_ioreq_vcpu { #define MAX_NR_IO_RANGES 256 =20 struct hvm_ioreq_server { - struct domain *target, *emulator; - + struct domain *target; /* Lock to serialize toolstack modifications */ spinlock_t lock; - - struct hvm_ioreq_page ioreq; - struct list_head ioreq_vcpu_list; - struct hvm_ioreq_page bufioreq; - - /* Lock to serialize access to buffered ioreq ring */ - spinlock_t bufioreq_lock; - evtchn_port_t bufioreq_evtchn; struct rangeset *range[NR_IO_RANGE_TYPES]; bool enabled; - uint8_t bufioreq_handling; + + union { + struct { + struct domain *emulator; + struct hvm_ioreq_page ioreq; + struct list_head ioreq_vcpu_list; + struct hvm_ioreq_page bufioreq; + + /* Lock to serialize access to buffered ioreq ring */ + spinlock_t bufioreq_lock; + evtchn_port_t bufioreq_evtchn; + uint8_t bufioreq_handling; + }; + struct { + void *data; + int (*handler)(ioreq_t *, void *); + }; + }; }; =20 /* --=20 2.23.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel