Skip to content

x86/cea: Clean up the exception stack names and declarations

Sohil Mehta kvm lkml 1 version Applied

Status from this message: The following commit has been merged into the x86/entry branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2x86/cea: Prefix exception stack names with ESTACK_arch/x86/coco/sev/noinstr.c arch/x86/coco/sev/vc-handle.c arch/x86/include/asm/cpu_entry_area.h +6 more+41 -390 replies
2/2x86/cea: Index exception stacks by the ordering enumarch/x86/include/asm/cpu_entry_area.h arch/x86/kernel/dumpstack_64.c arch/x86/mm/cpu_entry_area.c+24 -344 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchBinbin WuDave Hansen
1/2R-b A-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] x86/cea: Clean up the exception stack names and declarations

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/[email protected]/
[2]: https://lore.kernel.org/lkml/[email protected]/
[3]: https://lore.kernel.org/all/[email protected]/
[4]: https://lore.kernel.org/lkml/[email protected]/

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

Signature · 1 line
2.43.0