Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5649375rdb; Wed, 13 Dec 2023 15:26:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJgtTVxcLkK6FGyDE6fXuYVcCPm6QHtK8hqtbJXUak7gtwwK42jQGr1nU/rH2iQG65dv6M X-Received: by 2002:a05:6870:c0f:b0:1fb:75b:2fce with SMTP id le15-20020a0568700c0f00b001fb075b2fcemr11435087oab.101.1702509999552; Wed, 13 Dec 2023 15:26:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702509999; cv=none; d=google.com; s=arc-20160816; b=nU2a5zddEk9SplfhsW/a6qoGSyAyxqtr3v+kclNKZA3HHLS+tgl1w4vN2k9aweK425 i2JahtR9VNAewgEyfumIsGpL6P3F20ekcS254w+aHfU3cx2bp5ZLMJeMFO4gNkgABYQW qUw0UG4OXPddD0+wp+9lm342iZPghAjgoJJagNTzZpNddABxnkHoS7OqjyJ9W0eAjIyA LuO6GhXxDfIv1taQgUhOQc/7F3YFe3fwPKLUQfyvwZaxyUcR7xdWDfkZ0lbqdvgkzJD+ XvpjZ4+LSg//wuCVOUQ452uxpdwbRWYAuqCnoB7dGWxS0NdNCVBjB9hYwWGNArjsP/he n5Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aSdDbuhjZ+NYe0ySbtpj425ICqLIYL0Rg96OtvF0H7o=; fh=o7uENHTj2uRNfusi9U/YmIskyfzkzhU27NnH3Va5mLw=; b=nHjlUTvNZ2kHA1PPCkqF53/MWCeTABUwRe/pUwkj+9UNgxJtrcekmuDLVLYmWBrTqG lcpHR6GOgrstRpnY4ePn9DzNFfNPskPynC60QsaycZ/cKKDMOTQA9Jkb1VT2UQuB6WZJ 7RQrU8RqOS9oLqVLzwQce9wckbiquKScldrrD3kYXXUALOnowwxT2YmQ2YAJaYKtizWm DdXIgJ38H0Q8Q0nE/rhqKUD88aNTMaVu9HuUAyapLxyMsdWRdtOX8lZQu8lp08Kp8IG7 dt+EamCRFIRxi3giGE4zHFD9/W+HaEvMr7izAAqQw3X+CUnXy+27wa1yxFPCT4Usy/Vw iVzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PpUI5Soh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id w20-20020a631614000000b00557531eafb0si9906500pgl.559.2023.12.13.15.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 15:26:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PpUI5Soh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0E7EF8033DE1; Wed, 13 Dec 2023 15:26:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbjLMX0V (ORCPT + 99 others); Wed, 13 Dec 2023 18:26:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjLMX0U (ORCPT ); Wed, 13 Dec 2023 18:26:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 903E7A3 for ; Wed, 13 Dec 2023 15:26:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702509986; x=1734045986; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=A/ba4SiA2FRPgmLTnLmnHbfs6QQOwcs6Xl2vcb4F2eE=; b=PpUI5SohGlS0iWNqJHwQSsP3+2v86BlAS2WIItitcDe47d7ZRYdZiisx s2SzOkpiuHqrEBiblh+VyOZWaq24kdy/3rgZq6zrrnG49Vq88D9JVo24b +etpUtTWePQTYDdaf/4NJpFI6rC/cw2RJWu1q0x6bmxnL+3N+obTl1IVW BAR5Z1C9rFFU1gp3I9uA0jKqMTC+GSvqHtx2ZAFQPSRN8FrvGdmB86N1d pP2e616VEZiiTevCWnTeSOWXx+grZcSmnvbwlHid/DKv/AcoI1j/UezBd tiYiIZrB5qgwKydr5P/zOtbEs83DlHLM22hGGiQHQ6t3kMlO2GlDXMEjI Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="8437653" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="8437653" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 15:26:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="750302232" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="750302232" Received: from gschoede-mobl.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.33.110]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 15:26:23 -0800 Received: by box.shutemov.name (Postfix, from userid 1000) id 9529B10A4DA; Thu, 14 Dec 2023 02:26:20 +0300 (+03) Date: Thu, 14 Dec 2023 02:26:20 +0300 From: kirill.shutemov@linux.intel.com To: Kai Huang Cc: dave.hansen@intel.com, arnd@kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, bp@alien8.de, peterz@infradead.org, tglx@linutronix.de, tony.luck@intel.com, mingo@redhat.com, hpa@zytor.com Subject: Re: [PATCH] x86/virt/tdx: Make TDX host depend on X86_MCE Message-ID: <20231213232620.5apm2yt4bthw7ksc@box.shutemov.name> References: <20231213222825.286809-1-kai.huang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231213222825.286809-1-kai.huang@intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 13 Dec 2023 15:26:37 -0800 (PST) On Thu, Dec 14, 2023 at 11:28:25AM +1300, Kai Huang wrote: > 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. > > Reported-by: Arnd Bergmann > Closes: https://lore.kernel.org/all/20231212214612.GHZXjUpBFa1IwVMTI7@fat_crate.local/T/ > Fixes: 70060463cb2b ("x86/mce: Differentiate real hardware #MCs from TDX erratum ones") > Link: https://lore.kernel.org/all/20231212214612.GHZXjUpBFa1IwVMTI7@fat_crate.local/T/#m1a109c29324b2bbd0b3b1d45c218012cd3a13be6 > Signed-off-by: Kai Huang Reviewed-by: Kirill A. Shutemov -- Kiryl Shutsemau / Kirill A. Shutemov