Re: [PATCH v2 2/2] x86/mce/AMD: Carve out SMCA bank configuration

From: Borislav Petkov
Date: Wed Apr 05 2017 - 10:19:54 EST


On Tue, Apr 04, 2017 at 12:24:32PM -0500, Yazen Ghannam wrote:
> From: Yazen Ghannam <yazen.ghannam@xxxxxxx>
>
> Scalable MCA systems have a new MCA_CONFIG register that we use to
> configure each bank. We currently use this when we set up thresholding.
> However, this is logically separate.
>
> Group all SMCA-related initialization into a single, separate function.
> This includes setting MCA_CONFIG and gathering SMCA bank info.
>
> Signed-off-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
> ---
> Link:
> https://lkml.kernel.org/r/1490210971-62346-2-git-send-email-Yazen.Ghannam@xxxxxxx
>
> v1->v2:
> - Merge get_smca_bank_info() and set_smca_config() into smca_configure().
>
> arch/x86/kernel/cpu/mcheck/mce_amd.c | 74 ++++++++++++++++++------------------
> 1 file changed, 37 insertions(+), 37 deletions(-)

...

> @@ -516,7 +516,7 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
>
> for (bank = 0; bank < mca_cfg.banks; ++bank) {
> if (mce_flags.smca)
> - get_smca_bank_info(bank);
> + smca_configure(bank);

Pass in cpu from above:

smca_configure(bank, cpu);


>
> for (block = 0; block < NR_BLOCKS; ++block) {
> address = get_block_address(cpu, address, low, high, bank, block);
> --

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.