Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4659524pxb; Tue, 5 Oct 2021 07:45:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjk3LX+KAyoVm9tiYWpGNgLEBc/9uxwlO3vmqTZf0jiEnwxyymyWRXaWK5j6Sgv2dcvXtO X-Received: by 2002:a63:3ece:: with SMTP id l197mr10361549pga.461.1633445156848; Tue, 05 Oct 2021 07:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633445156; cv=none; d=google.com; s=arc-20160816; b=iXy+Xj0cRGVQg04FZ2qn3A3+s6hNPy2xyyhjcElZl5Gv8fJXXGztkO1YdI000bxW9p 1xt8xrYhDnrYNXGZgnObbtPUmZ+97aGsUcp8Vop8TfNN0VYLiJx4oUt84KGqZgQyJRLr 4SZkPRv0GMU5GTkY6HOc3PuBg+M1odt8TE+4C8jeblfEArbUO3MNoH+ipm5WAr+pfu5Q q/dp6yntuRCVRkiUrUJQpIZUewCBqTQrkBJZzcUC3KfTcEbqB0cZ7zQFGAyQXZ++Mn5j XW6gMD65dK92rBKnlKveh+TKOu4HfSLljaWmOh0WxbnWbM49WwePEs4cLbPHpMtLQioD dXYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=56aw8gD63zHtniTEPA5enm2CoPgY5DEEE2HasI9/JDI=; b=O0yhtgUDFrNjCLnGlWmxd/57sJyop4CTEsopyT4xq5Bn4W+8IMpxBi6D7TGJ7pJFDJ SrxL6izjuX+66YLUaCoTGWrFndlPuHgKy+olV0rGDSQZVVfNEu809XTXNkfK4ropremI yJzk9cZz2oruvViiYnJMbL5kWmtZColMcnvEcVUDskMyE9q5Qgwt2D7iN9mKpFZLgL0a rIzv0vqY/WnXAOkTsxzpDUCgezZsDsmCDVHZiaBPCNSqUFItWDHkpZkdTLmzEammsuUd O4u0u+PDKSAu528YZ1R0HPhS0OEOnggY+/KFBeyV0u6vkkZbfK2PbHC2bET76o1Es7L3 xZEw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si22207670pgv.406.2021.10.05.07.45.40; Tue, 05 Oct 2021 07:45:56 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235203AbhJEOpD (ORCPT + 99 others); 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