Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4640101pxb; Tue, 5 Oct 2021 07:22:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9B/LY8sXAKKQahiq/fabv/cNyu/N1XIbUoc9XfTQfZQ9PxXOdtTgvNLmdybCaSKzm00bN X-Received: by 2002:adf:a1d7:: with SMTP id v23mr11103117wrv.171.1633443741092; Tue, 05 Oct 2021 07:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633443741; cv=none; d=google.com; s=arc-20160816; b=VUukcTngAttt050iQWYf+gpt9GRSwH2w5wPcaMr735oHI+gdYD2q8xgrNw7F3bK0ow 6q4HUSNk89oEXGjr5ZA7qBi6zDLk4mD+tXRgcJZfF5bcujPKim9Wdudo/y3K9FcTS+TZ lKzMiKsB33b4xLlejP7k4x54LAnQov416Onm4BoY7Rw5oBeX9E/qAdvI5s1LYdrLKJ1+ apYNd0rImH7pe5bOsnj6W1qj+4j14mkvD/o7mRoJx2g+vq8PnbnP5zUJN8G5DGNgSIYU 9pDFuendvxQf3lIxjjHD44lOXgwvzKLCGmf19bEfj0ryAUM1CPX1bhhiCBxbCB/lVqlf YAnA== 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:autocrypt:from :references:cc:to:subject; bh=rfSTmuWW6eUvDbEfLhoBNsX6uxqpqIWY5AyUxV023jQ=; b=W9S1ax1YUziiYM5QNGWrW0ML2ayvp0jO0RnN/Kv2WpUQrzhxQ5mWDoylEWif4n15j9 gwP77Dx/jPMctjhT9PGyqFp5ulqkw0J9P8rvhihm2tyMfndbPuPtpnBrVZZ9bYYBX/4g v87LfKOYUK96D29531vhOebWrabwXksqr92G2DBp8HXC3d8UYsXSWWkZtK/20oBaYIms yIxn5CT1ENq7U8/sFSlK0FG9MxOHIqf3ZyRQN4Ed25sKQXaD/8M/HLhF944oH1thWhum Gu85nWlnGzsqGz/lXmx8Rk53SHNiaKRLHKI9Rg+8HMFa1j8QTuAwIwGMHEJ+aRgBus3p EFUg== 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 d10si23182970edm.434.2021.10.05.07.21.56; Tue, 05 Oct 2021 07:22:21 -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 S235793AbhJEOWF (ORCPT + 99 others); Tue, 5 Oct 2021 10:22:05 -0400 Received: from mga09.intel.com ([134.134.136.24]:64219 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235524AbhJEOWC (ORCPT ); Tue, 5 Oct 2021 10:22:02 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10128"; a="225650874" X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="225650874" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 07:10:03 -0700 X-IronPort-AV: E=Sophos;i="5.85,349,1624345200"; d="scan'208";a="523785654" Received: from ftbalow-mobl.amr.corp.intel.com (HELO [10.212.210.174]) ([10.212.210.174]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2021 07:10:02 -0700 Subject: Re: [PATCH v8 02/11] x86/tdx: Introduce INTEL_TDX_GUEST config option To: Sathyanarayanan Kuppuswamy Natarajan , Randy Dunlap Cc: Kuppuswamy Sathyanarayanan , 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> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5IuYsSwAeZGkdQ5g6m1xq7AlDJQZddhr/1DC/nMVa/2BoY 2UnKuZuSBu7lgOE193+7Uks3416N2hTkyKUSNkduyoZ9F5twiBhxPJwPtn/wnch6n5RsoXsb ygOEDxLEsSk/7eyFycjE+btUtAWZtx+HseyaGfqkZK0Z9bT1lsaHecmB203xShwCPT49Blxz VOab8668QpaEOdLGhtvrVYVK7x4skyT3nGWcgDCl5/Vp3TWA4K+IofwvXzX2ON/Mj7aQwf5W iC+3nWC7q0uxKwwsddJ0Nu+dpA/UORQWa1NiAftEoSpk5+nUUi0WE+5DRm0H+TXKBWMGNCFn c6+EKg5zQaa8KqymHcOrSXNPmzJuXvDQ8uj2J8XuzCZfK4uy1+YdIr0yyEMI7mdh4KX50LO1 pmowEqDh7dLShTOif/7UtQYrzYq9cPnjU2ZW4qd5Qz2joSGTG9eCXLz5PRe5SqHxv6ljk8mb ApNuY7bOXO/A7T2j5RwXIlcmssq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Ebs21IqBZbbKdY1GkcEGTE7AnkA3Y6YB7I/j9mQ3hCgm5muJuhM/2Fr OPsw5tV/LmQ5GXH0JQ/TZXWygyRFyyI2FqNTx4WHqUn3yFj8rwTAU1tluRUYyeLy0ayUlKBH ybj0N71vWO936MqP6haFERzuPAIpxj2ezwu0xb1GjTk4ynna6h5GjnKgdfOWoRtoWndMZxbA z5cecg== Message-ID: <8a484fb1-21c5-5181-3e77-c818bcc2ffa7@intel.com> Date: Tue, 5 Oct 2021 07:09:59 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/5/21 6:29 AM, Sathyanarayanan Kuppuswamy Natarajan wrote: > On Mon, Oct 4, 2021 at 9:53 PM Randy Dunlap wrote: >> On 10/4/21 7:51 PM, Kuppuswamy Sathyanarayanan wrote: >>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig >>> index 2b2a9639d8ae..c42dd8a2d1f4 100644 >>> --- a/arch/x86/Kconfig >>> +++ b/arch/x86/Kconfig >>> @@ -865,6 +865,20 @@ config ACRN_GUEST >>> IOT with small footprint and real-time features. More details can be >>> found inhttps://projectacrn.org/. >>> >>> +config INTEL_TDX_GUEST >>> + bool "Intel Trusted Domain eXtensions Guest Support" >>> + depends on X86_64 && CPU_SUP_INTEL && PARAVIRT >>> + depends on SECURITY >>> + select X86_X2APIC >> Apparently some Intel CPUs don't have the x2apic feature, since the >> Kconfig help text for X86_X2APIC says: >> >> This enables x2apic support on CPUs that have this feature. >> >> so how is it safe to set/enable/select that kconfig symbol? >> >> Will the x2apic code just safely not work if the h/w feature is >> missing? > 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 selected? What is the specific connection between TDX and X2APIC?