From nobody Mon Nov 25 09:24:09 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=1716297194; cv=pass; d=zohomail.com; s=zohoarc; b=fyDN6XhFtaLpgf1iImXcR1LU4yG0SERmIks0mTROK98FNXmRZ2Z5PSup8zOVdHFZm0YSAab59uMEmcoQM8cnmYzsLjr8d5CvwDM+rl0UAnfPxNOYrqiny4oqP7ZpvW0nBzk5u+iIh40Ra8l1VdvmhsbN417505iugAJf2HGgWA8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716297194; 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=lokuilwH5N8vJsvnP4ToLvsgvaPjW/Dc0GK83AImbMY=; b=cGMgIMpqJjth2OPuOVJRx4iumraWO5TtrkCjR7R5Xe5ygwEDUVTDKCOsLfGhOWUZ+gGAU+qADaQFFE/W8wV80HsGVxwmQQtivKXjSCdwgtxUTgxaY74/tQoqbAHmsL+hJlYK8VWJ4020R1ksVeopuFTzOpFjQgtQ7M6D2+Yf2iQ= 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 1716297194970225.82161545117674; Tue, 21 May 2024 06:13:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9PIB-0000E5-Cg; Tue, 21 May 2024 09:12:35 -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 1s9PHZ-0007kZ-Q6 for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:59 -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 1s9PHW-0001aH-Tm for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:57 -0400 Received: from mail-dbaeur03lp2169.outbound.protection.outlook.com (HELO EUR03-DBA-obe.outbound.protection.outlook.com) ([104.47.51.169]) by smarthost4.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 15:11:54 +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:52 +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:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1716297115; x=1747833115; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=lokuilwH5N8vJsvnP4ToLvsgvaPjW/Dc0GK83AImbMY=; b=wsLVx3XrXhLo2oqHonW9iidFHrYBTcFbnbSngd7hjmqVt/xNVZc2ejO4 bodveJuqsW35tkGDeDvdS62+vYlAcHP+g8nXmFPz8XS+34dqZW43rUTnN HAM7wwlOHQXocz+n3IDgdyYY5TU1oDIhKf7G8cotR86eQnvRuT9oZ3OiD JLg4m+M52EL0vXCDLydziRCGhnKIwhdBwZdakmRlyliUP9z/JD8CVNbXJ M4kikbt5BBlszrZKGc2cP2Anj5ZCA6KvNXxpVJpCxg+3BxcOxCiAKRELl c1P50M01D4l1b7taz4BHgDDLT3xl7XtQDLZyTP5B2LkNHVKg0LQJE8cy6 w==; X-IronPort-AV: E=Sophos;i="6.08,177,1712613600"; d="scan'208";a="13061517" X-MGA-submission: =?us-ascii?q?MDGLs7tvvTd7BKGXP6TYAai9RNVbUU9xeHDbT1?= =?us-ascii?q?reEOCzq9fGgNqyZOK7BA3NTrYZZ0wKAhPg4SIJWAtiql9QcVEqxa6cxj?= =?us-ascii?q?0a0zsVx2fDfUpmN2uZYM6wfSEK7jSMJ0HxVagJaLNBVGYBLwsyjcmRGS?= =?us-ascii?q?1dFKbFgncBRLMjEUmvS8e1Tw=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DS4PnH0y94wIWUHIDxW3Xn0vsL7WdDCQDh4TCgJqtvK5E5FbpzzUu4e40172t+aY6m8hfEE/MtjJbhb+ju7xygrzajX5zxERs3Ve0ha82njzqV4GWUtxDtjnb63BsJM3JMZmYIGJY/y9c0AzawTBE4vjs64oPcXXiMt3Hl1YiZbi7kBCPa83wz9DUjvmBNuthLRHCnf09P7LnwnP71cn7FQLkxUdSHfXUjfNZbsoRh1Q6sPTXeU1202cEqhq0oXyIJd0BFt1E39ysr2SYszfjaFMnv/oBoeJMAIPC4SUepL94OssaJSEndaI6qu5lgiowEKdf8dJA5shS87jWVlxEA== 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=lokuilwH5N8vJsvnP4ToLvsgvaPjW/Dc0GK83AImbMY=; b=aOB/hhAMRAvgsfuFF/d+1bgMJ1MJH1AreRF5/m6ihEzr42HwaFpuB16FUqNbEj2o+rBitIDxU27QSOCJPqhlHXBikQdhz9+Lp/Mn0L2l9HFT5uKA1r0ENkqScPyutLDDMi8TxzKIbpoYKYBiuSWQ9VSVnlqswCgwSj2x3pvLdYkkbE4iVcyuI7GXUfy4IDIqYgTMk3NqgVLDJeZtgajoEWrfrf1EEV5jPtsb9QQ1UFw+ZzNeMswrDBY+foHm+91Qs2eMDmaJoz+/4bF2yUVI+LooJfkDpUGD4Tf4dUk+D6YLDF5Iu0pNDbpEGVTSwfb2Dev0u3z0wvQNHWYrWsvxcA== 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 20/22] pci: add a pci-level API for ATS Thread-Topic: [PATCH ats_vtd 20/22] pci: add a pci-level API for ATS Thread-Index: AQHaq4ByZz976K1p+kGzAFoHDNZtkQ== Date: Tue, 21 May 2024 13:11:52 +0000 Message-ID: <20240521130946.117849-21-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: 6ad381df-f401-4ee7-6619-08dc79979517 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?cFJSOTczNUNFTzZWQWZPOVdGRDdRbkZYTGlaZ0lXbFhMdEJUc2F2ZmtnaXBL?= =?utf-8?B?SXZncTFzM2FWOVNNMGxLN1k3OUwrNmMzRXZpS2FmWlFvbnJHQm4wLzF5ejBl?= =?utf-8?B?YmVTSy9IL2N5VjVDU3crdjRwOWs2eU4wUnhCeXJ2YXhOT1NYUVlNYkRWSEN0?= =?utf-8?B?OGFjSmxJQzVRbTl5NFkrZDNFcStxeFNEYnVocjg3QnpUOFJqNkZDVFBRbm41?= =?utf-8?B?YnhoWS9tQlZOU3dJVTdZNkppTitNR3NudXd3bVc3Nm9Eb095YXVaWkFaK1lG?= =?utf-8?B?RmdtTkMyeTN1SE1Xci9XMHZkam51VmxDZEhKM2RpSCtvY2xSQnZXczRmQ0Fw?= =?utf-8?B?T2VzTWRVdmJnTDBtVUp4U3BnZVlTSzFqWTlqTlg5VlFGRzZYeHhJNU9oVGNE?= =?utf-8?B?YXVUK3pEWHFiRkpGbnNKMHJQQy9neTRjYWFjSzdMdHJiQm5raHI1Y0JHWGFt?= =?utf-8?B?OXltTEZJZlUrdHZTVXhEOU5JK0JFMG9iV29NendqekxMckxDcmRHRXZUOWtC?= =?utf-8?B?UUJrc3ZpQ3pwZFZnRm9jdXRIaUZUcXhmVU5Qbmc4bGZtOHJ4SGcvczQrRThM?= =?utf-8?B?MHlFdXFNNjQyZ1oz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xSXZx?= =?utf-8?B?R3l2RTJpVDl4Z3pERmVpT0J0RjBycmQybm9raDhBMk45WGNTbWtCSlJLSURv?= =?utf-8?B?ZnRXbmRBK0pSaDIyVVpEQjlOZ1pXZEFXcFJpMkZnbVZtbk4rRC85MGRmTHRO?= =?utf-8?B?UU9jK0NXcElycUxXRDVOdEVydXp3RGhib2R0cTlrdjF2L1JTWkV1NjBYV0I1?= =?utf-8?B?aVY5QjU4Sm5OWWVCYW9PN3p2U0hVOUczekZFbGJsRWdrUWRzQXArWEpXOERP?= =?utf-8?B?endmdms4eWp4Z3MyYzk2R3dWVGw0bVhDMW5BeCtibm10cXltaHJmb1M5c1Iz?= =?utf-8?B?OXc1TzZIUWZZSXhPVUJtUT09?= 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?YmZaRlRzR0tmbnpjelpSM083eEdSdTk4VzZMWjNudkFGVEliM0NwdDZoZzM4?= =?utf-8?B?T2NONUpkTHJSaGQ2UXVjNDdmR2E5dURGQ1VjcHVpT3lpWklkOUdPYlhVY1hW?= =?utf-8?B?TjZTVWYxK09oY21UcGYwWCtqdC9IaUx3NVB5SjJnaG1PTGo4S09jN005U1JF?= =?utf-8?B?WklyT2dBdnFJY2FWb3AxWFYxZkRwN2xIVERab3ZUa0hyRCtNazVyNUpiWXFH?= =?utf-8?B?cmpkOUpzZ1JTQndFZFZjbGFaNXVCSlVoY1VCc3ZFY1lEbmxLcndRSEpwdVor?= =?utf-8?B?Y05YZ3BHTHJrYkVlUFVPSm16QUZQVnhIRWdMSWo1SFBnZElKamc0VlFhbGJI?= =?utf-8?B?K2NhU0ZKRzFyd0VQSGp4K3ozVlM5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c3Nm?= =?utf-8?Q?FDxvXApESLoTZNaQTqMFlTM=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <8D2A294620C75A45B134EF95D29AABD2@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: 6ad381df-f401-4ee7-6619-08dc79979517 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2024 13:11:52.7918 (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: LOiCMTB7iiKb8kolVJhmaSOMTPYMqNI6SVlSuTNtjWFSvd23x/OnpMXzZXr9XB9E/ecg1dl3PqwOUscRTo0UbAM/AT6I8Y6JKlSUIJnm7B4ds7vOTOYJaNl0JonKVTyh 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.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 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: 1716297196611100010 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.44.0