From nobody Mon Nov 25 07:50:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@eviden.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=eviden.com); dmarc=pass(p=reject dis=none) header.from=eviden.com ARC-Seal: i=2; a=rsa-sha256; t=1717394659; cv=pass; d=zohomail.com; s=zohoarc; b=VEiNu3oOAjxFPkjUEyHzZyh1MVQpBQn0gmft02NAFnC7aCj7WVChY/lEYN0wuBdgv0lJRfvhKaRMGknQDl18LtGNsZpxPfR7swVPIlCXW8umCEjDoILWnZsFzd+WxipXysNeKgbvkZ0E4f7PUciOgMIwWGjc41lVVdHKii3vISI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394659; h=Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=MXsfVM0tixoaNoKt6SmmlBUVlcBTzQY5Cr2FLNrUCD57UMYL9nDJniZVg8mPU8lyCeZb2K456ps5YSWZkD0umYGZTmLAFxwNqYl56Zg0TmzCDKNHZy0++PLwk/mskR3isZsHdk0Jfp4S+Z2psKflfiaCblXvhniSeJwDF2W2g3o= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=@eviden.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=eviden.com); dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1717394659076225.9151034795716; Sun, 2 Jun 2024 23:04:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jm-0006oV-Oo; Mon, 03 Jun 2024 02:00:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sE0je-0006gB-5p for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:58 -0400 Received: from smarthost2.eviden.com ([80.78.11.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sE0jc-00072M-6L for qemu-devel@nongnu.org; Mon, 03 Jun 2024 01:59:57 -0400 Received: from mail-he1eur01lp2051.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) ([104.47.0.51]) by smarthost2.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:52 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by VI1PR07MB6238.eurprd07.prod.outlook.com (2603:10a6:800:136::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Mon, 3 Jun 2024 05:59:48 +0000 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d]) by AM8PR07MB7602.eurprd07.prod.outlook.com ([fe80::fbd7:ca71:b636:6f9d%5]) with mapi id 15.20.7633.021; Mon, 3 Jun 2024 05:59:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394396; x=1748930396; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=jvGMQsa072dGf2LQOUtoyh9n0IRX0MY/CqBJksFor2+SDVxoeyuns5bY dZILWau2ZxL0qBVUiJdJlgbFgvUgfNKu2WrrG6yHfuq9v2XbbaELD5YoN eDTi9urBa6jd9xoFAE8tB5Mv1qa6ay+vg+favYSLHxKcdDAWCpY9wETvq uSYOhz7cTrtifP6Ye8j+/0DXRV9W8uvc1u8jr+QzDpd+iWWqh1a7YxBOu gFCdoYu+6hv3xLhmv5NYhN4sjG2r8ig5ZU/tuQIAjp6gMQy+XhYYEaiSY MvTyINKAR2wVdwiKEbAeO9Ri/AvhYJE+Hj69E9I6lttmZW+3u9/JVCPX5 Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13763247" X-MGA-submission: =?us-ascii?q?MDGKF2e07mPGcTeH995K0EDXBeG5TS+uvNrQv4?= =?us-ascii?q?gEJbQZctbhJgnT6zdAdoslSNR21fpvMsa5fAaOM/jRz3dmTw3TopwqHb?= =?us-ascii?q?NzFCfFrl212+B+jA/krVtGXINjbOqzhkXZZIxboPnrJCTP1YEWyMxeig?= =?us-ascii?q?/ySoJ4YzcIFdv/0K0cFJydBA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQvut47cWXXHlJUP1FR6d7m6TI+UqefBobnlz53wfVQREZAWfse+KU+eunVW1oALOUKD/7J4W2aZj337hgZJ4EQQlET2A9UUte9h/QC9T4gm6Y0LDLm1xOWzsTptd6BWPrD1Y0SWSB+BIx+C1pzuLmekK7wZUbaoTl/Zu6EZLJf8Md1eUa2F6rQ/pBWl50vUO5+GxUWiJRuhtwrq+UTpPnldNhKEHvlZgoyr0ZPyBPML1HLTtGQsc5yzT96VwZSCY1ExsC1nHu7NRO1jDmmsV0/1YaBO2j3hI6TU0wCBtitiD0spXP16mHJ3pPiJlBX0oUQKzIln/2KaE/fPH/C0Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=WBYV69HMqPL93JhI5fvq8PyBXeJF7EqSlBPqC2vnPPXTbtvVbTx2iTVrnkPbIDc8QNg9ZUUdMCnNaTSnPXOmLR5Rdg8+lXHreEHlObAArGSOa+FFIXqXnLwym7kaQIoYkDPxpjmXFShjePG2KFgOXp1tJDOMtLOZgMM23AD6+Y33uNRcE9nYo2KsGRvyDlj0YxPXprybcWtUOmMOxUsHy+FvqQZMWfIGvmyutGR+HHfqpLUsaXUWjOH7/NMflH17k7kaK/OAimYvWLrb8QQo+i/wSle91ucM4jEp2LX9YezzlBFxXSvp/MiGe/LntGy8vl9AQO7XA+0krczGE77BOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=eviden.com; dmarc=pass action=none header.from=eviden.com; dkim=pass header.d=eviden.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Eviden.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3iGn8iTNBgQPofEUaGJboBsdoJafrIzD0MJJvX9ZvNk=; b=B8YyyqlgZo1UJFQYkd5k1jQT2RNBhEWPzLPysUSvOEX9hYjOHURI7hgdW4HnK0lkfX9GA8E8xRJxUKB6SWhKqpstlreSNiCv7z3/lMxj/LyVjW7PhN3pI5C1L3iLlQTEyJXTv3aCfeBZkshIiAFaIaT2jol6rUXL5+QAXaXqYK2gNReJCW2UlNLXyQkMuK/Lx4e0UnpE9eIcdH9hNG/XXTSkmaSLzuSOyOBEBEgGW9w3HcMiSeUpbdrVbNkBttEvn4eUUZ+YfS6DyNDlMzMLfucAtXabLTudvGegVEnpI9Ou2jR8KOVThXExPlBKd86iTOGpuwBjuuPELhhrCNsTeg== From: CLEMENT MATHIEU--DRIF To: "qemu-devel@nongnu.org" CC: "jasowang@redhat.com" , "zhenzhong.duan@intel.com" , "kevin.tian@intel.com" , "yi.l.liu@intel.com" , "joao.m.martins@oracle.com" , "peterx@redhat.com" , "mst@redhat.com" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd v5 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Topic: [PATCH ats_vtd v5 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Index: AQHatXs9hOklV2j/n0yx4sycS/sVhQ== Date: Mon, 3 Jun 2024 05:59:48 +0000 Message-ID: <20240603055917.18735-13-clement.mathieu--drif@eviden.com> References: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240603055917.18735-1-clement.mathieu--drif@eviden.com> Accept-Language: en-GB, fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=eviden.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM8PR07MB7602:EE_|VI1PR07MB6238:EE_ x-ms-office365-filtering-correlation-id: bcfc999d-997e-4c64-daa7-08dc8392605b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?dzVBMG4rV1dhRFlTYzRiWEJyYmppQkZsclhtMXNoV1JTRXRHUWY5NGdKWU9U?= =?utf-8?B?dDJaTnpyM1E1MkdFV2pTQmNrb0xvdktkVThZYURMM1dNa1lpRXc1aFhYYzRk?= =?utf-8?B?NGMrR1FNY01DckdiVGtndjRJYXcrSXNDeVUxYzQ2Tnl5RmJ1U0tCT1Q3cW8z?= =?utf-8?B?Wkx5R05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yMVVRTFpCcE9FTFFrRCtRcDZDeUhOUXV2bE94djdlV1lWMFpwdXhoMit3?= =?utf-8?B?b25yZVo0ZXlOTHplcjNXQXpRSDdCNC80NmpRV0tqTmlJMWZYR0lPUVQ2WGZS?= =?utf-8?B?UUgrOGpGdjUvUEY5WHJnZ2hLUnJxYzVPMEswZ1pwWU5EVWE0dmlsanhxUzZy?= =?utf-8?B?a0R3Mnl4ekRESitTVHdxeHBLc1JQeHdxMmY4RDFsYWJvL0wycHF6aWhNaW50?= =?utf-8?B?L3ZsWWFKbGJEVENkbmtmRFJUZlg0VFdhbCtrQXhDL3ZaNG5FWDRGTmRjdmZR?= =?utf-8?B?eXpWVXc2cGRsTzVGQ3djRWpZd2liSURlS1VucWRVQXB5a3U3cWdqZWROdEpB?= =?utf-8?B?Q1BWS09QeUVNUG5OeGx3WGxNTFUrYTdsYlhsZUIycU1UNkdhR20rMjRYa0VT?= =?utf-8?B?VUd3aFR5TGE0bm41aFVxZ2VCMEhpd0lIZlFTb0EySGtLZ2E2OGNTVzlLbGJj?= =?utf-8?B?ODdlRmdiTExuajUrTVdNcUZCcEdsWkkzWUh6bVh2a3VwYU10MkFHVHFtZWps?= =?utf-8?B?Q1laemVPSGR0Uk45SnJibFVrTEVUY0lTdjNJbXA5b29XSUV5alQzZnUza3g1?= =?utf-8?B?VVNyR2g2SXpTYmpFMjdzbHRGOG93ZHMvb3o5T3g4UHJUYzFjSDRsanJKcS9P?= =?utf-8?B?bVVVbzByd3NYcUVFYytWOTM5ZWc0ZzZwNjZOSjNkVkZiczZ5RkhkS2lZTjVz?= =?utf-8?B?YTJkN2dKNUtOVmpUSm1JZz09?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM8PR07MB7602.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount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cUh0eW0rVEFLUGRVQzMvSkNxVUJHYk9GVWo2b1Nj?= =?utf-8?B?VWlxU0h3RGFNc0ZTeTRienlPWUErWTBtRWpNTkg3VldiQmRmczdPQUtCRzRy?= =?utf-8?B?YnVldTRJcWkxbWlmUm9XKzJrdk5lRDdLU1NETWJjZ3huZFZiY3ZxL2c2K21D?= =?utf-8?B?b2hxdUxaQTY5K3dwRDZObm5Nd045MHEya0plY25ZWUlpNytMZEQwc3Q3M215?= =?utf-8?B?YXg2YVI5KzFNMkxMTWxwTHhKMXExY0dEcWhTRmFWdTNrSkRFZHB3L3BPVkU2?= =?utf-8?B?NGo4cXo3UnhSQkEydityUmN6aEhpSmZJNEMxblJSa3lpaGNoeGYzU3l1ZUxU?= =?utf-8?B?WVV1TlFLQ01mNlkxSzg1YmkrYit3UXE4dGdxWkI0WXlhempKalZvdnphRFZ0?= =?utf-8?Q?AMHZg068lOaFqiRGQP5vdHo=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <9EA5EFDC58048A46BFECDF1F9ABB0802@eurprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: eviden.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM8PR07MB7602.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bcfc999d-997e-4c64-daa7-08dc8392605b X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:48.4400 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 7d1c7785-2d8a-437d-b842-1ed5d8fbe00a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +ujNv+q6SuZMFmReHHzb8cBuuEzNgfQV+UQ/9t9oh6gbzzKZXoWM/FnNCniefq6UK8NskL2ZEZ636tdMaK6r9kGE9uWHwEbkcQZ6RLiCYPIBwbow+fETXdsrMUHAVoTL X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6238 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=80.78.11.83; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost2.eviden.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @eviden.com) X-ZM-MESSAGEID: 1717394659706100009 From: Cl=C3=A9ment Mathieu--Drif We add a convenient way to initialize an device-iotlb notifier. This is meant to be used by ATS-capable devices. pci_device_iommu_memory_region_pasid is introduces in this commit and will be used in several other SVM-related functions exposed in the PCI API. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 15 +++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 3fe47d4002..0e14ef4ab2 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2747,6 +2747,46 @@ AddressSpace *pci_device_iommu_address_space(PCIDevi= ce *dev) return &address_space_memory; } =20 +static IOMMUMemoryRegion *pci_device_iommu_memory_region_pasid(PCIDevice *= dev, + uint32_t pa= sid) +{ + PCIBus *bus; + PCIBus *iommu_bus; + int devfn; + + /* + * This function is for internal use in the module, + * we can call it with PCI_NO_PASID + */ + if (!dev->is_master || + ((pasid !=3D PCI_NO_PASID) && !pcie_pasid_enabled(dev))) { + return NULL; + } + + pci_device_get_iommu_bus_devfn(dev, &bus, &iommu_bus, &devfn); + if (iommu_bus && iommu_bus->iommu_ops->get_memory_region_pasid) { + return iommu_bus->iommu_ops->get_memory_region_pasid(bus, + iommu_bus->iommu_opaque, devfn, pasid); + } + return NULL; +} + +bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n, IOMMUNotify fn, + void* opaque) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return false; + } + iommu_notifier_init(n, fn, IOMMU_NOTIFIER_DEVIOTLB_EVENTS, 0, HWADDR_M= AX, + memory_region_iommu_attrs_to_index(iommu_mr, + MEMTXATTRS_UNSPECIF= IED)); + n->opaque =3D opaque; + return true; +} + AddressSpace *pci_device_iommu_address_space_pasid(PCIDevice *dev, uint32_t pasid) { diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 6c60f7a7c5..2147981423 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -458,6 +458,21 @@ bool pci_device_set_iommu_device(PCIDevice *dev, HostI= OMMUDevice *hiod, Error **errp); void pci_device_unset_iommu_device(PCIDevice *dev); =20 +/** + * pci_iommu_init_iotlb_notifier: initialize an IOMMU notifier + * + * This function is used by devices before registering an IOTLB notifier + * + * @dev: the device + * @pasid: the pasid of the address space to watch + * @n: the notifier to initialize + * @fn: the callback to be installed + * @opaque: user pointer that can be used to store a state + */ +bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n, IOMMUNotify fn, + void* opaque); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * --=20 2.45.1