linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
Cc: x86@kernel.org, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org, Robert Richter <rric@kernel.org>,
	Tony Luck <tony.luck@intel.com>,
	James Morse <james.morse@arm.com>,
	yazen.ghannam@amd.com
Subject: Re: [PATCH] EDAC/mce_amd: Do not load edac_mce_amd module on guests
Date: Mon, 9 Aug 2021 12:44:00 +0200	[thread overview]
Message-ID: <YREG8Pzj5n5AIEAs@zn.tnic> (raw)
In-Reply-To: <20210628172740.245689-1-Smita.KoralahalliChannabasappa@amd.com>

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 <bp@suse.de>
> Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@amd.com>
> ---
>  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

      parent reply	other threads:[~2021-08-09 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 17:27 Smita Koralahalli
2021-07-08 20:41 ` Yazen Ghannam
2021-07-23 18:18 ` Kim Phillips
2021-08-09 10:44 ` Borislav Petkov [this message]

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=YREG8Pzj5n5AIEAs@zn.tnic \
    --to=bp@alien8.de \
    --cc=Smita.KoralahalliChannabasappa@amd.com \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rric@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    --subject='Re: [PATCH] EDAC/mce_amd: Do not load edac_mce_amd module on guests' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).