amd64_edac: Fix syndrome calculation on K8

When calculating the DCT channel from the syndrome we need to know the
syndrome type (x4 vs x8). On F10h, this is read out from extended PCI
cfg space register F3x180 while on K8 we only support x4 syndromes and
don't have extended PCI config space anyway.

Make the code accessing F3x180 F10h only and fall back to x4 syndromes
on everything else.

Cc: <stable@kernel.org> # .33.x .34.x
Reported-by: Jeffrey Merkey <jeffmerkey@gmail.com>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>

+12 -12
+12 -12
drivers/edac/amd64_edac.c
··· 1958 1958 u32 value = 0; 1959 1959 int err_sym = 0; 1960 1960 1961 - amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value); 1961 + if (boot_cpu_data.x86 == 0x10) { 1962 1962 1963 - /* F3x180[EccSymbolSize]=1, x8 symbols */ 1964 - if (boot_cpu_data.x86 == 0x10 && 1965 - boot_cpu_data.x86_model > 7 && 1966 - value & BIT(25)) { 1967 - err_sym = decode_syndrome(syndrome, x8_vectors, 1968 - ARRAY_SIZE(x8_vectors), 8); 1969 - return map_err_sym_to_channel(err_sym, 8); 1970 - } else { 1971 - err_sym = decode_syndrome(syndrome, x4_vectors, 1972 - ARRAY_SIZE(x4_vectors), 4); 1973 - return map_err_sym_to_channel(err_sym, 4); 1963 + amd64_read_pci_cfg(pvt->misc_f3_ctl, 0x180, &value); 1964 + 1965 + /* F3x180[EccSymbolSize]=1 => x8 symbols */ 1966 + if (boot_cpu_data.x86_model > 7 && 1967 + value & BIT(25)) { 1968 + err_sym = decode_syndrome(syndrome, x8_vectors, 1969 + ARRAY_SIZE(x8_vectors), 8); 1970 + return map_err_sym_to_channel(err_sym, 8); 1971 + } 1974 1972 } 1973 + err_sym = decode_syndrome(syndrome, x4_vectors, ARRAY_SIZE(x4_vectors), 4); 1974 + return map_err_sym_to_channel(err_sym, 4); 1975 1975 } 1976 1976 1977 1977 /*