All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>, X86 ML <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] x86/mce: Get rid of msr_ops
Date: Wed, 22 Sep 2021 13:23:28 +0000	[thread overview]
Message-ID: <2B1FFC77-A740-41AE-BF8C-FB238B9DF7F5@intel.com> (raw)
In-Reply-To: <YUsesVeZ8PPC5iV5@zn.tnic>

Looks nice. I don’t think you need those “break;” after each “return …;”

Sent from my iPhone

> On Sep 22, 2021, at 05:18, Borislav Petkov <bp@alien8.de> wrote:
> 
> On Mon, Sep 20, 2021 at 10:32:11AM +0200, Borislav Petkov wrote:
>> but please don't make me add more helper functions. Those MSR defines
>> already have "SMCA" and "IA32" in their names so that should be a good
>> enough differentiation, I'd say.
> 
> I just had a better idea - it is compact but regular and one can see at
> a quick glance which block is for which set of MSRs:
> 
> u32 mca_msr_reg(int bank, enum mca_msr reg)
> {
>        if (mce_flags.smca) {
>                switch (reg) {
>                case MCA_CTL:    return MSR_AMD64_SMCA_MCx_CTL(bank);    break;
>                case MCA_ADDR:   return MSR_AMD64_SMCA_MCx_ADDR(bank);   break;
>                case MCA_MISC:   return MSR_AMD64_SMCA_MCx_MISC(bank);   break;
>                case MCA_STATUS: return MSR_AMD64_SMCA_MCx_STATUS(bank); break;
>                default: goto out; break;
>                }
>        }
> 
>        switch (reg) {
>        case MCA_CTL:    return MSR_IA32_MCx_CTL(bank);    break;
>        case MCA_ADDR:   return MSR_IA32_MCx_ADDR(bank);   break;
>        case MCA_MISC:   return MSR_IA32_MCx_MISC(bank);   break;
>        case MCA_STATUS: return MSR_IA32_MCx_STATUS(bank); break;
>        default: goto out; break;
>        }
> 
> out:
>        WARN_ON_ONCE(1);
>        return 0;
> }
> 
> -- 
> Regards/Gruss,
>    Boris.
> 
> https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2021-09-22 13:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 10:53 [PATCH 0/4] x86/mce: Remove indirect calls Borislav Petkov
2021-09-17 10:53 ` [PATCH 1/4] x86/mce: Get rid of the mce_severity function pointer Borislav Petkov
2021-09-17 10:53 ` [PATCH 2/4] x86/mce: Get rid of machine_check_vector Borislav Petkov
2021-09-20  4:57   ` Luck, Tony
2021-09-20  7:42     ` Rasmus Villemoes
2021-09-20  8:15       ` Borislav Petkov
2021-09-20  8:12     ` Borislav Petkov
2021-09-20 16:04       ` Luck, Tony
2021-09-20 16:32         ` Borislav Petkov
2021-09-17 10:53 ` [PATCH 3/4] x86/mce: Get rid of msr_ops Borislav Petkov
2021-09-20  4:47   ` Luck, Tony
2021-09-20  8:32     ` Borislav Petkov
2021-09-22 12:16       ` Borislav Petkov
2021-09-22 13:23         ` Luck, Tony [this message]
2021-09-22 13:55           ` Borislav Petkov
2021-09-22 15:22             ` Luck, Tony
2021-09-22 15:57               ` Borislav Petkov
2021-09-17 10:53 ` [PATCH 4/4] x86/mce: Get rid of the ->quirk_no_way_out() indirect call Borislav Petkov
2021-09-20  5:06   ` Luck, Tony
2021-09-20  8:34     ` Borislav Petkov
2021-09-23 14:51   ` Yazen Ghannam
2021-09-23 15:11     ` Borislav Petkov
2021-09-24 20:04       ` Yazen Ghannam

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=2B1FFC77-A740-41AE-BF8C-FB238B9DF7F5@intel.com \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=yazen.ghannam@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.