Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp165565rdb; Wed, 1 Nov 2023 22:42:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGlTTJPaFzu9iwyhtGzMB5wZrRQ0Xt3w8oSlDscZXupV+VNeMBsqxPjrBIInxYiNLhzIM7G X-Received: by 2002:a19:f003:0:b0:4fe:ecd:4950 with SMTP id p3-20020a19f003000000b004fe0ecd4950mr12955425lfc.1.1698903754852; Wed, 01 Nov 2023 22:42:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698903754; cv=pass; d=google.com; s=arc-20160816; b=nrNy3qVV8fJmgDRnR1HBhLrc2IpPvt0ogP7h/lebz2CsnRiTCYhxDEVmoInRnHBapJ bpc4v9WXmoBFUz0eJQY1pM3A3li+v6baCJN+xCQ2cUx6UvdEF2iJKMorxfujqhE0XOoA t5atRCal5RuJ54wdKuAJaRKx300yYGSB7oSD5AgbFDd15b7GT/TylBaLeVDT4I3lfW+O QQ4OTyoZVh3Gd0ajz01y6DQTdf1l8kJXqscK9IS3LaoIAZddcTKhw3kd5DQq5CEZ7QwE VyZ4qCs6oCBXwIa/RZM+mYD7JxklZRJWoyup1HXUQqiB636cBkparIp62VI5yaS2JL4h G28Q== 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=t2I8pVVwdBVwl/20yanWRskVkmck5U6vfz+GIs/jU+0=; fh=0NazDwdTVG0yMF+3yaLUaOQrtjMqKAq3pFuat6DKlzc=; b=TObgU2xnHIy8gfJn7YW9qqBaWIjaegy5gzB0AcfvirDbaT9tuoiouKyEjELaQHDSQr K/Z9Yd1lPgOJwn/k/VL2q7hycAOfIi4LkcNOGUgn06ZmRF8spQcHqY//FOfq6QbSSmYy zcGGrwlQGBeKqzJL1IG65IHvPcFaYKFu4L36s2UJZ0AAEHYgGVc7pjdna7orQL5JfqmO OCP3bHPfUALHm/SMkemEu4LDdeepv7QA7syQeNUJn5iEi3HGosFs/QE8vTrwxy6ubAIW bhaRmPhXHLqqQKnHW3Qbx2nyLPdI3Hep491zxHDlbZHT5qw/sOxQ9Ej4vGmeTlwq4kK1 vWHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=waBnpeah; 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.33 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. [23.128.96.33]) by mx.google.com with ESMTPS id ji18-20020a170907981200b0098678728b52si581150ejc.123.2023.11.01.22.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 22:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=waBnpeah; 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.33 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 CF4E0801C60A; Wed, 1 Nov 2023 22:42:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348472AbjKBFmO (ORCPT + 99 others); Thu, 2 Nov 2023 01:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjKBFmN (ORCPT ); Thu, 2 Nov 2023 01:42:13 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E830112E; Wed, 1 Nov 2023 22:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KVYMSh03tTDvaWP97yYWyNML35/kkd6lXFBzBTPkAfEm/8Zqaramx5TRUV+cgNH145+hVKZaqlqwHVSd5zkezgx/W/6QUTvcgMXO8i3ky068geazG33V5e3xu/HNSff4zktvBb7KmDMkOMtkazl40nixWVhZ/tjVujchHTmi8eofJWfYBAaefEDHCweyl7H7tA1XuStoIdjBDPjM/EWJH721K6rTkIgs0e8Fr3oZ1CfDSy/tiBkmfVO3TlP8v62ey8g/xwXyk3hivQrxw/Vd+/vwxxCWSJMYRkNS+tbczC5b8B8oGxj0VwKzVUyGd8o2hqrqKzrWhzgiu6Dx5/tTnA== 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=t2I8pVVwdBVwl/20yanWRskVkmck5U6vfz+GIs/jU+0=; b=PyYv8NC3BZ8fXU7c41tfWmd9UDSvNMFU/j4DqgPdDFCwvDZw/GeKl1NT0qUrz3bkpPmKbiTs0alqqHe44ZkY0GvX3sVZDxa83eZDL0poQzqOYhmnlncm8nSuEZGzcyVoM8ufy2j9/waffX93j8TIUKjwOXjj769jcZk+Dxk4xjOzS82SD5mGt582/umYoQj3dWQQVM8QSUGMmzG1KIfquM/cMQGTI8JViilr5W7epDw4W8gNVnxk+RyzbDc0RZIpSi0DpJp43ZisGO+gKB99OQzkne6whzp4AGodtQL80ITkTu3ElLsUFKTYGWyHde2FE+YnGHNdm36QPn1tvCBzsQ== 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=t2I8pVVwdBVwl/20yanWRskVkmck5U6vfz+GIs/jU+0=; b=waBnpeahL41G6aDUr5ZxkrsF8llTbcn+EeQ2Flca/R1LWwY9ZZPMOLwBhwOdAGNaH/BEE5jNY9TQ7tYGSk3/pX/4uV/6orth+zJRNe6EppmHkTsH68ondrlpXMhXpIqu9oEY34Iigrm5+RwZL0agYL8S1+JlcerquiAUgsBWJao= 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 BL1PR12MB5972.namprd12.prod.outlook.com (2603:10b6:208:39b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28; Thu, 2 Nov 2023 05:42:03 +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.019; Thu, 2 Nov 2023 05:42:03 +0000 Message-ID: <55de810b-66f9-49e3-8459-b7cac1532a0c@amd.com> Date: Thu, 2 Nov 2023 11:11:52 +0530 User-Agent: Mozilla Thunderbird Reply-To: nikunj@amd.com Subject: Re: [PATCH v5 09/14] x86/sev: Add Secure TSC support for SNP guests Content-Language: en-US To: Tom Lendacky , linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, "Kirill A. Shutemov" 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 References: <20231030063652.68675-1-nikunj@amd.com> <20231030063652.68675-10-nikunj@amd.com> From: "Nikunj A. Dadhania" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0148.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:c8::10) To DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6309:EE_|BL1PR12MB5972:EE_ X-MS-Office365-Filtering-Correlation-Id: 430ab452-0f97-498c-e9ad-08dbdb6670c3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BadLFb/brRJWn47GuduR1tq1XmFMyCCA0IIhjqHl3KIQLQqSUCRQOzC3viyC5foFAjyALww8N9EYH+z3BkX4hTMfPkoCEaUmiyCgDIP54dNRIEOHbjWClQn+BT501XV6bqeqrXUcSfDFZ9PXxrJEhKd3QtVN9zReU+AM0Y5J5pQ1YC/VQ9UzhB683zlZ+f8eYZCIIg0Dxrzgu0IyA9GPhlRvYYGda7vfvYNeVDz5loOPMKewBUhR+k7mOXx4/L+Ov3nKs4OGzA8gJwWepdhDdtD11c5RUA40sdsLF1bAP3zm7CF17W9F5TwXbW60AQdImkhmLF/ikAio1f6gK+o2WOTr8ZspBKOqd7+hrg79b6rTlZnmXofB0lMAXUZddR9FXsuK5wUTjx0QmGGEKgSwTstLEm7kmdpHsL1cmfxSFWw5G5Gxl98Clfem+LuTTgVgwAdIW0huuYtc/9DBWLvUzh/oR8Yax04gtDkrRCnv0FUhtoBWajh4RFBZ/W3l4e3RR0RTdIKsQV5JyDPM9bXZg3jbRQ8+fulZaQxpjCdtY2dggxj7/JJKQTR5uq8DNXOvrJIEMoAL1WHJVo/nE+nyJRMHNpNbazCj3cKIjuZTg5sZ4xGvO/O6/mM01eSRru0QCeaWPOhWRAX3SgvUbnspoQ== 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)(396003)(376002)(136003)(366004)(346002)(39860400002)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(110136005)(66476007)(5660300002)(31686004)(2906002)(41300700001)(478600001)(66556008)(6486002)(6512007)(6506007)(6666004)(53546011)(66946007)(4744005)(7416002)(26005)(2616005)(83380400001)(3450700001)(316002)(8936002)(4326008)(8676002)(38100700002)(31696002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SFFhZSsvMmJjV1QxV2Fnb1Q1STlOUTBhNUs3VGU4MjFTRlBzZmtYSWlMK0tn?= =?utf-8?B?WmpUajZmd2ZoYTdZbk8vUzM4UEFZVFdpNTVpN0s3RmFWamQvM0JCdEpsK0hp?= =?utf-8?B?K2ZZUXUyeUNPK1laL0RDNFFucDhiRFgybU55cWVTTlNyQ2dERGV2MU81SW5E?= =?utf-8?B?NHQyTi9OUmlkVkpnTzBCS3lYYno5N2JTYVFoY1MxVWc3ZVBoNnV4ZFN3TWMv?= =?utf-8?B?SzYxSFJUSjJqaW5JUzFPL0pCeUgzVmpkZTE3alpDTThUZmlzUXlZNHpSY3d3?= =?utf-8?B?SVNIVVdnSnduRkFmZWl3eDJ5NHdvaXQydkFDeGR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?v5Y5LtIOcNA1JZcJ8ZTxilskt?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 430ab452-0f97-498c-e9ad-08dbdb6670c3 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6309.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 05:42:03.1659 (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: Vpq1lNJnaJc8YXScw/ZSYn0QMdwB/3GGOoffAfJPJz0dTmZSHAbjalZIljZgDRaMqgichNQUsnE6QVuon+R0Og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5972 X-Spam-Status: No, score=-1.3 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, URIBL_BLOCKED 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]); Wed, 01 Nov 2023 22:42:26 -0700 (PDT) On 10/31/2023 1:56 AM, Tom Lendacky wrote: >> diff --git a/include/linux/cc_platform.h b/include/linux/cc_platform.h >> index cb0d6cd1c12f..e081ca4d5da2 100644 >> --- a/include/linux/cc_platform.h >> +++ b/include/linux/cc_platform.h >> @@ -90,6 +90,14 @@ enum cc_attr { >>        * Examples include TDX Guest. >>        */ >>       CC_ATTR_HOTPLUG_DISABLED, >> + >> +    /** >> +     * @CC_ATTR_GUEST_SECURE_TSC: Secure TSC is active. >> +     * >> +     * The platform/OS is running as a guest/virtual machine and actively >> +     * using AMD SEV-SNP Secure TSC feature. > > I think TDX also has a secure TSC like feature, so can this be generic? Yes, we can do that. In SNP case SecureTSC is an optional feature, not sure if that is the case for TDX as well. Kirill any inputs ? > > Thanks, > Tom > >> +     */ >> +    CC_ATTR_GUEST_SECURE_TSC, >>   }; >>     #ifdef CONFIG_ARCH_HAS_CC_PLATFORM Regards Nikunj