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

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

Fixes: 0ac06d63
 ("EDAC/amd64: Adjust address translation for Hygon family 18h model 4h")

Signed-off-by: fuhao <fuh@hygon.cn>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: caelli <caelli@tencent.com>
Signed-off-by: Jianping Liu <frankjpliu@tencent.com>
This commit is contained in:
fuhao 2024-02-01 15:08:04 +08:00 committed by Jianping Liu
parent b799eb7121
commit f687e8b76a
1 changed files with 1 additions and 6 deletions

View File

@ -722,12 +722,7 @@ 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;