Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2063685rdf; Mon, 6 Nov 2023 03:54:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHIoht5K09SqGEvWpLCB8FK3re6CL55BNBCRo5FvIXqK+65sN8lRNpeABeiXaxFI+sZk+89 X-Received: by 2002:a05:6a21:7185:b0:180:e2b8:3b0e with SMTP id wq5-20020a056a21718500b00180e2b83b0emr19206385pzb.50.1699271661741; Mon, 06 Nov 2023 03:54:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699271661; cv=pass; d=google.com; s=arc-20160816; b=VZonmh83pgZ30UXh8RzkHHA06LxIAFoCxDr06+sLeaCchJrF1D8iHJPfD9GaQ97lJR ua4n9nDqTNaWEYCLZmS8dx2rwZTw/uBWf/Vod7L6M+oSfxHneXpQ6Ipcoe0siLvlJch5 vE1J27+euEE5t6UORz6sNFsCmmwzi8PVyPdZLneBYkX1F9g5Su7vEVXYI4SvFu0/1SPT FgnPmysuJ9YetNKqOLnkr4biWaowjgEH1zvabe6pcUaTaCtQb8+5uAhiQ59JKZWpspjY CjPRixCsBbm7cBnpyAFWcChScFmhDL0vZnZ8X+CrLHTeI9BPaJCm3O9LFoTQNNKMIkhd nP9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject:reply-to :user-agent:date:message-id:dkim-signature; bh=CC803RG7GJFm+5UI+HZBOokAL8RnDCQfaPt9NLNt7Ls=; fh=oyLKe9cOqnNCCZMavKpeKG6LKYvc/MVP7RZPSlYEEQo=; b=XaAd2EiaP1mQjm9H29PeoGyMGSI9q75kdJQJcTLX319CWnOy08N8yxXvN/9HFM+5eO aDpKlVkcBuIHq2OUJ6zE8aBKfcGVflim+WJMjGQud9qohvCqyvMd3QjHyJ+wWv9OhnsI 0jsz+p/fs8QhNFhqQkhgGHDq0p/3YA194tMXWoXvAaMkneylWJnfrwZ7H8ahPS79pnOE z6l8QIcNWoyULdExJ7vzo/ttvKztiF/Z7xfsIi532g0DiiVvnlZ+h2bEAGSjDal54tv9 0WOx1qZKbj7bGgh2jLNPtcNj0AM64ezzh/GYBKxCL41sXtVLMgT/O3JlHdaZz0tHANio PFNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=BwOV+M05; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id il6-20020a17090b164600b0027d54b9f379si8255496pjb.123.2023.11.06.03.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 03:54:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=BwOV+M05; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 4B86F80401FB; Mon, 6 Nov 2023 03:54:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229583AbjKFLyG (ORCPT + 99 others); Mon, 6 Nov 2023 06:54:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231543AbjKFLyA (ORCPT ); Mon, 6 Nov 2023 06:54:00 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2068.outbound.protection.outlook.com [40.107.92.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD79E100; Mon, 6 Nov 2023 03:53:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h2DB7n5x+eUONN7aLOjigijXIXnGyK0oz4hmK3xZLJneH4SPH0BJz53u2ksuinnv54IgtYxHdyKtxXr5rPWLh0msfKTtLyarj3W91M9pch1XBm75CeyEn2908CaqnRm1IOIsCCvB2nLWF/kcfL9cGgENtIoF3tRv5q5/RYh5Qzl9V27v9DRMmzFf8LVTKJF1cSVjX01GXhCBkDQNQ2zLVApmzmxnWv8+jUN4AT+75KkbHlEaT/EXGlSfHA7YQds0vUjeI399y7zBJDpE+owybnE4tydCNa55bkafzgpoQrUJavoJZyYB+pedCXX7Pp/snlOVzI7zV0MCLhuG1GWWjg== 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=CC803RG7GJFm+5UI+HZBOokAL8RnDCQfaPt9NLNt7Ls=; b=eUI+ie8Q9dSVRZPmyJisCTxfEbb+t6l1BEW8mbneGhpeaTcnkGPk1phE+6PvVbf8q+Xi+iw0iLdoPaDmMSBQbud1l3JZwzKdGJBaddrWk5CHsvI8c/t2NjMix1GQvAYUdnCA8SkzvWbHEaUmbavkLqtFQh6gyRX4k0SAhPzunyVhwVAocCR0TrrosBXTkG1MhLSGlz1GRLN08yFCsIbLEIbM6bEBGOjIYIMS6DTuB5tykM9H/jI0sJQMLSDXWKJiq46Iu0bBCgQN+mwpAFePWKCnRXBwLSneKwZihRTQDZIYpazabK91b1Si9gpyfwyw4aoi5IkpU/nfdMnmX1YtIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=CC803RG7GJFm+5UI+HZBOokAL8RnDCQfaPt9NLNt7Ls=; b=BwOV+M0535ziqOe2bMbSQThoqQj4GyFIRjGPKmLydV9o1j7CNZF4tzcnTW5LSYE61ZTw4yJjisquEsNovb7+iaU+uYRNYaaYcKPh2Qvu9LpOQ6dAf9fKtIsUEmZut/YemXiH/dZftrXtk4k9glnaUh7gTO2grn1ks/wHgRsQWdc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) by CH0PR12MB5283.namprd12.prod.outlook.com (2603:10b6:610:d6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 11:53:54 +0000 Received: from DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::93cc:c27:4af6:b78c]) by DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::93cc:c27:4af6:b78c%2]) with mapi id 15.20.6954.028; Mon, 6 Nov 2023 11:53:54 +0000 Message-ID: Date: Mon, 6 Nov 2023 17:23:44 +0530 User-Agent: Mozilla Thunderbird Reply-To: nikunj@amd.com Subject: Re: [PATCH v5 13/14] x86/tsc: Mark Secure TSC as reliable clocksource Content-Language: en-US To: "Kirill A. Shutemov" , seanjc@google.com, pbonzini@redhat.com Cc: Dave Hansen , linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, x86@kernel.org, kvm@vger.kernel.org, bp@alien8.de, mingo@redhat.com, tglx@linutronix.de, dave.hansen@linux.intel.com, dionnaglaze@google.com, pgonda@google.com References: <20231030063652.68675-1-nikunj@amd.com> <20231030063652.68675-14-nikunj@amd.com> <57d63309-51cd-4138-889d-43fbdf5ec790@intel.com> <20231102103306.v7ydmrobd5ibs4yn@box.shutemov.name> <5d8040b2-c761-4cea-a2ec-39319603e94a@amd.com> <20231102123851.jsdolkfz7sd3jys7@box> From: "Nikunj A. Dadhania" In-Reply-To: <20231102123851.jsdolkfz7sd3jys7@box> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0044.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:22::19) To DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6309:EE_|CH0PR12MB5283:EE_ X-MS-Office365-Filtering-Correlation-Id: d576e8f2-9b19-4d59-3da8-08dbdebf0ccf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2/WWbyEE7V0gl/JXvqZdIsaLc6NtYDzq9BWTSQeh1X8P91ue4y1lo1MRuhgtUyKtbWI0AVkAYqqgsKviCEHA3Cjbs5zzh9CTPN9cWTaJ83f+MMwu9h9ntMEw2gzlCuhI5cYY01fZGsutsgsgx2TgDpgzdK5bOmXso70KgAJfuPnDQYF/EqLS7z0BdqY83pXhSyQSUx7vKuCGzRnRAffxjG7eQJMKlTSNvGYR+3F8jXr3IANqeBiDOYrIgpFHW0QSlOy/Y2FP0YHMPBdxezkgGVl6b3jKdD1qKBsMKBqb/PG8pueUyQWf5+sU2iWww8tDbBF1wDEDipiq8r13a4d2daG9cM99S1ZnxOr4m7N4JzuduKM5yBcSW2AFQXQgt8hJhLy0Yv05F64KUUuEfxhLRKV2PwDwu+SKPQ6xp+DXSsHQWbRfOttKO1npPqwat+gVWhQF3yerOeAWO6zvgsXXGeSnyVF2StuKWwd7ylqxk+HdCRJVa+NvM3ScNnTWXin7CbwG6q0Ffw19EXh+cKO3IDksu2AZyDorw9xQ6VOQvFdQNQ27Iq3EUQtcWGgcAirpBDdk9bjml2ORRg0BuWhTKKMYr8vo0m0eVKoY4hNTJv2HEZ2VZk9TMQOmrX7Q1CU5zmGTroFtTzFGDhIwZkCktg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR12MB6309.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(346002)(366004)(136003)(376002)(396003)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(83380400001)(316002)(38100700002)(6666004)(6506007)(6486002)(478600001)(2616005)(66556008)(66476007)(6512007)(26005)(66946007)(7416002)(5660300002)(53546011)(2906002)(3450700001)(4326008)(36756003)(31696002)(8676002)(8936002)(41300700001)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MVlvdk9WaWlUcXg0SUpxNWhTUU5vKytTaVl3UE5sRlRyQmhxdlpyU1FoMnpm?= =?utf-8?B?TGZrK3FlZit5anVqQXB3b3dUVUtmNlRFZVBkbC95MS9sNFR1ZWhiM3RXSjc1?= =?utf-8?B?R0tWZFdJcy9wSXplejJoY1JPWlVCTmJNenVBeXFqWjEzeXphVVpBSjBqVFdW?= =?utf-8?B?ZnhHUHpvK3E4aFRXNklnN1d2WVowVkdJMkZVazNMSkNmYWdSajk5a1RkRGV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ZjTGE3T3BCRDZ1UFBDcWR3MHc0a2VnSVVzSDcxaXExWlZX?= =?utf-8?B?OFlhWEZMS2xYVEpvVmk4enZtb0VZU3pqNnBQQ1lUVTFqanhnUmlzQjR1Rytq?= =?utf-8?Q?x7tFvrSnoyLBYoJ9igaOmDk89?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d576e8f2-9b19-4d59-3da8-08dbdebf0ccf X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6309.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 11:53:54.1533 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: S3Wu/f6v+nlA6qL27o+ow8oxt6C/otuPAp0TY/QTdEyd7HmjECV0l4lYX03b1dcRyWg6W8WouAsVAZc2gaP9rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5283 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: 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]); Mon, 06 Nov 2023 03:54:19 -0800 (PST) On 11/2/2023 6:08 PM, Kirill A. Shutemov wrote: > On Thu, Nov 02, 2023 at 05:46:26PM +0530, Nikunj A. Dadhania wrote: >> On 11/2/2023 5:37 PM, Nikunj A. Dadhania wrote: >>> On 11/2/2023 4:03 PM, Kirill A. Shutemov wrote: >>>> On Thu, Nov 02, 2023 at 11:23:34AM +0530, Nikunj A. Dadhania wrote: >>>>> On 10/30/2023 10:48 PM, Dave Hansen wrote: >>>>>> On 10/29/23 23:36, Nikunj A Dadhania wrote: >>>>>> ... >>>>>>> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c >>>>>>> index 15f97c0abc9d..b0a8546d3703 100644 >>>>>>> --- a/arch/x86/kernel/tsc.c >>>>>>> +++ b/arch/x86/kernel/tsc.c >>>>>>> @@ -1241,7 +1241,7 @@ static void __init check_system_tsc_reliable(void) >>>>>>> tsc_clocksource_reliable = 1; >>>>>>> } >>>>>>> #endif >>>>>>> - if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) >>>>>>> + if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE) || cc_platform_has(CC_ATTR_GUEST_SECURE_TSC)) >>>>>>> tsc_clocksource_reliable = 1; >>>>>> >>>>>> Why can't you just set X86_FEATURE_TSC_RELIABLE? >>>>> >>>>> Last time when I tried, I had removed my kvmclock changes and I had set >>>>> the X86_FEATURE_TSC_RELIABLE similar to Kirill's patch[1], this did not >>>>> select the SecureTSC. >>>>> >>>>> Let me try setting X86_FEATURE_TSC_RELIABLE and retaining my patch for >>>>> skipping kvmclock. >>>> >>>> kvmclock lowers its rating if TSC is good enough: >>>> >>>> if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && >>>> boot_cpu_has(X86_FEATURE_NONSTOP_TSC) && >>>> !check_tsc_unstable()) >>>> kvm_clock.rating = 299; >>>> >>>> Does your TSC meet the requirements? >>> >>> I have set TscInvariant (bit 8) in CPUID_8000_0007_edx and TSC is set as reliable. >>> >>> With this I see kvm_clock rating being lowered, but kvm-clock is still being picked as clock-source. >> >> Ah.. at later point TSC is picked up, is this expected ? >> >> [ 2.564052] clocksource: Switched to clocksource kvm-clock >> [ 2.678136] clocksource: Switched to clocksource tsc > > On bare metal I see switch from tsc-early to tsc. tsc-early rating is > equal to kvmclock rating after it gets lowered. For SNP guest with secure tsc enabled, kvm-clock and tsc-early both are at 299. Initially, kvm-clock is selected as clocksource and when tsc with 300 rating is enqueued, clocksource then switches to tsc. [ 0.004231] clocksource: clocksource_enqueue: name kvm-clock rating 299 [...] [ 2.046319] clocksource: clocksource_enqueue: name tsc-early rating 299 [...] [ 3.399179] clocksource: Switched to clocksource kvm-clock [...] [ 3.513652] clocksource: clocksource_enqueue: name tsc rating 300 [ 3.517314] clocksource: Switched to clocksource tsc > Maybe kvmclock rating has to be even lower after detecting sane TSC? If I set kvmclock rating to 298, I do see exact behavior as you have seen on the bare-metal. [ 0.004520] clocksource: clocksource_enqueue: name kvm-clock rating 298 [...] [ 1.827422] clocksource: clocksource_enqueue: name tsc-early rating 299 [...] [ 3.485059] clocksource: Switched to clocksource tsc-early [...] [ 3.623625] clocksource: clocksource_enqueue: name tsc rating 300 [ 3.628954] clocksource: Switched to clocksource tsc Regards Nikunj