Message ID | 20231128125959.1810039-16-nikunj@amd.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3899256vqx; Tue, 28 Nov 2023 05:03:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm1eYDsw/LjvFvbciAPXmlkLmbe26WYgD8u+5s0Womj9st1iRsOSIBy2Fl9afvpup7a/Fe X-Received: by 2002:a81:830a:0:b0:5cb:23:d28f with SMTP id t10-20020a81830a000000b005cb0023d28fmr17810718ywf.14.1701176590507; Tue, 28 Nov 2023 05:03:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701176590; cv=pass; d=google.com; s=arc-20160816; b=O7kaHRiQ+Sf2q3LbloI3Ol4mLHRelkDkvIHOIdi1UIp7wcmeO6BLkJ2ujoavVHhlrZ k/boriTR50Ij0/LRwU70eFMrTl7H94/2jis4Mf3WEytFhqX3U4JXcLg+rzPwQOVy5Hsx 2HQ7xMQrCa9Xavu386uj1pGdM0I0Nc5fszZqeUk814QxHiYQ5hb3mZCLYIvGFOnPS4o/ A9X8nabr6Lpm8BFwnZrufZOTJjXLYYMQzfNWL0vlJNhGvDkjI2x6EMXgdul8+d3GvxOV R+TOSS1oMM34ZYLpLVdmt+unYcqwnNhEGuji7nV6oJ8SwK5AsZhZ8TH4XXFCq1hKiXLR 2TEg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dugs95Hj+tOk0V2ks0J2fCcDN8SZXA3/1orRt+znSmE=; fh=GrBYTfaCmKSBoJ0OQBiloTDpWB/NcGHvBdTqN4MlWVs=; b=mf5S9fWjOHf8T/LfHqWe2xxATZXgw3poFLKDmPh0ATMFt5apgCNm/z6V0uC4sRAVRR qOKgDCRPO4Gmflblz8JLlS2jqFOZXe1VoA5E9RpTYDPHbaBqBnnAlKN/kMAj3XiNVTo8 QHxWrtxbA7f3LxtH87SqpN0eA4W1M+3p+4VUulnqLHeN/iJ30svWavfjObSa1oGDifWB 8y53OaQ1bNcEySNQBOlx8T2Kp5eaeUjCqj52VZusDMRjoqxrTjOo2RnKyeRbTr4ZjUO4 JiCZbkDeqxDiXtfrXbAsuMzb34yJc1roMQ8TXfU/23KQkIRlycc2GlvA8OVaTg+sCrj1 hpFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=uBKKM226; 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bz5-20020a05690c084500b005c9c3753c4csi7296442ywb.348.2023.11.28.05.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 05:03:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=uBKKM226; 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:2 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 agentk.vger.email (Postfix) with ESMTP id F1CB68055562; Tue, 28 Nov 2023 05:03:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345161AbjK1NCy (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 08:02:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345197AbjK1NCX (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 08:02:23 -0500 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2081.outbound.protection.outlook.com [40.107.100.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1866B2126; Tue, 28 Nov 2023 05:02:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D66yO6U3eFKLSDcKxJMR+hA056K40H7207YoQCcTL8KZ9jwWARWkb7ITnULBqppFtilNaWiaJcP3EbUGK4VF6QW3gAt0qyrYV0aHlKu4nBRXke9uPjufACGGFBh76bUqxRieYgszm8TUm6/kIuuLvOwTSVAxhOq0YSSy713Ym8heivwKjwhz19c+bEKUcrmxjIfEkfnmrjbsVyjJd0e57LptKrv9CwwXIWReLiIqMiPkkBy+Mm7EsVDV26VsDDzEPOeayNjaQjHKjcbvR2QVtgRQgGYN7o2KbzqT7hTP4WnXQttnVankc/QT0RdzwgoicwJSrydAtw314or1Ja3NUg== 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=dugs95Hj+tOk0V2ks0J2fCcDN8SZXA3/1orRt+znSmE=; b=ogjfPKS2IDDMSJb3ZJGLWQc+TXegQR20z5XuGXcMkqJfD3bFYjkhbWBFLX3oeYwKUk+Ohu9+JSM69L4Dz2bEBdghcbRGqSmfyZdWBAMWVMAPNxyDF68tZBX1Us4ZLVp9I18Jf2vYSSxknB8JVdP9FSk/4MAnqm0PWSYmGe7loTiN/1zlJ/QYNoWLQEN3wuTiPHnEtT4ri4WhEPwMDzDSP97Oj+eM604LGzUt+zLAER9/O0aa3CZ1bcK7b5afDIW+/2F6uxSpcKrzH81gu2Mh43CNlpDDs7IMuDAJrZiD7n/g9DvvGp9PCEV9KNG1sppJVin+RTSLpdZTupsuhP6j6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.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=dugs95Hj+tOk0V2ks0J2fCcDN8SZXA3/1orRt+znSmE=; b=uBKKM226uXjYaaXTtK6wi3L0t6WZyY0P76oEaQSzPXm1VYcEVEKtgecNg3tJSp+e1GpCEPbkSatsVPwwUhV0Gam+5yh+g7S/0VTykX0pTYsgmwSxVWPfmmcy2WIlIoR9On1XBLpcTcSthS/yd4avbsFarKS0C7SVsdd4NVXDvIQ= Received: from CY8P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:930:6b::18) by SA3PR12MB7782.namprd12.prod.outlook.com (2603:10b6:806:31c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Tue, 28 Nov 2023 13:02:12 +0000 Received: from CY4PEPF0000EE32.namprd05.prod.outlook.com (2603:10b6:930:6b:cafe::b6) by CY8P222CA0011.outlook.office365.com (2603:10b6:930:6b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29 via Frontend Transport; Tue, 28 Nov 2023 13:02:12 +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 CY4PEPF0000EE32.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Tue, 28 Nov 2023 13:02:12 +0000 Received: from gomati.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, 28 Nov 2023 07:02:07 -0600 From: Nikunj A Dadhania <nikunj@amd.com> To: <linux-kernel@vger.kernel.org>, <thomas.lendacky@amd.com>, <x86@kernel.org>, <kvm@vger.kernel.org> CC: <bp@alien8.de>, <mingo@redhat.com>, <tglx@linutronix.de>, <dave.hansen@linux.intel.com>, <dionnaglaze@google.com>, <pgonda@google.com>, <seanjc@google.com>, <pbonzini@redhat.com>, <nikunj@amd.com> Subject: [PATCH v6 15/16] x86/cpu/amd: Do not print FW_BUG for Secure TSC Date: Tue, 28 Nov 2023 18:29:58 +0530 Message-ID: <20231128125959.1810039-16-nikunj@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231128125959.1810039-1-nikunj@amd.com> References: <20231128125959.1810039-1-nikunj@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE32:EE_|SA3PR12MB7782:EE_ X-MS-Office365-Filtering-Correlation-Id: c578c474-ade1-4079-bf5e-08dbf0123cae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QBQE3w2kvXRE4wewRLKFK8hMwlkFZpBy2HRkSRAOaBPEzUWH3u1pcOrLg6BQkxSP1c9ngrdHajDDUOd4adDYe8TtxCpbMl3fqVZ4YsTZ+swP1lU+pNRDpGTJka8D6lNTcHyZHZOalWmqKVbSQk0QVqkJb7A3VdetujnKBbDU7dsQnmiJA9LgoR7swx/AzMdN5Occtkshr+P0T7Y1+3fFvpc3/FwNNEQYbkINqmE9xeBiNN0y1p69dtekGejs6eQ7j1WaZABm0JX39k06LZAme2J+XssAJbxgCYmVnSgw9b2EXeFsPqBgihWQgxwQ/0h2R8zz1hdRS64E3lgkXNJZdl4RYDmRrjHTdb3gcBdw7iXbq8lDV9pxhLDMgVNo9RzUchsGCG1EP/+W6ocZsElZcGcZSDGrbD+jjmqUNKUOEwxvmSPgOvR7NhdXEh0vhjM27Ea2gqMp/YQaWPmDomlh+9W7L+dL1qpJOCUvoozDPeJ75POwMZ2sqZzxA7Rl11Fg7pOpUcRWrVpSil19xw8O1w41zsEaQqhlynMAkmAEhf7X5sG9mrd8d8g9rnfpeGSq8ZX1i4l1NBdjKtEf7c5LTl7cXlszL24KxoB3efxZ7XQLSFNcmnZAQjI8x9y0lWLEJiF4bU3we6wcu05+axhX0D74j65oKzQIxQJtin4KdK1cdX1oHYJUgct4Evwj4DWvT4xM8+gigKdiwMyBvbPWNLtdSOkeK3hr+r7IAjLo+8k2RhlrIftAlnpuS0lFFzBLEHO+BkYJ3TPpIj658cfKww== 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)(376002)(136003)(396003)(39860400002)(346002)(230922051799003)(451199024)(64100799003)(82310400011)(1800799012)(186009)(40470700004)(36840700001)(46966006)(40480700001)(26005)(7696005)(1076003)(6666004)(2616005)(478600001)(82740400003)(36860700001)(81166007)(356005)(36756003)(7416002)(41300700001)(2906002)(110136005)(70586007)(336012)(5660300002)(47076005)(16526019)(83380400001)(4744005)(426003)(40460700003)(70206006)(316002)(54906003)(8936002)(8676002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 13:02:12.0282 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c578c474-ade1-4079-bf5e-08dbf0123cae 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: CY4PEPF0000EE32.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7782 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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 28 Nov 2023 05:03:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783812944504836869 X-GMAIL-MSGID: 1783812944504836869 |
Series |
Add Secure TSC support for SNP guests
|
|
Commit Message
Nikunj A. Dadhania
Nov. 28, 2023, 12:59 p.m. UTC
When SecureTSC is enabled and TscInvariant (bit 8) in CPUID_8000_0007_edx
is set, kernel complains with the below firmware bug:
[Firmware Bug]: TSC doesn't count with P0 frequency!
Secure TSC need not run at P0 frequency, the TSC frequency is set by the
VMM as part of the SNP_LAUNCH_START command. Avoid the check when Secure
TSC is enabled
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
---
arch/x86/kernel/cpu/amd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index a7eab05e5f29..4826a7393e5b 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c @@ -551,7 +551,8 @@ static void early_init_amd_mc(struct cpuinfo_x86 *c) static void bsp_init_amd(struct cpuinfo_x86 *c) { - if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) { + if (cpu_has(c, X86_FEATURE_CONSTANT_TSC) && + !cpu_feature_enabled(X86_FEATURE_SNP_SECURE_TSC)) { if (c->x86 > 0x10 || (c->x86 == 0x10 && c->x86_model >= 0x2)) {