From patchwork Fri Sep 8 03:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliott Mitchell X-Patchwork-Id: 13377011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83F22EE14D7 for ; Fri, 8 Sep 2023 03:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238988AbjIHDNL (ORCPT ); Thu, 7 Sep 2023 23:13:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238444AbjIHDNL (ORCPT ); Thu, 7 Sep 2023 23:13:11 -0400 X-Greylist: delayed 293 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 07 Sep 2023 20:13:06 PDT Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 170D21BD8; Thu, 7 Sep 2023 20:13:05 -0700 (PDT) Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7]) by mailhost.m5p.com (8.17.1/8.15.2) with ESMTPS id 388381l7002774 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 7 Sep 2023 23:08:07 -0400 (EDT) (envelope-from ehem@m5p.com) Received: (from ehem@localhost) by m5p.com (8.17.1/8.15.2/Submit) id 388380oI002773; Thu, 7 Sep 2023 20:08:00 -0700 (PDT) (envelope-from ehem) Date: Thu, 7 Sep 2023 20:08:00 -0700 From: Elliott Mitchell To: smita.koralahallichannabasappa@amd.com Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, xen-devel@lists.xenproject.org, rric@kernel.org, james.morse@arm.com, tony.luck@intel.com, yazen.ghannam@amd.com Subject: [PATCH] Revert "EDAC/mce_amd: Do not load edac_mce_amd module on guests" Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org This reverts commit 767f4b620edadac579c9b8b6660761d4285fa6f9. There are at least 3 valid reasons why a VM may see MCE events/registers. First, the hypervisor may have a bug. Ideally this should be dealt with by fixing the hypervisor. Failing that, the hypervisor and versions effected need to be identified so only they are flagged as buggy. Second, the Linux kernel may be handling adminstrative duties/hardware for a hypervisor. In this case, the events need to be processed and potentially passed back through the hypervisor. Third, the hypervisor may do full virtualization of MCE events. In such case, they should be handled normally. Any of these blanket disabling the functionality is bad. The original patch was wrong. --- drivers/edac/mce_amd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 9215c06783df..1b7fccfbb654 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c @@ -1361,9 +1361,6 @@ static int __init mce_amd_init(void) c->x86_vendor != X86_VENDOR_HYGON) return -ENODEV; - if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR)) - return -ENODEV; - if (boot_cpu_has(X86_FEATURE_SMCA)) { xec_mask = 0x3f; goto out;