Skip to content

x86: Allow variable-sized event frame

Xin Li (Intel) lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 3 repliesIn review
  2. v33 patches 5 repliesSuperseded
  3. v2 posting 2/23 patches 4 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v2 posting 1/23 patches0 repliesSuperseded
v13 patches2 repliesSuperseded

Changes in v4 from the cover letter

* Drop the patch that zaps TOP_OF_KERNEL_STACK_PADDING on x86_64 (Brian Gerst, hpa).

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/fred: Allow variable-sized event framearch/x86/entry/entry_fred.c arch/x86/include/asm/processor.h arch/x86/include/asm/thread_info.h +3 more+53 -93 replies
2/2x86: Remove the padding space at top of the init stackarch/x86/include/asm/processor.h arch/x86/kernel/vmlinux.lds.S+19 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] x86: Allow variable-sized event frame

This was initially posted as part of the FRED patch series and turned down due to its unacceptable quality:
https://lore.kernel.org/lkml/[email protected]/

Now comes another attempt to meet the bar.

A FRED event frame could contain different amount of information for different event types, e.g., #MCE could push extra bytes of information, or perhaps even for different instances of the same event type. Thus the size of an event frame pushed by a FRED CPU is not fixed and the address of a pt_regs structure that is used to save the user level context of current task is not at a fixed offset from top of current task kernel stack.

This patch set adds a new field named 'user_pt_regs' in the thread_info structure to save the address of user level context pt_regs structure, thus to eliminate the need of any advance information of event frame size and allow a FRED CPU to push variable-sized event frame.

With the above change, we can remove the padding space at top of the init stack because there is no user level context for init task.

Link to v3: https://lore.kernel.org/lkml/[email protected]/

Change in v4:
* Drop the patch that zaps TOP_OF_KERNEL_STACK_PADDING on x86_64 (Brian Gerst, hpa).

Change in v3:
* Replace "(struct pt_regs *)TOP_OF_INIT_STACK - 1" with (struct pt_regs *)__top_init_kernel_stack (Brian Gerst).
* Add declaration for __top_init_kernel_stack[] (Intel lkp).

Change in v2:
* Rebase on latest tip/master.

Xin Li (Intel) (2):
x86/fred: Allow variable-sized event frame
x86: Remove the padding space at top of the init stack

 arch/x86/entry/entry_fred.c        | 10 ++++++++++
 arch/x86/include/asm/processor.h   | 28 ++++++++++++++++++++--------
 arch/x86/include/asm/thread_info.h | 11 ++++++++---
 arch/x86/kernel/process.c          | 22 ++++++++++++++++++++++
 arch/x86/kernel/vmlinux.lds.S      |  7 +++++--
 include/linux/thread_info.h        |  1 +
 kernel/fork.c                      |  6 ++++++
 7 files changed, 72 insertions(+), 13 deletions(-)

base-commit: 8e3f385164626dc6bbf000decf04aa98e943e07e

Signature · 1 line
2.49.0