Message ID | 20240603055917.18735-22-clement.mathieu--drif@eviden.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org> 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 C4C7AC27C4F for <qemu-devel@archiver.kernel.org>; Mon, 3 Jun 2024 06:02:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces@nongnu.org>) id 1sE0jz-0006v8-2i; Mon, 03 Jun 2024 02:00:19 -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 <clement.mathieu--drif@eviden.com>) id 1sE0jx-0006uI-MH for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:17 -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 <clement.mathieu--drif@eviden.com>) id 1sE0jt-00070x-Ss for qemu-devel@nongnu.org; Mon, 03 Jun 2024 02:00:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eviden.com; i=@eviden.com; q=dns/txt; s=mail; t=1717394414; x=1748930414; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=tuP/ANJDo2OvMnNRNz6N+9RNwECzEo3QOE0XaaE07Riw+WoaS7xTRTIl MG0HsTJeWyannTxbgy6C9n5WBdUcc5liT6GDripeusRhIRTjdJ2vqU9w7 D6gTsIM/oix9E8sU0wPPFWZl9FXul6U9cA0wkpqXMRvo+DENgFR6EhqI0 e2UZlialFuSsYxE0qWojlb367VpUiSyT6Ml9PUeSEEamnb0aI/IwF6MDC y4cwsNTD1tAYbeC8ufWw50W2OJSgWzzOqWK/mi6aWhvhkqZ4niq972byD 9UJpSoCzhXvxE3T+Xwb157QTpQ0BzRwVfhimg4MKmeqFl9eqLRmmFlwJv Q==; X-IronPort-AV: E=Sophos;i="6.08,210,1712613600"; d="scan'208";a="13815891" X-MGA-submission: MDHyzdw5o6BKIpHUr10JNFBkkkSXiJ0e8seXGH55dTtPCVuTCef4FjXtrMW+lEZ3a579Il/V+aPmZmycfeJiPs+blvEocVf2FrTpKPFLaiR/anZMcV7a9hyYNwqxzoPt0e2OJ9dCfw5seKcju1Rg3ue032zZUMHJufrg6EorRCgguw== 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcPo2qQHQKFm6FBZ6Fa6gt9bs9bodcV/PP0vImgG6KqcO00L+f/gRa4ADNdhz0c1bTzi64M/DctfTJIwdbTTVF7Rr2nDTgsENGH4wWOjck8sw5wAdvsVmGFTWIN6fG1xmYHh5YCnJPhsErVMWM7vYSBJ/V8vmEnP39eU2vbw5/jSitb9R53U90Fb3VBMXP6FlXtysXUp5K+5rkIDz8VUNCnBTl2evtXfKxHlVPFy2J8n1NntVskFrUF2WZHLS5i9ZFLeV1pvqf4HoExKBS5jMfvMRdxDZsJ6K7ag1tfxBcF0dhLZi/uxtXwFJKrPBcDRLg0Meqk8neRDoOQs1HY51g== 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=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=hIhb9qGVt9/X7ZYkZ/gjlGB8qv54HF87zfRA+2acl9OpplpvtnBxUl6Dy0tnjR6JUt+ox2CTXntJKj8TW4JOPswRsXMYs9p99AgtS0U94nrv+d1HFDOzu7NqnuxBm0G6jgrjPHJzKA48fzG/Es5trq1KvsowNXZApCH7IUQBLB/FrF94XzwDe++IfSuMxPtf30p3r3ObJtYLy8fbIvfcD3vFV9Y73swGaQnvn0gtCuXkca9nkA2hpIHx8exF/O26TeaNvQc+EGSM/xiSKI0FA4XLWbzcdIpnuVFOFY1j6wgi6zaccd+fmVvZTDdHe7iXlzw1SDDM9JVmgTsm8GvKJg== 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=13GG35/z+g2/tSV3v8gmuukZxQXF5OOXbQi15tZoJ9g=; b=TJ2pv8gtPTY7v0M1dfMBA9ZHm3rpnxcSELXrymP2T0vrmcRVbRi5VSKl9SCXI+B2mo5lJu+OPVVsidWbNW4nxWivItlb78Yslsmxtv0Clv3XMqSwBF1VaEWAyOFWF81znIDyl7rMaqK1gV7kA2FVfGBi7tg6V0OwSs9bGK+0N3e2e6Cdcfxw0/arN9YRg4IwZUNq7nusIQZiGxeYE+tOQA6ewBwMTTDpO7+GWktD1Yr4+/Kkc+9QwheX57B4r2CRE2OokrkTlA6C5PS83xv1dlmq4yvsFFp8aQZZtdHVZNpUE3q+S+DGNeWD4nrj+/teCIFvvnXAL6FEgqSUftxQ/A== 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:54 +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:54 +0000 From: CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org> CC: "jasowang@redhat.com" <jasowang@redhat.com>, "zhenzhong.duan@intel.com" <zhenzhong.duan@intel.com>, "kevin.tian@intel.com" <kevin.tian@intel.com>, "yi.l.liu@intel.com" <yi.l.liu@intel.com>, "joao.m.martins@oracle.com" <joao.m.martins@oracle.com>, "peterx@redhat.com" <peterx@redhat.com>, "mst@redhat.com" <mst@redhat.com>, CLEMENT MATHIEU--DRIF <clement.mathieu--drif@eviden.com> Subject: [PATCH ats_vtd v5 21/22] intel_iommu: set the address mask even when a translation fails Thread-Topic: [PATCH ats_vtd v5 21/22] intel_iommu: set the address mask even when a translation fails Thread-Index: AQHatXtBNNesc+UKhU+lHqhLQmHLjA== Date: Mon, 3 Jun 2024 05:59:54 +0000 Message-ID: <20240603055917.18735-22-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: 8d04933a-0418-44d9-9c37-08dc839263f6 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?q?GORQQHlLbpggDLXzWGVtI9eaSwgno2I?= =?utf-8?q?mj4MO+YZkvT3k56GUhvaNGn9G1nhMrSUaMmEh+mOkgJ1xKxEkifAd58kI13emiTxU?= =?utf-8?q?estCDmRLNvVKd7vVTg1uYG+EU3GFa/OLWARMEVrprs6T8W/dK5AnQpqS0DUuBvfWI?= =?utf-8?q?6gxk1QVuSl4TRUJema62MBNjnxzS3P44uJRjGjW0snqFwJzGkaX/XlZ3/oGQHGTUv?= =?utf-8?q?yUOtDY3Xd+M5GDh9s3XC1pR7ffyGKz60FSHQE4Krp2EptXXTbsLcFTiBAP6Tjue00?= =?utf-8?q?nFRKvjYA2WB1PEGL7TiDm/R+o+TNmtao4yIKR5gijW55b0KdmL1Qc8RXeLJwKdPKt?= =?utf-8?q?EUmmzH69/vqXYPlNEaFBPqOKOGKnk+Ti8vaGffNzH/fSAZFn4DS9fGaWBLUTbbFAY?= =?utf-8?q?Q45fpgDN4HewTD7axj8oxbTH0zl9GF+hVJat70KFb6HVNlmzi903xs38bvbqqXeri?= =?utf-8?q?M50yo8UPoFAUQjzZoW5+VXcnkOZQsdBaRcBAlGadQ1z40ZVjMwYo3pWnw54nFA7Fp?= =?utf-8?q?9y45SI+5n9j/BSs9r4KYXTzRKDTXYB0LdRgfBM/il/gEMHrLwg2BGG1znu5ak+Ygj?= =?utf-8?q?BYX5L4bFqBolRz2x2b++oAsJmX/mO7YwdZRnmVZeoHVCY3iqmm6ZOHRhO0Ch8uqfx?= =?utf-8?q?qbEanlb+aOJ55Z2P08/TK426PzZFkHkKALQs7Id7erR69VoP90KVDi4UgTqf61yfy?= =?utf-8?q?FO481+c4yP87DMsbGjPMeSvYmSusxzRaJFWasj5RG3Cetsui5gqNSi2rwKcnEl7/Q?= =?utf-8?q?WWGZ57HYbJt1Yv6giVDiyxiI4hSONcUNNocSRupTzOO5g66j5ERn9O/3uWs1SJzxB?= =?utf-8?q?/soEdyWHJTYKZjjXwUBTeQE6tizpIZjoSTZVhmA6CROxHBx1B2lJBOgXZo7cZBp2e?= =?utf-8?q?yFifZPwkf8yaA2f8M4T+TbykYzv1EHSMX5OGyscyu5W/y5L5VYebwrsTlB0rsGmLi?= =?utf-8?q?PkzT5npOz7sNxdDpZMI7LESDgnZjx14brS8+kB06jzmIrN0HGjhJ2EQvFq3V7fRTN?= =?utf-8?q?FLRnfHcfM6W8aAMkySlSb4o25Lo3xx4MAS8qTNetyY9tajIvblhhx2wGkOLMPRaOM?= =?utf-8?q?mRzFzU8hN/JwJSM2HTBIh44eSjV95DVTwRQ8JP4eIbBi4d4qL4vVFpTujzh7zTW7q?= =?utf-8?q?coVSKcQzxfQz0O1VFbhCmTKQ6s3IH1lqhlBxXna19xS28MM928OkA0yNia184o4Uk?= =?utf-8?q?btx6KvIAVnGDFKVx9kC2qpqa3nySgYz5whuB0E0ORr/rrS1HBo7Lc/qYBtFlRcSrr?= =?utf-8?q?D0RvwLIz02Qd58lihkX5oQM3pKCZulHwICw=3D=3D?= 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-messagedata-0: =?utf-8?q?esJUSNWJJY9La3BOqjzPapu+DWVL?= =?utf-8?q?jT6yQFpCjm2NwULFnHBrlfh8FdDXTQe5xyALzyBkRcQRoUTzPgMXRgUD2tk/nkyoa?= =?utf-8?q?tbunbYNKmm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QefJpC8qKcKGE6M5qsT+EjJbFBvO0X5SrVCFWbuUXYja5deG9AWv?= =?utf-8?q?eq0g16Kz8RbKkaP8L+W2kGq0I9blYoB33J9LV4cTJNCG1y51v/GLVjMJBR/fJ3B0a?= =?utf-8?q?TW7t+blA/2yl2Ti101vd63E+KdKcCBFljGmJ3KFllBThTB7wR2GfZIX+dV56SZKR1?= =?utf-8?q?Wx+6SMDfYsHcKdrw4pG2GjXuKkYR2JJOX2VEjVitf4NhtBWVyr6ugrjJNCo+pqOLZ?= =?utf-8?q?xGdnbWEBd+wTsOMwr1GXWeQFLQvU9h6KVcg0ybz/TtAkCV+pra00Gj8T+I04ZBq67?= =?utf-8?q?0Qx4S3ALPYy1jtxtA37jlVfw7DlgDITI0hzZwKIBt0ug/af1tdMomUQDQ4sDand+N?= =?utf-8?q?7xH9pyrYaKEOHCK8StHW9tM7pMyRPZm9XZh44oo8ylX1PS+dO6CdEo6HQtPWME4qY?= =?utf-8?q?I+m0kEfm/CldeJ79kSa7CdbMGqbqBV2a9BCGxWpplKOI8H08KwtjY+684u4D5Thqp?= =?utf-8?q?aQGQRaPS/v2DmfzJt8SegxNRE+4fnlFQ2p5r4fgSepAeGsk3xiIklKal+J1zNPxUw?= =?utf-8?q?7gCJOxadkWr9/ykirVPZfTjIM/otWe+dzDJAaPI3wDAUrZXT8N/oigk=3D?= Content-Type: text/plain; charset="utf-8" Content-ID: <004ADB066C57CA4993F77BA78EC6E000@eurprd07.prod.outlook.com> Content-Transfer-Encoding: base64 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: 8d04933a-0418-44d9-9c37-08dc839263f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jun 2024 05:59:54.4871 (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: ktrGHM2nKjhCJa2F3S2gq9NNAhU0bpnFFhW1sfVviDwjT79bjUnLNICVaozwidC+VqhPextJ6xf/kMR7CXySSw87dnhwucky7/1ApQ1892+s3q5kJjAG7Giwjlip2FUM X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB8192 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org |
Series |
ATS support for VT-d
|
expand
|
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 0f3bd5978e..1ba43f59b5 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -2169,7 +2169,8 @@ static bool vtd_do_iommu_translate(VTDAddressSpace *vtd_as, PCIBus *bus, uint8_t bus_num = pci_bus_num(bus); VTDContextCacheEntry *cc_entry; uint64_t pte, page_mask; - uint32_t level, pasid = vtd_as->pasid; + uint32_t level = UINT32_MAX; + uint32_t pasid = vtd_as->pasid; uint16_t source_id = PCI_BUILD_BDF(bus_num, devfn); int ret_fr; bool is_fpd_set = false; @@ -2314,7 +2315,12 @@ error: vtd_iommu_unlock(s); entry->iova = 0; entry->translated_addr = 0; - entry->addr_mask = 0; + /* + * Set the mask for ATS (the range must be present even when the + * translation fails : PCIe rev 5 10.2.3.5) + */ + entry->addr_mask = (level != UINT32_MAX) ? + (~vtd_slpt_level_page_mask(level)) : (~VTD_PAGE_MASK_4K); entry->perm = IOMMU_NONE; entry->pasid = PCI_NO_PASID; return false;