mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Kai Huang" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Arnd Bergmann <arnd@kernel.org>, Kai Huang <kai.huang@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/tdx] x86/virt/tdx: Make TDX host depend on X86_MCE
Date: Thu, 14 Dec 2023 22:16:16 -0000	[thread overview]
Message-ID: <170259217628.398.17615017051831948237.tip-bot2@tip-bot2> (raw)

The following commit has been merged into the x86/tdx branch of tip:

Commit-ID:     83e1bdc94f32dcf52dfcd2025acc7a2b9376b1e8
Gitweb:        https://git.kernel.org/tip/83e1bdc94f32dcf52dfcd2025acc7a2b9376b1e8
Author:        Kai Huang <kai.huang@intel.com>
AuthorDate:    Thu, 14 Dec 2023 11:28:25 +13:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Thu, 14 Dec 2023 14:08:24 -08:00

x86/virt/tdx: Make TDX host depend on X86_MCE

A build failure was reported that when INTEL_TDX_HOST is enabled but
X86_MCE is not, the tdx_dump_mce_info() function fails to link:

  ld: vmlinux.o: in function `tdx_dump_mce_info':
  ...: undefined reference to `mce_is_memory_error'
  ...: undefined reference to `mce_usable_address'

The reason is in such configuration, despite there's no caller of
tdx_dump_mce_info() it is still built and there's no implementation for
the two "mce_*()" functions.

Make INTEL_TDX_HOST depend on X86_MCE to fix.

It makes sense to enable MCE support for the TDX host anyway.  Because
the only way that TDX has to report integrity errors is an MCE, and it
is not good to silently ignore such MCE.  The TDX spec also suggests
the host VMM is expected to implement the MCE handler.

Note it also makes sense to make INTEL_TDX_HOST select X86_MCE but this
generates "recursive dependency detected!" error in the Kconfig.

Closes: https://lore.kernel.org/all/20231212214612.GHZXjUpBFa1IwVMTI7@fat_crate.local/T/
Fixes: 70060463cb2b ("x86/mce: Differentiate real hardware #MCs from TDX erratum ones")
Reported-by: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/all/20231212214612.GHZXjUpBFa1IwVMTI7@fat_crate.local/T/#m1a109c29324b2bbd0b3b1d45c218012cd3a13be6
Link: https://lore.kernel.org/all/20231213222825.286809-1-kai.huang%40intel.com
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 01cdb16..92c03cb 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1974,6 +1974,7 @@ config INTEL_TDX_HOST
 	select ARCH_KEEP_MEMBLOCK
 	depends on CONTIG_ALLOC
 	depends on !KEXEC_CORE
+	depends on X86_MCE
 	help
 	  Intel Trust Domain Extensions (TDX) protects guest VMs from malicious
 	  host and certain physical attacks.  This option enables necessary TDX

                 reply	other threads:[~2023-12-14 22:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=170259217628.398.17615017051831948237.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=arnd@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=kai.huang@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®