Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1268927rwb; Thu, 19 Jan 2023 08:32:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtIIA/MZMfA5B9QIOMfs6WnaUwfEbvGvAhVI2PPB7MDZFgRZ48jUkRvcNcf8gCdVwKKYcUG X-Received: by 2002:a05:6a20:3d09:b0:b8:6fe8:5ed7 with SMTP id y9-20020a056a203d0900b000b86fe85ed7mr16055402pzi.44.1674145961356; Thu, 19 Jan 2023 08:32:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674145961; cv=pass; d=google.com; s=arc-20160816; b=Ei23DVav2wstN8d/Me/9nTKSEsSXtUyxy7ahXHX+cvkqgtTtxGGZ1CM/ClsqfpkJQq Mr07OuLaHKcmLXxE9794DA4N5ib9uYwQGr2OFKohPtaUuvWq3U84j6foy1935kaPBRI+ az7QtCi0AwvXCAHuURXA32ul92BW5+B7bA3+WlDqImfaCpRd5jYQhI0lRsGMXCJdMkbr 05g+sd9bCIzQrAc/QWBMs9WszufOniqEYyS+GU73gnfZZ9fy1rT6860euQrrdxHjpLVB 1QNa18JoO+8JVvBgRZSP1P+85/FCVHVPiUvnUoZrKw6a8PRgDCtU/Z2LIB6aoX3TeNyM PAhA== 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=vruIbLVG+Tuu/GDPV/0LiSTgD1TOFB71/Ot/UCYD8pc=; b=BuzDHz/umVawxVta87vrxKVLAM4Laa1KA/Ucw37KVaK/a6SLH8nHFnS6eRVY6o+Eiv LAZ1+pYPyaeK9qvCdzCbp+3jIleavnaDegVj4eOgPZ5+KFxJRVEvJFBH/F+odOtWuTmx XdSSFwumWyFdNTnZah+ptw9MHGejooZ6T4Gji9jG214Emp4A+G6GuGICIbINy5DADHqM Nxk+frra1tR3xDarlgvFML/St4227asThc4LLRCEHWzuAhprq+hKbU8kAUeOGlj8rBE5 rIzCxxm8qaT4IKV3/1+ZqfA+zKsuC9CJqDhkpd57AeQ5he7oz/MUKHSpRYqp2q90L/H5 vfWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=2VLm5OnO; 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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 j6-20020a632306000000b004b484eb6657si32343207pgj.576.2023.01.19.08.32.21; Thu, 19 Jan 2023 08:32:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=2VLm5OnO; 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-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S229932AbjASQ0z (ORCPT + 99 others); Thu, 19 Jan 2023 11:26:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjASQ0x (ORCPT ); Thu, 19 Jan 2023 11:26:53 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2054.outbound.protection.outlook.com [40.107.243.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3967875BB; Thu, 19 Jan 2023 08:26:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ctJ9V97F9LD/TbCgqup18vSKQrYok5NY+Iisjxyrga0qYItswi7xdaTSnLaAP7lGwAlEp952M4P7sGuTRt6WNq4Z/vv23Ic5qde7TEmoTcLplo2DRAuz5jmdydjTWu6B1bOWCNlLVVynHvC3uRxpyx6zPv3ORYPxEq/6KRzE62A2EtF6b21nRD3XYQs5Xn54GvvIL7TiN7zoPhRvZ9enalgZiB4yS/n11ZXCrSFW7GKcQ+ssIRxNCt6kIxOVElJNiI3ArkoE0Nd1DMfqCgMhw4mNSrQG+knZeG85Lb8XB1vFJ+Ko0fuMi0vcOO7KC5eNXkCXkxvwiocEISImkt9B2Q== 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=vruIbLVG+Tuu/GDPV/0LiSTgD1TOFB71/Ot/UCYD8pc=; b=VMWSnC/7viXkD6ZQYcj0Hg5Pwd6bCWAxqJs4fSVhRd62Fk7UEzqi4brKtTmPD3vEe6VyUYEbfKWM7ctzXLxhHOLtC+wx38fqIvDnIGkwDLTkuLvrRCGdC20yy5SK/49pjdB8F1WFhl1xOwpvkY6nHHzd+zFyHsIJc96p3CvALoYgGOtdc4lXo+aL2rKEF6PsNmn2f2REbT7QKPGndtbpXscClyuO7Cb9xKLsgV3+dI0fKYSapleXp12jtUMosBBjsYRnJ4ZveqP1qLEXcRnsTEITKXsZxXjxf4zm6kIW9HmtDSOI9ReGfzsKuh61Azi/WrZGmmTawpVvTvXNUVabJg== 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=vruIbLVG+Tuu/GDPV/0LiSTgD1TOFB71/Ot/UCYD8pc=; b=2VLm5OnOhEhdzgxEdw/xoL6X4nCQfoR2BxKVSwUqzA0i2gt5I7DG7f0KtRwnU65Ri59B6H9u57qGF3O1+G2JDllmaMJCGNrggO4q8HxKsN9p+qPss494c1X8KDPVxiI58r55nFq7agm+weeHI08X4tC6S65r8EU4TNrRgFJtXls= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) by SN7PR12MB8004.namprd12.prod.outlook.com (2603:10b6:806:341::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Thu, 19 Jan 2023 16:26:48 +0000 Received: from SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::5317:fa3f:5cbe:45e9]) by SN6PR12MB2767.namprd12.prod.outlook.com ([fe80::5317:fa3f:5cbe:45e9%3]) with mapi id 15.20.5986.023; Thu, 19 Jan 2023 16:26:48 +0000 Message-ID: Date: Thu, 19 Jan 2023 10:26:42 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH RFC v7 14/64] x86/sev: Add the host SEV-SNP initialization support Content-Language: en-US To: Sabin Rapan , Michael Roth , kvm@vger.kernel.org Cc: linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, bp@alien8.de, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org, harald@profian.com, Brijesh Singh References: <20221214194056.161492-1-michael.roth@amd.com> <20221214194056.161492-15-michael.roth@amd.com> <65f056ed-68ab-2541-7c83-3f1712e597ce@amazon.com> From: "Kalra, Ashish" In-Reply-To: <65f056ed-68ab-2541-7c83-3f1712e597ce@amazon.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR16CA0011.namprd16.prod.outlook.com (2603:10b6:610:50::21) To SN6PR12MB2767.namprd12.prod.outlook.com (2603:10b6:805:75::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR12MB2767:EE_|SN7PR12MB8004:EE_ X-MS-Office365-Filtering-Correlation-Id: 02d25bfd-df6e-43b3-c39b-08dafa39f60f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Hc1a5xuz1IkFM0SQnzzp6Zi0+pmLeAg5VwEOTX24lVAhKxrrIKIg+IjgieWXUavtCWukuonHhyJylbOTV5WeA2h70P0uYwyPp8gOC3o5LUry7cXKdYCBkdztAPd+Utg69w11vEL+00NbmtmrbR7u7Myu49HFCnZ3zHXROPUEQBwg5+35+78BFOd9FCHEM/nCVEpm/xY0OditP3Q+UCATiCNph1DhOKNBzVej9316MWDIlLDIfo6j1jyerKvQ1tf3isk8YKT+a7AnOKIQeiXcmO51ObQGxtpqb9VPnG+3YVQgcuc97wnJYCh/UTcGX/EqSfLk5LcBQzn/q6owlImv6/g+BzlU2yfrMQPrjFGo8tg6k9jp75V1sKWOOvrRHzVDTKiyJNG16Sx4V+ukKzcS6cIdQ6Ju4EbobvqzzWc9XPNinuTu7no+BFs54aOkpGYjYB2qol+Ag+Q7Dw/3XjraRWAuySJBTyQrEzt1MO+zWYXXbwXgTkMNpDnHlssNLxHkKudkHtv0oIig3NlaYttjnPeSiLBLTUR3eeNUpTbmpZcD9xImGrxYqCYnZiIGNrGl6AmmJ27qqu2O/h+Pa5l+K3Tk6jc/oUTtQh65D7iWDmgxZ5l0l5p5ybNohyqevXQS2gXHCNYWHrseZJ0nKKQEKgCFp3qymxYMoEcNFQOWH4d63m4AdbggvtEmz66S/T9aX4TyK5Ys9kbhzgstSi3iczMBdo+BvVK+jse1nZtFFg= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2767.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(366004)(346002)(376002)(396003)(136003)(451199015)(86362001)(6506007)(53546011)(31696002)(6486002)(478600001)(6666004)(36756003)(8936002)(5660300002)(316002)(26005)(38100700002)(4744005)(7406005)(66946007)(7416002)(66476007)(8676002)(4326008)(66556008)(41300700001)(6512007)(186003)(2616005)(2906002)(83380400001)(110136005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?elJUU21PQklQaDBmTzNvNjlENHB2OHNVWDdvcEYrR0dQL0x1NjNOMm80S2p1?= =?utf-8?B?Sjk0WVFhZ09IS0c3OUozZU1NSzJNU1BGRWdPdW00QUx1Y3B5eEplL2wrQ0c0?= =?utf-8?B?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FZaUFp2UitoWVBUd01xbmFjb25ISkxkTE1LSU9qUmM3VGt1Vlpp?= =?utf-8?B?MS9oNmNrWjFXZTIrWkREZURuYi9ZUmN5eUptbHNvalFPS3hsVUlVRlA4ZnN5?= =?utf-8?B?QmI5U2pXbG1oczVJUktuYi95NjRYY3RiZHRiVUlKS21RdlM3anZPNFZOZW5a?= =?utf-8?B?V1hKTVlzbk80M251OUhnRTBGQVJsSHhCdmFBKzdTajRNR1hZSXBQT2VKdFRZ?= =?utf-8?Q?QNkkpnlzjqxIM7ChTvJJHdpAY?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02d25bfd-df6e-43b3-c39b-08dafa39f60f X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2767.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 16:26:47.9029 (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: p88UHbSlINMAJ71eLoK7V0DWecqKQ0fod7XWMx7ihFo/YLtuCy0mIqI3e6kCc3ZngyEFMj2H0AOWKDIfPmrdFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8004 X-Spam-Status: No, score=-2.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-crypto@vger.kernel.org On 1/11/2023 8:50 AM, Sabin Rapan wrote: > > > On 14.12.2022 21:40, Michael Roth wrote: >> +#ifdef CONFIG_AMD_MEM_ENCRYPT >> +# define DISABLE_SEV_SNP 0 >> +#else >> +# define DISABLE_SEV_SNP (1 << (X86_FEATURE_SEV_SNP & 31)) >> +#endif >> + > > Would it make sense to split the SEV-* feature family into their own > config flag(s) ? > I'm thinking in the context of SEV-SNP running on systems with > Transparent SME enabled in the bios. In this case, enabling > CONFIG_AMD_MEM_ENCRYPT will also enable SME in the kernel, which is a > bit strange and not necessarily useful. > Commit 4e2c87949f2b ("crypto: ccp - When TSME and SME both detected > notify user") highlights it. > Yes, we plan to move the SNP host initialization stuff into a separate source file and under a different config flag such as CONFIG_KVM_AMD_SEV or something. Thanks, Ashish