Re: [PATCH v2 10/22] EDAC/amd64: Merge struct amd64_family_type into struct amd64_pvt

From: Borislav Petkov
Date: Sat Mar 18 2023 - 11:39:58 EST


On Fri, Jan 27, 2023 at 05:04:07PM +0000, Yazen Ghannam wrote:
> From: Muralidhara M K <muralidhara.mk@xxxxxxx>
>
> Future AMD systems will support heterogeneous "AMD Node" types, e.g.
> CPU+GPU. Therefore, a global "family type" shared across all "AMD Nodes"

"CPU and GPU types."

...

> +static int per_family_init(struct amd64_pvt *pvt)
> {
> pvt->ext_model = boot_cpu_data.x86_model >> 4;
> pvt->stepping = boot_cpu_data.x86_stepping;
> pvt->model = boot_cpu_data.x86_model;
> pvt->fam = boot_cpu_data.x86;
> + pvt->max_mcs = 2;
> +
> + /*
> + * Decide on which ops group to use here and do any family/model
> + * overrides below.
> + */
> + if (pvt->fam >= 0x17)
> + pvt->ops = &umc_ops;
> + else
> + pvt->ops = &dct_ops;
>
> switch (pvt->fam) {
> case 0xf:
> - fam_type = &family_types[K8_CPUS];
> - pvt->ops = &family_types[K8_CPUS].ops;
> + pvt->ctl_name = (pvt->ext_model > K8_REV_F) ?

The original test is >=

- amd64_info("%s %sdetected (node %d).\n", fam_type->ctl_name,
- (pvt->fam == 0xf ?
- (pvt->ext_model >= K8_REV_F ? "revF or later "
^^^^^


- : "revE or earlier ")

> + "K8 revF or later" : "K8 revE or earlier";
> + pvt->f1_id = PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP;
> + pvt->f2_id = PCI_DEVICE_ID_AMD_K8_NB_MEMCTL;
> + pvt->ops->map_sysaddr_to_csrow = k8_map_sysaddr_to_csrow;
> + pvt->ops->dbam_to_cs = k8_dbam_to_chip_select;
> break;

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette