Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1266261pxb; Tue, 26 Oct 2021 05:59:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyV0qtlDuAxC/lsTjkSffSl7/r+u+sg5VEWxLhKQRTPCVe0FzJGyL8NrLxR0QxrXOsxOCnR X-Received: by 2002:a05:6a00:1ad4:b0:44d:9ab:c129 with SMTP id f20-20020a056a001ad400b0044d09abc129mr25666674pfv.14.1635253181971; Tue, 26 Oct 2021 05:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635253181; cv=none; d=google.com; s=arc-20160816; b=jAzGNdv38uUVcRXFZqNMRxgwolU1tS5xBziqUdPxpb0jN5VTbThU+QM12PCfZB9Edm 6JftJIwoeizGutuq8zVgDGrPVjLzxEf4lJWGfbMAuUmyTr/GtkT86elS/Xm//8okQTCw sgEls9P+mCye/NWB16wpMg4YMTWOELI94RvGH5HaJckmDNkwfy9SB/i9gNDLuIm1EY37 Qg4OP54jhLvpFfcF9q1TlWUCM7IPib/2SNHDYEmSTyubDzzMCdfws70mki+3pAi9bvw8 I2PwMFZyHkrTezYYJHKuW5nA4lyHS6PxnBp18Gjx53gG0jPfbsufxXAfQ7G07/MUQ9HL V45A== 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=WhjVDXMFSu8Xxoze/JOX25dHFUwk5eljGOQCDrVyJYI=; b=R5gI9y73guq3RJ/CaMre0IxuRboufH7ijIgUoqt7aveWaYlQhI9S4ZYcSBm0PbrjcQ 9QD95zrG7a4IYtD6mnzMcuyZXzgKUnoPvdv5mQbPf5cfefDgu7jWI5GeUNabLz8xd9Sw PyXZN8ORy54rSIPATXKrqQ/vqJvy05L9hh9IsFKk2jWFFZMSjE5NAdM0ntAYzUHLEvZ8 bPno211SIkG9erR5AzgNkU16+Bdux47R9oqwwL1LM3wLqhEtGMN3DR3PXqYkJqtxxqmc 9SqOX+EStuD1uNDC2ZuNN4YRlnNGAFoy2uoD4XlwF70+u4DWsDTeRqjU+KhdW6ww+f+P 2bEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=RA7fOra9; 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 j6si27656301plt.111.2021.10.26.05.59.28; Tue, 26 Oct 2021 05:59:41 -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=RA7fOra9; 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 S234476AbhJZKE0 (ORCPT + 99 others); Tue, 26 Oct 2021 06:04:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233868AbhJZKEY (ORCPT ); Tue, 26 Oct 2021 06:04:24 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF279C061745; Tue, 26 Oct 2021 03:02:00 -0700 (PDT) Received: from zn.tnic (p200300ec2f131c00c83ef6486df21458.dip0.t-ipconnect.de [IPv6:2003:ec:2f13:1c00:c83e:f648:6df2:1458]) (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 7E3B31EC03AD; Tue, 26 Oct 2021 12:01:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1635242519; 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=WhjVDXMFSu8Xxoze/JOX25dHFUwk5eljGOQCDrVyJYI=; b=RA7fOra9IGQkqGgYf34IEhAcFA3OAz2hhUHSSaRq72KIpjvXMWQjPk/RpOfXjaY2vwxqMa 374hSANxgEmNv7WCmm8e99ocs+xiPEDSuoyroTAKSBNGGmjZH9piqH5oQs9E9hHgs/GRj2 ULBYiKhrkVIEg2ewawvGhSy/iEHZekg= Date: Tue, 26 Oct 2021 12:02:01 +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 v2 2/5] x86/mce/inject: Warn the user on a not set valid bit in MCA_STATUS Message-ID: References: <20211019233641.140275-1-Smita.KoralahalliChannabasappa@amd.com> <20211019233641.140275-3-Smita.KoralahalliChannabasappa@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211019233641.140275-3-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 19, 2021 at 06:36:38PM -0500, Smita Koralahalli wrote: > MCA handlers check the valid bit in each status register (MCA_STATUS[Val]) > and will likely ignore signatures if the valid bit is not set. > > Warn the user if the valid bit is not set before doing error injection. > > Signed-off-by: Smita Koralahalli > --- > v2: > Added a warning statement instead of setting the valid bit. > --- > arch/x86/kernel/cpu/mce/inject.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kernel/cpu/mce/inject.c b/arch/x86/kernel/cpu/mce/inject.c > index 601efd104bb4..a993dc3d0333 100644 > --- a/arch/x86/kernel/cpu/mce/inject.c > +++ b/arch/x86/kernel/cpu/mce/inject.c > @@ -487,6 +487,9 @@ static void do_inject(void) > > i_mce.tsc = rdtsc_ordered(); > > + if (!(i_mce.status & MCI_STATUS_VAL)) > + pr_warn("Handlers might ignore signatures with Val=0 in MCA_STATUS\n"); > + > if (i_mce.misc) > i_mce.status |= MCI_STATUS_MISCV; > > -- So what's the real reason for this? You've injected and you didn't get any feedback and were wondering why? If handlers ignore !VAL MCEs, why don't you simply set it unconditionally on entry to do_inject()? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette