[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YU2LzwNm4CNZ8fT8@zn.tnic>
Date: Fri, 24 Sep 2021 10:26:55 +0200
From: Borislav Petkov <bp@...en8.de>
To: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
Cc: x86@...nel.org, linux-edac@...r.kernel.org,
linux-kernel@...r.kernel.org, Tony Luck <tony.luck@...el.com>,
"H . Peter Anvin" <hpa@...or.com>, yazen.ghannam@....com
Subject: Re: [PATCH 5/5] x86/mce/mce-inject: Return error code to userspace
from mce-inject module
On Wed, Sep 15, 2021 at 06:27:39PM -0500, Smita Koralahalli wrote:
> Currently, the mce-inject module fails silently and user must look for
> kernel logs to determine if the injection has succeeded.
>
> Save time for the user and return error code from the module if error
> injection fails.
>
> Signed-off-by: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
> ---
> arch/x86/kernel/cpu/mce/inject.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c
> index c7d1564f244b..0ef9ff921c6a 100644
> --- a/arch/x86/kernel/cpu/mce/inject.c
> +++ b/arch/x86/kernel/cpu/mce/inject.c
> @@ -549,8 +549,10 @@ static void do_inject(void)
> }
>
> cpus_read_lock();
> - if (!cpu_online(cpu))
> + if (!cpu_online(cpu)) {
> + mce_err.err = -ENODEV;
You could issue a pr_err() here too. That ENODEV probably turns into
"write failed" but that doesn't say why.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists