Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp320630pxb; Wed, 6 Oct 2021 05:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze6OQ7LaBRN+vVdg/nkrO1D1m2T7e/a71dr4pYQW4yEnfIff148LqdDvElSe01vHfuBGFR X-Received: by 2002:a17:90b:1c02:: with SMTP id oc2mr2670104pjb.52.1633524546668; Wed, 06 Oct 2021 05:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633524546; cv=none; d=google.com; s=arc-20160816; b=h7cgZdK6u5/Z9ezJNXBly2C6Ig/XR5fHMt1c2YOtyNHukWCxC053FDLpTvUSznAMr8 hdVYE+QtR1vgjye09MJkLrI9TJxu0SbBqB/w6gWWYdJKVTH/X9uVbXR5YeIH08MF4jJ6 kTaIjhfHyyddg+jgYukh8aGNg3dj/uLNaF9VA4i3nsokVt/UPEU9AkmgsjAAKPoJWNxi 1VgHavY86O9gBe5Ire1dUPSVo98HtEg14Q34Er5A3SkkoMy6y7XN1VuYYNqiZKFaAgm0 d51akeq2rbp+AoYDxutB/xYHG328RDrFp7oDPol9kcMKiE52OiMIylFs5h7LVJOFxDoB exlg== 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=OIi5fQlCiQUmAZsMGAxtcqUTEjX4uAH3bLsnXW/m3AE=; b=xd6WnCT9pJS6TddA8D8zwf97sj0hkKvyIX/j8Evaf/DBWQg3DUwX04voYSM14luhRD Pjq4wOlXpgfHWo7DglJRs/IHZWkwA1ipbiyOJsq8jStvu6U0O3pZlPTMC4chWBgxPkEB LYRLtQdBgk4MB2BPU7IclPuPCjIjrwC38uTmaINv6OCzZpPHzs7RKNhbHgD7lS4UCTMI onRx3Ucqte/KWv9KoUXOwhJVOQvgDlB7aLytbLLTQHARS4yEcJMERf+/A4+A/hPgnMcK NS+GypJPIxff9IQhjAgDI648Y/zEiAxFU4KpnOqdZHCVbwAhvbH3yadVanBd1sY+bf4V 7HoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=BL02zMUM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp16si6273402pjb.79.2021.10.06.05.48.53; Wed, 06 Oct 2021 05:49:06 -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=@alien8.de header.s=dkim header.b=BL02zMUM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238542AbhJFMtg (ORCPT + 99 others); Wed, 6 Oct 2021 08:49:36 -0400 Received: from mail.skyhub.de ([5.9.137.197]:57486 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238545AbhJFMtf (ORCPT ); Wed, 6 Oct 2021 08:49:35 -0400 Received: from zn.tnic (p200300ec2f0d360075f221dbc8708d3a.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:3600:75f2:21db:c870:8d3a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 695041EC03AD; Wed, 6 Oct 2021 14:47:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1633524462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=OIi5fQlCiQUmAZsMGAxtcqUTEjX4uAH3bLsnXW/m3AE=; b=BL02zMUMndK1m1ADZIZ26PUo6GYsrPkSbrNA7xo5I6gGUl/I0fOJzdYaUcD6md5yQLXuYf FnVttnzGb+VEX9lImIoiaKZXqNZYgquYVy1jxRyn52QnkkvYh0rw57y9i36hy0VHzYNplo PDBnzP/uRu/o/3GHgVXw+GY1aePpm8g= Date: Wed, 6 Oct 2021 14:47:42 +0200 From: Borislav Petkov To: Josh Poimboeuf Cc: "Kuppuswamy, Sathyanarayanan" , Thomas Gleixner , Ingo Molnar , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Juergen Gross , Deep Shah , VMware Inc , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Peter H Anvin , Dave Hansen , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Kuppuswamy Sathyanarayanan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 03/11] x86/cpufeatures: Add TDX Guest CPU feature Message-ID: References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-4-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005210423.yfftpxxmj3cjprtv@treble> <15a07997-2659-6be1-b8a3-da57e72562b5@linux.intel.com> <20211006034218.ynamwigsvpgad7sr@treble> <20211006050309.ldn5myznmpurnomm@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211006050309.ldn5myznmpurnomm@treble> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 05, 2021 at 10:03:09PM -0700, Josh Poimboeuf wrote: > I'm not suggesting getting rid of the feature flag. I'm suggesting > getting rid of the global variable. Is there a reason you can't check > the feature flag instead of checking the global variable? The reason is that cc_platform_has() is used too early, even before get_cpu_cap(). So you need to have TDX guest detected even before feature flags. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette