From patchwork Mon Jan 20 17:41:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CLEMENT MATHIEU--DRIF X-Patchwork-Id: 13945431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03AF0C02182 for ; Mon, 20 Jan 2025 17:44:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZvmc-0004cj-9j; Mon, 20 Jan 2025 12:41:54 -0500 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 1tZvmT-0004WA-Sl for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:45 -0500 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 1tZvmR-0000Ya-G2 for qemu-devel@nongnu.org; Mon, 20 Jan 2025 12:41:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1737394903; x=1768930903; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=6MckZQwCYjffMS2jXtjONQ/OHOr/zGtMmZperPRxHuY=; b=nqCzTsdlSXdKqdOoOVY1vwnFCCae9+fwwO2jWOIVtSLG62ht19GqgcIN 2jXM5PW6+//NhlOAeD1f7BRwwM4mvFQa5qpbApx6ujadYl/qlfl3xUwMJ 7AmfaKPWp+4qhYWymPxjU6OYDE+QjcRyLnVgG4DlbdzCRcnu2Z1OzcbOV Ju4t0pr1mw4Vo8kzdVRlO9XyyvkBURmRvE4QikxZrInKOmQTv3rCGIbA+ hCrViBO1jWz4k7cjJI6tBF0DaP3yUdQq23U6FZ77wH8rPW1Yd+qyKJQ9g FND3IuctKC3kZFY4tDhcWibCNy4hWUjY82xNl/J3o4IelTsr7ZIY17INU g==; X-CSE-ConnectionGUID: OUkLtZ1BSRaGyuj0IQ8qIg== X-CSE-MsgGUID: M+zK+41hRnGSrnJKa9jl1g== X-IronPort-AV: E=Sophos;i="6.13,219,1732575600"; d="scan'208";a="30291717" X-MGA-submission: MDGmXsEpqMchtTU4s8IrzGa/htVpLuB4mdB84wOjS9VMP+18vl/kxw9al2XtHJU7VztPhdES5deZePi0Q8Yi3PGqPOlpCBtblcV/A5HvC2gESVd3y4SRGzP3C/4eQfjkouY0NKCAf+xvWM/4fDGzCEMCRvNq1K8jzzD15Et+WfKnnA== Received: from mail-db8eur05lp2111.outbound.protection.outlook.com (HELO EUR05-DB8-obe.outbound.protection.outlook.com) ([104.47.17.111]) by smarthost4.eviden.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 20 Jan 2025 18:41:41 +0100 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=va47eTGCG4AMKfiUyOoaTFtUuYMCh0e3P6pfQZmWSt4edoXojhTyllrUN41Vg43DRAbptaKtC2+Mzyb7EazSvbn5Up55ZFz7jTU+S1VMyBDLqw+iHc7dDADQf5oIO6/MWbv+YEn1x3pPhMHsDKQofXyt7+JD6AGiS56jU5aWqkBrb0TG+XEXgr8lkZd6s9prK1ck1Aqv2J+6XxzYf5GMAp63DF2jcsCVNlpLsUm/6oWEewtmsV3zGV1WvKAf5f1PxucVejaH7oIiRr4/0uCU41SXW2kD6j4mNGbzXSPXodDmXbRduCv3SoGH+YUKLC35A31ScrzRCfvdYcD88jJ4kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MVkhoKa+zWw25OWncBd6cKrfwqHMKy/axZuf3JScfE8=; b=m93EJjYZq64YEEKGqUbWU326tThqctFXY5BAaXHGzL/pLMSBO1qd8Y7/W7JG6ibVQdD4CHHjBnz9dTpEZhvE5teIPvouEyFsXsnJrGWrOKMsaQArwpKoQWve0TNjXXNp3HjJ0/q6ro8fZupzLb93FNJOvSAW73nkkLGd4mWQI4sPZjB4Om1TPO11U7c5or0oY2bATJnkj4JucFAxF24Dod91Xyc8AaU34cmAJxaEcrsKT2pqV2LrQN7m7O9ZJMwNkQPd3O5+bVjRG2VEC327aeUBpdJuHVaymG3aLGdupfRitOWcv1+brRr/PwlHhWsCoFoFzOT3sgU9mJC/nOAbjw== 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=MVkhoKa+zWw25OWncBd6cKrfwqHMKy/axZuf3JScfE8=; b=UqKy0TWCkFg+NCdgFcbg17/3mhY5uVQbsTbo8L4XXZP02xcm83+dlDMM3id2a6Od8E9XZ/CiFGPlS/HZsNzEfAkNsdSw3f93Qp423+D8/s03FZFYInBNWiLWS5xOrXVIC02mFZ4jHI3iiSTmXu+V/P5TCIJXoUhucHM1tyCuS5Tp1LV0Ga+2cVz11WYoc9nSbR7G+S5+2l+jq7Lk0+SNnnhc6JaQl1OXDDsHw0xoZl13TCWAP2XKVkMSbaAoIAfXMkzgtGZ/o6D7hrqlsG9iXzN1ZeyOD7YUkmYQPK+j71A8bih15UIAx93gwwr7CQlv0Q+yAA0M/2I9TH+GqCx3HQ== Received: from AM8PR07MB7602.eurprd07.prod.outlook.com (2603:10a6:20b:24b::7) by DBBPR07MB7548.eurprd07.prod.outlook.com (2603:10a6:10:1eb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Mon, 20 Jan 2025 17:41:40 +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.8356.020; Mon, 20 Jan 2025 17:41:40 +0000 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" , "tjeznach@rivosinc.com" , "minwoo.im@samsung.com" , CLEMENT MATHIEU--DRIF Subject: [PATCH v2 02/19] intel_iommu: Declare supported PASID size Thread-Topic: [PATCH v2 02/19] intel_iommu: Declare supported PASID size Thread-Index: AQHba2KP0vNGn4J+iEKQX3X8t9NAGQ== Date: Mon, 20 Jan 2025 17:41:40 +0000 Message-ID: <20250120174033.308518-3-clement.mathieu--drif@eviden.com> References: <20250120174033.308518-1-clement.mathieu--drif@eviden.com> In-Reply-To: <20250120174033.308518-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_|DBBPR07MB7548:EE_ x-ms-office365-filtering-correlation-id: 21a7d2dc-1d7e-454f-b55d-08dd3979b256 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|38070700018; x-microsoft-antispam-message-info: =?iso-8859-1?q?EW3I13h6KBwVYyMrQt3FOs4Dil?= =?iso-8859-1?q?TQnio1K2ltyythBps4Gmg4oOsLdBqfVPmvZsOv5+cJ/sDWssJNbJd8L6cUfO?= =?iso-8859-1?q?Fj2PM2xe5OZQIMIP4u28/piR4ipe9U69ryjwPqpbmWrNKq/VKfuv/fG9LxXI?= =?iso-8859-1?q?xkNYHm0mfTC8hKeLXeIDrdnxPe1ZzoblZfmh2GyIdEst5rxSIUnFq7Tw9ppK?= =?iso-8859-1?q?u8CnnNXC6CFfSRyLQ71DB9/253isicUeSy70pTjMEM8EeEH0plKwAEalIcXe?= =?iso-8859-1?q?MbcEhcZV6u4henUxpvpBxNBeFCLrKKZ7O9TrOGrsnMqVIAxJrht17NWc3rQp?= =?iso-8859-1?q?e8HcrE5Zey3TxJiKE6TacMZr4oJD2nJlRgQD/PPh7R53l+EsOMT24lPkE+zm?= =?iso-8859-1?q?vq5Hz3ZmgSAzsSwQUQMdFGZp6DIEm4qprg7Vgxmj4wng6zf/LxAOkRRB+Egq?= =?iso-8859-1?q?ScdVbiMHcL7NbHz6hNplMaZlhhIhC4JZSCJpp6q2h5LgWKK9J43CzDhs4F4q?= =?iso-8859-1?q?VpbIs173XLxoNXD9Vg9czx8Bs1dV6me5tDIvkMabhi+b39jN+c1lCn0+ryu/?= =?iso-8859-1?q?EuyPjgldr5plUaaBOhHgwZkqiy2jLCc9Jnrv+mU2IeXGbHQ9xfI9RZYmrrUI?= =?iso-8859-1?q?pf05xafQPU2yULEjmBS8Q3Q3gchFzkSHUyxFawAUoOOmQla8cwighzt2nchH?= =?iso-8859-1?q?TPl8rHpbEjoY0xf6bf70fd5OQKftIlrmsjQO3gUASUsQxjSlSGJQXzdn8n7O?= =?iso-8859-1?q?3LHN6g4FdBUo0/+MJTVzBfN/98CJL/5k9oknQ3Hg2ZmSflZS40mfakg/4P4A?= =?iso-8859-1?q?NxCoNo1GWcpwRe1SVgXE33Vb3OXXwyTvqKs3jG6J2YP/tTjxEQer3OqXWiuF?= =?iso-8859-1?q?4Bl+Qp+xmUfLqQJpDDupP91Yv6hyHsWCwxNPXndeWjpbXE01bjdWibSVEWEH?= =?iso-8859-1?q?kBpG8qLakRJBmdikHmbYD0cPUf8/WpF2nWY82/4jG+ff7K3kOiOCVV2CXhBG?= =?iso-8859-1?q?SOVzmgLhRj3r5xljVablz9JjoDyYwH3u+TJV1CK4+Fd39R/1mvTYC/dLajrP?= =?iso-8859-1?q?xcg9KTYB1pXgfvZNUAFPS8tx/Hw7f6huTqsih2Zge9ByVO39tITpAHHILCPq?= =?iso-8859-1?q?9eqYapNhSdt199Jyw3jOuz4qAtZW2sosMEP2IakPpHIxwp+WSxSjPvc+xVNW?= =?iso-8859-1?q?I9A3sFUuz2oQuunquvmlzQtW5vahH3O7Iz4b/ASNgtJrV54OrNMKNB6oWuxr?= =?iso-8859-1?q?9fPs6dXOua023i2Zl2jO75EjBAgnDNOcCLGdz8IV5e0++gzN0/gksuciCyjK?= =?iso-8859-1?q?e0/81RM1meyrSJg2JK0YiFaOUkdvP3ftboLBX/17PUj+HIvUn43KDu6RbWbg?= =?iso-8859-1?q?RGUNwkQq2QxhUpD/pbr61leU90NEYbL0wiJjD96mq0nFaarXnydLorPA8MCW?= =?iso-8859-1?q?7zL4HPQSa5trgSqDOngZ/PcKcva/5TWvGsppcz5meUH0N2zXlCEYBJjmtOpn?= =?iso-8859-1?q?B57VTk?= 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:(13230040)(1800799024)(366016)(7416014)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8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XYc?= =?iso-8859-1?q?QHTtQzFwr8KujNb4Y/mOzKqT6Nh3+k9CBDRQbxdKy/l76oH4yHYYkLYZ+q4H?= =?iso-8859-1?q?Vup0QEWZJ3jQbmVT0GnbWB1Zfgi7w/wEAKABYqgMAN0pgOG275i38RugGdQ2?= =?iso-8859-1?q?DxIxnm74pUYk7iP4dUxAG4MBvzWfJcHh2l/eUt3YKF4XMtmFArYgCBKndQJI?= =?iso-8859-1?q?RkcoYcU5cNG8uyF5PxohbCR0gsT2ePmAimtjy0tqM/+e0/955iGtoIfAr9O9?= =?iso-8859-1?q?hqunTwS8+d52c/pDyN0ks6y5AFoAIkRcb2BmWsw7AJDx66+nijCuEJTP5Jie?= =?iso-8859-1?q?eye/wzYNArx47nftuDXG0TwatbWvqQlHuv1XjSrze0p2wMVt9D9Iiat2Wrtj?= =?iso-8859-1?q?tZdKM/gPc9mTonAhH1gHRNGUtPCHFRbhFxvI4VLUctWcudzzu6VvbZqM2lf3?= =?iso-8859-1?q?VXFKxCo+eGSGm/aJWrKwYEoUOb83bvA1b9bxurCtzXakah6k+lVUujrWc7J/?= =?iso-8859-1?q?ejOqNc5HHkU2QLpSrV6iLyIA/eez58nh5PwGIEozoFKNS2KHLojf2C+721k4?= =?iso-8859-1?q?MYlaAtHLBmTLxMX2z12J15sz1C04tbZtnHRYVvJoKHwRkcIc3DRNxbpPS+te?= =?iso-8859-1?q?MB98sZwiunoOtTwEEj5HzXo2GuHjz0XRLFqIfdfKY1kPVcrU9G62LdQpf1T4?= =?iso-8859-1?q?GOCEc5ihvudg/YEfywZQsHF/a6pj4Kk+BEpEOHg9EqW9EmfWW6n/5KR3xoJR?= =?iso-8859-1?q?tX9DE0EWU++piT0dAVb1I1gO85Md2q3qtdFTX7cilyvfzJoyXwEBzD7JBT6g?= =?iso-8859-1?q?=3D?= 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: 21a7d2dc-1d7e-454f-b55d-08dd3979b256 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2025 17:41:40.2156 (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: 5aciZ3rhAAGPCSiQEBjmcJIsg3iSddjlJLmv6wNM4SRviUd9hwLO+4A3QIsN13RQ/9zcCZ2AAUCNWsl2Nupc8HS7JfRdkXCXsokE+W2/nsjYHQUILuI1OCaP7S8WALL9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7548 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, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Clement Mathieu--Drif PSS field of the ecap register stores the supported PASID size minus 1. Thus, this commit adds support for 20bits PASIDs. Signed-off-by: Clement Mathieu--Drif --- hw/i386/intel_iommu.c | 2 +- hw/i386/intel_iommu_internal.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index f366c223d0..1d5ff8f4f6 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4574,7 +4574,7 @@ static void vtd_cap_init(IntelIOMMUState *s) } if (s->pasid) { - s->ecap |= VTD_ECAP_PASID; + s->ecap |= VTD_ECAP_PASID | VTD_ECAP_PSS; } } diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index e8b211e8b0..238f1f443f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -192,6 +192,7 @@ #define VTD_ECAP_SC (1ULL << 7) #define VTD_ECAP_MHMV (15ULL << 20) #define VTD_ECAP_SRS (1ULL << 31) +#define VTD_ECAP_PSS (19ULL << 35) #define VTD_ECAP_PASID (1ULL << 40) #define VTD_ECAP_SMTS (1ULL << 43) #define VTD_ECAP_SLTS (1ULL << 46)