Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp420109rdb; Thu, 2 Nov 2023 07:30:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG0+dgfAbqf7aN9xpWkOMMGhUd8lnlXHiGhtwYNMXJkk0ngYVd4hBXFfO4b6piXxgRHb/kK X-Received: by 2002:a17:903:110d:b0:1ca:d778:a9ce with SMTP id n13-20020a170903110d00b001cad778a9cemr20560367plh.38.1698935436774; Thu, 02 Nov 2023 07:30:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698935436; cv=pass; d=google.com; s=arc-20160816; b=cKZOeNVOWNvRGflQEhciLWgh+0Rv4Upg6Qid4dP5yBmIl/Gq0tNQC1Roq9NNp5Sk6u IJKhc7IILue1DXWTR+vWZmRNu6enoK9nxgtXMwF+Y8CV9kXqhNbnrhwM+ZHZKtWCGPeY krLfao3lnFCqjLPlSCqqqciH48Ncy1BSYBoBXZVs1PY4g4e68nMU9gz0A6Yp7zhvPJlo eYby2iA+lCWO639yqYNLvt5K2cvNp/acehNY6zzgaQ5RUzUKSmc0YgTdtB2rK8Sk198D gO/FuT7+1X6ZnAkedfTT+TZcG/KqGewzv/hwrKPQ5+AlfwWFqYSMwtTRiqgT1lDiVS86 KBzQ== 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:autocrypt:from:references:cc:to:content-language :subject:user-agent:date:message-id:dkim-signature; bh=CXc9McQIhEfXK0Hww43B0fzTvs5x3MsGCGcmbuXFtXU=; fh=NoV8nuzIYluVOkqz1HmhGW/gtP1Ua5f5cgDACAPcQqU=; b=Z0+H7Dn/ByCwEEkqu54ebpmUyaFEUjX3xr/IbgP7MvVNeAHGzl4XRyv8utdD9DXtxc wfBErGaESBJvpg0f3VrrbCRX2YPk6aTwYXd8EAwBVm75D51HjC3qurwgx6WLLHKNA+2g 2PgATyN8NAri2P9vEWyMTSzIyx9H1CNn9qryJGypH0q7ecgSgpYVkEXfkWGoSsxDjFla SWrZrS9vn3gwSq/nWUsTqyIZXF8tIwfmSM9RMmHy7yLIaLDadwJIZFV2dCTRXZdvbzsn hNrqoq7uGLoif62B304V+KfU/J8Zm9OWONfaRF1PthptjjaaO0JaCHRLeCwjSf0xvDX2 lNAw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5pxqjCQd; 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.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id kn8-20020a170903078800b001cc17d8bcb5si4809304plb.615.2023.11.02.07.30.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 07:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5pxqjCQd; 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.37 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 snail.vger.email (Postfix) with ESMTP id 552668230CEB; Thu, 2 Nov 2023 07:30:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343820AbjKBOaK (ORCPT + 99 others); Thu, 2 Nov 2023 10:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235475AbjKBO3z (ORCPT ); Thu, 2 Nov 2023 10:29:55 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC2A210F5; Thu, 2 Nov 2023 07:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KN3tDAVrG8IfncLOSO5oRHfdTX17YMoxJfag1h1LXVTaTXRb5h20kzF2T9AVDI5pJ8bv5uPlIZtT6gQb+IDJiinLSTYArbWOZNZzgnzPQOCaA+HV0sPfROTv/Bmp/sviLyDRHq3eihkq6FV/dW5nlB4neNxs+xypaBE45V7Yc5vJWL59QmmJ4X+NRYZ7r1I36MJldXrcomMrHWlq+yjv5DiUmITZnG4RK8ELPiTj9RyzBCfzYBpTPjK1AzYCsM958GKDUwjKdg+Dul+/d38eBy7j45DTel646skxrCvyT9EX5S5KX6906Aj53vfSOTuJYA+eIjYEXp6Wz2s01HcE6w== 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=CXc9McQIhEfXK0Hww43B0fzTvs5x3MsGCGcmbuXFtXU=; b=lSd34cRpdY1CCMidaJVCKc4pyrQ7dtEP6fKi11C5FPJm9lS1nQq4EAC211Qr8gJwgfcqBQ/pPkD2ERdsK1PElbykeljjCAZtM/KnvLvJZfy9CAcvApjO3pLtZn1KPWVm3rFvCb3TDj1J+6wbxU78GhJMDfJlUBSSQlSUd2/Q/kyttNz6uQzsDpqXToly+uW61j5VdaMfGb0fuFIAMpt5btROBEpjeWIvJtgKJeYfB/zwg4BkwHkI+IxkaUY2wj1jt7HRLOgqCOB7wB0fvhVvI3DedkT/EtdvcO2j/pG9kfSamG5LWGyLebKnjnedmx7t8ULIuLzNOGik+M7RvVKu0A== 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=CXc9McQIhEfXK0Hww43B0fzTvs5x3MsGCGcmbuXFtXU=; b=5pxqjCQdDqSla0LMQSEe/IirW5sGo97H0UqAQHfLoKlJTUAuHA6EFeDy3cPmhVJvqI/VtH6Be3qvNjvBUbDYuMVaCLPfchGbB40czJONo7Bph4AeMAwnSZIItUamsOpbT0qmmzXvhw96lt3Q4+QaxmMObvu2lT3ffmoazIiUMiw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by SN7PR12MB6840.namprd12.prod.outlook.com (2603:10b6:806:264::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 14:29:25 +0000 Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::e16e:d7f1:94ad:3021]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::e16e:d7f1:94ad:3021%7]) with mapi id 15.20.6933.030; Thu, 2 Nov 2023 14:29:25 +0000 Message-ID: <0c4ea410-4213-4ab6-9151-da312a50aacf@amd.com> Date: Thu, 2 Nov 2023 09:29:22 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 09/14] x86/sev: Add Secure TSC support for SNP guests Content-Language: en-US To: nikunj@amd.com, 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> <60e5b46c-7e4b-44bb-a76f-a4b30b154d4a@amd.com> From: Tom Lendacky Autocrypt: addr=thomas.lendacky@amd.com; keydata= xsFNBFaNZYkBEADxg5OW/ajpUG7zgnUQPsMqWPjeAxtu4YH3lCUjWWcbUgc2qDGAijsLTFv1 kEbaJdblwYs28z3chM7QkfCGMSM29JWR1fSwPH18WyAA84YtxfPD8bfb1Exwo0CRw1RLRScn 6aJhsZJFLKyVeaPO1eequEsFQurRhLyAfgaH9iazmOVZZmxsGiNRJkQv4YnM2rZYi+4vWnxN 1ebHf4S1puN0xzQsULhG3rUyV2uIsqBFtlxZ8/r9MwOJ2mvyTXHzHdJBViOalZAUo7VFt3Fb aNkR5OR65eTL0ViQiRgFfPDBgkFCSlaxZvc7qSOcrhol160bK87qn0SbYLfplwiXZY/b/+ez 0zBtIt+uhZJ38HnOLWdda/8kuLX3qhGL5aNz1AeqcE5TW4D8v9ndYeAXFhQI7kbOhr0ruUpA udREH98EmVJsADuq0RBcIEkojnme4wVDoFt1EG93YOnqMuif76YGEl3iv9tYcESEeLNruDN6 LDbE8blkR3151tdg8IkgREJ+dK+q0p9UsGfdd+H7pni6Jjcxz8mjKCx6wAuzvArA0Ciq+Scg hfIgoiYQegZjh2vF2lCUzWWatXJoy7IzeAB5LDl/E9vz72cVD8CwQZoEx4PCsHslVpW6A/6U NRAz6ShU77jkoYoI4hoGC7qZcwy84mmJqRygFnb8dOjHI1KxqQARAQABzSZUb20gTGVuZGFj a3kgP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AV/+8g7BuGF+ 6irTe/qtb/1CMFFtcqDorjI3hkc10N0jzPOsjS8bhpwKeUwGsgvXWGEqwlEDs2rswfAU/tGZ 7L30CgQ9itbxnlaOz1LkKOTuuxx4A+MDMCHbUMAAP9Eoh/L1ZU0z71xDyJ53WPBd9Izfr9wJ 1NhFSLKvfA== In-Reply-To: <60e5b46c-7e4b-44bb-a76f-a4b30b154d4a@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DS7PR05CA0048.namprd05.prod.outlook.com (2603:10b6:8:2f::19) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|SN7PR12MB6840:EE_ X-MS-Office365-Filtering-Correlation-Id: e2332115-ec17-43bf-0b5d-08dbdbb01d36 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VEpDKD0tCWLPmnrqLeIJSSD+XUCIILZppl/MP7xjrNcNMmeOtNKARLpzOCGQTm2zTN6MTxzkchq0Edg/yThJgOw+A2ln7OVMbvGS6sqDC9tlm0N/UaP5lgNH9FwLHTIPGGMax7MHuwCJEdD6pWLfQcMdKcciihjg7VH+6z+bDnYb7Lej+rd4n08iGXFi67hWaPXcgZqvUSPufwpXzYf1smvEoKx7JI48cduE2xtqaMTpD0YoatBz6CH+OsVJk5dwsfmspLBmD38rpYt7m3q0kE5p1Rc+pUWqpGbVbLh9Wu8CyIiGpoZWH6tY21+1ETHUY+yWGMPN+L9kIB0vCwRFBPG1zD0b9E5teFqKSizDE/YvDGL90k5TJsdYpCbYpxarenEOBycpGe0x+LOPO3auLAzAXzyDVt2uF/6QAi1U7spr6gLPl5oVMXmDEJQr50y9xKagWDYVA9Kefo1nkUUgcvaQm9y0IClQ07g1rfKV/e6vlEstVSHfn+WMPquMpsclO5hQocBlMT6qydDrX4BWgljVmJtjR6+p8PBIsaZGFbhsisPTI/0gEXX82Bmup+X5QOi95CaDe3aIRMnuCmyP3VIT55Ii+4AA39XFYV6CP3ejIJk297abewWRS33PwBmmcAZomMCwaO/WiSkYPoR+2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5732.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(366004)(39860400002)(346002)(136003)(376002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(26005)(6512007)(53546011)(6666004)(2616005)(6506007)(478600001)(6486002)(66946007)(5660300002)(41300700001)(8936002)(66476007)(6916009)(8676002)(66556008)(316002)(36756003)(38100700002)(31696002)(4326008)(83380400001)(86362001)(2906002)(7416002)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UjFOcTgwUHczT1JPYm1NK1dsU3I0RTlVaEpnaGFSNFNleThxTDBqbkZPQy96?= =?utf-8?B?SDFVNnV0dGlkUjZUTUlqRGRwZlhmSnNvOE9RSVBPcUVLSU9hL3lzNXBtckZC?= =?utf-8?B?QzBPOHRLdVZKOXF0aGxvcEVQdzJHR29iTDJvbittWWRGdmhqeDdzUG42L2c0?= =?utf-8?B?WlRhbjU4dGlOZXY1c3hmS3NLNGE0T0ZvYlArR0syRnF1aFM5NnpDdi84Smd0?= =?utf-8?B?QStaRS9EeU1jS2R4N3Jnbm1aM3pWSlBRUVlBMWZDbXUrTUVTY0RWRmR1K09Y?= =?utf-8?B?VnJjc1J4OENUL0szN2xvTHgyUzJkRzZZaVpmQWVPT3l1czNrS0xkMlVnQjJ4?= =?utf-8?B?Uk85QVJmNmdRKzdSb3dqbklVbmFQYUFNNDRPa1RaWHNFN0FrLzlGMUdBU1Yv?= =?utf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d36 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 14:29:25.5294 (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: n0KCoida6k2QBUyqr/I9nDMcT2KKrvplLvt0Pa9g8bI9YO2KAB+t6/LXosuCQWeetK/HlR+kOZwXwIGB9WU7OA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6840 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 07:30:25 -0700 (PDT) On 11/2/23 00:36, Nikunj A. Dadhania wrote: > On 10/31/2023 1:56 AM, Tom Lendacky wrote: >> On 10/30/23 01:36, Nikunj A Dadhania wrote: >>> Add support for Secure TSC in SNP enabled guests. Secure TSC allows >>> guest to securely use RDTSC/RDTSCP instructions as the parameters >>> being used cannot be changed by hypervisor once the guest is launched. >>> >>> During the boot-up of the secondary cpus, SecureTSC enabled guests >>> need to query TSC info from AMD Security Processor. This communication >>> channel is encrypted between the AMD Security Processor and the guest, >>> the hypervisor is just the conduit to deliver the guest messages to >>> the AMD Security Processor. Each message is protected with an >>> AEAD (AES-256 GCM). Use minimal AES GCM library to encrypt/decrypt SNP >>> Guest messages to communicate with the PSP. >> >> Add to this commit message that you're using the enc_init hook to perform some Secure TSC initialization and why you have to do that. > > Sure, will add. > >>> >>> Signed-off-by: Nikunj A Dadhania >>> --- >>>   arch/x86/coco/core.c             |  3 ++ >>>   arch/x86/include/asm/sev-guest.h | 18 +++++++ >>>   arch/x86/include/asm/sev.h       |  2 + >>>   arch/x86/include/asm/svm.h       |  6 ++- >>>   arch/x86/kernel/sev.c            | 82 ++++++++++++++++++++++++++++++++ >>>   arch/x86/mm/mem_encrypt_amd.c    |  6 +++ >>>   include/linux/cc_platform.h      |  8 ++++ >>>   7 files changed, 123 insertions(+), 2 deletions(-) >>> >>> +void __init snp_secure_tsc_prepare(void) >>> +{ >>> +    if (!cc_platform_has(CC_ATTR_GUEST_SECURE_TSC)) >>> +        return; >>> + >>> +    if (snp_get_tsc_info()) >>> +        sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SNP_UNSUPPORTED); >> >> How about using SEV_TERM_SET_LINUX and a new GHCB_TERM_SECURE_TSC_INFO. > > Yes, we can do that, I remember you had said this will required GHCB spec change and then thought of sticking with the current return code. No spec change needed. The base SNP support is already using it, so not an issue to add a new error code. Thanks, Tom