From patchwork Sat Dec 30 16:19:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 13506924 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44F00C46CD2 for ; Sat, 30 Dec 2023 16:30:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE0486B0163; Sat, 30 Dec 2023 11:30:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C8F356B016D; Sat, 30 Dec 2023 11:30:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABBCE6B016E; Sat, 30 Dec 2023 11:30:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 943396B0163 for ; Sat, 30 Dec 2023 11:30:37 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6B65F1C0DE1 for ; Sat, 30 Dec 2023 16:30:37 +0000 (UTC) X-FDA: 81624022914.25.82AE258 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by imf10.hostedemail.com (Postfix) with ESMTP id 614CCC000E for ; Sat, 30 Dec 2023 16:30:34 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=LX0cMnah; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf10.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.236.40 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703953834; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=tvsYf0n2GxElwqDzXGtfzBBHQRJyP8zKv4HrR1SkNBs=; b=NFOFqdO63bWqXD9MZFWuHcZ36L0d9WPyZxx3UkAc8Vr13sTaV70cDx1MyDDHJwzSvdBitn hX5E2vaZ8G1uSik8qKFWyBlmZvm+OE9zlY5EPZWhw5KZ5JZDtWdeSmdJe+MoPwqGwA5Mec 91Vk0RK7+MyITzZvP31LDP3LQX8LU7U= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=LX0cMnah; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf10.hostedemail.com: domain of Michael.Roth@amd.com designates 40.107.236.40 as permitted sender) smtp.mailfrom=Michael.Roth@amd.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1703953834; a=rsa-sha256; cv=pass; b=leUfk7S4CsLRx+mupSxBAO5OtV2WAN4f1+yAMqhRwRt+oPdFTk3ar0i1eDmBRW6DVQyJuk KpYRNtDhLHUGHS5wc+0jP+tYwhzd6qqt7OmIgIu+wjhRHB0NLT+z5w0BqwhUgrreqCLrlC OhixwbvbYmW5asmcRIZtzVyQwee/dKY= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fNVNV0jyxsmEvVyLgF2Svxz2XNXsutze1uuLhcNJMa00euVQlK5Fmq1lPH4wNl2R6Gh2uUcmXpFmudSA9aLppgx0R2ITadYfy4FRlPeUbolEqNTRe6++EXGacfe2axVoTrkzKuVswzQPaoOYJT2EUB1n9TgXBRHIoNS0R/8i1CuyF7//HD+EXSYTUAJpQbOK9Ce9OCTdpmcQCaujGLj2izHdy2Ew5iuHzQ2igZP7kmvwjM1Hwg5hjSUB9kiu0ZzEucdRVENyTgNI+zJZGQSJhjS9cP2bdv/rQ8S8GnEM0HGMEx7j3P77yOQSjYbqwY5V/wX4Ex/2USmtrltwDI6aGg== 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=tvsYf0n2GxElwqDzXGtfzBBHQRJyP8zKv4HrR1SkNBs=; b=IVazzJ5E1LbWWdE4AMSriJD3xhfvprx+gNfS+xTYPs1cUNTnZD54bVUXzv5feky0obigd4npV6NozelL0wiQ83WDeWaxaqS4hhYpMOlDAY5o+Jwv2swiQ47tjgkLIAGd3UvA/yhbHQTCI4a5/jAAAAuTdTkqO3sMCFHSnf1ueohJLKMiMF2Z36G68PnzWu6m1O9apKaYg6123UCmZkxuZyfU2OVeVWrvlPjUZSSxZMYSe91OQELwPPxLcSKsS39JMHIJIpxfrgiCgbi/Xbi0KZtNlTSg90GyfApK+x78jlCqvennhYfR7UBcJVF5C77FMUHG2LGziaCtqYkc6ncxvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org 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=tvsYf0n2GxElwqDzXGtfzBBHQRJyP8zKv4HrR1SkNBs=; b=LX0cMnah+beOhxX7Wkpv6PLcyBAHhCBp+WIruAhj/n4OyhxNA8QI8GT4VtGnIL04smm9SYrwFUXjF3JNSfg5s+WdRWHUH2AvaBnFtlC15Lce0tP7lDxMaaZtiebbJZBYxdM7lOoN0b6Rvjk1yuyJa9+InfaBhpm6hImqDMaMP3g= Received: from SA9P223CA0028.NAMP223.PROD.OUTLOOK.COM (2603:10b6:806:26::33) by CH0PR12MB5299.namprd12.prod.outlook.com (2603:10b6:610:d6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.22; Sat, 30 Dec 2023 16:30:27 +0000 Received: from SN1PEPF0002BA4C.namprd03.prod.outlook.com (2603:10b6:806:26:cafe::b7) by SA9P223CA0028.outlook.office365.com (2603:10b6:806:26::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27 via Frontend Transport; Sat, 30 Dec 2023 16:30:26 +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 SN1PEPF0002BA4C.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7159.9 via Frontend Transport; Sat, 30 Dec 2023 16:30:26 +0000 Received: from localhost (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; Sat, 30 Dec 2023 10:30:26 -0600 From: Michael Roth To: CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Jeremi Piotrowski Subject: [PATCH v1 05/26] x86/mtrr: Don't print errors if MtrrFixDramModEn is set when SNP enabled Date: Sat, 30 Dec 2023 10:19:33 -0600 Message-ID: <20231230161954.569267-6-michael.roth@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231230161954.569267-1-michael.roth@amd.com> References: <20231230161954.569267-1-michael.roth@amd.com> MIME-Version: 1.0 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: SN1PEPF0002BA4C:EE_|CH0PR12MB5299:EE_ X-MS-Office365-Filtering-Correlation-Id: 30e12e1e-62b1-490c-5e4c-08dc0954a156 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pNqUTEasT68+PI7tuKei4cA2VnNa763bd30gN6xo6vb7b/Pvy4jWIz0jALTcxn5uvf9bC0yk7DdDMl9veJfkHAUAcY825WJdwOKbAi9x8YwuvLpUe6u1/NgvLFeNysE1nKAiD2FBkGqy3bpNqW9ts5js9DteHgHIQR5N/UHRMzKisRx4uy5W/UjCe9LLo1PtnMEK2zzQf7VUNhHJOu8azb9fe3+8NWxCszhWFJ5DiyZj3h2gaRDFYpRDF1IqsnIWXConHzMIYm7ie/oa9YP9SueNuQLzouqLW0FV6SH/Ps/leYgiZ9BcHoUx6x76hA2hRBfeuAmd/f0IaSTGfxj6NcRAzh7ec948Dzracre0xIqKPbtBIOgo/GS+cZh1qYUQpAf0nxX+sc0JilGvmO/s0BxFHh/wK/xUIcYHlwExNXcEs+a/e8mWRxvYU8AJ9kVcu1IVvFCqEvuX3BTmOmnfxk4wjtlZ7ONI40iEe68j3Y8tRh2KY5YWhrW9CTcObl9GWUL/KBXzh8cIQFczQANWvs7g329WTBA8LJa0+grUub2RxOoYeFXpuORtlmwRCttsVHrcm9AWPTsyRldCesN1oIF4M3XjPoo4ALZtHJCVCS9CAghVN++W8yAT/Dtdx4zVD+4pSoW+f4+eX6oXpqkos1VpjvJSGV6+VdNvqIM4dV7aQXD4SEQQjDi/IjYrW/ghux54lfDmzCZIFzzaN/YIfwcIHftr31PCCcSmpGFM/mBUdubcB5toAbGeV64pEGjKcOE55txIZ/Th2jvcci6LDQ== 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)(136003)(396003)(39860400002)(376002)(346002)(230922051799003)(186009)(1800799012)(64100799003)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(36860700001)(966005)(478600001)(40460700003)(41300700001)(82740400003)(44832011)(356005)(6916009)(36756003)(4326008)(86362001)(316002)(54906003)(81166007)(70206006)(70586007)(6666004)(47076005)(336012)(426003)(16526019)(26005)(1076003)(40480700001)(83380400001)(8676002)(8936002)(2616005)(2906002)(5660300002)(7416002)(7406005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 16:30:26.7993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 30e12e1e-62b1-490c-5e4c-08dc0954a156 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: SN1PEPF0002BA4C.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5299 X-Rspamd-Queue-Id: 614CCC000E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vfb3yEw11peJJ5yDszr+37uu8GcNoYZaTJwCKs22KqpAOOTSjPOSN9q4O9Sbiexu5tZEnMOgoYUr3rTaQrdJY8YiYKeZ0M2ft9dO6BYu1OBi6XCS5AcuLHPXkrrhRq5dp4SQz0LB3K/eV2h0Bnf/VK0zJ0LsmY8Bp0QIW5BrNKwmtAnlmkFQ0nRgAN2j/I/ycdNXmj2csaRtGPz7appFBAO5F2E1Q3PZs1lKRA6Z0DcPalwyVm2P2J/2RvVykwwIRbTqbvAhlVddfRJXviyJf5a6oHaw3HBJnIRFt5OEQMyXSqa1Q4mNEZtLj73PYUCnIAO/iS7RHMMAxnoiWzt2cT5ssETwBjaj4XYAYkrjMll3JV5eRQafHX83m5J44n6RLnRCWNe2+ZK2QDQREmb4tqK/J9V2H1i X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Ashish Kalra SNP enabled platforms require the MtrrFixDramModeEn bit to be set across all CPUs when SNP is enabled. Therefore, don't print error messages when MtrrFixDramModeEn is set when bringing CPUs online. Reported-by: Jeremi Piotrowski Closes: https://lore.kernel.org/kvm/68b2d6bf-bce7-47f9-bebb-2652cc923ff9@linux.microsoft.com/ Signed-off-by: Ashish Kalra Signed-off-by: Michael Roth --- arch/x86/kernel/cpu/mtrr/generic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index d3524778a545..422a4ddc2ab7 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c @@ -108,6 +108,9 @@ static inline void k8_check_syscfg_dram_mod_en(void) (boot_cpu_data.x86 >= 0x0f))) return; + if (cpu_feature_enabled(X86_FEATURE_SEV_SNP)) + return; + rdmsr(MSR_AMD64_SYSCFG, lo, hi); if (lo & K8_MTRRFIXRANGE_DRAM_MODIFY) { pr_err(FW_WARN "MTRR: CPU %u: SYSCFG[MtrrFixDramModEn]"