Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35345539rwd; Mon, 10 Jul 2023 06:16:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlFu3TrcQhBD5U96BbOrq93u9btuXv71qheGFVcOCD/4w6tB3YBypNWW7ScpeBORwOCgvgDG X-Received: by 2002:a05:6402:51c8:b0:51e:5dd8:fc4d with SMTP id r8-20020a05640251c800b0051e5dd8fc4dmr1668750edd.0.1688994974192; Mon, 10 Jul 2023 06:16:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688994974; cv=pass; d=google.com; s=arc-20160816; b=TxweUCur7hCdGsKQB/MZVQdT2Qn0i3ww7JJllire0VhGkOjE4m+wRaAgOSvx6w7L9d ypqLRz9Ve3mlvZ3lUlL0Z4hhqL3qSQzNTEmtuOC6Mq6v7ElvYzPQTrrTJDu7AZD2qJAl /t3jRHktLJFZCTyq9wZJhI2L5gwJR6IRHXRfURmBcGwCBdpmoMKcA+/lzj0DPfunVbX8 pUasIq0PAlKedyqpR5fUWLeSId1ddEl3cztvDNoFmquRfnhZatTNP9h1GH+jW2yQVxgN Gc5WIk50EHTcpUgO7CsF+wIw7Eo6i7Xwc/Do/VfSep6OZQ8c9obeQrcT1SfMeOieUHLc neug== 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:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature; bh=C9LuWivrCUx2ZzaSRMGJ26Bniz5SiEQBB6xOHqphK9c=; fh=xJGYLGzaQAjjQJODpWFe7zB6bAbwYdrw7mKq/7FwaA4=; b=HXvgbdqOGFNTXRqj7yf0kc0KKGVlDP/lieCmoDts66auQZX5MnbLKFuad+ir9h+Y3d kFjbbAqdfis/BpQyFhKNmdUf5hHfkSujRovYPvRJPPKFoYTT91gNXJZ47ifV82Moadhg D4s8cmGu35YcYKY2MddOIRNqJRPsazHb/pK6SdUF5JuhaFNIEOhZmc3ZDNHSk5rEfBQt ShFbwhrk6LQRxM3n5ETYQx+J5w4gDgTotJD91yf/QS+ac9Or3VmQaTNYB1QUdeqdkrxd CWS9Jic/0yzZBn3v55Te/9gsXnRMaZa49lsvd/xKnj0yMXN1M3aG9T7E1wmcVLp1PvCj 9kaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="MhoEyJ/X"; 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 f14-20020a056402160e00b0051e0d0b6d9bsi9997395edv.557.2023.07.10.06.15.37; Mon, 10 Jul 2023 06:16:14 -0700 (PDT) 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="MhoEyJ/X"; 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 S230063AbjGJNLc (ORCPT + 99 others); Mon, 10 Jul 2023 09:11:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbjGJNLb (ORCPT ); Mon, 10 Jul 2023 09:11:31 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2078.outbound.protection.outlook.com [40.107.223.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFDC4C4; Mon, 10 Jul 2023 06:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kegvXHrmKwl9hsttcg+ISuaS+eB0AyzzBzigit8dDS4kYGdk4GyfoIHfBZCVlNtrf/I2z91ZgM8T6Rf6c6bP0dCr1JJRCp81SvrZ7hjb4jJrAnR0FsrzjgL7XK8sfzwCbSIcZdQSjSk2l4VLC2R65j6R7do38kJi9sbKvzh0W/+DA+c154gwY6X5uW4zq/OSB0YQZthuU9B2EfjpkI8VNiRlFlsRwG91okjvo6vETQpRPSK81VZ0Aa1ZLq9oeOyr9+O+N/8aHF41BjGnnCWxDP9pcyrKvXxbKxy1slHxHorvoQEvbhF+M89uZsBJAWLpwyNGUNAxOx3P55o8yi5H3g== 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=C9LuWivrCUx2ZzaSRMGJ26Bniz5SiEQBB6xOHqphK9c=; b=ULWSBftWi541x8950+u/Dg5VUBkhMVC48fChvoqk24KCuPHymbpNV54HhSeNZuEgxbsBRUPK/3C8hJtH/2ka0Zm/Gf9J1NOsR1KBPXOI9O1Rcv5CBrCkiYydKF/7jAIiGRpep+NXa11pIW0uq3MPNxTvOlC0IQmCE78dPe8msrvtBv5j5OT3X5x86SEHPmP00wVJqNTIybxf1uXNMA5lJnQTKCBFYBTbADUMd5dHF0Pi90DEIcPeNxOz8WkgG4L7fBSjYiXE45QlQz+csUIAIiMhT95HlWpVl3w4tmhZ5DCmYTgq2lZsuC4lSjQH9YyFp22SnaxK4VQsZcHllC59HA== 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=C9LuWivrCUx2ZzaSRMGJ26Bniz5SiEQBB6xOHqphK9c=; b=MhoEyJ/X/1AnrWd8duEd3xBzOi9MiGXBMdOYbSNW4zdhgU/H7CQnXxEpREivCLECfed0hNRbm6j9pFbIMwQIpaft6PqURheH9PZ4Ymy2O1uH0grJ/jRKvjJoP8ywbEF4lbx93yoNOhxWAj/DkwDy6VCC2GiVXPUQkoTPINnZXL0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) by SN7PR12MB6888.namprd12.prod.outlook.com (2603:10b6:806:260::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.26; Mon, 10 Jul 2023 13:11:26 +0000 Received: from DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::c440:6819:be48:f4b8]) by DM4PR12MB5229.namprd12.prod.outlook.com ([fe80::c440:6819:be48:f4b8%4]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 13:11:26 +0000 Message-ID: <6cc8c7b6-1cc6-8425-7c6a-7f2e42d5f78e@amd.com> Date: Mon, 10 Jul 2023 08:11:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH RFC v9 05/51] x86/coco: move CONFIG_HAS_CC_PLATFORM check down into coco/Makefile To: Sathyanarayanan Kuppuswamy , 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, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.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, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org, ashish.kalra@amd.com, nikunj.dadhania@amd.com, liam.merwick@oracle.com, zhi.a.wang@intel.com, "Kirill A . Shutemov" References: <20230612042559.375660-1-michael.roth@amd.com> <20230612042559.375660-6-michael.roth@amd.com> Content-Language: en-US From: Tom Lendacky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR13CA0080.namprd13.prod.outlook.com (2603:10b6:806:23::25) To DM4PR12MB5229.namprd12.prod.outlook.com (2603:10b6:5:398::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB5229:EE_|SN7PR12MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: b320061f-45d0-4e12-f5c9-08db814729b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MRtFemPiawT7j+HAcu7dWDiXiMzwZHluxYaA8ZTLZ3hxeBopz7NDfCgrTvAKU3pnrPoWI1Kaqzebrq6WQ8fb0QGz0nq2P9PEyeYx0OFsPoAEUAbqmZV2yubKqiH8Ga7LsXHH8PnkRuWngT2DjiL6XVuV53kyit/rltv/0n5dJhRqpJkdF8dR3RIKyo8tWu4i1e/CdYwyKJ8jEgxfiPF93FAV3GPgYxfr+QbMY6CQW/9DX+SwiPjkCgmPaU25HmrQqFa7zO1Eizz7rEzTl+BpWxLcD9IKSzLkgcQ3RKURPnZ9zhFM3idU8LWEmIec9Y2+k8L8vZWbVE34TLbYE4Om5WW3zlOtbUAJsqSdPHApaq0coAsCaUE0x2c2a6KUij1nSpKNpIfAAOxNTh+psxRd7WlVqyWhsRoYoSglQfbX+CTWo+gwL9CAm/yzZpoN2z6g59jOWqTNWfrlx9fYcChwjCG6kRr3kae85QfOG+XTC25NCi1Z8ghhcTnQht0CV+4BtGIIquxm6ye65NKktLXyJOIaTSpKnVd1HMnmezrP1bTOuZd7IV2sFp8mMdhAt3c+bpQZvSEW8UaHICcDvhOJu4K1Bt9mUfLPRdhkcr4olC1UcLZ/5Uq5ge1u/61rJ3RLVPEm9cPIODKZnUBg7XfaDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB5229.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(366004)(136003)(39860400002)(376002)(346002)(451199021)(31686004)(86362001)(31696002)(38100700002)(36756003)(478600001)(6666004)(110136005)(66946007)(53546011)(186003)(6486002)(6506007)(6512007)(26005)(316002)(7406005)(2906002)(66556008)(66476007)(5660300002)(8936002)(8676002)(7416002)(4326008)(2616005)(41300700001)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NFYrYzlpTXdnR0hsNmh2bW41RjZ0QnovYy91RjhEZngxcWFkTk56c3RDNTJl?= =?utf-8?B?ZHlOdUdrL3VCV0E3eTd5bUZWSmpMQXBtdWMyTDhHNUNPNkxzWFdndjRObXN2?= =?utf-8?B?KzZOK3hpc2ptbU1kZHk3bUxIWFVJM0NwdWE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ZiQjAvVDJ3SHE1OVMrU2J2V21NVmkxQ1dYbnFYNFpw?= =?utf-8?B?L215WnVESS84c2VkQzBBcUNseDVoQVRabkFiU2VyNnpuSlpNd2lsa01qZ3kr?= =?utf-8?B?UGE5S0Y5NWdmZXFYc0s3NWExckF6YWdCNlBFWks2Q2xsaG5GSmFYL1kxLzNV?= =?utf-8?Q?7Fh9XpuddxV6OqBCky/+DSMrO?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b320061f-45d0-4e12-f5c9-08db814729b7 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5229.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 13:11:25.9543 (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: Ey58R+LlnFF/iIeJolIrxcp99kF8rAIB/e2Cir545OObBOI+8+VadmfxjxZJD24XiwOPGQrnM61bVFUTUdv8Fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6888 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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-crypto@vger.kernel.org On 7/9/23 22:05, Sathyanarayanan Kuppuswamy wrote: > Hi, > > On 6/11/23 9:25 PM, Michael Roth wrote: >> Currently CONFIG_HAS_CC_PLATFORM is a prereq for building anything in >> arch/x86/coco, but that is generally only applicable for guest support.> >> For SEV-SNP, helpers related purely to host support will also live in >> arch/x86/coco. To allow for CoCo-related host support code in >> arch/x86/coco, move that check down into the Makefile and check for it >> specifically when needed. > > > I think CONFIG_HAS_CC_PLATFORM is not meant to be guest specific (otherwise, Correct, it is used in bare-metal for SME support, so that needs to continue to work. Thanks, Tom > we could have named it CONFIG_HAS_CC_GUEST). Will it create any issue if > we enable it in host? > >> >> Cc: Kirill A. Shutemov >> Suggested-by: Tom Lendacky >> Signed-off-by: Michael Roth >> --- >> arch/x86/Kbuild | 2 +- >> arch/x86/coco/Makefile | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/arch/x86/Kbuild b/arch/x86/Kbuild >> index 5a83da703e87..1889cef48b58 100644 >> --- a/arch/x86/Kbuild >> +++ b/arch/x86/Kbuild >> @@ -1,5 +1,5 @@ >> # SPDX-License-Identifier: GPL-2.0 >> -obj-$(CONFIG_ARCH_HAS_CC_PLATFORM) += coco/ >> +obj-y += coco/ >> >> obj-y += entry/ >> >> diff --git a/arch/x86/coco/Makefile b/arch/x86/coco/Makefile >> index c816acf78b6a..6aa52e719bf5 100644 >> --- a/arch/x86/coco/Makefile >> +++ b/arch/x86/coco/Makefile >> @@ -3,6 +3,6 @@ CFLAGS_REMOVE_core.o = -pg >> KASAN_SANITIZE_core.o := n >> CFLAGS_core.o += -fno-stack-protector >> >> -obj-y += core.o >> +obj-$(CONFIG_ARCH_HAS_CC_PLATFORM) += core.o >> >> obj-$(CONFIG_INTEL_TDX_GUEST) += tdx/ >