Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp218938lqh; Thu, 30 May 2024 21:38:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfBdxDqXIOQS7mb+9Qyf0XnSgr6QDCqeyN+ARg10ILPOocEifUYaXg2/NmkGdAMDXcJU4sg1FcQemg2DG+ITmzXxxbXbnoNeP2ZfeMpw== X-Google-Smtp-Source: AGHT+IGH+BRxu/NwJa1PGz0gTj1HADTrDi/j7pfomXDU9goIqpkAKrWS1/giTR8hiCbn5C8qPWy3 X-Received: by 2002:a17:906:3ec8:b0:a59:9a28:f1bd with SMTP id a640c23a62f3a-a6821f53499mr44233066b.66.1717130333161; Thu, 30 May 2024 21:38:53 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a683063b9a5si31716166b.861.2024.05.30.21.38.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 21:38:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=hhJHTjZO; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-196270-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196270-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 936E51F23079 for ; Fri, 31 May 2024 04:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF88713A3F4; Fri, 31 May 2024 04:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="hhJHTjZO" Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2072.outbound.protection.outlook.com [40.107.220.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 697E4187572; Fri, 31 May 2024 04:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.72 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717130098; cv=fail; b=J7Y/PwEdgBy/7j07wb4KG4L49oxUXqrwGOon9+RzoeIXSS61tGaNGzEevHQXW0xBLasrd+HY+aSiwy/msbnwPOJLLVUwG/SPY3BZ9aLPrvgIpei9ZBvn7BF4yU/7xcZRzZWU7i8ZYNU1AhmaAojTHplLgeFL1ZFo8c6fldUHJhA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717130098; c=relaxed/simple; bh=wjgsaMYeT1GD78TxdoMUeB43JDwnow8CRuB1a5G31SY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=p3V3bot4ueScWZzSXLg3TzSDjr0fdGUj+FRFcSWy+JKql+nfO0t8pAXuW6J/DNjAgqb4Fu8W9dkqnlm23rjKrtp5UIGyPr+8TSQj8rx+ZFYisSRP98h5M4gRIZelnj0W8et/3RWZgiAKiAcS2davPkuGcmGh/Qv+9KzYtTnOs+w= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=hhJHTjZO; arc=fail smtp.client-ip=40.107.220.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AI9XakDAJccOJtmrh6ibu5CuDsCEtx85uAYJJtQlmrHjCHSkZ6/KORSOV9mb1Up1F4iGd7O3Gbhns8XpPtb6tx7OCjBViYRavh0c26gX6ZjYdKLjF599X5wR3AzN4d7vsyJUw+d+MF07Y9IzFht5W+roduSqhfNYop+Sc9P9HIlUQNhFybb9+yyOiiLf2cfVHKP6/Du0tI8K4QgTWTDiN+xZTx9RxvSQkzr5Qh1eGBYx+imsA2H/Aw8Xa/A3kf2ssmML6IHptJBBC85Yy0fxiMYlqxVJGUdaqXbsC0TjfLOG5rdKNoR1J22qGvTWnjE4LEtP6kAAUBZoglhB6aWlNw== 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=UAaAbe3aro4EM2xBQdGp/o69Ah/mnZD76EyvwIMZKr0=; b=lzGnVYNlV3vKtV3sgvcKgcgleSuzke4Ov5G0lN4+3uZyvO7NZhAPSRotPrdHx3ME+4htsfq48sRArLAgkyXMF2gn5oMD62lWdTYhtAssovfVb1fG+s04JTnRgbTx4YIFYpQWz3pDhNwZw/vw2KQ6tV0CFDkn+z2fIV+zkfUYgXCLQABCWrtpmkXt8Qv4qiO/BGf7Mtbtg4wx4tZiZPEC49ieP78oQ9fsm5MESgi88ry2XgoVLOAWej0ZSbSX3CpbA62lLjlMfBrDSc3QzX4DlHFZTE0GOHCiR37/Pjo7jBlHC7wT2ncr56UOQekbCHNb/lyr5YhFqByCnRH0WVEJZA== 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=UAaAbe3aro4EM2xBQdGp/o69Ah/mnZD76EyvwIMZKr0=; b=hhJHTjZOPJ4M9uFVgC26T9YdfNr+I3hNJ/9qYfaX0G3ZToUtCe5RJ3h/R7uVOlKjjY0Kg8Ab7fnRbfLKBnobh1cq+dRyKy2JvzCFv5ksJ5j7daCwAaKh9gdUspDNEaQ2Y0Mg3BPZ06TMVSj2MBDPaydiqhbb8E4Gn//mozGO8+0= Received: from DM6PR08CA0054.namprd08.prod.outlook.com (2603:10b6:5:1e0::28) by LV2PR12MB5893.namprd12.prod.outlook.com (2603:10b6:408:175::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.21; Fri, 31 May 2024 04:34:50 +0000 Received: from DS3PEPF000099D7.namprd04.prod.outlook.com (2603:10b6:5:1e0:cafe::a6) by DM6PR08CA0054.outlook.office365.com (2603:10b6:5:1e0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.22 via Frontend Transport; Fri, 31 May 2024 04:34:50 +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 DS3PEPF000099D7.mail.protection.outlook.com (10.167.17.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Fri, 31 May 2024 04:34:50 +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.35; Thu, 30 May 2024 23:34:46 -0500 From: Nikunj A Dadhania To: , , , , CC: , , , , , , Subject: [PATCH v9 21/24] x86/kvmclock: Skip kvmclock when Secure TSC is available Date: Fri, 31 May 2024 10:00:35 +0530 Message-ID: <20240531043038.3370793-22-nikunj@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531043038.3370793-1-nikunj@amd.com> References: <20240531043038.3370793-1-nikunj@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: DS3PEPF000099D7:EE_|LV2PR12MB5893:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d9619f1-44d7-43d5-c642-08dc812b02ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|82310400017|1800799015|36860700004|7416005|376005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vMqFn3yiNJCkV1Gr1r+o8GqsAE3DJGcERatRsHP09qqqHfgtrdT5TYAzgkHe?= =?us-ascii?Q?uXV9UITW+6rlOEMcwvlovMweQ4vcOw8hjH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vWPUkAwCkpvrI9/daJLTMgbGj0O8nsYMLWxfOycvvF7OxMLTBYk3?= =?us-ascii?Q?2f0Yi6qpOF0U+qP/xnrcJnN7YhnSRRhvOqGbOwqnEmp7EYks2FcQAs6wGebV?= =?us-ascii?Q?9l6Q26Crhqki9XvLvUL+zPojuQf1Cpfx8ORFSwvHlegr/NcG65/E+6SfsirM?= =?us-ascii?Q?K3NLkNVZumc39y63q9ZcbL/v3UVp1u5t5au2ugRm162BKz45gFxngqcY56fF?= =?us-ascii?Q?2eybTTO6A69ureBh8IfKxFeEVGnM8Cm8W6i7+IjvQJ1BjQfxNFIAIetfnE90?= =?us-ascii?Q?X/Dnr3YV2HZ32IfrFiyfmzLVOuJrfB8YSx8cJDmh2+L+d8//LBXZo5Pbn2tO?= =?us-ascii?Q?eQQJkmSQg/471s4vKh7ExeLEmcrICztpL6wSSyl7hLOkixWoLGGhOkS5W9BB?= =?us-ascii?Q?FZC4TIvOxDsuAS2k95SCubO3mr56?= 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)(82310400017)(1800799015)(36860700004)(7416005)(376005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2024 04:34:50.7571 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d9619f1-44d7-43d5-c642-08dc812b02ae 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: DS3PEPF000099D7.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5893 For AMD SNP guests having Secure TSC enabled, skip using the kvmclock. The guest kernel will fallback and use Secure TSC based clocksource. Signed-off-by: Nikunj A Dadhania Tested-by: Peter Gonda --- arch/x86/kernel/kvmclock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c index 5b2c15214a6b..3d03b4c937b9 100644 --- a/arch/x86/kernel/kvmclock.c +++ b/arch/x86/kernel/kvmclock.c @@ -289,7 +289,7 @@ void __init kvmclock_init(void) { u8 flags; - if (!kvm_para_available() || !kvmclock) + if (!kvm_para_available() || !kvmclock || cc_platform_has(CC_ATTR_GUEST_SECURE_TSC)) return; if (kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE2)) { -- 2.34.1