From patchwork Thu Dec 14 22:16:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 178933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8886578dys; Thu, 14 Dec 2023 14:16:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF51ua6VJBO//hNmkqm7UG1qWwgmOACBuYZILG8STuNgn6J8lO+KytbgZ3IGuZtykCyXYfY X-Received: by 2002:a05:6a20:42a6:b0:18f:97c:8a1c with SMTP id o38-20020a056a2042a600b0018f097c8a1cmr13843272pzj.71.1702592194996; Thu, 14 Dec 2023 14:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702592194; cv=none; d=google.com; s=arc-20160816; b=gNuaJpVYSdnUYBNSUniLOhAcnUCpPz18532QwtRAcYLzlrzMrnE/wRE8/6DY4T5LkA GF+kVmXY3zHc/Kv1zJFRJvP7jn491BpbcBrakvOuVgxFS9rxrMykWNiXkeQoDicIZOyH HA+Ipwzf7r+9mG2PsXJA+C1pVJ+6mwdZ72VU9bIHTirAo+m6dcrkmi1mDmnnHzVRQNZu 8ZlT9E/z0PWZ5iKV9UbWPlKt6p2uYJ7kVExgVPry1RUNGkTkt2CoN2za+gvE7unt8ZCT T0c/Zlea7XBICDkVNAP0Kg72/TP/3TAIT4eB2S5cPwKGZ2Q4HffErMCh4/1Wxz0enVYW SF9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:cc:subject:to:reply-to:sender:from:dkim-signature :dkim-signature:date; bh=23JHJ4YvU/vkCLKZ2ZNv1Me7c3wPWOyfscdZ0QqE0yM=; fh=Rj5I+CiJQUCzBkgURQWTh61f6sCy5nqlkEcrVLMpXDk=; b=JeE6yZ98KMs5Q9Oh7cO0SU3uFww+HTPMy7Ch75fsveFX1jPIjyjrDaZHMtOgJby8UZ K2dq3k3O3w7CKoSBs+jwFor8R8QajBr2jZOsU7LyykTS3GUSOvTKfx9YovkhssCow04m 0elcPxutXtie3IVe2Ta+p9Kb0nC2eVBRK44HhEmdSzXfcCWS0dH9P90SxPCVJEHtuUyh 4LInd9mLil3KDh7akzrOKfRs2EobqsSr/YuufYiKjo1JHI4aGnTQo1Yg1OA8gOBt0xZT vYANbc7XWauLR1paOIr9C1V4bLaS0SA52+8tu8beN9/cAP2Pzkeq+usEuq/lBkTE0pNT OgSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B85ZHcEP; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel+bounces-178-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s34-20020a17090a2f2500b0028ad32112d2si1413907pjd.78.2023.12.14.14.16.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 14:16:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B85ZHcEP; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel+bounces-178-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B14B02838CE for ; Thu, 14 Dec 2023 22:16:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 071602C687; Thu, 14 Dec 2023 22:16:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="B85ZHcEP"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2ZBXHdJh" X-Original-To: linux-kernel@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2406F671E8; Thu, 14 Dec 2023 22:16:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 14 Dec 2023 22:16:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702592177; h=from:from:sender:sender:reply-to: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:content-transfer-encoding; bh=23JHJ4YvU/vkCLKZ2ZNv1Me7c3wPWOyfscdZ0QqE0yM=; b=B85ZHcEPL6OBxidkyNeYDGRwlyAnTSgk5TlH8Fx2toPSd1CWBMGCI5635rTuac68jt09n0 gsaboMZLZitgmwAUSGFfIM4idrK1Vno5U7p8DlsB+rCkzzlbw7AQHZa6HXg7Zvbju3siHe wfb15MWPqm+FqpqZinGSGY4P9i9iX1FE7Vg3l6TQizDqxTd8jrfEs4319lbe43Ize0pWcr Rv/4Fo1XS0bQ9FJAcZr9ZirhaQkrCvN7mmdlrRAOUM1gcIOIKrfF4bXKLGlbmZfEe89lTR RDp6Ylr95alC7qTMaFwYRYpvNDl2NPdhIgeFvYiCQ1cnPhtHk8EDhy39YOQ/vA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702592177; h=from:from:sender:sender:reply-to: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:content-transfer-encoding; bh=23JHJ4YvU/vkCLKZ2ZNv1Me7c3wPWOyfscdZ0QqE0yM=; b=2ZBXHdJhShe2SpVwbYYZWLqU1MCZ84W0wKRQGtqyPRuurOEh8v7v+17ZPz+W/WrHq+YBkl S9ro0568/hMkKBCA== From: "tip-bot2 for Kai Huang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/tdx] x86/virt/tdx: Make TDX host depend on X86_MCE Cc: Arnd Bergmann , Kai Huang , Dave Hansen , "Kirill A. Shutemov" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170259217628.398.17615017051831948237.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785297313016146373 X-GMAIL-MSGID: 1785297313016146373 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 AuthorDate: Thu, 14 Dec 2023 11:28:25 +13:00 Committer: Dave Hansen 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 Signed-off-by: Kai Huang Signed-off-by: Dave Hansen Reviewed-by: Kirill A. Shutemov 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