linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-edac <linux-edac@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] EDAC/amd64: Merge error injection sysfs facilities
Date: Tue, 15 Dec 2020 10:11:20 -0600	[thread overview]
Message-ID: <20201215161120.GB2122783@yaz-nikka.amd.com> (raw)
In-Reply-To: <20201215110517.5215-2-bp@alien8.de>

On Tue, Dec 15, 2020 at 12:05:17PM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
> 
> Merge them into the main driver and put them inside an EDAC_DEBUG
> ifdeffery to simplify the driver and have all debugging/injection stuff
> behind a debug build-time switch.
> 
> No functional changes.
> 
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
>  drivers/edac/Kconfig          |   7 +-
>  drivers/edac/Makefile         |   6 +-
>  drivers/edac/amd64_edac.c     | 237 +++++++++++++++++++++++++++++++++-
>  drivers/edac/amd64_edac.h     |   8 --
>  drivers/edac/amd64_edac_inj.c | 235 ---------------------------------
>  5 files changed, 236 insertions(+), 257 deletions(-)
>  delete mode 100644 drivers/edac/amd64_edac_inj.c
> 
> diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
> index 7a47680d6f07..9c2e719cb86a 100644
> --- a/drivers/edac/Kconfig
> +++ b/drivers/edac/Kconfig
> @@ -81,10 +81,9 @@ config EDAC_AMD64
>  	  Support for error detection and correction of DRAM ECC errors on
>  	  the AMD64 families (>= K8) of memory controllers.
>  
> -config EDAC_AMD64_ERROR_INJECTION
> -	bool "Sysfs HW Error injection facilities"
> -	depends on EDAC_AMD64
> -	help
> +	  When EDAC_DEBUG is enabled, hardware error injection facilities
> +	  through sysfs are available:
> +
>  	  Recent Opterons (Family 10h and later) provide for Memory Error

Can we say "Opterons (Family 10h to Family 15h)"? It may also apply to
Family 16h, but I don't know if they were branded as Opterons.

The injection code in this module doesn't apply to Family 17h and later.

Also, Family 17h and later doesn't allow the OS direct access to the error
injection registers. They're locked down by security policy, etc.

>  	  Injection into the ECC detection circuits. The amd64_edac module
>  	  allows the operator/user to inject Uncorrectable and Correctable

...

> +
> +static umode_t inj_is_visible(struct kobject *kobj, struct attribute *attr, int idx)
> +{
> +	struct device *dev = kobj_to_dev(kobj);
> +	struct mem_ctl_info *mci = container_of(dev, struct mem_ctl_info, dev);
> +	struct amd64_pvt *pvt = mci->pvt_info;
> +
> +	if (pvt->fam < 0x10)

Related to the comment above, can this be changed to the following?

	if (pvt->fam < 0x10 || pvt->fam >= 0x17)

> +		return 0;
> +	return attr->mode;
> +}
> +

Everything else looks good to me.

Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>

Thanks,
Yazen

  reply	other threads:[~2020-12-15 16:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 11:05 [PATCH 1/2] EDAC/amd64: Merge sysfs debugging attributes setup code Borislav Petkov
2020-12-15 11:05 ` [PATCH 2/2] EDAC/amd64: Merge error injection sysfs facilities Borislav Petkov
2020-12-15 16:11   ` Yazen Ghannam [this message]
2020-12-15 18:58     ` Borislav Petkov
2020-12-22 18:00     ` Borislav Petkov
2020-12-15 16:01 ` [PATCH 1/2] EDAC/amd64: Merge sysfs debugging attributes setup code Yazen Ghannam

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=20201215161120.GB2122783@yaz-nikka.amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).