Commit 7722509e authored by Pu Wen's avatar Pu Wen
Browse files

EDAC/amd64: Adjust UMC channel for Hygon family 18h model 6h

hygon inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8U3K8


CVE: NA

---------------------------

Hygon family 18h model 6h has 2 cs mapped to 1 umc, so adjust for it.

Signed-off-by: default avatarPu Wen <puwen@hygon.cn>
parent f71c4cab
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3115,6 +3115,7 @@ static void decode_umc_error(int node_id, struct mce *m)
	struct amd64_pvt *pvt;
	struct err_info err;
	u64 sys_addr;
	u8 umc;

	node_id = fixup_node_id(node_id, m);

@@ -3145,7 +3146,12 @@ static void decode_umc_error(int node_id, struct mce *m)

	pvt->ops->get_err_info(m, &err);

	if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, err.channel, &sys_addr)) {
	if (hygon_f18h_m4h() && boot_cpu_data.x86_model == 0x6)
		umc = err.channel << 1;
	else
		umc = err.channel;

	if (umc_normaddr_to_sysaddr(m->addr, pvt->mc_node_id, umc, &sys_addr)) {
		err.err_code = ERR_NORM_ADDR;
		goto log_error;
	}