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 E69F1C433F5 for ; Tue, 5 Oct 2021 14:43:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C094A613E6 for ; Tue, 5 Oct 2021 14:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234694AbhJEOpD (ORCPT ); Tue, 5 Oct 2021 10:45:03 -0400 Received: from mga06.intel.com ([134.134.136.31]:64035 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234084AbhJEOpC (ORCPT ); Tue, 5 Oct 2021 10:45:02 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="286638942" X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="286638942" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 07:43:11 -0700 X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="656586278" Received: from cthurman-mobl.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.209.18.154]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 07:43:09 -0700 Subject: Re: [PATCH v8 02/11] x86/tdx: Introduce INTEL_TDX_GUEST config option To: Dave Hansen , Sathyanarayanan Kuppuswamy Natarajan , Randy Dunlap Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , 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 , Tony Luck , Dan Williams , Andi Kleen , Kirill Shutemov , Sean Christopherson , Linux Kernel Mailing List References: <20211005025205.1784480-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20211005025205.1784480-3-sathyanarayanan.kuppuswamy@linux.intel.com> <8a484fb1-21c5-5181-3e77-c818bcc2ffa7@intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <65d75ccf-dbf5-5f29-3a26-a2ee9d2ec96f@linux.intel.com> Date: Tue, 5 Oct 2021 07:43:02 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <8a484fb1-21c5-5181-3e77-c818bcc2ffa7@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/21 7:09 AM, Dave Hansen wrote: >> For the TDX guest, x2apic will be emulated. So it will exist in our >> case. Even if x2apic or TDX guest is not supported by CPU, it will >> boot just fine. > This doesn't really explain the "select X86_X2APIC", though. > > You just said that TDX doesn't*require* X2APIC. So, why is it being I meant for a valid TD guest, x2APIC will *always* be emulated. It is also specified in the spec. Please check sec "TD Hardware" in Intel TDX Virtual Firmware Design Guide or "Interrupt Handling and APIC Virtualization" section in Intel Trust Domain Extensions Module specification. For the case without x2APIC, TDX initialization should fail (hence TDX) will not be enabled). So in non-TDX mode, kernel will boot fine. But in TDX mode, current behavior should be "kernel hang" > selected? What is the specific connection between TDX and X2APIC? X2APIC is used manage interrupts in virtualized environment (like TDX guest). So it is required for interrupt management. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer