From nobody Fri Nov 29 20:57:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=2; a=rsa-sha256; t=1627989256; cv=pass; d=zohomail.com; s=zohoarc; b=b1aFVG6vWzttjyDerBzd70dH0RPimawho0qEiaR0Wrz5FDUwCPptmHOcX1+If25vP6+jIdUsXB2YLTKHCn7e5XGkdWJgMEzd0gXTOVkq0eFXJiZpoyBfr2TOssL7TYMc+vL8LctGdcGF4Dj/E9CMRCaZq/Obr4I/0d4l86j4yII= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627989256; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xWaLnr6aNgmuj2Dd6xZE5CJ2eUlvhSileQ7UcXxl4BE=; b=XowIQOPepSORvnRIYgsUNwtx6Cbek3LSu+ZhVRG3/Nw/qCHEz67WgvgnuY6InhdfZCtUucih/YxsGIMvnONTe3hw4RyU1KOH6St3USsiYbz+a0PFuN3VJJ+ljpZwMoyNFm6PiUOAtxZDS6mtfihvYTdLJgZ4Zjn9C7nwIXrrvYY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=suse.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1627989256905503.34267265382505; Tue, 3 Aug 2021 04:14:16 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.163415.299350 (Exim 4.92) (envelope-from ) id 1mAsMl-0003f0-9m; Tue, 03 Aug 2021 11:13:47 +0000 Received: by outflank-mailman (output) from mailman id 163415.299350; Tue, 03 Aug 2021 11:13:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mAsMl-0003et-6U; Tue, 03 Aug 2021 11:13:47 +0000 Received: by outflank-mailman (input) for mailman id 163415; Tue, 03 Aug 2021 11:13:46 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mAsMj-0003en-Up for xen-devel@lists.xenproject.org; Tue, 03 Aug 2021 11:13:45 +0000 Received: from de-smtp-delivery-102.mimecast.com (unknown [194.104.111.102]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4d37fde0-d250-491c-9580-894aca751db5; Tue, 03 Aug 2021 11:13:45 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2056.outbound.protection.outlook.com [104.47.14.56]) (Using TLS) by relay.mimecast.com with ESMTP id de-mta-26-LhFKX99qMRSnSiP8GI10og-1; Tue, 03 Aug 2021 13:13:43 +0200 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) by VI1PR0401MB2333.eurprd04.prod.outlook.com (2603:10a6:800:28::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Tue, 3 Aug 2021 11:13:42 +0000 Received: from VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea]) by VI1PR04MB5600.eurprd04.prod.outlook.com ([fe80::99d3:99cd:8adf:3eea%5]) with mapi id 15.20.4373.026; Tue, 3 Aug 2021 11:13:41 +0000 Received: from [10.156.60.236] (37.24.206.209) by FR3P281CA0039.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.11 via Frontend Transport; Tue, 3 Aug 2021 11:13:41 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4d37fde0-d250-491c-9580-894aca751db5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1627989224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xWaLnr6aNgmuj2Dd6xZE5CJ2eUlvhSileQ7UcXxl4BE=; b=QCv/3iAEB1/yRF2sURuZuBlXAO9Vf2Zrt80HZ6heXNmMuX66RkjCSz5Bg0gFoRtAKT2Vz3 LmTYL1KD1Ss+vYB+7bYue/2vVGXd/QdiIi6tjNiUrm0bk6s4PR8qzQ+1yzSoV8w1n1vkmY TvmezxAWSGO6AWJQ33VvFwgxWicjTC8= X-MC-Unique: LhFKX99qMRSnSiP8GI10og-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W6lnO6Wsvo8ZhxqzHPhQkyxMJtVcC/S0NRTVTZCRhwSayRu4nHAaSPTYFchZ1ewYHGZv24VyLt/hyZpvFxFA5Gg3fkK/R5+jhZUl1xQvPbesaJskGiQWuSDrRN+LEOrZUrIOPZQB+eq2LCXCsx0Y1MWWNudd8FzI87W2uBTun5kP7faq4STubl7P6ShjASMsFa4Z0nq3nh86hALCkN2nTRMSqmUQ/CZgYW0YO0JMirvGvfCfGpep0XP2em5ZEQw5MvDUWMUjIkuTLFHYQqUOhUp/W05DxRFiUyntLaX889XXh/QWUHyck2y6YggVpjBAGgv7RRKneXnJHELVlNfmJg== 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-SenderADCheck; bh=xWaLnr6aNgmuj2Dd6xZE5CJ2eUlvhSileQ7UcXxl4BE=; b=RGXoZn5f85KCftzYdI5xNuKgQ5DqpC1XLrhtUEJb90PuQHVZ0G0sP0sUXZgw2zmOMcmcIDV87CXQrRNxof0cuAVCTK8sKYc7GcTZPUobsN9dcH9KEuGMCtP8f53GdfA1ZYJ08uYKkDX8qCs2jMfGHNqUKA7w9wLog7ypDs8T8Nx6NE91NK7lJvdrhbBHmOFhSS+cQ5Q7RkOW4J/E90dJDX0wWEORIRk0XovPGA9sAkTFPj5ONV4rTt70pr1/vv2sEGGW0/mb/lzXFhD9wnpnjdp+riIGzbIx9ZE5LOZ5rYo8DGON7+69kyJdZM90T/5mK2quYCfHtRkzsacY9KCgzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=none action=none header.from=suse.com; To: "xen-devel@lists.xenproject.org" Cc: Kevin Tian , Andrew Cooper From: Jan Beulich Subject: [PATCH] VT-d: Tylersburg errata apply to further steppings Message-ID: <07ded368-5c12-c06e-fd94-d7ae52d18836@suse.com> Date: Tue, 3 Aug 2021 13:13:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: FR3P281CA0039.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::11) To VI1PR04MB5600.eurprd04.prod.outlook.com (2603:10a6:803:e7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 657b5aa6-83a6-4c9d-fffe-08d9566fc04d X-MS-TrafficTypeDiagnostic: VI1PR0401MB2333: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yXah1SBRnGPgfvlT7rZVJr3mq8Dc+llgno8pf3gvtwAD+gZZ7qgRnWbuegSRCeWhFIiguea5SN7J2LT7tFH7RMBv9zQa9HF29U94NhGqoImoQ0HN00OuUbr0CmWxSTh6T92q2LfLgMIkBhHeGDZfZfSkKUi3iuPQSqovjOfIXJdan36z3Bwro/v3U7/pQ2ZuHNPfT42mWHfThOxR+L5Q76mudJJTx7e2UmvxUFNRtI5iu0d++CBDkOlmWbDn0nVNskDr7desvuv6nyifHki7x2662l79SWgIyZdjUOQ5ktueabq4r07snM1xwsI2UquTARvdQFX5vEy3GiRYCe+sBk+kFneUu4XDD0Lci/5mtPhd+sPs4Gl1hJsgqCEwJrnDevZIubih4vzPA3w71gxY5KpbpkWx+py7AOLL9aEyr2SafU+n0mLwLv8uQKMwfcCrcKwFZqMJmdqU+04qILQpczIiFO1xH3SCUNAMj5dJeQHKvVua3lzhwBPr+4uafmEfKpHEPvncaUVu13XdZrjkbQijlPfmG7/6hJ8ZfJwFQVfdPZBIabjtVgPRTmmZ+kaSn/ntHemyHjQqEQyyv3la8GsCHgUlQiz0YT0NOujQVMStAjtmakvaAokNd6JxaYEZqvPP18261l9Hcbg5eYWeMy0A3/bsvobDraYFug9GBemc4iZohiRDOVWJKyLREw60/eE4OzA1jlPCB1JDaauutyLtrarsa9oD8aDryG2zL1M= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5600.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(396003)(366004)(346002)(39860400002)(376002)(136003)(36756003)(2616005)(31696002)(956004)(8936002)(186003)(26005)(2906002)(8676002)(38100700002)(83380400001)(478600001)(66574015)(5660300002)(16576012)(31686004)(66476007)(6916009)(86362001)(316002)(6486002)(66946007)(66556008)(4326008)(54906003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RlhVaTN1Z1d0VUVDMWs5QVV3Y0drcnJRT0RiS3FuK3MzMG1laGVXYzJqK200?= =?utf-8?B?aDB1ZVNPQmJqSW5zQXBEZkphTW5vKzhtNHpydW9aZkhNOVRvSFlSS1pqc0ZC?= =?utf-8?B?WDI5cEQ1ZkIvcCs0cXphbXRTOExNRjNKcVlmTWhNZ2VkZGtOMjhxc1RWU2pp?= =?utf-8?B?OVA4b0xHVXZBZm1yeGx4T2t4Y2VFbm9COUVOWld4YW9UMTZselRZYWpwTlpu?= =?utf-8?B?U2M5Y0ZsVVJpL2tZTVpEQ29ma2JrWGF1dGhWbHpoaGo1MlZ2TjZ2Sm1vY1NX?= =?utf-8?B?YnNERSt4MmxwZE43WGNGVk1henFRem5NV3MvdzR2Umt4VnZXQ296MFp1NVVX?= =?utf-8?B?SEoxbk5UK1FDRFhhaHBsdlhzSGZzSXlrYW8rUTFrRkFEelJMNTc3cWxZb3RC?= =?utf-8?B?Y3N1Sm1FcTRLK0xEVVFtbDZwL1dVazBtVEYvd0tUM2g3RFZxc0I0QmdDUWcv?= =?utf-8?B?VHF5aU5KMThjc3M4em1YcGhYRVFpYlJmZXZKMmowcndBUVR0ZEZYZXZCVzRr?= =?utf-8?B?NElYMCszdGxvVTNLY042YUEyb0VGWn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wRnJWZ1B1eVMrd2doeUt3SWtlcUhzSm4yMVNZdW5CQVJmV0pQNWErS2lo?= =?utf-8?B?Z2laeCsyUVk5NlVLTFBIRlVhcUwvKzZpU212RjNnV09KUDY2SWg4NitKWTZv?= =?utf-8?B?aEpnK1BzcmQvWVRSZU1UakdwR05KS0ZNaVRReXd0SkM3b0Y5d1c2WG92WkUy?= =?utf-8?B?aHJEZEI0YU44bjdtdDNQZ0l6MDIrVFIzUzVaNk5kMjZiVU9yc2VFRmEvRU45?= =?utf-8?B?ZlhQVGdLL3VxRmhRUG5ycXZ1djhCcEJWRlQ5Z0hjazl4UmhvbHlnd0lPYlRu?= =?utf-8?Q?EQ394GmF72TeKUft7K1OfqmLnViv+qNweqsGWZE?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 657b5aa6-83a6-4c9d-fffe-08d9566fc04d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5600.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2021 11:13:41.8640 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D7qXUx7stsQJLgXHb3X3my3sxt1T1Wo8mfyEtQO/rFGyV9+SyYZcEAl8BnngEWZmBpo8Dm8abaBemmHFMg2HzA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2333 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1627989257921100003 Content-Type: text/plain; charset="utf-8" While for 5500 and 5520 chipsets only B3 and C2 are mentioned in the spec update, X58's also mentions B2, and searching the internet suggests systems with this stepping are actually in use. Even worse, for X58 erratum #69 is marked applicable even to C2. Split the check to cover all applicable steppings and to also report applicable errata numbers in the log message. The splitting requires using the DMI port instead of the System Management Registers device, but that's then in line (also revision checking wise) with the spec updates. Fixes: 6890cebc6a98 ("VT-d: deal with 5500/5520/X58 errata") Signed-off-by: Jan Beulich Reviewed-by: Kevin Tian --- As to disabling just interrupt remapping (as the initial version of the original patch did) vs disabling the IOMMU as a whole: Using a less heavy workaround would of course be desirable, but then we need to ensure not to misguide the tool stack about the state of the system. It uses the PHYSCAP_directio sysctl output to determine whether PCI pass- through can be made use of, yet that flag is driven by "iommu_enabled" alone, without regard to the setting of "iommu_intremap". --- a/xen/drivers/passthrough/vtd/quirks.c +++ b/xen/drivers/passthrough/vtd/quirks.c @@ -268,26 +268,42 @@ static int __init parse_snb_timeout(cons } custom_param("snb_igd_quirk", parse_snb_timeout); =20 -/* 5500/5520/X58 Chipset Interrupt remapping errata, for stepping B-3. - * Fixed in stepping C-2. */ +/* + * 5500/5520/X58 chipset interrupt remapping errata, for steppings B2 and = B3. + * Fixed in stepping C2 except on X58. + */ static void __init tylersburg_intremap_quirk(void) { - uint32_t bus, device; + unsigned int bus; uint8_t rev; =20 for ( bus =3D 0; bus < 0x100; bus++ ) { - /* Match on System Management Registers on Device 20 Function 0 */ - device =3D pci_conf_read32(PCI_SBDF(0, bus, 20, 0), PCI_VENDOR_ID); - rev =3D pci_conf_read8(PCI_SBDF(0, bus, 20, 0), PCI_REVISION_ID); + /* Match on DMI port (Device 0 Function 0) */ + rev =3D pci_conf_read8(PCI_SBDF(0, bus, 0, 0), PCI_REVISION_ID); =20 - if ( rev =3D=3D 0x13 && device =3D=3D 0x342e8086 ) + switch ( pci_conf_read32(PCI_SBDF(0, bus, 0, 0), PCI_VENDOR_ID) ) { + default: + continue; + + case 0x34038086: case 0x34068086: + if ( rev >=3D 0x22 ) + continue; printk(XENLOG_WARNING VTDPREFIX - "Disabling IOMMU due to Intel 5500/5520/X58 Chipset err= ata #47, #53\n"); - iommu_enable =3D 0; + "Disabling IOMMU due to Intel 5500/5520 chipset errata = #47 and #53\n"); + iommu_enable =3D false; + break; + + case 0x34058086: + printk(XENLOG_WARNING VTDPREFIX + "Disabling IOMMU due to Intel X58 chipset %s\n", + rev < 0x22 ? "errata #62 and #69" : "erratum #69"); + iommu_enable =3D false; break; } + + break; } } =20