From nobody Mon Nov 25 09:35:53 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=JiHv+BwMkHqDakXkUOBXX1IDJSrRp9VUDvrUEncXtY+V6BAVeyVIt9BnNRFhlHvQRdWW7XrPxUJe2eENzpdR/8v9dVDpQxfOYPGMZP/oDkhmdCWL/HuIUkCqUQWKxiOn5u0pGSXnZvhSYZqZLAUDz3WZ6TkP/mbRmpujat5BQoU= 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=0dE/fO+DHZfygGNvv8Lx3q8Dt93nwgJmL7gxtEqEPQA=; b=h0ypLXlNHkneul0/SvwZiSII9QDCMQWbrOvIcGS8X0KuV8SBAaPBMhbJWTDbQMCxCjEOEw9+SyKy4kriJtfvKymE39SmzmJN3JOB9qSai+RcfWWGIyKFRA7OJE7GezNYDTRWqlNkn1BgO3HLKP/7AaRW0q6Wlb1Cj8ac+oXaV8g= 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 171629719472572.49056192506953; 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 1s9PHq-00083X-4o; Tue, 21 May 2024 09:12:14 -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-0007kW-IM for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:58 -0400 Received: from smarthost1.eviden.com ([80.78.11.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s9PHW-0001by-NO for qemu-devel@nongnu.org; Tue, 21 May 2024 09:11:56 -0400 Received: from mail-dbaeur03lp2169.outbound.protection.outlook.com (HELO EUR03-DBA-obe.outbound.protection.outlook.com) ([104.47.51.169]) by smarthost1.eviden.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2024 15:11:53 +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:51 +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:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1716297114; x=1747833114; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=0dE/fO+DHZfygGNvv8Lx3q8Dt93nwgJmL7gxtEqEPQA=; b=c/j4I7bhSuKLF1i38R74cJRFh3GpVRhdvwCnCK9o+WWv/0O9vhuzHY9y yoRVP/cFcfFGam4Ri5vklY5sOtJ/JV5CaYDOvx/ebx1JGUneP2tNXwnhh 6rRO/ZGE+01xApFSB2d6P33/eAoahgI/jFasPfHS9WiEY60QcRKuu5vM+ P7GWeuuoSGYmSVan6HO/HIMp2iJEZtY4cFXmXeqvMZLUvMx0Uy4w4mJWb M0xU3Hsn/HJx67ExTS5ztbBUCrkjVXgRpcxkLhJD2ohldcNIkmr+wAGwJ Gr2KrL3F5lLPmWND7sV6GlCny/UxA1ek+DIZLF6Gv1n5FIXBk47NzylRl A==; X-IronPort-AV: E=Sophos;i="6.08,177,1712613600"; d="scan'208";a="13004111" X-MGA-submission: =?us-ascii?q?MDGq8+OYkkOKG5+DJmqOPG8PEpenaY6pYbuyD+?= =?us-ascii?q?Ap6RQ2Hbe+2Q1ANRCkLmb2Iu7V73i0SCtWFjYKT0JIwcP5cCo3kPzB6U?= =?us-ascii?q?7aQV5tGS/a9qkjjEAlp8sBVvEtHGzSC0a4AMxSsAV/I/FPVuVi98/V/S?= =?us-ascii?q?OvtFqCzvjPi34uxL1cu0HK2g=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=So5HxPW4MaavwqEFJLCKCVhkGx790Wydd2gPOBXv2iRlLwy/Uwn1+dtavxtJyfivf2SvGdUvXQcbYcxdjho+tmOVP+yZc9gtg8IX2MICIKawH3TrrNzGsbGDgWOi0EL8QSNOAbQMCvVEioRLdwuVsmalVMzhyTBIyNSJUKhLQ5Pqj/9qyNUkr4HMGj0LDFGIEDNqqzV0PHrKG1YltAkkMnvgSGrToZUEkAr4vDZ8+NWdZWfMaevLYT7AM4yin5vU/gi0xhFYVp7ZKIe/L7xSWbk7eunl9UtfGzjJCnuUhrw5/gc93kTLjqQXhwrLx3vwmPsY0xn+4U29FF/JKKFpWw== 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=0dE/fO+DHZfygGNvv8Lx3q8Dt93nwgJmL7gxtEqEPQA=; b=XafJC83IpvbcXr/Bhq3DO2/9fu5mIwktaT/cWExmqfFhDHqhYC3daaxXKqwh2qaHi0AlSMZKlM0NL8Tg6nDLowPkftm2tOqUsIoEYl0Q2zAb6mEqa5qR5Dg6v0cfF79zuI4Yd7LTlXszdSaJ9Bg5BPw08x/ktufRLRhH6rQMNEURdkvpNffs+Ts5NkYs0kbrs3JSxv9+jZ1K5HXx74ePNdsm3EeYD+Tgq0/nJRzmzXVZMlMeur2hqACEmfqo6xksgaDP6d3FSv2GfMJDNU+Gf66N7Ya2WMadTFkSzA+60zRx3xtguMl5hxR3zH0fdFDigXz5OItgcVWWFsNkHbgWIQ== 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 19/22] memory: add an API for ATS support Thread-Topic: [PATCH ats_vtd 19/22] memory: add an API for ATS support Thread-Index: AQHaq4By7GJRtLEAU06I3NQX0IDNRg== Date: Tue, 21 May 2024 13:11:51 +0000 Message-ID: <20240521130946.117849-20-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: 123c417a-4e6a-48a1-e56b-08dc79979491 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?dVFLZVdrc0hwMWFTWHlFcXNEY1pNSmpmNEU3d2FZMXZ6WForend2NzNKWTRw?= =?utf-8?B?TWFMdlpHNXVjME40VUViZ0NpczZ1RHF0aVloVjJHQ3U3WlY5UUZFeENPVytp?= =?utf-8?B?cUZJNndYSlc5TEN5ak9aMXI5SWVWSy82NTlQdkl6cCtLQk52Y1RuQnRVZS9a?= =?utf-8?B?bVl6OTh2U240c29PU0xwY1NwcklXNjhwWXBwY1BpalFRVlBPZkNESStoVzJs?= =?utf-8?B?dmZ5NndjZHZMRnl2eHN4OThqckJQYTF3YlM2WlMrTk1oampnVnRuRTNJN0hW?= =?utf-8?B?SlVwTFlGY0dFZmRqWEwxWmFTTEk2aFFRekdRMmVmZ2RCUEZkS2w2Z0dOdmJF?= =?utf-8?B?ZUxSTkFHM2NPTVhOeWc2ZGRUZUI5dDgxcCtYd3FhL280UWcvMnFaUWFka09i?= =?utf-8?B?MWowTU5oT2lsOFo4QzVveDQyQU0zRU50M2R1K0RzcFB5UDhaZ1NiU1JXVW9I?= =?utf-8?B?N090ZzJiVkNReWVtZHpwRXZ6VW9RRy93UDZ6NlFKM28wQXlMV0ExNTBPemds?= =?utf-8?B?VXhnQmVQTkFzaGtYOGRKQkl3UDFCREhuUXZGZmNjb3FkL09tRm81Yk5keW1U?= =?utf-8?B?U0hBODlha0d4anB1NGVh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-8?B?bzIrajhRQ1VVQ0pYNWJMQnNmNkE0S0xUSGtlak1tdmc3a2NGcDloZ3pBSUhQ?= =?utf-8?B?UFo2OE0yNGVqMThSRTF0MUlIYUZOa0N6cS9lU2RqZVNLL2k1alBxOXh5WnJ3?= =?utf-8?B?d0ZsemJHSkxrSXpHQjFzdFBKTDhmdkQyeGU5TTU1TFN6OEdVZDdqdWdpWWpF?= =?utf-8?B?SnFZSVByMVR0ZmE3djdMbVF5UHpaVDd0dzVRSUhJUFZRcGovcWxrbGdycXpK?= =?utf-8?B?bkV2THJjMGJ0L3lpODM2aFhRUERBenJYU3R0dEFIdG1TdUlNWVlZRE9RV3py?= =?utf-8?B?emhLM1dENVlzVWNVa3Zhdz09?= 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?WkY1c2tzaUFTeEo0Z0FMWVBSVjRSNEV2MkNKYkJZUEFJazV3Rk5vcXRzdHBD?= =?utf-8?B?MmtDcDhORlBZaXB5RU42QnpVbmhPVTVGaG5hcU9NQ3FqQlA3aDBFZGdNVm1S?= =?utf-8?B?V2oyUmd2ZkFhZUNrVGM4UEx6RHRHbkxHc0dPeG1pTmZUZWFuV0NBaVovMTZi?= =?utf-8?B?SFVkcThZaUo1SHFjQlA2SXU5KzloNEFoRkFXRWlocVF5cHUvU1BOWEhHRnN2?= =?utf-8?B?Vk1HUU14MTNxN1A1d1RtZFpHUGJFWFhINEhMT3FSdmhUa1BkbDBUTitkUFdq?= =?utf-8?B?WCtSZHlCckNMRUM3NGZQZmJNZkpIWkdWcXU3aktqVFhRK2djM1pudjNaVjZI?= =?utf-8?B?eTNxL2FJYTU1UVFOZC9XWk51d2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FwnS9w3rZ5NYFGFkpKY=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: 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: 123c417a-4e6a-48a1-e56b-08dc79979491 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2024 13:11:51.9146 (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: IWoqWKhHDysmLTuizscQic5ySeyh82m5AzW6LBZl9bfGPcTsNGbEvDV8sR9kCL9fFts91szZzUex0abkVrxcOY8rp9Lvm4pJRgLBBaTQ28CDOgetutiAdY93lvot/0dn 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.82; envelope-from=clement.mathieu--drif@eviden.com; helo=smarthost1.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: 1716297196598100009 IOMMU have to implement iommu_ats_request_translation to support ATS. Devices can use IOMMU_TLB_ENTRY_TRANSLATION_ERROR to check the tlb entries returned by a translation request. Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- include/exec/memory.h | 26 ++++++++++++++++++++++++++ system/memory.c | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 56ef48780f..0ced7c33b1 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -148,6 +148,10 @@ struct IOMMUTLBEntry { uint32_t pasid; }; =20 +/* Check if an IOMMU TLB entry indicates a translation error */ +#define IOMMU_TLB_ENTRY_TRANSLATION_ERROR(entry) ((((entry)->perm) & IOMMU= _RW) \ + =3D=3D IOMMU_NONE) + /* * Bitmap for different IOMMUNotifier capabilities. Each notifier can * register with one or multiple IOMMU Notifier capability bit(s). @@ -571,6 +575,20 @@ struct IOMMUMemoryRegionClass { int (*iommu_set_iova_ranges)(IOMMUMemoryRegion *iommu, GList *iova_ranges, Error **errp); + + /** + * @iommu_ats_request_translation: + * This method must be implemented if the IOMMU has ATS enabled + * + * @see pci_ats_request_translation_pasid + */ + ssize_t (*iommu_ats_request_translation)(IOMMUMemoryRegion *iommu, + bool priv_req, bool exec_req, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); }; =20 typedef struct RamDiscardListener RamDiscardListener; @@ -1888,6 +1906,14 @@ void memory_region_iommu_replay(IOMMUMemoryRegion *i= ommu_mr, IOMMUNotifier *n); void memory_region_unregister_iommu_notifier(MemoryRegion *mr, IOMMUNotifier *n); =20 +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iom= mu_mr, + bool priv_req, bool exec_r= eq, + hwaddr addr, size_t length, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count); + /** * memory_region_iommu_get_attr: return an IOMMU attr if get_attr() is * defined on the IOMMU. diff --git a/system/memory.c b/system/memory.c index 49f1cb2c38..d9d66ae2e1 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2005,6 +2005,26 @@ void memory_region_unregister_iommu_notifier(MemoryR= egion *mr, memory_region_update_iommu_notify_flags(iommu_mr, NULL); } =20 +ssize_t memory_region_iommu_ats_request_translation(IOMMUMemoryRegion *iom= mu_mr, + bool priv_req, + bool exec_req, + hwaddr addr, size_t le= ngth, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUMemoryRegionClass *imrc =3D memory_region_get_iommu_class_nocheck= (iommu_mr); + + if (!imrc->iommu_ats_request_translation) { + return -ENODEV; + } + + return imrc->iommu_ats_request_translation(iommu_mr, priv_req, exec_re= q, + addr, length, no_write, res= ult, + result_length, err_count); +} + void memory_region_notify_iommu_one(IOMMUNotifier *notifier, IOMMUTLBEvent *event) { --=20 2.44.0