[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240204082627.3892816-4-tongtiangen@huawei.com>
Date: Sun, 4 Feb 2024 16:26:27 +0800
From: Tong Tiangen <tongtiangen@...wei.com>
To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, <wangkefeng.wang@...wei.com>, Dave Hansen
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, "H. Peter Anvin"
<hpa@...or.com>, Tony Luck <tony.luck@...el.com>, Andy Lutomirski
<luto@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Andrew Morton
<akpm@...ux-foundation.org>, Naoya Horiguchi <naoya.horiguchi@....com>
CC: <linux-kernel@...r.kernel.org>, <linux-edac@...r.kernel.org>,
<linux-mm@...ck.org>, Tong Tiangen <tongtiangen@...wei.com>, Guohanjun
<guohanjun@...wei.com>
Subject: [PATCH -next v5 3/3] x86/mce: rename MCE_IN_KERNEL_COPYIN to MCE_IN_KERNEL_COPY_MC
In the x86 mce processing, error_context() use MCE_IN_KERNEL_COPYIN for
user-to-kernel copy(EX_TYPE_UACCESS) and kernel-to-kernel copy
(EX_TYPE_DEFAULT_MCE_SAFE).
"COPYIN" only stands for user-to-kernel copy and can't stands for
kernel-to-kernel copy, this can cause some misunderstandings. So rename
MCE_IN_KERNEL_COPYIN to MCE_IN_KERNEL_COPY_MC.
Signed-off-by: Tong Tiangen <tongtiangen@...wei.com>
---
arch/x86/include/asm/mce.h | 8 ++++----
arch/x86/kernel/cpu/mce/core.c | 2 +-
arch/x86/kernel/cpu/mce/severity.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index de3118305838..cb628ab2f32f 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -151,11 +151,11 @@
/*
* Indicates an MCE that happened in kernel space while copying data
- * from user. In this case fixup_exception() gets the kernel to the
- * error exit for the copy function. Machine check handler can then
- * treat it like a fault taken in user mode.
+ * from user or kernel. In this case fixup_exception() gets the kernel
+ * to the error exit for the copy function. Machine check handler can
+ * then treat it like a fault taken in user or kernel mode.
*/
-#define MCE_IN_KERNEL_COPYIN BIT_ULL(7)
+#define MCE_IN_KERNEL_COPY_MC BIT_ULL(7)
/*
* This structure contains all data related to the MCE log. Also
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 04acdc3534c8..644748a5d98e 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1608,7 +1608,7 @@ noinstr void do_machine_check(struct pt_regs *regs)
mce_panic("Failed kernel mode recovery", &m, msg);
}
- if (m.kflags & MCE_IN_KERNEL_COPYIN)
+ if (m.kflags & MCE_IN_KERNEL_COPY_MC)
queue_task_work(&m, msg, kill_me_never);
}
diff --git a/arch/x86/kernel/cpu/mce/severity.c b/arch/x86/kernel/cpu/mce/severity.c
index b2cce1b6c96d..b4b1d028cbb3 100644
--- a/arch/x86/kernel/cpu/mce/severity.c
+++ b/arch/x86/kernel/cpu/mce/severity.c
@@ -294,7 +294,7 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs)
return IN_KERNEL;
fallthrough;
case EX_TYPE_DEFAULT_MCE_SAFE:
- m->kflags |= MCE_IN_KERNEL_COPYIN;
+ m->kflags |= MCE_IN_KERNEL_COPY_MC;
fallthrough;
case EX_TYPE_FAULT_MCE_SAFE:
m->kflags |= MCE_IN_KERNEL_RECOV;
--
2.25.1
Powered by blists - more mailing lists