Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1312199pxb; Fri, 24 Sep 2021 01:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCFNBVQaorf69On9d8oxr6jGTPoytYKKFvizDB9vQUeiqRBX/zZGrR3kiiOg9ojEPau/NN X-Received: by 2002:a05:6638:203:: with SMTP id e3mr8224480jaq.88.1632472131347; Fri, 24 Sep 2021 01:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632472131; cv=none; d=google.com; s=arc-20160816; b=uMoE+Sgk6qyTB7rag6Xdo0/MSH6sNAVDSm7jABW0pCTSg8f10LRinjOdJPD4D/0js7 GAKHa8fmdXiCxGT7VehBaHguWkTaAIxzud24qZUf8TWmJ1ciyLaSowy+ScQyNomt8RZ/ zDqNHsZEy4zSW+C5HalfYWHYDMSmaDek6F+HTnr9StRTh8p09n4a6561G7382WUvOL6Q rNkEZJVTpspHyXCBOfx+UYkwj3nq/MoSgfyIHJCtspMiqJTSP4i+EjS7hwWVC//FV/kr d3NhmRZ+zIuRsPA1Rxx0CnZEizSgiDhOi8gCjcflnWd5Yiln8ZuJt+2pQIervpzg0ZPw ydxw== 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=bHMJS/aYXU9qw9zIv9pZZwDh/cCLOLB5X5GoNoeX9vo=; b=Hp5cDgVzEyG922bA8yQRpqUPL1EvtN6GZ6KdghoJtLwkCv0t9e9OQxOlXukB2r0qLi /pv3FMyvIHRrKpzVqSmDiDdXyOO57UDNWgfQXwT9Ch5AeidpI5LN+t7+yOMcnu5eyd+6 s+Hh4XPc7+52HVEG820VjWuhY1g2EV2fWN8T1/drBCHaCoWsVThSWOI8PuWp94krFuG1 AfEtXLiNQph+Q8jOqmFqk/BmTBRnyfSQ7hRtB9YBRoBCBnB8FbK3K96Y6qWOzb0GRtpt ZsUYw0rKV44ludLhWEO98VbmWHKT4qE0oCdbWkdY4Z3IgVHDLc4/W5L57v2hBcE3gEnU +QCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=W4yJdlgq; 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 k39si9886359jav.88.2021.09.24.01.28.38; Fri, 24 Sep 2021 01:28:51 -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=W4yJdlgq; 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 S244717AbhIXI2g (ORCPT + 99 others); Fri, 24 Sep 2021 04:28:36 -0400 Received: from mail.skyhub.de ([5.9.137.197]:52902 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244692AbhIXI2f (ORCPT ); Fri, 24 Sep 2021 04:28:35 -0400 Received: from zn.tnic (p200300ec2f0dd600c2485b7778a62ff5.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:d600:c248:5b77:78a6:2ff5]) (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 5679F1EC0301; Fri, 24 Sep 2021 10:26:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1632472017; 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=bHMJS/aYXU9qw9zIv9pZZwDh/cCLOLB5X5GoNoeX9vo=; b=W4yJdlgqBzi5H0z5kuAc7jGN3hOJFaAm3WA1VGMNO5mXT1u6rQbb3Y6o7vKGhHYy+DlBWc 1z+DDpJme5HKDHBaqCfOW6De4mvGO74oqOiF9aKiel8SKG2+az6tV6r1TtJFI8h7V1dYTv WCCAQe23QdWh9+yzlMEAbnCg1loyf70= Date: Fri, 24 Sep 2021 10:26:55 +0200 From: Borislav Petkov To: Smita Koralahalli Cc: x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Luck , "H . Peter Anvin" , yazen.ghannam@amd.com Subject: Re: [PATCH 5/5] x86/mce/mce-inject: Return error code to userspace from mce-inject module Message-ID: References: <20210915232739.6367-1-Smita.KoralahalliChannabasappa@amd.com> <20210915232739.6367-6-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210915232739.6367-6-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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