Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp960660rdh; Fri, 24 Nov 2023 02:02:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcTk1M0mWHJhN07ivzju/mwuVh9/GI4/NDemN4tr2Xg95FJAmgFjOl8O5QWsT3nPuKzB7v X-Received: by 2002:a05:6820:16a8:b0:58a:9a06:690c with SMTP id bc40-20020a05682016a800b0058a9a06690cmr1893905oob.0.1700820175070; Fri, 24 Nov 2023 02:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700820175; cv=none; d=google.com; s=arc-20160816; b=zrGDwrLB9uFnIEsb4N/H60SuoP7C3TczuzDx9tu6egxzgS4xICAhywTb6fX2YtVgWj cJb9z6GJCL85CU0d+v3MNCjbYZjR2lWl3Pmhzv4uKGWHlWHRZOOUZjllE2PFhF2v6AjF HCbcgHNAnP/gNmV0C71qulqHuuj9JSuw4tDRiWNt2deVaYEp/VaeXftlc9nFaP5r3AQ1 BaCwSQ5nJN0TAVaPnOvEOxKj4EHvEVPUoQ7NT2NGo4/7r6ClwnOJ5r3VnYeIrtVVW28j tzIzQkVmpxAeBpj0pntbzjxfwFDVH1kPswfV0o2SO8I70pSASewTgq9ERq5631nltvrv iGKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=TeRTeq8Ab0NebTdEjigLF0N3D06Mm51J5Eb7h9xqKQI=; fh=CtPEWLGW3h0xHqpYmMk3bEL5pF6SAQdyssf4zEDqQSU=; b=o+s9DhXZbeNm1yekWQ5ZxMYm1zt1QUsQ9bLebVtrqqmZEwT50SHbjqGiMaZqWD5D1g vXOz+tLwTp8VJ9+nmQtVxDXpesHG4FsV/Lw16g+ZCRYGRTL975ANUBSkwN6h+0A+vd5V MxAUjsyt05hGTmwSD2PgGlB79oCzFlah/yhci2yGQDUKUQnGj+jcvw6yR8iYLwHsohfF GSgSRi3T1WEH9SYW9ZZ5+WM6pWwMehtlp6p1Ulm6M1QtR0hvmcqvnfq205GZBbzOo2y9 sRMiv6zkOeGepiKFSlQ5ARkFK6+bAVe8NF+o8L/T2digb1+rSd7N5tyZqPOBNjyQIjIc bH6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jO7vNFx2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i26-20020a4a6f5a000000b005879493e68fsi1000685oof.3.2023.11.24.02.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 02:02:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jO7vNFx2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CAA5380AB1CF; Fri, 24 Nov 2023 02:01:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230450AbjKXKAn (ORCPT + 99 others); Fri, 24 Nov 2023 05:00:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229668AbjKXKAk (ORCPT ); Fri, 24 Nov 2023 05:00:40 -0500 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 560891AB; Fri, 24 Nov 2023 02:00:46 -0800 (PST) Received: from [192.168.1.150] (181-28-144-85.ftth.glasoperator.nl [85.144.28.181]) by linux.microsoft.com (Postfix) with ESMTPSA id 9844C20B74C0; Fri, 24 Nov 2023 02:00:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9844C20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1700820045; bh=TeRTeq8Ab0NebTdEjigLF0N3D06Mm51J5Eb7h9xqKQI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jO7vNFx2Waub77EPXbAmhsNTXDyhvYWhqOAPtHY+m3ubeSojbzit0I9PjznVQq7GW ke26RpAECLS423AmH3ggOuh0kgd5DCthbDjP8LcwyjRFOycoknBLZzrR01KeztWxP4 qCOt6plQL8At7N1nDKogqCrmysq8fAmreYQ/x8G0= Message-ID: <281e1f13-811b-4897-b3d9-18d233af25f7@linux.microsoft.com> Date: Fri, 24 Nov 2023 11:00:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 3/3] x86/tdx: Provide stub tdx_accept_memory() for non-TDX configs To: "Kirill A. Shutemov" Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Ingo Molnar , Michael Kelley , Nikolay Borisov , Peter Zijlstra , Thomas Gleixner , Tom Lendacky , x86@kernel.org, Dexuan Cui , linux-hyperv@vger.kernel.org, stefan.bader@canonical.com, tim.gardner@canonical.com, roxana.nicolescu@canonical.com, cascardo@canonical.com, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, sashal@kernel.org, stable@vger.kernel.org References: <20231122170106.270266-1-jpiotrowski@linux.microsoft.com> <20231122170106.270266-3-jpiotrowski@linux.microsoft.com> <20231123141113.l3kwputphhj3hxub@box.shutemov.name> Content-Language: en-US From: Jeremi Piotrowski In-Reply-To: <20231123141113.l3kwputphhj3hxub@box.shutemov.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-17.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 24 Nov 2023 02:01:02 -0800 (PST) On 23/11/2023 15:11, Kirill A. Shutemov wrote: > On Wed, Nov 22, 2023 at 06:01:06PM +0100, Jeremi Piotrowski wrote: >> When CONFIG_INTEL_TDX_GUEST is not defined but CONFIG_UNACCEPTED_MEMORY=y is, >> the kernel fails to link with an undefined reference to tdx_accept_memory from >> arch_accept_memory. Provide a stub for tdx_accept_memory to fix the build for >> that configuration. >> >> CONFIG_UNACCEPTED_MEMORY is also selected by CONFIG_AMD_MEM_ENCRYPT, and there >> are stubs for snp_accept_memory for when it is not defined. Previously this did >> not result in an error when CONFIG_INTEL_TDX_GUEST was not defined because the >> branch that references tdx_accept_memory() was being discarded due to >> DISABLE_TDX_GUEST being set. > > And who unsets it now? > Who unsets what now? DISABLE_TDX_GUEST still works the same as before, but patch 2 changed the check in arch_accept_memory() to be more specific (cc_platform_has(CC_ATTR_TDX_MODULE_CALLS)). The stub should have been there all along for CONFIG_AMD_MEM_ENCRPYT=y && CONFIG_INTEL_TDX_GUEST=n configs, but it happened to work without it.