[PATCH 0/2] x86/cea: Clean up the exception stack names and declarations
From: Sohil Mehta
Date: Fri Nov 20 2026 - 18:52:45 EST
Background
----------
This is a simple cleanup of how the x86-64 exception stacks are named and
reached. These patches started out as part [1][2] of the FRED KVM series. They
were prerequisites for the KVM enabling because the original proposal [3] was
to call __this_cpu_ist_top_va() directly from KVM. So the macro had to be
converted to a function and then be exported.
However, KVM is now planning to use a FRED-specific helper [4] which is
compiled into vmlinux so the macro directly works inside it. Therefore, FRED
KVM no longer needs any of this. Though the cleanup itself is still valuable
and makes the code clearer and the comments more accurate.
Motivation
----------
The exception stacks (DF, NMI, DB, MCE, VC) carry names too short for a header
that almost the whole x86 build pulls in, and the stacks themselves are both
declared and looked up by pasting those names into structure member names.
The first patch adds the ESTACK_ prefix to the names and the second patch
indexes the stacks by the enum that callers already pass. This removes most of
the pasting, and leaves the layout, the addresses and the guard pages exactly
as they were.
There is no change in behavior expected.
Changes from the FRED KVM v10
-----------------------------
Patch 1:
- Minor commit message improvements
- Pick up Binbin's review tag
Patch 2:
- Drop the conversion of __this_cpu_ist_{bottom,top}_va() from macros
to functions.
- Expand struct exception_stacks explicitly and drop ESTACKS_MEMBERS()
- Rewrite most of the commit message and drop the prior tags.
Links
-----
[1]: https://lore.kernel.org/lkml/20260911213659.2025974-5-sohil.mehta@xxxxxxxxx/
[2]: https://lore.kernel.org/lkml/20260911213659.2025974-6-sohil.mehta@xxxxxxxxx/
[3]: https://lore.kernel.org/all/20251026201911.505204-7-xin@xxxxxxxxx/
[4]: https://lore.kernel.org/lkml/20260911213659.2025974-7-sohil.mehta@xxxxxxxxx/
Sohil Mehta (1):
x86/cea: Index exception stacks by the ordering enum
Xin Li (Intel) (1):
x86/cea: Prefix exception stack names with ESTACK_
arch/x86/coco/sev/noinstr.c | 5 +--
arch/x86/coco/sev/vc-handle.c | 3 +-
arch/x86/include/asm/cpu_entry_area.h | 52 +++++++++++----------------
arch/x86/kernel/cpu/common.c | 10 +++---
arch/x86/kernel/dumpstack_64.c | 18 +++++-----
arch/x86/kernel/fred.c | 6 ++--
arch/x86/kernel/traps.c | 2 +-
arch/x86/mm/cpu_entry_area.c | 14 ++++----
arch/x86/mm/fault.c | 2 +-
9 files changed, 52 insertions(+), 60 deletions(-)
base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.43.0