Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp11337955rwl; Mon, 2 Jan 2023 19:33:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuAHo4N0pwXLuLW1kXvIGfOtadNofoLKuN1ZMd73lvZueNDwwRG0r+1kXAkhyTXyER9P5CX X-Received: by 2002:a17:90a:9413:b0:226:412e:2e0c with SMTP id r19-20020a17090a941300b00226412e2e0cmr14098887pjo.5.1672716816139; Mon, 02 Jan 2023 19:33:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672716816; cv=pass; d=google.com; s=arc-20160816; b=mHtydcUwfVJaDd6Py95WMncEyN/AhGZpEiUhOjpUBcrv1lymtSA8DyPn8bdEjAQdt2 YT0FGoJSDy7oeyU/GqO8TCvJuoYeWPmv4S8UEr7DDTSjDqzYYgiDHKC5SfK7JhTPQA46 1COyDv8l81RQtXTn/G33MmKZqtUTc/BMNnm9NyyEhJ4CF8iGnx8ml/HzrPKhg5MNgnoh EQF2TCHiMOPhyqGTflFthiGLqVz6L3QZ0Cb1OfqyiBpS0Va590Mzb3ApgiHdk2CRRAGv 07h12p2KpqYJWKrdN9+7fv8jd4gMqnh/54XDWNThJC/hh/OCgSXYqR0nkqCyk47OJ3Fw bISQ== 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 :user-agent:date:message-id:dkim-signature; bh=Yxd45ZinjUFrbLnpuB48sHZ3s8H5JAuexFgmFC+hJBA=; b=pyXDu4xj4FnOh5JrtZalnlz6UEcibKCLKz7HMpaDecOai1qCycWf7mRWYSUGy6wW/C 9GhYdpTLC/yp5Z+R/KEQGaKijpQyhCJo1FM+y3V2aBK0PNzx1Df2ER4tYqDnF4wHf7D+ qWdOgowvybFGCIIW+f+ISnK8xkmj+dcPEBCpOUHz+8Ny6AlnRInbc75JJvlJi0SU+XNi qmG/GDccLzYBbrxXkq5Xt30Gw0pr9WcpBbYX8HB5NUzkhFThHfgXln0tBvjG3eLzgjIP cpNK7njdOaTS0YMy0cL3GDHFOPjJGyvE1WxshrGQqqdUNe51BVDO8dsIViE0z5P+hTLW yEvQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ScLQS4gs; 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 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q5-20020a654945000000b0048be2e2a01esi32447166pgs.174.2023.01.02.19.33.25; Mon, 02 Jan 2023 19:33:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=ScLQS4gs; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232978AbjACDZ5 (ORCPT + 63 others); Mon, 2 Jan 2023 22:25:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjACDZz (ORCPT ); Mon, 2 Jan 2023 22:25:55 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2054.outbound.protection.outlook.com [40.107.223.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A108BB5C; Mon, 2 Jan 2023 19:25:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J0WGuioH3q3wXWalDMxwwok4qOyzTyjFFKUWRPVL5chY1CNm+J0KgbpQUm0Byu7GkbHCr/THDIEcdqVNJP8F9mxsIErHAaugW8JhHswWiWRFE2sQhD25IQCXIsiXDGXlrhdlf6njH3sMdFVj6mae/SLWbYFG69ZhhTiEOSDaK/n4iRl1E0y/hA1JeZNTrTrrK8uSRuHtF0eekzs5C24XRHIwv77py5hlKWO3yLiFFGYwreD9aW+qaYB+JoVJYjvVx+9a9kUvayHqd9ft//JtU7YZFoUJnECJUh9a2ZyTF3JaN9YmW7vxGjZg8JMdjia96GwvC9e+Y0VdAd1KnHCT2w== 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=Yxd45ZinjUFrbLnpuB48sHZ3s8H5JAuexFgmFC+hJBA=; b=YtNN+zUH/w+VpSOo0UFsOMrcbnQ2pqx5JqlPiX297enjyRE6bP+B/EZoKnnkXGhx8/ZM06h4E0AHlF0TWSwfGH1kCWT6toY2Week22tmO458PlQo6PsHnDudy19/6aX+/+vLpE1iddwjf1F3vrM1HB3rdgsio9ihuhknUdTSSnmVcPNcVZOLWqooH8eoqVpE6qCoGygySpdfOiEg1sdmB5N24Wr1Zx+Psl7qaFb/LlXb8+VGzPcQQma4qm4YQcAbAORyIeERuCPC8irXBVA7Szllww8ULwHZ7vtVkaL02F6NUfpGJoEVpH1TzSQ4fKjWQkBWWYbVits84u63FWIN5A== 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=Yxd45ZinjUFrbLnpuB48sHZ3s8H5JAuexFgmFC+hJBA=; b=ScLQS4gsZUYeGDxv51oki2/IN+pt2A777ffWBtoHJ6GE9xITmOgmeCVIcXC2/ZbJ08nIf1FdZyEW6yb0HiIzRAmAhgUWKPUKe2JXVjDrzLPBVHs7PmtUtcZY5Nl1o6N6RLatU/KmQbjT5NmDw/Zn0jXxAU4BIrePEXfgCoFjd6g= 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 SJ0PR12MB5634.namprd12.prod.outlook.com (2603:10b6:a03:429::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 03:25:50 +0000 Received: from DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::15a4:6861:1131:87d3]) by DS7PR12MB6309.namprd12.prod.outlook.com ([fe80::15a4:6861:1131:87d3%6]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 03:25:50 +0000 Message-ID: Date: Tue, 3 Jan 2023 08:55:35 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3] x86/sev: Add SEV-SNP guest feature negotiation support Content-Language: en-US To: Borislav Petkov Cc: David Rientjes , linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, dave.hansen@linux.intel.com, seanjc@google.com, pbonzini@redhat.com, thomas.lendacky@amd.com, michael.roth@amd.com, stable@kernel.org References: <20230102083810.71178-1-nikunj@amd.com> <3169b54b-d990-7707-5ec4-cde7261318fe@google.com> <45487a87-764a-7ff3-292b-4a55fe29f7ba@amd.com> From: "Nikunj A. Dadhania" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:25::20) To DS7PR12MB6309.namprd12.prod.outlook.com (2603:10b6:8:96::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR12MB6309:EE_|SJ0PR12MB5634:EE_ X-MS-Office365-Filtering-Correlation-Id: 718025a7-df9a-4476-8e6e-08daed3a3607 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 42rMWX8arXBQ3xq3zcK22hWYMSKVkDDp/oxvWf1aDVykt7L+kqCyl/nBRG6iH2eanujj0BrQ/k1goCbydlNpfkXS3KAavcZduxfT32rauvD7aoszMCRIVTb2lGdqeoyvjeS+KMZQLUt8g0KKKfB4kAqebHqmpXKrL3J+rysBj1EpFQUdUjSwlqbpgL43rKOcTGDcg8FsaAxW8d0HGqcw170Ujzm+rmVHO4s0SlxAoqk8E5wokZzgSqWaaRTaxAIpiby5XQhtFidbL8ArIQZiIFFmF0HWkACARjFHF0fmyFlXYV3oK32EbVxR2b2Lx/KRtY3wXQyuKcewyo3dFk9koxASdgqx5mVdlLqY1/BBYnhk9WjsYT3+s5RePx+3UucM4Sd+nf31QzIFFE/epKBmhO6MC5Rj5UdvltZAv3mSpu1jEQ4HWorEUDos9yDA6Kaw11VcFj1nReVL83vq0pz3ZwgNSuz1FKFjZOyRsQnvKcGOmiTB7sKCpBQ+rPFZMFascbAfUg5DaZ4wZ1c2BvFpkGwaf6+baCrMOjj+vPJpkkms5HKBt/bJ7BmF25AnvSIozhLxRfhx5OVfjEv21UN1S2J17RE5b9SjRd1bA2jYGJzZZoGQxlN/mfhfhQtckKwpPcwCNPZsXFZodUY2mepP8JoP8QAsPUqqxPzchhX5CSpBxEIFnUaViodUzxTExmYl0Du9vUux0eQ3IxrbssSTgnQNB0RPS5ENzRfxdL0ZfSX2QVYyhzRGZMv7/UWsSIpB 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:(13230022)(4636009)(346002)(366004)(39860400002)(376002)(136003)(396003)(451199015)(83380400001)(31696002)(38100700002)(2906002)(7416002)(8936002)(5660300002)(41300700001)(6506007)(53546011)(6666004)(478600001)(26005)(2616005)(6512007)(186003)(8676002)(4326008)(66476007)(66556008)(316002)(6916009)(6486002)(66946007)(31686004)(36756003)(22166006)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L3l5cU1lNkhTdDFRTlAzUnllOTRNQk9STTdRQTRUc1Y4WjUvQzB4NDd6OHlt?= =?utf-8?B?a0Y1RjJnK1JmWUFPT0RtK0JvN1ptWDhiYnFlNDVHNGJMYVpsc1gyOVJ2dEtX?= =?utf-8?B?d0lLQjdQSHlOTGRZSXAzeUdyR1lPenlvMm51dFcyR3FRSGxlUSt6Y2VlRktn?= =?utf-8?B?MUtJNnFsZnZMZ24xTy9DRVRDbWNNNTJGVEhPaEszSDNqZlExSEdzc2JqUUlk?= =?utf-8?B?Y1pTREd2ZWczK1pWZ0UzbTBzUitHSlo4bkEvSm1tczJjTGZwaWJYVWZwMDE1?= =?utf-8?B?MUZ6TGFMd3NwalpwbVJhRTgwOXlzTXEvSE9xZXpHczhIOWZYSWIyK3FQMWxW?= =?utf-8?B?bWFDN1U1TXNYNEF0UCtjL1JKVVFOc1pqbCtYZ3J3VzVLRGl5b3JxV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a-4476-8e6e-08daed3a3607 X-MS-Exchange-CrossTenant-AuthSource: DS7PR12MB6309.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 03:25:50.0290 (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: +Cy0PvkDhez8YtV6Bkfxvc3tac7diF1ZKaZgl78FR9Wb6WH3gfp2zmauQptBJayYk61++nYEhEhCbnHYPW0fqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5634 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 On 03/01/23 01:12, Borislav Petkov wrote: > On Mon, Jan 02, 2023 at 08:50:23PM +0530, Nikunj A. Dadhania wrote: >> I think the "why" part depends on the user. Whether or not the user needs a >> certain feature enabled for the confidential guest. >> >> If the cloud provider(hypervisor) enables the feature on user request, the >> guest terminates with GHCB_SNP_FEAT_NOT_IMPLEMENTED when guest kernel does >> have corresponding code/implementation. > > I think you mean "does not have" here. Yes, that is correct. > > In any case, I think this whole handling of SEV features could go both ways: > > * Cloud provider could say: we've enabled features X, Y and Z and if the guest > doesn't have support for them, then it would fail booting. > > There would optimally be some text sowewhere in the cloud provider documentation > stating why those features are enabled and thus required to be supported by the > guest. > > * Guest owner could require a minimal subset of features which must be present > in the HV in order to even boot on that HV. > > Of course, I'm only speculating here. How it ends up really playing out in > reality we will have to see... >