Commit 7f9decc5 authored by Pu Wen's avatar Pu Wen
Browse files

EDAC/amd64: Revert hi_addr_offset for Hygon family 18h model 4h

hygon inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I92NKS


CVE: NA

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

The HiAddrOffset is always the top 4 bits of normalized address,
so revert the modification in commit f2f10bd1 to the original
implementation.

Fixes: f2f10bd1 ("EDAC/amd64: Adjust address translation for Hygon family 18h model 4h")
Signed-off-by: default avatarPu Wen <puwen@hygon.cn>
parent ecb0378f
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -760,12 +760,7 @@ static int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr

	/* Remove HiAddrOffset from normalized address, if enabled: */
	if (tmp & BIT(0)) {
		u64 hi_addr_offset;

		if (hygon_f18h_m4h())
			hi_addr_offset = (tmp & GENMASK_ULL(31, 18)) << 8;
		else
			hi_addr_offset = (tmp & GENMASK_ULL(31, 20)) << 8;
		u64 hi_addr_offset = (tmp & GENMASK_ULL(31, 20)) << 8;

		if (norm_addr >= hi_addr_offset) {
			ret_addr -= hi_addr_offset;