[PATCH 13/25] x86/MCE/AMD: Skip denormalization if no interleaving

From: Yazen Ghannam
Date: Fri May 07 2021 - 15:02:39 EST


From: Yazen Ghannam <yazen.ghannam@xxxxxxx>

Denormalization doesn't apply to the "no interleaving" mode, so return
early without error in this case.

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

diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index a60d9d275d14..605376351cc8 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -838,6 +838,10 @@ static int denormalize_addr(struct addr_ctx *ctx)
u8 intlv_num_dies, intlv_num_chan, intlv_num_sockets;
u8 num_intlv_bits, cs_mask = 0;

+ /* Return early if no interleaving. */
+ if (ctx->intlv_mode == NONE)
+ return 0;
+
if (get_intlv_addr_bit(ctx))
return -EINVAL;

--
2.25.1