From nobody Mon Nov 25 08:02: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=1717394538; cv=pass; d=zohomail.com; s=zohoarc; b=D6qfw3azjTJ+1unI6GsXihrvtCQs1+KzzzPoHFXrAkbusg1x81DZ3+9qxz5gvrh5VmUWj9t5DuKhvSMRHYQrYWY3PO8Mo2MvyUkokJoe14O/b3zjvPKUqPQ4rOm5cUc9A2+J//oeiW1w26op5zDrfo8Nw+nf9mrJGdIj5hk2q3Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717394538; 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=OwQ3k/+gRDERcqMVYzSHBw1RO9me5bFm6JaZbGWf/2U2Fdmo8W1/e/CgnIZoo4EDDOAcmW2AgAJy68uHesa4TfRcNex0JcQ0s3nymTDfM5SlEeU0seE3hRngj70mh8BDx3IlBw3COOgAoQhaMoWQNZqkp7f6cruETCAyIJ981+c= 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 1717394538565615.1382684378465; Sun, 2 Jun 2024 23:02:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sE0k1-0006wm-3Y; Mon, 03 Jun 2024 02:00:21 -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 1sE0jz-0006v9-54 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:19 -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 1sE0jx-00071T-7Z for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:18 -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:56 +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:55 +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:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394417; x=1748930417; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=VfhILN9JaX3HmJIiiGPzp5W9rHdTQedknny/dHE7aDsT8hnVx6AC4YNx 2ifTRReGDqLhV2BCe96KsoLIR13oKGHg/rO3AQYNjViuN9AyEJNDk+sUQ PYOsijKxWDQJvZuuqm3A1Bvber8HVcE32dFuxwuyrkqL6atf+ie5gjjSf tgSvRlE7ob8JrvSyJFkBgr7/EHTqpGrlB/QKWIhFxeex4a1xS9Ln+Pmaj f0r/E5rD1ofFNmYpnbCh5X+WNd8JTBtCjvp80dZkE7bcrc8OlPZ293Nh/ aM23vhkuo46pqvzFirJNaGYkEynKUpFwgtvB9hGjyGb/y+Oq36Ht/HC1X w==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815892" X-MGA-submission: =?us-ascii?q?MDEChmrP99g/INWBO2XY1sgCHxeEV/KiqAxell?= =?us-ascii?q?Q6koXuX9T/M+mhJk3lpgc2+ffTSwFoJvBDS1z7IDFOjntZ3PKDhQBxFm?= =?us-ascii?q?8S6m2wWW3uCbTuELFnM6a6M3HKawDEsmH1fOa+VrFt2JxqC/0k84Ml7f?= =?us-ascii?q?lAP2nj9nUB04FXClUlNHF4+Q=3D=3D?= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fAFPidFNeuMP0ATQYweNjavejAtT4wOdEUivUQbDdllDHcY2I9w2x1T4y1MMbHYkHGz0OO6U7Vy2g6v5gAXITyxybm+ISS973BynU00OKyUsEHExjx7LgcZYTtYJqu3IQh3A1+SW8aBTF+ppt4yib+nVdZavQ+bRelL3M7wDr2E6P5c3+6freExlqs+cC6EjLvNxIOD6vEymhUZgsKxR0SBvwBXli0a7NQErp70gnd5LEVeHeuASB/C0aHwYhowP7NW/aKGNaZd16Z6r846/BX1IiVTTDS4Q5VF1vTVcX95g4UuF/BmD9sygTkGV7/IGX3h0TwjxcSoHNGgSGnsM5w== 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=TmlDkJotorBTBDG2rX2dI4goXFAOc+1jW3oE9MkQMxstyoZQvHJDaDgcKW7379r5JSmxYy7/SVxMQRq2UTpn4X9CtD1IfPknJ++15NKvwc4AaaaGst101dkvo2Q9N80Pm65yB0+QVAw56qxAIxK/63egK/Aep7AkJj0UD6OyesE3egzMSG15yURd3qfhnsbN4Vh1aQZ+qYo00xCy0OyWWLVKc7Q+lMbQksD4fT8+TDcNAjEqysPA9kTfhyHKsSIk6k/U8Ri97/ZG2bBrJK1EH6h2RRUUejGXgtDaWCklR7SwiZHzd0V73OcagM/X1wZ3KcmjGEWg8GDewO45apkbNg== 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=0lj8izfHYem3sgTsQJtxLtGdzGMHztq4df66p0nIbd0=; b=Y/KCOXre9s/dwJPiFOQeubG2FEQppvCQhRqxqw/ViAzM56dH0MOLpg6EQU5CiIFYJvZ9kBZ9socp4FLhWeSGizpS446ecvCYmkFmqpmL93Aq1eXlHusD/xXRUChahEdgI6F2Ix2IAMIOSKTYYH0v0AOkVVWYfec0QLogbiZpJi0pnXKYS38GzAEp+BMaAcmyJAoLzHzBbJMxsBwXZRplIcs0s1K9EkxTX3lefIwHEOx8CCox5lavGn1qX+UivNkA5QnnavEDFDPzZ7ql/Fq0rSExMAfCp7iySOKSLB3lCdZbQkIfgHA4ZXRgumSLrsAHOUcwcEz1rccQ11ieteBs5Q== 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 22/22] intel_iommu: add support for ATS Thread-Topic: [PATCH ats_vtd v5 22/22] intel_iommu: add support for ATS Thread-Index: AQHatXtByK+MPvyRxk6nyjnkNV88Ag== Date: Mon, 3 Jun 2024 05:59:55 +0000 Message-ID: <20240603055917.18735-23-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: eda0d791-07dc-4726-05fd-08dc83926469 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?dUhWUjd4QzdVQzRGQ2ZiYXM2NnhySlVia2p5cUJqS3p4Wk8xTEcrQ09jb0Zx?= =?utf-8?B?aGt6Z2FsckdHbkdWYlMySDVxVEVIUDNENjhqN2pZQUVUcDd2ek9oWk9IT0N6?= =?utf-8?B?UmZxWkZDZGtpbWI5L1F3dnJ5c0hydkZQZEdEaENvT0JmU2cwVW9zZnliN3Ri?= =?utf-8?B?WGJuaCt0dnFjcjY5TEF4eFJFd296blg1dlR4c0FRT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0xYaWd2N0JaM0VYam94M0dVa2tvZkJPTWEw?= =?utf-8?B?ODF6MGFpd0Zwc1AydGZ0QkU4T0I4VG5ucTY2VFFSajlwcm9IY3ZGTXdTRG0x?= =?utf-8?B?VWM1bVl4WmU2a2JvbXMvSjlyUDJkU3NYbHhqVE53anI4VUhpeERwdUo4YXBv?= =?utf-8?B?cE1FYjZ2YXhhR1lodHhCS1kxcG1ubjAvOXByTmV6dDRHVU1rM2NwdXZDQjVa?= =?utf-8?B?Z2R1dmFvTXhnUjVKZHRYNlZpTTRrbHF4ZDBNS0pMa1dvQ21lMDB6UWZOb01v?= =?utf-8?B?b01DOTFlemhsUjJSVXM0eHRUL2U5ek94cHNVWUlGbzgyVzE0T1A3SDkzZ2J4?= =?utf-8?B?YS9uc0hXV3o4QlgzbEtsSi9ubmdYS2NtU0FjT0JyWGNENVhyM0dTVURoV05n?= =?utf-8?B?UkZoVkpLeHZsYzZGRnpZUUN4ZTZiYlNUWitJSmdNSFBqVXlCZWFpdVRSSER2?= =?utf-8?B?VnBOKzFKZUhwSlN0NlZ2eUk0YXhMMFZaWWNIUWJoYkRCTGxqZDJTS1pCYkVP?= =?utf-8?B?RDVubUhraE9HRTMzaEYxMG1mdHozN2djbkxCdDc2aCtnVm81c0RnZHJYRklr?= =?utf-8?B?bUQ4WGtRaFRqUzJrZUo4bjU3bllDUkRIbGZtNWNwd2VuQVJGTjBJV2tlNEV4?= =?utf-8?B?WnlhSTYrbVcvZEY2VW10SHJzekpGWTlCd0E1NFNqenBWWUJ3UGI4QkhWZUVT?= =?utf-8?B?UEp2RDcxMWVwZHA3ZGdqQT09?= 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-messagedata-chunkcount: 1 x-ms-exchange-antispam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GS3ZPRFVLa0FjUzFpSDRFaDhvdHkxY0VaNFQ4TEZhVTgwUThO?= =?utf-8?B?ak5rN0V6R1dqZjdWZEdTNUtyMzlYdnZ2MzdCRWQ2cWhSRWxyUmxsZ0NSS0k0?= =?utf-8?B?NVRHTjQ2NXBEUWxHQnFsY0FkYWZQZjZBbFY1aGJFMUdsVllOanNHNDlJVGtx?= =?utf-8?B?T0lJZ0N6RE9ZVnUrVEdHZGo0MGZDVFUwaW8xSHRIVkRwS2gzak1VTWljTTk1?= =?utf-8?B?T09QdHU1T2MxcTVGZ0hUVm9VMmMzMmt5ZEYrNkZyVU9CRU1YaVZBUUozZnp6?= =?utf-8?B?V1JwREorL3F4UmpsTFJyTkZGZzBTNStldnhqU1FwaXlLSDFWa2Jlc0tCaCtm?= =?utf-8?B?QlRMNHU2NzBHMTN1TDY3RStTbnFuK25Eck1leiswUTcvZE4wSmVCRHdDMVdv?= =?utf-8?Q?h2K/r51H1oW8IhiGvhQNyJo=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: eda0d791-07dc-4726-05fd-08dc83926469 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:55.2314 (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: zQ0kj8z+50QyRfBBuGdWuMiV/eMp3evroqOVu2sVtX6ozEHDk4SnKxUalWnkT7IXDM4vI7mJjCW1ZoPiEHb2RY7RtoAKmXrfx9sCkHKdOibwAR+XSWUYVtMOhktMdcuP 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: 1717394539069100001 From: Cl=C3=A9ment Mathieu--Drif Signed-off-by: Cl=C3=A9ment Mathieu--Drif --- hw/i386/intel_iommu.c | 75 ++++++++++++++++++++++++++++++++-- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 1ba43f59b5..d12441430f 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -5381,12 +5381,10 @@ static void vtd_report_ir_illegal_access(VTDAddress= Space *vtd_as, bool is_fpd_set =3D false; VTDContextEntry ce; =20 - assert(vtd_as->pasid !=3D PCI_NO_PASID); - /* Try out best to fetch FPD, we can't do anything more */ if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) =3D=3D 0) { is_fpd_set =3D ce.lo & VTD_CONTEXT_ENTRY_FPD; - if (!is_fpd_set && s->root_scalable) { + if (!is_fpd_set && s->root_scalable && vtd_as->pasid !=3D PCI_NO_P= ASID) { vtd_ce_get_pasid_fpd(s, &ce, &is_fpd_set, vtd_as->pasid); } } @@ -6004,6 +6002,75 @@ static IOMMUMemoryRegion *vtd_get_memory_region_pasi= d(PCIBus *bus, return &vtd_as->iommu; } =20 +static IOMMUTLBEntry vtd_iommu_ats_do_translate(IOMMUMemoryRegion *iommu, + hwaddr addr, + IOMMUAccessFlags flags, + int iommu_idx) +{ + IOMMUTLBEntry entry; + VTDAddressSpace *vtd_as =3D container_of(iommu, VTDAddressSpace, iommu= ); + + if (vtd_is_interrupt_addr(addr)) { + vtd_report_ir_illegal_access(vtd_as, addr, flags & IOMMU_WO); + entry.iova =3D 0; + entry.translated_addr =3D 0; + entry.addr_mask =3D ~VTD_PAGE_MASK_4K; + entry.perm =3D IOMMU_NONE; + entry.pasid =3D PCI_NO_PASID; + } else { + entry =3D vtd_iommu_translate(iommu, addr, flags, iommu_idx); + } + return entry; +} + +static ssize_t vtd_iommu_ats_request_translation(IOMMUMemoryRegion *iommu, + bool priv_req, bool exec_= req, + hwaddr addr, size_t lengt= h, + bool no_write, + IOMMUTLBEntry *result, + size_t result_length, + uint32_t *err_count) +{ + IOMMUAccessFlags flags =3D IOMMU_ACCESS_FLAG_FULL(true, !no_write, exe= c_req, + priv_req, false, false= ); + ssize_t res_index =3D 0; + hwaddr target_address =3D addr + length; + IOMMUTLBEntry entry; + + *err_count =3D 0; + + while ((addr < target_address) && (res_index < result_length)) { + entry =3D vtd_iommu_ats_do_translate(iommu, addr, flags, 0); + if (!IOMMU_TLB_ENTRY_TRANSLATION_ERROR(&entry)) { /* Translation d= one */ + if (no_write) { + /* The device should not use this entry for a write access= */ + entry.perm &=3D ~IOMMU_WO; + } + /* + * 4.1.2 : Global Mapping (G) : Remapping hardware provides a = value + * of 0 in this field + */ + entry.perm &=3D ~IOMMU_GLOBAL; + } else { + *err_count +=3D 1; + } + result[res_index] =3D entry; + res_index +=3D 1; + addr =3D (addr & (~entry.addr_mask)) + (entry.addr_mask + 1); + } + + /* Buffer too small */ + if (addr < target_address) { + return -ENOMEM; + } + return res_index; +} + +static uint64_t vtd_get_min_page_size(IOMMUMemoryRegion *iommu) +{ + return VTD_PAGE_SIZE; +} + static PCIIOMMUOps vtd_iommu_ops =3D { .get_address_space =3D vtd_host_dma_iommu, .get_address_space_pasid =3D vtd_host_dma_iommu_pasid, @@ -6210,6 +6277,8 @@ static void vtd_iommu_memory_region_class_init(Object= Class *klass, imrc->translate =3D vtd_iommu_translate; imrc->notify_flag_changed =3D vtd_iommu_notify_flag_changed; imrc->replay =3D vtd_iommu_replay; + imrc->iommu_ats_request_translation =3D vtd_iommu_ats_request_translat= ion; + imrc->get_min_page_size =3D vtd_get_min_page_size; } =20 static const TypeInfo vtd_iommu_memory_region_info =3D { diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index 1b0d8958ad..461158f588 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -194,6 +194,7 @@ #define VTD_ECAP_MHMV (15ULL << 20) #define VTD_ECAP_NEST (1ULL << 26) #define VTD_ECAP_SRS (1ULL << 31) +#define VTD_ECAP_NWFS (1ULL << 33) #define VTD_ECAP_PSS (19ULL << 35) #define VTD_ECAP_PASID (1ULL << 40) #define VTD_ECAP_SMTS (1ULL << 43) --=20 2.45.1