Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2568173pxt; Mon, 9 Aug 2021 03:51:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwkZOUZx7HdTqg3sx3VYbqqSmtkuEGCMeM/hEvXW1ryXVh7mcEdtVSf/YEn5Vm54EkQPrp X-Received: by 2002:a05:6402:2297:: with SMTP id cw23mr28689289edb.329.1628506269988; Mon, 09 Aug 2021 03:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628506269; cv=none; d=google.com; s=arc-20160816; b=QmzTsPJfBzAqcYzRceDWkW0HKrf8MMq9lM3EjoVYwVGAMXTT32Psknid/xQ2rIm7Ws 5GwdTyXqhSvxt6bksdXSCjxzyq+a3kt9+DBrIcGhnJKVZQyGXexcC9lsv1PsQqe+yw/f 11DLkvWIbjer01bHGk2nbwl4Z7CtpRFQv0cq9UP6a52uGELQv9fi4YCmzXJAQKBrvefk hWetkD1CULjVv6Jb3oYo5yxLZT64WbtJDS11Y+D6bPeYOGzDMghNNl1GzQ7h38aJEBIv IaoluDSkViWSxXipi165Ivr8A8tZQgljCAx86K+cNz+6SVIWjeDH10ezEL8lE9NpKaTY 0rzw== 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=iRZgmeCr/Savpcr/auC+m2pX5jLL5wpQZZXyOWrBPUc=; b=hO9+VZrNRvunRd+G+YDdWX3bnlJAk3e9Ji6mIEL2UMm2KY8bY/7NUGeOhDsfCKNZdZ 8Duj6F7wUw5BFBh8yV+1Y1odiJb8Hm1wc8UPDo3trz34HUujF5ozg2yBZ6jGHWuQoZQ2 pby/zIz6AsVZQUPta5BaJwbCLNCTJxhVJQKexaFMq/E7cVt6uUchBbKDpA78e5QArq2Y 3W1jz+kuV5qe7ZdfTPGydg/Caopg7trmyV1Msv6l59JRno8gCgsORaxPhteiwemMEswE /vxOXD/JTIQY4HBAcTOSfe5wH1BXV+614OZtAFVugnNx9XePoKOql9sLcI/fhFxyqiZP P++A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=kEl2pueu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce17si17299158ejc.222.2021.08.09.03.50.47; Mon, 09 Aug 2021 03:51:09 -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; dkim=pass header.i=@alien8.de header.s=dkim header.b=kEl2pueu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234353AbhHIKnv (ORCPT + 99 others); Mon, 9 Aug 2021 06:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbhHIKnt (ORCPT ); Mon, 9 Aug 2021 06:43:49 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CBB7C0613D3; Mon, 9 Aug 2021 03:43:29 -0700 (PDT) Received: from zn.tnic (p200300ec2f26f300329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ec:2f26:f300:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D47E21EC03FE; Mon, 9 Aug 2021 12:43:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628505804; h=from:from: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:in-reply-to:in-reply-to: references:references; bh=iRZgmeCr/Savpcr/auC+m2pX5jLL5wpQZZXyOWrBPUc=; b=kEl2pueuhWRmxbCPU2YGFyTIm0CA72sLxsE7iGU8w/YUwUbr80EKuCFiEkxrUlFUwPeKnP nBbFFNJExUwVq9MWMJ2c7d4wpheBOqQgTBaItGCtHfS8zuItHLw4wSbnIyi3zA0RsGkpJN FnoK3e6cneFPXPkEitmc50zUKZLH2zc= Date: Mon, 9 Aug 2021 12:44:00 +0200 From: Borislav Petkov To: Smita Koralahalli Cc: x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Richter , Tony Luck , James Morse , yazen.ghannam@amd.com Subject: Re: [PATCH] EDAC/mce_amd: Do not load edac_mce_amd module on guests Message-ID: References: <20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 12:27:40PM -0500, Smita Koralahalli wrote: > Hypervisors may not expose SMCA feature to the guest. > > Check for X86_FEATURE_HYPERVISOR on entry in mce_amd_init() and return > -ENODEV if set. > > Suggested-by: Borislav Petkov > Signed-off-by: Smita Koralahalli > --- > drivers/edac/mce_amd.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c > index 5dd905a3f30c..1a1629166aa3 100644 > --- a/drivers/edac/mce_amd.c > +++ b/drivers/edac/mce_amd.c > @@ -1176,6 +1176,9 @@ 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; > -- > 2.17.1 Applied, thanks. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette