From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AA02C433F5 for ; Wed, 13 Oct 2021 21:07:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D5C261163 for ; Wed, 13 Oct 2021 21:07:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230049AbhJMVJk (ORCPT ); Wed, 13 Oct 2021 17:09:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbhJMVJj (ORCPT ); Wed, 13 Oct 2021 17:09:39 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AED0C061570 for ; Wed, 13 Oct 2021 14:07:34 -0700 (PDT) Received: from zn.tnic (p200300ec2f120800318554cedc812785.dip0.t-ipconnect.de [IPv6:2003:ec:2f12:800:3185:54ce:dc81:2785]) (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 62A8F1EC04EE; Wed, 13 Oct 2021 23:07:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1634159253; 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=0KSXduuTUcKm2QHVLTp6LvwWCnWKFHzdXsUFLWSeP0E=; b=T1Jfn/DIf8Xz5qoc0pyE7GCeg01f/OaJm3eSNlN6zX7foGT/+vK19iZ42Yy/1Zam9ijNUk kWVmrx4C4qw6zTduMPqMi/ab+6i2rT4MlO6bgPRvVHlLtvYD5DzV99G9dBOFWX3RbZR8om cz5e0BZW9m5qAcRXnqCamhXjL55zTv4= Date: Wed, 13 Oct 2021 23:07:32 +0200 From: Borislav Petkov To: Thomas Gleixner Cc: Kuppuswamy Sathyanarayanan , Ingo Molnar , x86@kernel.org, Paolo Bonzini , David Hildenbrand , Andrea Arcangeli , Josh Poimboeuf , 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 v10 03/11] x86/cpufeatures: Add TDX Guest CPU feature Message-ID: References: <20211009053747.1694419-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211009053747.1694419-4-sathyanarayanan.kuppuswamy@linux.intel.com> <87ee8o8xje.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87ee8o8xje.ffs@tglx> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 10:44:37PM +0200, Thomas Gleixner wrote: > No. This is tasteless garbage, really. > > tdx_early_init() is invoked from x86_64_start_kernel() very early in the > boot process __before__ is_tdx_guest() is invoked. > > So why on earth is it requried to keep those conditionals and cpuid() > muck around after init? Yah, reportedly, they wanna parse cmdline options so it has to be after copy_bootdata() but copy_bootdata() has a cc_platform_has() call which ends up in is_tdx_guest() on Intel and there you have the catch 22 because CPUID hasn't happened yet in tdx_early_init(). -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette