[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250508153734.GA1939543@yaz-khff2.amd.com>
Date: Thu, 8 May 2025 11:37:34 -0400
From: Yazen Ghannam <yazen.ghannam@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, Tony Luck <tony.luck@...el.com>,
linux-kernel@...r.kernel.org, linux-edac@...r.kernel.org,
Smita.KoralahalliChannabasappa@....com,
Qiuxu Zhuo <qiuxu.zhuo@...el.com>
Subject: Re: [PATCH v3 13/17] x86/mce: Unify AMD DFR handler with MCA Polling
On Wed, May 07, 2025 at 11:20:42AM +0200, Borislav Petkov wrote:
> On Tue, Apr 15, 2025 at 02:55:08PM +0000, Yazen Ghannam wrote:
> > +static bool smca_should_log_poll_error(enum mcp_flags flags, struct mce_hw_err *err)
> > +{
> > + struct mce *m = &err->m;
> > +
> > + /*
> > + * If this is a deferred error found in MCA_STATUS, then clear
> > + * the redundant data from the MCA_DESTAT register.
> > + */
> > + if (m->status & MCI_STATUS_VAL) {
> > + if (m->status & MCI_STATUS_DEFERRED)
> > + mce_wrmsrq(MSR_AMD64_SMCA_MCx_DESTAT(m->bank), 0);
> > +
> > + return true;
> > + }
> > +
> > + /*
> > + * If the MCA_DESTAT register has valid data, then use
> > + * it as the status register.
> > + */
> > + m->status = mce_rdmsrq(MSR_AMD64_SMCA_MCx_DESTAT(m->bank));
> > +
>
> Superfluous newline.
>
Ack.
> > + if (!(m->status & MCI_STATUS_VAL))
> > + return false;
> > +
> > + /*
> > + * Gather all relevant data now and log the record before clearing
> > + * the deferred status register. This avoids needing to go back to
> > + * the polling function for these actions.
> > + */
> > + mce_read_aux(err, m->bank);
> > +
> > + if (m->status & MCI_STATUS_ADDRV)
> > + m->addr = mce_rdmsrq(MSR_AMD64_SMCA_MCx_DEADDR(m->bank));
> > +
> > + smca_extract_err_addr(m);
> > + m->severity = mce_severity(m, NULL, NULL, false);
> > +
> > + if (flags & MCP_QUEUE_LOG)
> > + mce_gen_pool_add(err);
> > + else
> > + mce_log(err);
>
> Except you have a function which is called "should log" which also does the
> logging.
>
> And you have that same logging being done in machine_check_poll().
>
> This code needs more designing.
>
Okay, will do.
Thanks,
Yazen
Powered by blists - more mailing lists