From nobody Mon Nov 25 10:31:38 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=1716297309; cv=pass; d=zohomail.com; s=zohoarc; b=jCe2gWNpnUUc2uZ1CRV8DNrWUslGDXnqmXRYPMq0qiNn67iIS5KlOy/9uarv1iTau8ynyuQu6Ql7PkSRgjQcgtDVl47CiYvUdPc16usYLHWe8BBz1yLW129DS5PAussSdEL1feilvdda8EuV3/z7+YBoghmuIDFsNd4bu2Wyx9s= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716297309; 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=8GU03lMLg26o1svETtJlIBqEUa69Gidx+p5JjCEJw4o=; b=aDxrVIKpenqYtEmFoDAQ3Sj+ZTSsimkih+1gH5ART5gjEXVM5PRCCGJcDSXE2z1HiitqEpLyZCL/AaGjvxjo/cy6Bz1YcwNehdDz+1sX6i1WxorLn4Gm+OPwakyhyOKGawDJoCxtKOJWQEVaw5kJOID+tn3daAcnzWce6h8cE+E= 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 1716297309489806.7739984813168; Tue, 21 May 2024 06:15:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9PHo-00081T-3N; Tue, 21 May 2024 09:12:12 -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 1s9PHX-0007j4-Il for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:56 -0400 Received: from smarthost3.eviden.com ([80.78.11.84]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9PHV-0001ZU-9j for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:55 -0400 Received: from mail-dbaeur03lp2168.outbound.protection.outlook.com (HELO EUR03-DBA-obe.outbound.protection.outlook.com) ([104.47.51.168]) by smarthost3.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 15:11:47 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DB8PR07MB6249.eurprd07.prod.outlook.com (2603:10a6:10:140::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Tue, 21 May 2024 13:11:46 +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.7587.035; Tue, 21 May 2024 13:11:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1716297113; x=1747833113; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=8GU03lMLg26o1svETtJlIBqEUa69Gidx+p5JjCEJw4o=; b=pNYY1y+svE8M0v3ADhYd3OoSBY9IaXGN1ZNgVkpr11v/Nk2Z8ACgo1+6 uxjjOWmWh5YI2DevxVbcq28UfAu9g8wUUabakvhiktg/qWaHzdqFOtXqW 2jmaI1P26x0xt17MxSL5KML3Mwo3WnAH95si7H0ENs9BaH9ZQeA9m22HK E7RYXLhIlDBhyham9BEwkcOLd2TOpmV6KxaxS7SrQNH6DJueBbh1d1clS Cb2Ent2Zl2FZTbwWCQfWG8Oqv26OyfW3Sg2TEVxHmpNk1w9dtBRJQw7JN +FVH1E8+xskNPx4NMjdKxpVjyzeoydHzFkfAgNdEMGVbR3lT8jNZYMSZK g==; X-IronPort-AV: E=Sophos;i="6.08,177,1712613600"; d="scan'208";a="13008001" X-MGA-submission: =?us-ascii?q?MDG9qdn3Uyn/Y7UYQZwolynDeoy6s57ew4fIME?= =?us-ascii?q?rye0JCeA64twQk2W96vDNTdcaBh5X5e/C521o3x6/8j1UlEoeZ4tNz4q?= =?us-ascii?q?yqbebNeBsADuFBkgkQ3+xVsaApJjpNnfOYV1+dJYlrSl1FCY85yd3aNo?= =?us-ascii?q?kIwxQk2JSMVnpyzFUZKgYjyg=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XONUUh3ILGm9RX0Fq6QAv2u4BKP5VIbl/zqY82nijyZJyjVq9kMLgANPuaEgqn+a5aC3n3IYuKaCxx9ylTpaqxZNBFistEF8chFhCEY91S8npzGha72c0q4JqYXu/NKKKqa4rzgC+NA9Ov+ME+caQyQYy8viOfHI53iYHeYkfcEPbXGl8vqapjc/vhjfxqG5cMdHoyXjKJgRmppiyUnDccSsWASYahSRLdFQUt2skyi7JEm9pgHmyEN9izSIPr/21FQSy/ohUDOfZispv03Cvj/jtsTHqTcSnLIiuRDhJ1j2KuFKediZcoM3pFFjhWRhE+xS5sCbimTbvbWghN1jkQ== 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=8GU03lMLg26o1svETtJlIBqEUa69Gidx+p5JjCEJw4o=; b=f6js85/VWNiG164qr4NV0QxstjR5ftbav/Yxztd7l+BqSwGCLcaGfRUe+WuU0hdBik9gfH/NJQ9NDB2es5GY47grUnDKT/uS3+U2h3FinoQIXBSNttnr17mafZre6V7vc6H4P4aLQ4sWwSxThwJ2M5V+8EdRK8fvqYqCGUsUiCRTQ0liMATZBh+K3ktd2zGL0BKzSBqWurKYncztwmgCfUnP7F0bEBFIE9ZqZ+ojjePHRUWP8owBbC4y7UeRLNchRGHWMjS2YXM5O85Xw5VQzRBSHZUyBjTuVswPOAK8TKLKg0MgvAwEbRiUaffwDs5yE0mxmcH/3JPsxEFCcv2S2Q== 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 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" , CLEMENT MATHIEU--DRIF Subject: [PATCH ats_vtd 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Topic: [PATCH ats_vtd 12/22] pci: add a pci-level initialization function for iommu notifiers Thread-Index: AQHaq4BuIH0I4A4DJUyHT8GkQmNaSw== Date: Tue, 21 May 2024 13:11:46 +0000 Message-ID: <20240521130946.117849-13-clement.mathieu--drif@eviden.com> References: <20240521130946.117849-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20240521130946.117849-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_|DB8PR07MB6249:EE_ x-ms-office365-filtering-correlation-id: 74c113ac-ce04-4578-13e8-08dc79979122 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|366007|1800799015|376005|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?YTRsZTJlWEMrUER0NUowQzQ5SSsySXM5MUdhNXlJU3M5Zm9SS3FjdktJdjFI?= =?utf-8?B?RlVoRFd1MkFLOWVuTjFNcHpVWlZ6d2lTVVA3Y2FrRml3VWIwaUNaNTNlOVNa?= =?utf-8?B?dmIvVGpIdTdsaEREeXRiUTF2aXB5UTdEMTA3NVJocEF0TDRDVGFURFh1Y1dv?= =?utf-8?B?ZzdmVjd5dXV2WkQwcmQyWGNTV084Tm5yQjVVbVMvNVlGdHR3N2oveUlGZHR4?= =?utf-8?B?OTk3UFpncGtRcGNtMlhKNEVLRFZWY3JpSGswR2Q1KzBwSjJEcktiWGJ3VkJk?= =?utf-8?B?VVlaU2puQ0dEQnNjRnc5WTdJMk9CSUdsTVBVaVlWd2pPMUZZL3Faa0dId1Zm?= =?utf-8?B?U3Vmd21jc2Q2dnZjL0FpNGZIWThVdzVzK2Fqam1rSVp3MzBBY0F1blZQWVN5?= =?utf-8?B?MDkrZVFKSU1tQmlUbTM1NGRkNUhsbjVsdm5VbVpVOXkyRTFlaTRzT2ZCQklE?= =?utf-8?B?NWM4YUxtTXdwNERBTGN6TUN5c0VCdXBLMld6OXRLMm00YkxQZG1lYVhud2RM?= =?utf-8?B?KzEzaDNaYWNRcXdUY0NhVWEvMGp1UDdERThrcVBwSmg5SlRrbWh6S0ZoNkNT?= =?utf-8?B?TEg0OXk3T3pBUWNKbEJCa3UyQVQ1K1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B?cldteVByOXZncHdITzlqRldvWFpQdEo4ZHNiYVAvRzNWMVlqR1VsZTI3cTZR?= =?utf-8?B?K21xYzZ3OFNEbzA5aFJvb3JrQnlrTkFlU2c3YzRDYVFIck9RdjZaRjNLNGxT?= =?utf-8?B?aHF4VDV3cHdQNktPR0RkNWVZVGs4bUY1YnR5Nkx3VEx4ZW1XMGpNZ1dkcGtp?= =?utf-8?B?WE1PRnl2b2VYVklkTUVZUHpCQUo1SlpqRGUyenQxTGQzek9Yc2loUmJwQzFs?= =?utf-8?B?cTh0RUM4VzBydHFIenNINEdpTTdydmpsS2lGTWxMNWtZV2NhMTZweHFGeVhj?= =?utf-8?B?TGZKVTdVbnZ5cCtkVCsrZz09?= 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)(366007)(1800799015)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?OWdRMmx6TENVb056TVFySGVFYldPZkI2b2hvL2RkcTl6YXFiOWh1aWlRaW9t?= =?utf-8?B?KzJSWjBhSktPZTNoMThBTlRTcFNWU0tUaitvN2JWaGlTWlNEeTl3YTBkY0xo?= =?utf-8?B?VHg3dUQrQnd1cSthbkNSN2VNTE4rb3JEakdUVWJ1MEVSdDIxNWNyV09IbFc5?= =?utf-8?B?UkJKV1d1V1N5YXpHTHlwVjRBdkhyR3R0bStxekVDV0NSMjN4S01tai9GMnZ5?= =?utf-8?B?TGEyYVYzcFROZnhmdkUzRkVVVHJJdVN0NFJNNW9YRXAraE9vUHFScTd4azVp?= =?utf-8?B?NjlDb1VFY2V6SjQ5UW9CVGFFVENUNVJtMDVoK1FGeHhLTFNiSkZVTS9Nc0o2?= =?utf-8?B?ZExCZzkrZGRMYzE0QVJVcjZjejd4NGVGQTNsL2h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aalqXE=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <81569FAB2078DC4D84B676C8B7C99CFA@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: 74c113ac-ce04-4578-13e8-08dc79979122 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2024 13:11:46.1263 (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: 5wVz3ykZjwVZRfeQli12TkNPKeKzWlyc2pN8GWYnaARcYjCJy8xJQcXqNtvmPKH2aEm9MDWB22+2duFHXNJz/FiVdkGVRlHf587rbNj//AikAkTwuHuzmWYkW09phvDq X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR07MB6249 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.84; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost3.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 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: 1716297311192100001 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.44.0