From: Christoph Egger <Christoph.Egger@amd.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/MCE: Implement clearbank callback for AMD
Date: Thu, 25 Oct 2012 12:13:19 +0200 [thread overview]
Message-ID: <508910BF.6030805@amd.com> (raw)
In-Reply-To: <50892A7A02000078000A4627@nat28.tlf.novell.com>
On 10/25/12 12:03, Jan Beulich wrote:
>>>> On 25.10.12 at 11:29, Christoph Egger <Christoph.Egger@amd.com> wrote:
>> On 10/25/12 10:55, Jan Beulich wrote:
>>>>>> On 25.10.12 at 10:18, Christoph Egger <Christoph.Egger@amd.com> wrote:
>>>> On 10/24/12 14:18, Jan Beulich wrote:
>>>>>>>> On 12.10.12 at 16:46, Christoph Egger <Christoph.Egger@amd.com> wrote:
>>>>>> +static int k8_need_clearbank_scan(enum mca_source who, uint64_t status)
>>>>>> +{
>>>>>> + switch (who) {
>>>>>> + case MCA_MCE_SCAN:
>>>>>> + case MCA_MCE_HANDLER:
>>>>>> + break;
>>>>>> + default:
>>>>>> + return 1;
>>>>>> + }
>>>>>> +
>>>>>> + /* For fatal error, it shouldn't be cleared so that sticky bank
>>>>>> + * have chance to be handled after reboot by polling.
>>>>>> + */
>>>>>> + if ( (status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC) )
>>>>>> + return 0;
>>>>>> + /* Spurious need clear bank */
>>>>>> + if ( !(status & MCi_STATUS_OVER)
>>>>>> + && (status & MCi_STATUS_UC) && !(status & MCi_STATUS_EN))
>>>>>> + return 1;
>>>>>> +
>>>>>> + return 1;
>>>>>> }
>>>>>
>>>>> So what's the purpose of first conditionally returning 1, and then
>>>>> also doing so unconditionally? Do anticipate to insert code between
>>>>> the two parts within the very near future? Otherwise I'd drop the
>>>>> whole if() construct.
>>>>
>>>> This function is derived from intel_need_clearbank_scan().
>>>> I just took over the relevant parts for AMD.
>>>
>>> But that would suggest that the final return be "return 0" rather
>>> than "return 1".
>>>
>>> Further, the Intel code does no extra checking for the
>>> MCA_MCE_HANDLER case, so I'd like you to confirm that this is
>>> indeed to be different for your CPUs.
>>
>> I just noticed that MCA_MCE_HANDLER is not used at all and can be
>> removed entirely.
>
> Will do.
Ok, thanks.
> But how about the "return" related question above?
I just run some tests.
Remove this part:
> + /* Spurious need clear bank */
> + if ( !(status & MCi_STATUS_OVER)
> + && (status & MCi_STATUS_UC) && !(status & MCi_STATUS_EN))
> + return 1;
Christoph
--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85689 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
next prev parent reply other threads:[~2012-10-25 10:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-12 14:46 [PATCH] x86/MCE: Implement clearbank callback for AMD Christoph Egger
2012-10-19 13:11 ` Christoph Egger
2012-10-19 14:59 ` Jan Beulich
2012-10-24 12:18 ` Jan Beulich
2012-10-25 8:18 ` Christoph Egger
2012-10-25 8:55 ` Jan Beulich
2012-10-25 9:29 ` Christoph Egger
2012-10-25 10:03 ` Jan Beulich
2012-10-25 10:13 ` Christoph Egger [this message]
2012-10-25 10:23 ` Christoph Egger
2012-10-25 10:28 ` Jan Beulich
2012-10-25 10:30 ` Christoph Egger
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=508910BF.6030805@amd.com \
--to=christoph.egger@amd.com \
--cc=JBeulich@suse.com \
--cc=xen-devel@lists.xen.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).