[PATCH 24/25] x86/MCE/AMD: Match hash function to reference code

From: Yazen Ghannam
Date: Fri May 07 2021 - 15:04:03 EST


From: Yazen Ghannam <yazen.ghannam@xxxxxxx>

The reference code for DF2 hashing was changed to XOR the interleave
address bit rather than the CS ID. Match that here.

Signed-off-by: Yazen Ghannam <yazen.ghannam@xxxxxxx>
---
arch/x86/kernel/cpu/mce/amd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 3340f8326681..b3bfdc42dcaa 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -1037,7 +1037,7 @@ static int dehash_addr_df2(struct addr_ctx *ctx)
(ctx->ret_addr >> 18) ^
(ctx->ret_addr >> 21) ^
(ctx->ret_addr >> 30) ^
- ctx->cs_id;
+ (ctx->ret_addr >> ctx->intlv_addr_bit);

hashed_bit &= BIT(0);

--
2.25.1