Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3101218pxb; Tue, 21 Sep 2021 14:43:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8ydxeD8JfTsI69rVqNRV8L93v6+VbAm72j9JbyXGa0PG4YzkC1H/cRV8W++QViulmoZu/ X-Received: by 2002:a50:e1c3:: with SMTP id m3mr36712994edl.28.1632260622712; Tue, 21 Sep 2021 14:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632260622; cv=none; d=google.com; s=arc-20160816; b=MA481JOsWGpVg1ysl3ViLAwp0gGCbHTmC/5P1+awsgoKsibP28wRy1zE2CJA8q/aVr G4FKEpZwiFZqm/n8llk7sajy4mOpOJRM8cHezCYBRxAo5nAcQoiOE4O8ILObOPo+Wjy1 Ba5KvB1BhEky9o65VadtNODhp+gazRC3Z88olwKpARjvAauA8+yI1Kk6QXLl5EJpR/5Z Q4HOJY17dEGmEBQ7Uy590J+12YrNoBSubq2fWB5/5ioxYrbr+vJWI9ZHbNWWbckgo/l1 vsT/uJGALC8DHvaL0d8mGaJTlKx5hAkSGqQQsSZCiz1imjM6uJDR7ff7GQVLW5yHJiXq fQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=onYH57UKgRX2y9FA652B6Jil/Y6sRo6kbtM4byaxFbk=; b=XHI/dq6xvW5BK2dXwTdAcoZ6JpKeem8l9mSaru29CwXqLHcPoMOuhJ9ss2lwPfCk6V tgv7j1XSj2L79ayOGUWxaHK2mMSrl6Swp+KQtZDKWBlHdgG/4YzVkkEdT+kDs0dYAwHf 1oKm4kxFDKvKNrEtY6JJP6hfu2xZBX1eMu1Eqw24waHXeu+YkYzFG96xgoaLbtfYeWqA jZ4GEQCUKXB47jmdi01mUgUij0hiFcCH2gsg8PzUf7nnI+SlrE0SufnU+xw/lRXBvzhW uaorMnYUMyTihAHRtFFVREJdB2skPFGQ4X0/4LmMr7BMrDBmQDJojcBIV+RnAIgEkldJ MzUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=eBVF3W3V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si242431edn.26.2021.09.21.14.43.15; Tue, 21 Sep 2021 14:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov-name.20210112.gappssmtp.com header.s=20210112 header.b=eBVF3W3V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235404AbhIUVfe (ORCPT + 99 others); Tue, 21 Sep 2021 17:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235405AbhIUVfb (ORCPT ); Tue, 21 Sep 2021 17:35:31 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EBCEC061756 for ; Tue, 21 Sep 2021 14:34:02 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id i4so3194278lfv.4 for ; Tue, 21 Sep 2021 14:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=onYH57UKgRX2y9FA652B6Jil/Y6sRo6kbtM4byaxFbk=; b=eBVF3W3VBl8/Kcc3edgbmiaMz5aGtiFcsghvZhSejZhbmeEyK5UQw/1PFkiQyXYHaG ep1Qe79XGKoddakjbluJzSSdU6e7ItIa/VyOBVU9ai0Bymzz3iDJtyFjRD39EIPM25vz 4qz0qSZamNXJd68fq5IJpTDDpau43+mSfg2XWhoKoGxbOFiuRtiRYE7GfxGmSUDaHEJg E7kAQREHoi4We6KjgT1K6PZUTHBzzEa/WGaKq/wElm+NwA9Dj3BI08sAZJBTPlkJn2D7 eFgy10WdV1zv/1WS3CBekNlpT18oJkYC++DPHzSZnogr5FAXrL71q6vwYz/oJyJkBY1z HMkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=onYH57UKgRX2y9FA652B6Jil/Y6sRo6kbtM4byaxFbk=; b=rQ9X5pXdtBGlccVgufcAr9V9JEELbI24xYdBPPQ1UZ+VTcNj8gXoQ9z2e/C4BMrXcO OJ1oJb4S+sUQ9n5hhkxm49s4IH9MHh0SZu5IPYK+Y5ShPCBqOUy7Ued29Zp1KVTu1DGP SpGknplF4/0QkAr3fLwJBiX+nxvThGt69Kfo4p4HT5BK0lwqfhUtd1X+MZKflK3tGHsZ biR6ZKw8khLoZqYyUCWrCxr5ncZt8BapM7JC2ljV9vPp6AD1Hk6uCRB2Yye1jgQZ980J b3LI0Nbgrf76r5bf/htd0iOvTRVl8wWcGS82LaWBIAo76bS5epAAaCQFhel1AF3mn/Qo j3Bw== X-Gm-Message-State: AOAM532xBdmLVQMGDsJqmpblTRdDKl0zrKRcIymWmkFG6OJ+0LNwijsG 8SJaw7uoCgQwEqmNwSCKFzzAgA== X-Received: by 2002:a05:6512:3096:: with SMTP id z22mr19350411lfd.167.1632260040535; Tue, 21 Sep 2021 14:34:00 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id t14sm16618lfp.15.2021.09.21.14.33.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 14:34:00 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 3890410305C; Wed, 22 Sep 2021 00:34:01 +0300 (+03) Date: Wed, 22 Sep 2021 00:34:01 +0300 From: "Kirill A. Shutemov" To: Borislav Petkov Cc: Tom Lendacky , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-graphics-maintainer@vmware.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kexec@lists.infradead.org, linux-fsdevel@vger.kernel.org, Brijesh Singh , Joerg Roedel , Andi Kleen , Sathyanarayanan Kuppuswamy , Tianyu Lan , Christoph Hellwig , Thomas Gleixner , Ingo Molnar , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Will Deacon Subject: Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has() Message-ID: <20210921213401.i2pzaotgjvn4efgg@box.shutemov.name> References: <367624d43d35d61d5c97a8b289d9ddae223636e9.1631141919.git.thomas.lendacky@amd.com> <20210920192341.maue7db4lcbdn46x@box.shutemov.name> <77df37e1-0496-aed5-fd1d-302180f1edeb@amd.com> <20210921212059.wwlytlmxoft4cdth@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 11:27:17PM +0200, Borislav Petkov wrote: > On Wed, Sep 22, 2021 at 12:20:59AM +0300, Kirill A. Shutemov wrote: > > I still believe calling cc_platform_has() from __startup_64() is totally > > broken as it lacks proper wrapping while accessing global variables. > > Well, one of the issues on the AMD side was using boot_cpu_data too > early and the Intel side uses it too. Can you replace those checks with > is_tdx_guest() or whatever was the helper's name which would check > whether the the kernel is running as a TDX guest, and see if that helps? There's no need in Intel check this early. Only AMD need it. Maybe just opencode them? -- Kirill A. Shutemov