Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp375536rdb; Tue, 5 Dec 2023 07:49:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGqSvk7kwzYWEvrYG2503HXvf4xYp3codke4Q4eypa7gFCxZdmOWWz4Nxp82jvRNqjAbxk X-Received: by 2002:a92:6811:0:b0:35d:59a2:331d with SMTP id d17-20020a926811000000b0035d59a2331dmr7423825ilc.33.1701791360841; Tue, 05 Dec 2023 07:49:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701791360; cv=pass; d=google.com; s=arc-20160816; b=bGFtTnDaktxDeVR5QtpH+X7ZbXBd2Z114qVtpcvnbpw2On+ux4GItGFg0lEt+F4vB8 JFg27G/gyFU7FqdfDzZ96HeCRiwPmwM2XGK9V/rhhn8q2eq180bYao+ckoQ6Nn9ttpir ii05hgsGr/sqMtpT2hFMmLyxYjFQo5dtuHt7e8Lz4wvzVVBWGg7UCy551XPXUii+hlVh wtzaFcnlaOntXIxtVIgWA1s5rXkoDtDvM+OiF+Nvm/KxTchtBrXglVXBW2kJGwr344ze vH0u+nQJfqEeIetaHbnnGavinKTpcskQJgKjqrCz9JJH5hro5YsF2mRq0dcyRjjNu6eZ 1z3g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=eLuQYjjCa83wy5FxCm9aqnG3UyNRRCE2OjcDryFxIyQ=; fh=tc9SYlXOZhtw7UXgbNRbkae7BVF+Xi03bmiDGmcbsgQ=; b=fh2si8sSDgQx8mkf9iDAFY22Em8Swz5nBiYv7WpSEBAe7mZNbqhHu+MX9Zw62UZXQo R84hfXpScZz6zH5/KVjcvb70CpPzeMV8QAaLeRcXLxLpuMD/JVcRloL/XJsa+tan+k3o SbMHx1MCzYwilhXFVnLcFj/rmn5hXrU6EZJ4YN0foHvE6tHS8B0plj9RYBefYMkz4oOH A94DMprz0+q+EMHGlck0FCWMXwb2qIpg/ZoRgpDVq36s1cZ91TVJJIlzR6bn/7V00C2k gaoCR7vTt+yiJsaxyFLjA8W6FgVjr9ETTUmlPsImdyEP5MkrVDVvIrHjcfssS9uJlid/ I2AQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dM5DBmVH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f19-20020a02b793000000b00422cc8f6fbcsi4739643jam.93.2023.12.05.07.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:49:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=dM5DBmVH; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B06AE8038B4A; Tue, 5 Dec 2023 07:49:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442448AbjLEPs6 (ORCPT + 99 others); Tue, 5 Dec 2023 10:48:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346860AbjLEPs5 (ORCPT ); Tue, 5 Dec 2023 10:48:57 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2079.outbound.protection.outlook.com [40.107.212.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0A0BA; Tue, 5 Dec 2023 07:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJF5XWnKPS9qusgEry5dttgFRiOC4Nb52wf1GtLz/t9ompvZ5x//rnDzMatYX0KHpEalqQgzxLU/EC+cxadTB/yfed4j0VY7n/E3bbkFskQV8kKBh6vi6y2bCdKqoFcXZNBvIeSy2MCORSQdpq/DBcIvJzmlMzKQ4vD/g9dTG3zqTGUZLJUVcxrDT0nulfGFDKo6Ez5NmCszeWpGZyf6y2azBUa/3UICbT0+mlWEyUyWbxEBVQbvpCcqcFpcbuuM8HnU0x6LFMqNn5oASf51g6hi5yfNS59asqQazWmm6s+wt2h0D3QNIz+lexF69+u/7jmRHpV5BEH4KE7pkqvy9A== 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=eLuQYjjCa83wy5FxCm9aqnG3UyNRRCE2OjcDryFxIyQ=; b=iaRLIqzBjm13w/T+svuj1rzt9Dx5oSBdlMU+31qWZ2DS1j9UQIqm0uAI5r2gX39C3Ej/z2uHTJIFCZVKUfEyJrf74kYzLpGTIc1Pci7iauEeUThkezcq30LEjLNiewA4OZ21Sy+sCtWr8YIEk46IuHe07mUfulDnjAINvA/TaTUTxw3dAzsfUbJ3WR20xadukdX5Af1WK5RjGDQbaaHvhLa8mxLBgf+plPV3LGgfKSxdpNAp7jAP5lHrE/x/S5BpiuhphmlyYVEI53CHUcvydiyZ+ia9UpZMSH4bm+cW2u5FrwnDlaeAeYiKW8Eb3Fpmju9vgJveieUy2j5tfWE7/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eLuQYjjCa83wy5FxCm9aqnG3UyNRRCE2OjcDryFxIyQ=; b=dM5DBmVHsFSazC45RlTJg4xhzv6VqLpz/Vtf3IDnwbZ4nXakkZMDVdndegbS83sXFR8LCCR0vAxjH5aoOMl0K0EcgjGv9bDb4xre8BeIxXLDK0Ucid7Z569qbudP5i+WV5gATj2uMSkL4qU8s/zOkrHHvq2J9wSWmZvf9gHjtJg= Received: from BL1PR13CA0318.namprd13.prod.outlook.com (2603:10b6:208:2c1::23) by MW4PR12MB7359.namprd12.prod.outlook.com (2603:10b6:303:222::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Tue, 5 Dec 2023 15:48:57 +0000 Received: from BL6PEPF0001AB72.namprd02.prod.outlook.com (2603:10b6:208:2c1:cafe::31) by BL1PR13CA0318.outlook.office365.com (2603:10b6:208:2c1::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.24 via Frontend Transport; Tue, 5 Dec 2023 15:48:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF0001AB72.mail.protection.outlook.com (10.167.242.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.24 via Frontend Transport; Tue, 5 Dec 2023 15:48:57 +0000 Received: from AUS-P9-MLIMONCI.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 5 Dec 2023 09:48:56 -0600 From: Mario Limonciello To: Bjorn Helgaas , "Rafael J . Wysocki" CC: , , , Mario Limonciello Subject: [PATCH] x86/pci: Stop requiring MMCONFIG to be declared in E820, ACPI or EFI for newer systems Date: Tue, 5 Dec 2023 09:48:45 -0600 Message-ID: <20231205154845.44463-1-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB72:EE_|MW4PR12MB7359:EE_ X-MS-Office365-Filtering-Correlation-Id: 6786bc5a-dc38-4388-2e1c-08dbf5a9b141 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T6VRhPSJE0AI/K6ZEXouq7+aebw9KJiwxsYNBM+zHxW6Ypnw0Kf5FnJ5ZCNN+S37TG7+kt1w1MjNX3GVC0n0bNPPXgwGy38eu0wepyjCPxvpWmhl7DJnM+ixtKj4J7lo3XbJ805XSd6c1sdFfJEIyZMFTWk8iCDx/7ymXlR3nFwqSrAT4ZIp+2pzYr4WJYi9kPuziUPMI678nQ4C4OXyaAujZDLJTnhqvILrEkUGeIzDLDGDejSad5BjwfvrlsM38xJMzAg1/6lTqUL4e74+nWfR+hIh4T9u6DBxsRyrTRzp48fS++556scNBXUnEkrwQN6XSfMIaivAkJ9vXWhk6yG2BnjVT7DuKzxlDDId249LwOjlW/rRKBdLwbSfdngdaMcomAoODpNfhvDL3s8VhmP7JTGZfmhQ0hYrrgiYSeeSeC8SbqzXdKgwm1+ZO9O/wnSK3unzmD0xa6kuNtHHfY4llBi/g4HWAK+OfogksHcL5Qs5LkrLnPnVSNVG6x7ImA48EZg50i61qtrKdEINBDg513RPNf0ARVfvz6pZflQ72D9QWi+TnzAE7qN2LpgaFrWwyWPWuxBUSG2oNFmjiXV7uWfwXbUTjZtesfRTqgDa8NBWJUMok4HPQ3E46MXIWHH71NNDXLFAEsEY+e1OW7ol1qcKh8znSsEWAhOFoZykpYYghomr8arhqM5CO8YMKgAdrZWSizV51VfXx58Mo4HmsRmDPxfNm8JRt/PCKGkeCElvl6MT1ovzF7K5XqYgJfNNpExj7HYg+T1KYtlB9GsbK+riWPRfn4r98obocKq12u28EZMwk4eBHswEpqMk X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(82310400011)(40470700004)(46966006)(36840700001)(8676002)(6666004)(8936002)(4326008)(7696005)(110136005)(316002)(54906003)(40460700003)(966005)(40480700001)(478600001)(81166007)(356005)(47076005)(2616005)(41300700001)(36756003)(1076003)(86362001)(2906002)(44832011)(36860700001)(70586007)(336012)(26005)(82740400003)(83380400001)(426003)(16526019)(70206006)(5660300002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2023 15:48:57.4861 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6786bc5a-dc38-4388-2e1c-08dbf5a9b141 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB72.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7359 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 05 Dec 2023 07:49:17 -0800 (PST) commit 7752d5cfe3d1 ("x86: validate against acpi motherboard resources") introduced checks for ensuring that MCFG table also has memory region reservations to ensure no conflicts were introduced from a buggy BIOS. This has proceeded over time to add other types of reservation checks for ACPI PNP resources and EFI MMIO memory type. The PCI firmware spec however says that these checks are only required when the operating system doesn't comprehend the firmware region: ``` If the operating system does not natively comprehend reserving the MMCFG region, the MMCFG region must be reserved by firmware. The address range reported in the MCFG table or by _CBA method (see Section 4.1.3) must be reserved by declaring a motherboard resource. For most systems, the motherboard resource would appear at the root of the ACPI namespace (under \_SB) in a node with a _HID of EISAID (PNP0C02), and the resources in this case should not be claimed in the root PCI bus’s _CRS. The resources can optionally be returned in Int15 E820h or EFIGetMemoryMap as reserved memory but must always be reported through ACPI as a motherboard resource. ``` Running this check causes problems with accessing extended PCI configuration space on OEM laptops that don't specify the region in PNP resources or in the EFI memory map. That later manifests as problems with dGPU and accessing resizable BAR. Similar problems don't exist in Windows 11 with exact same laptop/firmware stack, and in discussion with AMD's BIOS team Windows doesn't have similar checks. As this series of checks was first introduced as a mitigation for buggy BIOS before EFI was introduced add a BIOS date range to only enforce the checks on hardware that predates the release of Windows 11. Link: https://members.pcisig.com/wg/PCI-SIG/document/15350 PCI Firmware Specification 3.3 Section 4.1.2 MCFG Table Description Note 2 Signed-off-by: Mario Limonciello --- arch/x86/pci/mmconfig-shared.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 4b3efaa82ab7..e4594b181ebf 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -570,9 +570,13 @@ static void __init pci_mmcfg_reject_broken(int early) list_for_each_entry(cfg, &pci_mmcfg_list, list) { if (pci_mmcfg_check_reserved(NULL, cfg, early) == 0) { - pr_info(PREFIX "not using MMCONFIG\n"); - free_all_mmcfg(); - return; + if (dmi_get_bios_year() >= 2021) { + pr_info(PREFIX "MMCONFIG wasn't reserved by ACPI or EFI\n"); + } else { + pr_info(PREFIX "not using MMCONFIG\n"); + free_all_mmcfg(); + return; + } } } } -- 2.34.1