From nobody Mon Nov 25 08:00:49 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=1717394517; cv=pass; d=zohomail.com; s=zohoarc; b=Ddu8y4mIszCES/pnPL+8GNN+yIMiyooEuvl0N0LIaNAWBfIeqejfclr0egt7SYzrkyyv9xzA6Z/RKT/i3Cq9qyn2V5DcQQEjQQgGrRvpAhVOWG9Dub1rb4D2QCQRJHkvEKCbY98qjzLSidLc9YqEAZDqoj/TOM3/l5yMBN5UPuU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394517; 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=hR/AIuvVmxZVWbQF+Nw4Kp67eIdKRUUMQcRjcy8BUcwSnSg4cJ/GSBUegY9lJTiYab0V4Og+LhrHZaY87aYJQf/L32YDz30AJvyKzpVmdpFXKeSzaCHjQpi4k4LzGDmjNymLuQini99AnbOTyshQ+qKRTgt5Ghk4XChAM2AvQJc= 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 1717394517337580.08310125604; Sun, 2 Jun 2024 23:01:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0jq-0006qj-QM; Mon, 03 Jun 2024 02:00:10 -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 1sE0jn-0006oq-LI for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:09 -0400 Received: from smarthost4.eviden.com ([80.78.11.85]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sE0ji-00071B-DE for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:07 -0400 Received: from mail-vi1eur02lp2041.outbound.protection.outlook.com (HELO EUR02-VI1-obe.outbound.protection.outlook.com) ([104.47.11.41]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2024 07:59:55 +0200 Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by AM8PR07MB8192.eurprd07.prod.outlook.com (2603:10a6:20b:323::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.25; Mon, 3 Jun 2024 05:59:53 +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:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394402; x=1748930402; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=sa7h+GYSzQcpRashY1+231sKn3MT9hqdcq4lcrWYtvzEv0PNLznlyE8E NxVk0GIiz1Eh3s3d13j3ylqvvelFaDZeEljLYWzbjlpyrUbMHT9VcmHgU 15aoicW2K3p4N7/btplpiNnW1Mz72L+LxcTowOO/tJOI6eTVn9tepoR2g 3dzVvyNWkbzUjigHB1lWrJsPlVd/T4PE4Wz7LnlQ7DP4FxcNV6M9q7Q/1 TyMiWoq4nM+FVGFTyr4q0sqHECPnHxqUquG/dDimkdXLeZ08Klio3bvlT pP6k8nH2skDg7qhRY4+3ESYMRblAKUJU6hh4GGKySCAFF/EPIQKu+8WUJ Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815890" X-MGA-submission: =?us-ascii?q?MDG+EJthOwb2PohCC+um530FvvMiF5mgbkxk0f?= =?us-ascii?q?ie/XrQhZQNUGCCzLKwh4OYzC8jYf9+xCa+anXeeSsQ51sVHBX10Fk+yp?= =?us-ascii?q?trDLVmjmm0kjjovVJFEkQn3MS2pdv2i0Q3rM+GqGh3EQEWmCEqRgr38d?= =?us-ascii?q?oNGQxHZjHp/co65zyneX4kuA=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKDbkDko1A2bzBomWKQl7LyAIOjXyV4zI9weQ4Q2MoMVuVW7JBsklgEHelF3wUXu6ojzHNHFNSPFHfFK/qkcn5rmhv+2OC50oOhbaFMYPif63qqBydcHAxNGFL2SN8PD2iHZdimi3P6Al0CPMk62C8EYgmZ0hXdSK6Nnajuy7Lin4n/K6Prym0k72KK+65zL4aywPBbQkcW9y+P8gDp5iXj1rT9GB2Hc/gnr/Wp3rADdAXb1VTWFyBvZUe7d3ny8AsEICfJ6nsXaHwN9Ah+ut/joQr0dHE2Gh+0OzZOtlCeUIvvWC7WVQPt3PenilenQ18vPk4xEHAk1JKHXAxAOMA== 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=baJBP7cfPGt3bM4L5sGMirw8bpR1SZYm75mGK+MXxyvt7G0nz1MeqgrzBVVQYECB3Q9fyoUwtdSPaQa2OJzV/jAgT/ffoGobPZE6bhjQuJaJRjUde5cfm+iPEFpUwNh5F4zcJwS+SSQ3D7KM3M4C+grIWRnwWBbUk9SbXaQNIasf9Azv4QeafWltBKoGZmDC+HZpNu7qxRwPwEZ3fjdcytpfbz79raVCRGOGt3N+L9EV40p1iyR+4wZv5VeHRFvjH72WF6PT4QxNgK4zinBlmZ0plD9Yl0tg+k+XHGsuL9l03yc3s+LO7WOB61Y3PWEsHHUVnuC231vOGQ7k62itbg== 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=4eokjYkt7nIttPX3M6XueVLBousvJ2ZkPb0CEz6nEXc=; b=ItikILNt/r0S+WZ+q+S/SSoH3Ot+16jj0XcvflnEwVWVHYvCBgE7g6oKdms68Xbd6kQNdSye9XIDkXBvNOmigdqfoogdvNw0k5HVEkLAFX4iVxWlk7FJEGOfYflHuTNGIgZJBUFpbomIgAdp2ikJ63gXZ+iux5+AaFF7BwE0AB54OgL4p3oGgCutTdzzbNtAYH1i6LFq8d/Vv6AYbPHbFz0Rb09BAxersmH3MQfI4oYbMIZLgZa/SqFGBLHgkIJWffylr2d+x0MVJvXDrtuCAIyGyaxwAELytDE+03tIQqGyfHtunrZMahriouuwGslcThdxx9bIH1JB8eLDNtQ2Zw== 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 20/22] pci: add a pci-level API for ATS Thread-Topic: [PATCH ats_vtd v5 20/22] pci: add a pci-level API for ATS Thread-Index: AQHatXtBWfzK4X3MW0619Cac8t7GQQ== Date: Mon, 3 Jun 2024 05:59:53 +0000 Message-ID: <20240603055917.18735-21-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_|AM8PR07MB8192:EE_ x-ms-office365-filtering-correlation-id: dc3b9bbd-e9a1-4fb1-addd-08dc8392638d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|1800799015|366007|38070700009; x-microsoft-antispam-message-info: =?utf-8?B?M1cvY3ZRRFdhSi9VODFiaDNpSldLbmlybHIya0ZCbHRvTHZJMHN3eGlLbVdI?= =?utf-8?B?Qy85K1RFUWhFbktXMDVKUlZLbGN5YTd6NXZLTS9CT2Q4RG9IU3ZJVlFIcVV0?= =?utf-8?B?S25JRm44SG1wU2hvSWg5MTBsd0dEYk5NMVlxQU9waGh2OGRzNG9XcXlsaXBW?= =?utf-8?B?THllNmluQjY0bFFw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?B?bUx3SitoNjFuQ2syU2t4OE1DWFhLcFhmSm1xZGdvalRTQ002T25qL0FSOEds?= =?utf-8?B?MnVkU25ESFZWMXVLQ3hFZjArLzcxSHN5clJxc1E3cXJ1ODZSMlI5ZDU4MURu?= =?utf-8?B?Z280TUNTVEtKZ1creGhJZ0pFdUp2dmdzYktjTm44dUVlM2VGYzZ6cEsxQWVx?= =?utf-8?B?UkRxMWVaVW1Ib2dFcGpNRzZ6ZFFLVTI3LzFoM29Ga2ZvRnk2ZnNwaC9tT1Bs?= =?utf-8?B?aWMwbHY4UGNtVktRYmU2QzJFcW5PZTBlNm1RMkpJMUh4b0hZM0ROU0JTbzlV?= =?utf-8?B?L3JOOTdwU29jWEJEVjJ3UW9Ta0IxQU1TREo1S2t0amtBMjhLNjQ2dGJMNWpq?= =?utf-8?B?endkNzRnQkRzY0p2a1hSUW10OWZRRlFjY05oblFBZTBsK0l4SlFGbUVSaDBV?= =?utf-8?B?M0tWcmNNbmM3WlI4WGFUZWdjeDR2L0xqaXRwQm5CMWVLWk83TWpzbDFwaE5J?= =?utf-8?B?Z3I5cy9MN3NYczgwQnd2MlpxQzZJNFFObWhGVnNkd2RsMlgybEkrUkFTNThx?= =?utf-8?B?dWRMc0ZiK0FHUCtJRVlOWE94c1dLby8wOWVqenE2V0xVNzN0K2t3bFFRWTNi?= =?utf-8?B?aGlYSVAxYTc0TmpUZGxQeVhhSUYvZlplVzFIS2h2alhYdlgxOVltUFVFUW5p?= =?utf-8?B?OHVNdDNWOUFSaGl4TXBqaU9kNjFuRWIxUjBKOTc1Z0s3dllodFlCd2ZoNWUx?= =?utf-8?B?WXI5QlFHaERidFZ1NURDZz09?= 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)(1800799015)(366007)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-mess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VkwrN3Jz?= =?utf-8?B?OVlSdVd2Q25hNmlMcXN2dHZzOVZoVEd5eDJXa0VhQzNjUk11VmErM2ZEazdW?= =?utf-8?B?WnFmVVVKNGdWTzFBbXVMODVabXBIZ1ZhcU5FN0VYSWJwRG9oSkoxeUdKQnV4?= =?utf-8?B?VnZlS3hraFE3cmRMd3F3M0dIYzB1elZKL0UwbVUwT3M1TXBhT0RIVDdEZlQ4?= =?utf-8?B?SjB0UkRrM1E5eXdMQlkrdTEvWmtqcXVmTmk0YVIxa3UrZ2diRTNHNzJ4SStG?= =?utf-8?B?SkN3alVQNS9FN24wN1RtUFM2VWlTczgwVGU5YVlyTXg5YWxUbWxmK2R3NDl1?= =?utf-8?B?VGpGL3YzMllQY2FOdThCN1ZrZjFvUGcrU2pYL0ZHVWdMT0w3ZzdTelVRdXdH?= =?utf-8?B?NURTbjZTQXFwOWZ3T0h5M2w2UWdFbEtwTkZVZllaR09DRmtJcXlKR2FhS01z?= =?utf-8?Q?v9QoEBHKIDM1f+rVvGxI1WQ=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <9AD7886A24DF7B4BA0ED300DEC7558B0@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: dc3b9bbd-e9a1-4fb1-addd-08dc8392638d X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:53.7936 (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: Da1YmndRksTMrJicfV5wVD31Ew6SC6+u+WTRCfFyT2Msbbyq1uGfWKVEU0zP3dIKPkMb1Ag1fRQ1bI8VH5sh/gniaIYxHjF4sH2qvz0bWM1Unu7bYqp7d286gFARHxw0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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.85; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost4.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: 1717394519007100001 From: Cl=C3=A9ment Mathieu--Drif Devices implementing ATS can send translation requests using pci_ats_request_translation_pasid. The invalidation events are sent back to the device using the iommu notifier managed with pci_register_iommu_tlb_event_notifier and pci_unregister_iommu_tlb_event_notifier Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/pci/pci.c | 44 +++++++++++++++++++++++++++++++++++++ include/hw/pci/pci.h | 52 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0e14ef4ab2..10b0708130 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2833,6 +2833,50 @@ void pci_device_unset_iommu_device(PCIDevice *dev) } } =20 +ssize_t pci_ats_request_translation_pasid(PCIDevice *dev, uint32_t pasid, + bool priv_req, bool exec_req, hw= addr addr, + size_t length, bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + assert(result_length); + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr || !pcie_ats_enabled(dev)) { + return -EPERM; + } + return memory_region_iommu_ats_request_translation(iommu_mr, priv_req, + exec_req, addr, len= gth, + no_write, result, + result_length, + err_count); +} + +int pci_register_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return -EPERM; + } + return memory_region_register_iommu_notifier(MEMORY_REGION(iommu_mr), = n, + &error_fatal); +} + +int pci_unregister_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n) +{ + IOMMUMemoryRegion *iommu_mr =3D pci_device_iommu_memory_region_pasid(d= ev, + pa= sid); + if (!iommu_mr) { + return -EPERM; + } + memory_region_unregister_iommu_notifier(MEMORY_REGION(iommu_mr), n); + return 0; +} + void pci_setup_iommu(PCIBus *bus, const PCIIOMMUOps *ops, void *opaque) { /* diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 2147981423..8adba6af97 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -473,6 +473,58 @@ bool pci_iommu_init_iotlb_notifier(PCIDevice *dev, uin= t32_t pasid, IOMMUNotifier *n, IOMMUNotify fn, void* opaque); =20 +/** + * pci_ats_request_translation_pasid: perform an ATS request + * + * Return the number of translations stored in @result in case of success, + * a negative error code otherwise. + * -ENOMEM is returned when the result buffer is not large enough to store + * all the translations + * + * @dev: the ATS-capable PCI device + * @pasid: the pasid of the address space in which the translation will be= made + * @priv_req: privileged mode bit (PASID TLP) + * @exec_req: execute request bit (PASID TLP) + * @addr: start address of the memory range to be translated + * @length: length of the memory range in bytes + * @no_write: request a read-only access translation (if supported by the = IOMMU) + * @result: buffer in which the TLB entries will be stored + * @result_length: result buffer length + * @err_count: number of untranslated subregions + */ +ssize_t pci_ats_request_translation_pasid(PCIDevice *dev, uint32_t pasid, + bool priv_req, bool exec_req, hw= addr addr, + size_t length, bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); + +/** + * pci_register_iommu_tlb_event_notifier: register a notifier for changes = to + * IOMMU translation entries in a specific address space. + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to get notified + * @pasid: the pasid of the address space to track + * @n: the notifier to register + */ +int pci_register_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + +/** + * pci_unregister_iommu_tlb_event_notifier: unregister a notifier that has= been + * registerd with pci_register_iommu_tlb_event_notifier + * + * Returns 0 on success, or a negative errno otherwise. + * + * @dev: the device that wants to unsubscribe + * @pasid: the pasid of the address space to be untracked + * @n: the notifier to unregister + */ +int pci_unregister_iommu_tlb_event_notifier(PCIDevice *dev, uint32_t pasid, + IOMMUNotifier *n); + /** * pci_setup_iommu: Initialize specific IOMMU handlers for a PCIBus * --=20 2.45.1