x86: Allow variable-sized event frame
Subsystems (6)
Xin Li (Intel)
maintainerv3 cover 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
1) Remove the padding space at top of the init stack because there is no user level context for init task.
2) Get rid of TOP_OF_KERNEL_STACK_PADDING on x86_64, which was defined to 0 for IDT to keep the code consistent with 32bit.
Link to v2: https://lore.kernel.org/lkml/[email protected]/
Change in v3:
* Replace "(struct pt_regs *)TOP_OF_INIT_STACK - 1" with (struct pt_regs *)__top_init_kernel_stack (Brian Gerst).
Change in v2:
* Rebase on latest tip/master.
Xin Li (Intel) (3):
x86/fred: Allow variable-sized event frame
x86: Remove the padding space at top of the init stack
x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
arch/x86/entry/entry_fred.c | 10 ++++++++++ arch/x86/include/asm/fred.h | 2 +- arch/x86/include/asm/processor.h | 32 +++++++++++++++++++++--------- arch/x86/include/asm/thread_info.h | 19 ++++++------------ arch/x86/kernel/process.c | 21 ++++++++++++++++++++ arch/x86/kernel/vmlinux.lds.S | 7 +++++-- include/linux/thread_info.h | 1 + kernel/fork.c | 6 ++++++ 8 files changed, 73 insertions(+), 25 deletions(-)
base-commit: 60c162a51180cb2b05d7505a565ab079bfa9cf12
Signature · 1 line
2.48.1
Xin Li (Intel)
maintainerPATCH v3 1/3 x86/fred: Allow variable-sized event frame
A FRED event frame could contain different amount of information for different event types, 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 the pt_regs structure that is used to save a user level context of current task is not at a fixed offset from top of current task kernel stack.
Add 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.
For IDT user level event delivery, a pt_regs structure is pushed by hardware and software _always_ at a fixed offset from top of current task kernel stack, so simply initialize user_pt_regs to point to the pt_regs structure no matter whether one is pushed or not.
While for FRED user level event delivery, user_pt_regs is updated with a pt_regs structure pointer generated in asm_fred_entrypoint_user().
---
Change in v3:
* Replace "(struct pt_regs *)TOP_OF_INIT_STACK - 1" with (struct pt_regs *)__top_init_kernel_stack (Brian Gerst).
--- arch/x86/entry/entry_fred.c | 10 ++++++++++ arch/x86/include/asm/processor.h | 12 ++++++------ arch/x86/include/asm/thread_info.h | 9 ++++++--- arch/x86/kernel/process.c | 22 ++++++++++++++++++++++ include/linux/thread_info.h | 1 + kernel/fork.c | 6 ++++++ 6 files changed, 51 insertions(+), 9 deletions(-)
arch/x86/entry/entry_fred.c +10 -0
@@ -228,6 +228,16 @@ __visible noinstr void fred_entry_from_user(struct pt_regs *regs)/* Invalidate orig_ax so that syscall_get_nr() works correctly */ regs->orig_ax =-1 ; +/* +* A FRED event frame could contain different amount of information +* for different event types, 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 the pt_regs structure +* that is used to save a user level context of current task is not +* at a fixed offset from top of current task stack. +*/ + current->thread_info.user_pt_regs = regs; +switch (regs->fred_ss.type) {case EVENT_TYPE_EXTINT :return fred_extint (regs);
arch/x86/include/asm/processor.h +6 -6
@@ -646,12 +646,12 @@ static __always_inline void prefetchw(const void *x)#define task_top_of_stack (task) ((unsigned long)(task_pt_regs(task) + 1)) -#define task_pt_regs (task) \ -({ \ - unsigned long __ptr = (unsigned long)task_stack_page(task); \ - __ptr += THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING; \ - ((struct pt_regs *)__ptr) - 1; \ -}) +/* +* Note, this can't be converted to an inline function as this header +* file defines 'struct thread_struct' which is used in the task_struct +* structure definition. +*/ +#define task_pt_regs (task) ((task)->thread_info.user_pt_regs)#ifdef CONFIG_X86_32 #define INIT_THREAD { \
arch/x86/include/asm/thread_info.h +6 -3
@@ -56,6 +56,7 @@*/ #ifndef __ASSEMBLER__struct task_struct ; +struct pt_regs ;#include <asm/cpufeature.h> #include <linux/atomic.h>
@@ -66,11 +67,13 @@ struct thread_info {#ifdef CONFIG_SMP u32 cpu;/* current CPU */ #endif + struct pt_regs *user_pt_regs; }; -#define INIT_THREAD_INFO (tsk) \ -{ \ - .flags = 0, \ +#define INIT_THREAD_INFO (tsk) \ +{ \ + .flags = 0, \ + .user_pt_regs = (struct pt_regs *)__top_init_kernel_stack, \ }#else /* !__ASSEMBLER__ */
arch/x86/kernel/process.c +22 -0
@@ -108,6 +108,28 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)return 0 ; } +/* +* Initialize thread_info.user_pt_regs for IDT event delivery. +* +* For IDT user level event delivery, a pt_regs structure is pushed by both +* hardware and software and always resides at a fixed offset from top of +* current task kernel stack, thus thread_info.user_pt_regs is a per-task +* constant and NEVER changes after initialization. +* +* While for FRED user level event delivery, user_pt_regs is updated in +* fred_entry_from_user() immediately after user level event delivery. +* +* Note: thread_info.user_pt_regs of the init task is initialized at build +* time. +*/ +void arch_init_user_pt_regs (struct task_struct *tsk) +{ +unsigned long top_of_stack = (unsigned long )task_stack_page (tsk) +THREAD_SIZE ; + + top_of_stack -=TOP_OF_KERNEL_STACK_PADDING ; + tsk->thread_info.user_pt_regs = (struct pt_regs *)top_of_stack -1 ; +} +#ifdef CONFIG_X86_64 void arch_release_task_struct (struct task_struct *tsk) {
include/linux/thread_info.h +1 -0
@@ -273,6 +273,7 @@ void arch_task_cache_init(void); /* for CONFIG_SH */void arch_release_task_struct (struct task_struct *tsk);int arch_dup_task_struct (struct task_struct *dst,struct task_struct *src); +void arch_init_user_pt_regs (struct task_struct *tsk);#endif /* __KERNEL__ */
kernel/fork.c +6 -0
@@ -1105,6 +1105,10 @@ int __weak arch_dup_task_struct(struct task_struct *dst,return 0 ; } +void __weak arch_init_user_pt_regs (struct task_struct *tsk) +{ +} +void set_task_stack_end_magic (struct task_struct *tsk) {unsigned long *stackend;
@@ -1132,6 +1136,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)if (err) goto free_tsk; +arch_init_user_pt_regs (tsk); +#ifdef CONFIG_THREAD_INFO_IN_TASK refcount_set (&tsk->stack_refcount,1 );#endif
Signature · 1 line
2.48.1
kernel test robot
build botRe: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame
kernel test robot noticed the following build errors:
Hi Xin,
kernel test robot noticed the following build errors:
[auto build test ERROR on 60c162a51180cb2b05d7505a565ab079bfa9cf12]
url: https://github.com/intel-lab-lkp/linux/commits/Xin-Li-Intel/x86-fred-Allow-variable-sized-event-frame/20250319-151307 base: 60c162a51180cb2b05d7505a565ab079bfa9cf12 patch link: https://lore.kernel.org/r/20250319071009.1390984-2-xin%40zytor.com patch subject: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame config: i386-buildonly-randconfig-003-20250320 (https://download.01.org/0day-ci/archive/20250320/[email protected]/config) compiler: clang version 20.1.0 (https://github.com/llvm/llvm-project 24a30daaa559829ad079f2ff7f73eb4e18095f88) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250320/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> init/init_task.c:68:17: error: use of undeclared identifier '__top_init_kernel_stack'
68 | .thread_info = INIT_THREAD_INFO(init_task),
| ^
arch/x86/include/asm/thread_info.h:76:36: note: expanded from macro 'INIT_THREAD_INFO'
76 | .user_pt_regs = (struct pt_regs *)__top_init_kernel_stack, \
| ^1 error generated.
vim +/__top_init_kernel_stack +68 init/init_task.c
d08b9f0ca6605e Sami Tolvanen 2020-04-27 61
d11ed3ab3166a2 David Howells 2018-01-02 62 /*
d11ed3ab3166a2 David Howells 2018-01-02 63 * Set up the first task table, touch at your own risk!. Base=0,
d11ed3ab3166a2 David Howells 2018-01-02 64 * limit=0x1fffff (=2MB)
d11ed3ab3166a2 David Howells 2018-01-02 65 */
0eb5085c38749f Heiko Carstens 2023-11-16 66 struct task_struct init_task __aligned(L1_CACHE_BYTES) = {
4e7e3adbba5224 David Howells 2018-01-02 67 #ifdef CONFIG_THREAD_INFO_IN_TASK
4e7e3adbba5224 David Howells 2018-01-02 @68 .thread_info = INIT_THREAD_INFO(init_task),
f0b89d3958d73c Elena Reshetova 2019-01-18 69 .stack_refcount = REFCOUNT_INIT(1),
4e7e3adbba5224 David Howells 2018-01-02 70 #endif
2f064a59a11ff9 Peter Zijlstra 2021-06-11 71 .__state = 0,
d11ed3ab3166a2 David Howells 2018-01-02 72 .stack = init_stack,
ec1d281923cf81 Elena Reshetova 2019-01-18 73 .usage = REFCOUNT_INIT(2),
d11ed3ab3166a2 David Howells 2018-01-02 74 .flags = PF_KTHREAD,
d11ed3ab3166a2 David Howells 2018-01-02 75 .prio = MAX_PRIO - 20,
d11ed3ab3166a2 David Howells 2018-01-02 76 .static_prio = MAX_PRIO - 20,
d11ed3ab3166a2 David Howells 2018-01-02 77 .normal_prio = MAX_PRIO - 20,
d11ed3ab3166a2 David Howells 2018-01-02 78 .policy = SCHED_NORMAL,
3bd3706251ee8a Sebastian Andrzej Siewior 2019-04-23 79 .cpus_ptr = &init_task.cpus_mask,
b90ca8badbd114 Will Deacon 2021-07-30 80 .user_cpus_ptr = NULL,
3bd3706251ee8a Sebastian Andrzej Siewior 2019-04-23 81 .cpus_mask = CPU_MASK_ALL,
22d5607400c62c Qais Yousef 2024-03-24 82 .max_allowed_capacity = SCHED_CAPACITY_SCALE,
d11ed3ab3166a2 David Howells 2018-01-02 83 .nr_cpus_allowed= NR_CPUS,
d11ed3ab3166a2 David Howells 2018-01-02 84 .mm = NULL,
d11ed3ab3166a2 David Howells 2018-01-02 85 .active_mm = &init_mm,
2b69987be575b9 Kent Overstreet 2019-10-16 86 .faults_disabled_mapping = NULL,
d11ed3ab3166a2 David Howells 2018-01-02 87 .restart_block = {
d11ed3ab3166a2 David Howells 2018-01-02 88 .fn = do_no_restart_syscall,
d11ed3ab3166a2 David Howells 2018-01-02 89 },
d11ed3ab3166a2 David Howells 2018-01-02 90 .se = {
d11ed3ab3166a2 David Howells 2018-01-02 91 .group_node = LIST_HEAD_INIT(init_task.se.group_node),
d11ed3ab3166a2 David Howells 2018-01-02 92 },
d11ed3ab3166a2 David Howells 2018-01-02 93 .rt = {
d11ed3ab3166a2 David Howells 2018-01-02 94 .run_list = LIST_HEAD_INIT(init_task.rt.run_list),
d11ed3ab3166a2 David Howells 2018-01-02 95 .time_slice = RR_TIMESLICE,
d11ed3ab3166a2 David Howells 2018-01-02 96 },
d11ed3ab3166a2 David Howells 2018-01-02 97 .tasks = LIST_HEAD_INIT(init_task.tasks),
4e7e3adbba5224 David Howells 2018-01-02 98 #ifdef CONFIG_SMP
4e7e3adbba5224 David Howells 2018-01-02 99 .pushable_tasks = PLIST_NODE_INIT(init_task.pushable_tasks, MAX_PRIO),
4e7e3adbba5224 David Howells 2018-01-02 100 #endif
4e7e3adbba5224 David Howells 2018-01-02 101 #ifdef CONFIG_CGROUP_SCHED
4e7e3adbba5224 David Howells 2018-01-02 102 .sched_task_group = &root_task_group,
f0e1a0643a59bf Tejun Heo 2024-06-18 103 #endif
f0e1a0643a59bf Tejun Heo 2024-06-18 104 #ifdef CONFIG_SCHED_CLASS_EXT
f0e1a0643a59bf Tejun Heo 2024-06-18 105 .scx = {
d4af01c3731ff9 Tejun Heo 2024-07-08 106 .dsq_list.node = LIST_HEAD_INIT(init_task.scx.dsq_list.node),
f0e1a0643a59bf Tejun Heo 2024-06-18 107 .sticky_cpu = -1,
f0e1a0643a59bf Tejun Heo 2024-06-18 108 .holding_cpu = -1,
f0e1a0643a59bf Tejun Heo 2024-06-18 109 .runnable_node = LIST_HEAD_INIT(init_task.scx.runnable_node),
8a010b81b3a50b David Vernet 2024-06-18 110 .runnable_at = INITIAL_JIFFIES,
f0e1a0643a59bf Tejun Heo 2024-06-18 111 .ddsp_dsq_id = SCX_DSQ_INVALID,
f0e1a0643a59bf Tejun Heo 2024-06-18 112 .slice = SCX_SLICE_DFL,
f0e1a0643a59bf Tejun Heo 2024-06-18 113 },
4e7e3adbba5224 David Howells 2018-01-02 114 #endif
d11ed3ab3166a2 David Howells 2018-01-02 115 .ptraced = LIST_HEAD_INIT(init_task.ptraced),
d11ed3ab3166a2 David Howells 2018-01-02 116 .ptrace_entry = LIST_HEAD_INIT(init_task.ptrace_entry),
d11ed3ab3166a2 David Howells 2018-01-02 117 .real_parent = &init_task,
d11ed3ab3166a2 David Howells 2018-01-02 118 .parent = &init_task,
d11ed3ab3166a2 David Howells 2018-01-02 119 .children = LIST_HEAD_INIT(init_task.children),
d11ed3ab3166a2 David Howells 2018-01-02 120 .sibling = LIST_HEAD_INIT(init_task.sibling),
d11ed3ab3166a2 David Howells 2018-01-02 121 .group_leader = &init_task,
d11ed3ab3166a2 David Howells 2018-01-02 122 RCU_POINTER_INITIALIZER(real_cred, &init_cred),
d11ed3ab3166a2 David Howells 2018-01-02 123 RCU_POINTER_INITIALIZER(cred, &init_cred),
d11ed3ab3166a2 David Howells 2018-01-02 124 .comm = INIT_TASK_COMM,
d11ed3ab3166a2 David Howells 2018-01-02 125 .thread = INIT_THREAD,
d11ed3ab3166a2 David Howells 2018-01-02 126 .fs = &init_fs,
d11ed3ab3166a2 David Howells 2018-01-02 127 .files = &init_files,
0f2122045b9462 Jens Axboe 2020-09-13 128 #ifdef CONFIG_IO_URING
0f2122045b9462 Jens Axboe 2020-09-13 129 .io_uring = NULL,
0f2122045b9462 Jens Axboe 2020-09-13 130 #endif
d11ed3ab3166a2 David Howells 2018-01-02 131 .signal = &init_signals,
d11ed3ab3166a2 David Howells 2018-01-02 132 .sighand = &init_sighand,
d11ed3ab3166a2 David Howells 2018-01-02 133 .nsproxy = &init_nsproxy,
d11ed3ab3166a2 David Howells 2018-01-02 134 .pending = {
d11ed3ab3166a2 David Howells 2018-01-02 135 .list = LIST_HEAD_INIT(init_task.pending.list),
d11ed3ab3166a2 David Howells 2018-01-02 136 .signal = {{0}}
d11ed3ab3166a2 David Howells 2018-01-02 137 },
d11ed3ab3166a2 David Howells 2018-01-02 138 .blocked = {{0}},
d11ed3ab3166a2 David Howells 2018-01-02 139 .alloc_lock = __SPIN_LOCK_UNLOCKED(init_task.alloc_lock),
d11ed3ab3166a2 David Howells 2018-01-02 140 .journal_info = NULL,
d11ed3ab3166a2 David Howells 2018-01-02 141 INIT_CPU_TIMERS(init_task)
d11ed3ab3166a2 David Howells 2018-01-02 142 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(init_task.pi_lock),
d11ed3ab3166a2 David Howells 2018-01-02 143 .timer_slack_ns = 50000, /* 50 usec default slack */
2c4704756cab7c Eric W. Biederman 2017-09-26 144 .thread_pid = &init_struct_pid,
d11ed3ab3166a2 David Howells 2018-01-02 145 .thread_node = LIST_HEAD_INIT(init_signals.thread_head),
4b7d248b3a1de4 Richard Guy Briggs 2019-01-22 146 #ifdef CONFIG_AUDIT
4e7e3adbba5224 David Howells 2018-01-02 147 .loginuid = INVALID_UID,
f0b752168d7091 Richard Guy Briggs 2018-05-12 148 .sessionid = AUDIT_SID_UNSET,
4e7e3adbba5224 David Howells 2018-01-02 149 #endif
4e7e3adbba5224 David Howells 2018-01-02 150 #ifdef CONFIG_PERF_EVENTS
4e7e3adbba5224 David Howells 2018-01-02 151 .perf_event_mutex = __MUTEX_INITIALIZER(init_task.perf_event_mutex),
4e7e3adbba5224 David Howells 2018-01-02 152 .perf_event_list = LIST_HEAD_INIT(init_task.perf_event_list),
4e7e3adbba5224 David Howells 2018-01-02 153 #endif
4e7e3adbba5224 David Howells 2018-01-02 154 #ifdef CONFIG_PREEMPT_RCU
4e7e3adbba5224 David Howells 2018-01-02 155 .rcu_read_lock_nesting = 0,
4e7e3adbba5224 David Howells 2018-01-02 156 .rcu_read_unlock_special.s = 0,
4e7e3adbba5224 David Howells 2018-01-02 157 .rcu_node_entry = LIST_HEAD_INIT(init_task.rcu_node_entry),
4e7e3adbba5224 David Howells 2018-01-02 158 .rcu_blocked_node = NULL,
4e7e3adbba5224 David Howells 2018-01-02 159 #endif
4e7e3adbba5224 David Howells 2018-01-02 160 #ifdef CONFIG_TASKS_RCU
4e7e3adbba5224 David Howells 2018-01-02 161 .rcu_tasks_holdout = false,
4e7e3adbba5224 David Howells 2018-01-02 162 .rcu_tasks_holdout_list = LIST_HEAD_INIT(init_task.rcu_tasks_holdout_list),
4e7e3adbba5224 David Howells 2018-01-02 163 .rcu_tasks_idle_cpu = -1,
46faf9d8e1d52e Paul E. McKenney 2024-02-05 164 .rcu_tasks_exit_list = LIST_HEAD_INIT(init_task.rcu_tasks_exit_list),
4e7e3adbba5224 David Howells 2018-01-02 165 #endif
d5f177d35c2442 Paul E. McKenney 2020-03-09 166 #ifdef CONFIG_TASKS_TRACE_RCU
d5f177d35c2442 Paul E. McKenney 2020-03-09 167 .trc_reader_nesting = 0,
276c410448dbca Paul E. McKenney 2020-03-17 168 .trc_reader_special.s = 0,
d5f177d35c2442 Paul E. McKenney 2020-03-09 169 .trc_holdout_list = LIST_HEAD_INIT(init_task.trc_holdout_list),
434c9eefb959c3 Paul E. McKenney 2022-05-16 170 .trc_blkd_node = LIST_HEAD_INIT(init_task.trc_blkd_node),
d5f177d35c2442 Paul E. McKenney 2020-03-09 171 #endif
4e7e3adbba5224 David Howells 2018-01-02 172 #ifdef CONFIG_CPUSETS
b75058614fdd31 Ahmed S. Darwish 2020-07-20 173 .mems_allowed_seq = SEQCNT_SPINLOCK_ZERO(init_task.mems_allowed_seq,
b75058614fdd31 Ahmed S. Darwish 2020-07-20 174 &init_task.alloc_lock),
4e7e3adbba5224 David Howells 2018-01-02 175 #endif
4e7e3adbba5224 David Howells 2018-01-02 176 #ifdef CONFIG_RT_MUTEXES
4e7e3adbba5224 David Howells 2018-01-02 177 .pi_waiters = RB_ROOT_CACHED,
4e7e3adbba5224 David Howells 2018-01-02 178 .pi_top_task = NULL,
4e7e3adbba5224 David Howells 2018-01-02 179 #endif
d11ed3ab3166a2 David Howells 2018-01-02 180 INIT_PREV_CPUTIME(init_task)
4e7e3adbba5224 David Howells 2018-01-02 181 #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
4e7e3adbba5224 David Howells 2018-01-02 182 .vtime.seqcount = SEQCNT_ZERO(init_task.vtime_seqcount),
4e7e3adbba5224 David Howells 2018-01-02 183 .vtime.starttime = 0,
4e7e3adbba5224 David Howells 2018-01-02 184 .vtime.state = VTIME_SYS,
4e7e3adbba5224 David Howells 2018-01-02 185 #endif
4e7e3adbba5224 David Howells 2018-01-02 186 #ifdef CONFIG_NUMA_BALANCING
98fa15f34cb379 Anshuman Khandual 2019-03-05 187 .numa_preferred_nid = NUMA_NO_NODE,
4e7e3adbba5224 David Howells 2018-01-02 188 .numa_group = NULL,
4e7e3adbba5224 David Howells 2018-01-02 189 .numa_faults = NULL,
4e7e3adbba5224 David Howells 2018-01-02 190 #endif
d73b49365ee65a Andrey Konovalov 2020-12-22 191 #if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
4e7e3adbba5224 David Howells 2018-01-02 192 .kasan_depth = 1,
4e7e3adbba5224 David Howells 2018-01-02 193 #endif
dfd402a4c4baae Marco Elver 2019-11-14 194 #ifdef CONFIG_KCSAN
dfd402a4c4baae Marco Elver 2019-11-14 195 .kcsan_ctx = {
757a4cefde7669 Marco Elver 2020-03-25 196 .scoped_accesses = {LIST_POISON1, NULL},
dfd402a4c4baae Marco Elver 2019-11-14 197 },
dfd402a4c4baae Marco Elver 2019-11-14 198 #endif
4e7e3adbba5224 David Howells 2018-01-02 199 #ifdef CONFIG_TRACE_IRQFLAGS
4e7e3adbba5224 David Howells 2018-01-02 200 .softirqs_enabled = 1,
4e7e3adbba5224 David Howells 2018-01-02 201 #endif
4e7e3adbba5224 David Howells 2018-01-02 202 #ifdef CONFIG_LOCKDEP
e196e479a3b844 Yuyang Du 2019-05-06 203 .lockdep_depth = 0, /* no locks held yet */
f6ec8829ac9d59 Yuyang Du 2019-05-06 204 .curr_chain_key = INITIAL_CHAIN_KEY,
4e7e3adbba5224 David Howells 2018-01-02 205 .lockdep_recursion = 0,
4e7e3adbba5224 David Howells 2018-01-02 206 #endif
4e7e3adbba5224 David Howells 2018-01-02 207 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
4e7e3adbba5224 David Howells 2018-01-02 208 .ret_stack = NULL,
7e0a9220467dbc Steven Rostedt (VMware 2021-01-29 209) .tracing_graph_pause = ATOMIC_INIT(0),
4e7e3adbba5224 David Howells 2018-01-02 210 #endif
c1a280b68d4e6b Thomas Gleixner 2019-07-26 211 #if defined(CONFIG_TRACING) && defined(CONFIG_PREEMPTION)
4e7e3adbba5224 David Howells 2018-01-02 212 .trace_recursion = 0,
4e7e3adbba5224 David Howells 2018-01-02 213 #endif
4e7e3adbba5224 David Howells 2018-01-02 214 #ifdef CONFIG_LIVEPATCH
d927752f287fe1 Wardenjohn 2024-05-07 215 .patch_state = KLP_TRANSITION_IDLE,
4e7e3adbba5224 David Howells 2018-01-02 216 #endif
4e7e3adbba5224 David Howells 2018-01-02 217 #ifdef CONFIG_SECURITY
4e7e3adbba5224 David Howells 2018-01-02 218 .security = NULL,
4e7e3adbba5224 David Howells 2018-01-02 219 #endif
64bdc0244054f7 [email protected] 2021-03-21 220 #ifdef CONFIG_SECCOMP_FILTER
c818c03b661cd7 Kees Cook 2020-05-13 221 .seccomp = { .filter_count = ATOMIC_INIT(0) },
c818c03b661cd7 Kees Cook 2020-05-13 222 #endif
d11ed3ab3166a2 David Howells 2018-01-02 223 };
a4a2eb490e38aa Thomas Gleixner 2012-05-03 224 EXPORT_SYMBOL(init_task);
a4a2eb490e38aa Thomas Gleixner 2012-05-03 225 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Xin Li
maintainerRe: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame
Quoted 21 lines · kernel test robot
Hi Xin,
kernel test robot noticed the following build errors:
[auto build test ERROR on
60c162a51180cb2b05d7505a565ab079bfa9cf12]url: https://github.com/intel-lab-lkp/linux/commits/Xin-Li-Intel/x86-fred-Allow-variable-sized-event-frame/20250319-151307 base: 60c162a51180cb2b05d7505a565ab079bfa9cf12 patch link: https://lore.kernel.org/r/20250319071009.1390984-2-xin%40zytor.com patch subject: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame config: i386-buildonly-randconfig-003-20250320 (https://download.01.org/0day-ci/archive/20250320/[email protected]/config) compiler: clang version 20.1.0 (https://github.com/llvm/llvm-project 24a30daaa559829ad079f2ff7f73eb4e18095f88) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250320/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All errors (new ones prefixed by >>):
Quoted 8 lines
Quoted 1 line
Quoted 1 line
init/init_task.c:68:17: error: use of undeclared identifier '__top_init_kernel_stack'68 | .thread_info =
INIT_THREAD_INFO(init_task),
| ^
arch/x86/include/asm/thread_info.h:76:36: note: expanded from macro 'INIT_THREAD_INFO'
76 | .user_pt_regs = (structpt_regs*)__top_init_kernel_stack, \
| ^
1 error generated.
Okay, I need to add:
extern unsigned long __top_init_kernel_stack[];
Unfortunately my configs don't expose the build issue.
Thanks!
Xin
kernel test robot
build botRe: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame
In reply to Xin Li (Intel)kernel test robot noticed the following build errors:
Hi Xin,
kernel test robot noticed the following build errors:
[auto build test ERROR on 60c162a51180cb2b05d7505a565ab079bfa9cf12]
url: https://github.com/intel-lab-lkp/linux/commits/Xin-Li-Intel/x86-fred-Allow-variable-sized-event-frame/20250319-151307 base: 60c162a51180cb2b05d7505a565ab079bfa9cf12 patch link: https://lore.kernel.org/r/20250319071009.1390984-2-xin%40zytor.com patch subject: [PATCH v3 1/3] x86/fred: Allow variable-sized event frame config: i386-buildonly-randconfig-001-20250320 (https://download.01.org/0day-ci/archive/20250320/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250320/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from include/linux/thread_info.h:60,
from include/linux/smp.h:118,
from include/linux/lockdep.h:14,
from include/linux/rcupdate.h:29,
from include/linux/init_task.h:5,
from init/init_task.c:2:
>> arch/x86/include/asm/thread_info.h:76:45: error: '__top_init_kernel_stack' undeclared here (not in a function)
76 | .user_pt_regs = (struct pt_regs *)__top_init_kernel_stack, \
| ^~~~~~~~~~~~~~~~~~~~~~~ init/init_task.c:68:27: note: in expansion of macro 'INIT_THREAD_INFO'
68 | .thread_info = INIT_THREAD_INFO(init_task),
| ^~~~~~~~~~~~~~~~
vim +/__top_init_kernel_stack +76 arch/x86/include/asm/thread_info.h
72
73 #define INIT_THREAD_INFO(tsk) \
74 { \
75 .flags = 0, \
> 76 .user_pt_regs = (struct pt_regs *)__top_init_kernel_stack, \
77 }
78 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Xin Li (Intel)
maintainerPATCH v3 1/3 x86/fred: Allow variable-sized event frame
In reply to Xin Li (Intel)A FRED event frame could contain different amount of information for different event types, 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 the pt_regs structure that is used to save a user level context of current task is not at a fixed offset from top of current task kernel stack.
Add 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.
For IDT user level event delivery, a pt_regs structure is pushed by hardware and software _always_ at a fixed offset from top of current task kernel stack, so simply initialize user_pt_regs to point to the pt_regs structure no matter whether one is pushed or not.
While for FRED user level event delivery, user_pt_regs is updated with a pt_regs structure pointer generated in asm_fred_entrypoint_user().
---
Change in v3A:
* Add declaration for __top_init_kernel_stack[] (Intel lkp).
Change in v3:
* Replace "(struct pt_regs *)TOP_OF_INIT_STACK - 1" with (struct pt_regs *)__top_init_kernel_stack (Brian Gerst).
--- arch/x86/entry/entry_fred.c | 10 ++++++++++ arch/x86/include/asm/processor.h | 12 ++++++------ arch/x86/include/asm/thread_info.h | 11 ++++++++--- arch/x86/kernel/process.c | 22 ++++++++++++++++++++++ include/linux/thread_info.h | 1 + kernel/fork.c | 6 ++++++ 6 files changed, 53 insertions(+), 9 deletions(-)
arch/x86/entry/entry_fred.c +10 -0
@@ -228,6 +228,16 @@ __visible noinstr void fred_entry_from_user(struct pt_regs *regs)/* Invalidate orig_ax so that syscall_get_nr() works correctly */ regs->orig_ax =-1 ; +/* +* A FRED event frame could contain different amount of information +* for different event types, 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 the pt_regs structure +* that is used to save a user level context of current task is not +* at a fixed offset from top of current task stack. +*/ + current->thread_info.user_pt_regs = regs; +switch (regs->fred_ss.type) {case EVENT_TYPE_EXTINT :return fred_extint (regs);
arch/x86/include/asm/processor.h +6 -6
@@ -646,12 +646,12 @@ static __always_inline void prefetchw(const void *x)#define task_top_of_stack (task) ((unsigned long)(task_pt_regs(task) + 1)) -#define task_pt_regs (task) \ -({ \ - unsigned long __ptr = (unsigned long)task_stack_page(task); \ - __ptr += THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING; \ - ((struct pt_regs *)__ptr) - 1; \ -}) +/* +* Note, this can't be converted to an inline function as this header +* file defines 'struct thread_struct' which is used in the task_struct +* structure definition. +*/ +#define task_pt_regs (task) ((task)->thread_info.user_pt_regs)#ifdef CONFIG_X86_32 #define INIT_THREAD { \
arch/x86/include/asm/thread_info.h +8 -3
@@ -56,6 +56,7 @@*/ #ifndef __ASSEMBLER__struct task_struct ; +struct pt_regs ;#include <asm/cpufeature.h> #include <linux/atomic.h>
@@ -66,11 +67,15 @@ struct thread_info {#ifdef CONFIG_SMP u32 cpu;/* current CPU */ #endif + struct pt_regs *user_pt_regs; }; -#define INIT_THREAD_INFO (tsk) \ -{ \ - .flags = 0, \ +extern unsigned long __top_init_kernel_stack[]; + +#define INIT_THREAD_INFO (tsk) \ +{ \ + .flags = 0, \ + .user_pt_regs = (struct pt_regs *)__top_init_kernel_stack, \ }#else /* !__ASSEMBLER__ */
arch/x86/kernel/process.c +22 -0
@@ -108,6 +108,28 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)return 0 ; } +/* +* Initialize thread_info.user_pt_regs for IDT event delivery. +* +* For IDT user level event delivery, a pt_regs structure is pushed by both +* hardware and software and always resides at a fixed offset from top of +* current task kernel stack, thus thread_info.user_pt_regs is a per-task +* constant and NEVER changes after initialization. +* +* While for FRED user level event delivery, user_pt_regs is updated in +* fred_entry_from_user() immediately after user level event delivery. +* +* Note: thread_info.user_pt_regs of the init task is initialized at build +* time. +*/ +void arch_init_user_pt_regs (struct task_struct *tsk) +{ +unsigned long top_of_stack = (unsigned long )task_stack_page (tsk) +THREAD_SIZE ; + + top_of_stack -=TOP_OF_KERNEL_STACK_PADDING ; + tsk->thread_info.user_pt_regs = (struct pt_regs *)top_of_stack -1 ; +} +#ifdef CONFIG_X86_64 void arch_release_task_struct (struct task_struct *tsk) {
include/linux/thread_info.h +1 -0
@@ -273,6 +273,7 @@ void arch_task_cache_init(void); /* for CONFIG_SH */void arch_release_task_struct (struct task_struct *tsk);int arch_dup_task_struct (struct task_struct *dst,struct task_struct *src); +void arch_init_user_pt_regs (struct task_struct *tsk);#endif /* __KERNEL__ */
kernel/fork.c +6 -0
@@ -1101,6 +1101,10 @@ int __weak arch_dup_task_struct(struct task_struct *dst,return 0 ; } +void __weak arch_init_user_pt_regs (struct task_struct *tsk) +{ +} +void set_task_stack_end_magic (struct task_struct *tsk) {unsigned long *stackend;
@@ -1128,6 +1132,8 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)if (err) goto free_tsk; +arch_init_user_pt_regs (tsk); +#ifdef CONFIG_THREAD_INFO_IN_TASK refcount_set (&tsk->stack_refcount,1 );#endif
Signature · 1 line
2.48.1
Xin Li (Intel)
maintainerPATCH v3 2/3 x86: Remove the padding space at top of the init stack
In reply to Xin Li (Intel)Because the owner of the init stack, init task, doesn't have any user level context, there will NEVER be an actual pt_regs structure pushed at top of the init stack.
However a zeroed pt_regs structure is created at build time and kept at top of the init stack for task_pt_regs() to function properly with the init task in the same manner as a normal task with user level context.
Besides, task_pt_regs() no longer converts a fixed offset from top of a task kernel stack to a pt_regs structure pointer, but rather returns whatever in the thread_info.user_pt_regs field, which is initialized at build time to '(struct pt_regs *)TOP_OF_INIT_STACK - 1' for the init task.
As a result, there is no point to reserve any padding space at top of the init stack, so remove the padding space.
--- arch/x86/include/asm/processor.h | 16 ++++++++++++++-- arch/x86/kernel/vmlinux.lds.S | 7 +++++-- 2 files changed, 19 insertions(+), 4 deletions(-)
arch/x86/include/asm/processor.h +14 -2
@@ -641,8 +641,20 @@ static __always_inline void prefetchw(const void *x) "m" (*(const char *)x)); } -#define TOP_OF_INIT_STACK ((unsigned long)&init_stack + sizeof(init_stack) - \ - TOP_OF_KERNEL_STACK_PADDING) +extern unsigned long __end_init_stack[]; + +/* +* No need to reserve extra padding space above the pt_regs structure +* at top of the init stack, because its owner init task doesn't have +* any user level context, thus there will NEVER be an actual pt_regs +* structure pushed at top of the init stack. +* +* However a zeroed pt_regs structure is created at build time and kept +* at top of the init stack for task_pt_regs() to function properly with +* the init task in the same manner as a normal task with user level +* context. +*/ +#define TOP_OF_INIT_STACK ((unsigned long)&__end_init_stack)#define task_top_of_stack (task) ((unsigned long)(task_pt_regs(task) + 1))
arch/x86/kernel/vmlinux.lds.S +5 -2
@@ -178,8 +178,11 @@ SECTIONS /* init_task */ INIT_TASK_DATA(THREAD_SIZE) - /* equivalent to task_pt_regs(&init_task) */ - __top_init_kernel_stack = __end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE; + /* + * task_pt_regs(&init_task) is: + * '(struct pt_regs *)&__end_init_stack - 1' + */ + __top_init_kernel_stack = __end_init_stack - PTREGS_SIZE; #ifdef CONFIG_X86_32 /* 32 bit has nosave before _edata */
Signature · 1 line
2.48.1
Xin Li (Intel)
maintainerPATCH v3 3/3 x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
In reply to Xin Li (Intel)Because task_pt_regs() is now just an alias of thread_info.user_pt_regs, and no matter whether FRED is enabled or not a user level event frame on x86_64 is always pushed from top of current task kernel stack, i.e., '(unsigned long)task_stack_page(task) + THREAD_SIZE', there is no meaning to keep TOP_OF_KERNEL_STACK_PADDING on x86_64, thus remove it.
---
Change in v2:
* Rebase on latest tip/master.
--- arch/x86/include/asm/fred.h | 2 +- arch/x86/include/asm/processor.h | 6 ++++-- arch/x86/include/asm/thread_info.h | 10 ---------- arch/x86/kernel/process.c | 3 +-- 4 files changed, 6 insertions(+), 15 deletions(-)
arch/x86/include/asm/fred.h +1 -1
@@ -97,7 +97,7 @@ static __always_inline void fred_sync_rsp0(unsigned long rsp0) static __always_inline void fred_update_rsp0(void) { -unsigned long rsp0 = (unsigned long )task_stack_page (current) +THREAD_SIZE ; +unsigned long rsp0 =task_top_of_stack (current);if (cpu_feature_enabled (X86_FEATURE_FRED ) && (__this_cpu_read (fred_rsp0) != rsp0)) {wrmsrns (MSR_IA32_FRED_RSP0 , rsp0);
arch/x86/include/asm/processor.h +4 -2
@@ -656,8 +656,6 @@ extern unsigned long __end_init_stack[];*/ #define TOP_OF_INIT_STACK ((unsigned long)&__end_init_stack) -#define task_top_of_stack (task) ((unsigned long)(task_pt_regs(task) + 1)) -/* * Note, this can't be converted to an inline function as this header * file defines 'struct thread_struct' which is used in the task_struct
@@ -666,6 +664,9 @@ extern unsigned long __end_init_stack[];#define task_pt_regs (task) ((task)->thread_info.user_pt_regs)#ifdef CONFIG_X86_32 +#define task_top_of_stack (task) ((unsigned long)task_stack_page(task) + THREAD_SIZE \ + - TOP_OF_KERNEL_STACK_PADDING) +#define INIT_THREAD { \ .sp0 = TOP_OF_INIT_STACK, \ .sysenter_cs = __KERNEL_CS, \
@@ -673,6 +674,7 @@ extern unsigned long __end_init_stack[];#else extern unsigned long __top_init_kernel_stack[]; +#define task_top_of_stack (task) ((unsigned long)task_stack_page(task) + THREAD_SIZE)#define INIT_THREAD { \ .sp = (unsigned long)&__top_init_kernel_stack, \
arch/x86/include/asm/thread_info.h +0 -10
@@ -30,10 +30,6 @@* * In vm86 mode, the hardware frame is much longer still, so add 16 * bytes to make room for the real-mode segments. -* -* x86-64 has a fixed-length stack frame, but it depends on whether -* or not FRED is enabled. Future versions of FRED might make this -* dynamic, but for now it is always 2 words longer. */ #ifdef CONFIG_X86_32 # ifdef CONFIG_VM86
@@ -41,12 +37,6 @@# else # define TOP_OF_KERNEL_STACK_PADDING 8# endif -#else /* x86-64 */ -# ifdef CONFIG_X86_FRED -# define TOP_OF_KERNEL_STACK_PADDING (2 * 8) -# else -# define TOP_OF_KERNEL_STACK_PADDING 0 -# endif #endif /*
arch/x86/kernel/process.c +1 -2
@@ -124,9 +124,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)*/ void arch_init_user_pt_regs (struct task_struct *tsk) { -unsigned long top_of_stack = (unsigned long )task_stack_page (tsk) +THREAD_SIZE ; +unsigned long top_of_stack =task_top_of_stack (tsk); - top_of_stack -=TOP_OF_KERNEL_STACK_PADDING ; tsk->thread_info.user_pt_regs = (struct pt_regs *)top_of_stack -1 ; }
Signature · 1 line
2.48.1
Re: [PATCH v3 3/3] x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
Quoted 107 lines · Xin Li (Intel)
Because
task_pt_regs()is now just an alias of thread_info.user_pt_regs, and no matter whether FRED is enabled or not a user level event frame onx86_64is always pushed from top of current task kernel stack, i.e., '(unsigned long)task_stack_page(task) +THREAD_SIZE', there is no meaning to keepTOP_OF_KERNEL_STACK_PADDINGonx86_64, thus remove it.Signed-off-by Xin Li (Intel) <[email protected]>---
Change in v2:
* Rebase on latest tip/master.--- arch/x86/include/asm/fred.h | 2 +- arch/x86/include/asm/processor.h | 6 ++++-- arch/x86/include/asm/thread_info.h | 10 ---------- arch/x86/kernel/process.c | 3 +-- 4 files changed, 6 insertions(+), 15 deletions(-)arch/x86/include/asm/fred.h +1
-1@@ -97,7 +97,7 @@ static __always_inline void fred_sync_rsp0(unsigned long rsp0) static __always_inline void fred_update_rsp0(void) { -unsigned long rsp0 = (unsigned long )task_stack_page (current) +THREAD_SIZE ; +unsigned long rsp0 =task_top_of_stack (current);if (cpu_feature_enabled (X86_FEATURE_FRED ) && (__this_cpu_read (fred_rsp0) != rsp0)) {wrmsrns (MSR_IA32_FRED_RSP0 , rsp0);arch/x86/include/asm/processor.h +4
-2@@ -656,8 +656,6 @@ extern unsigned long __end_init_stack[];*/ #define TOP_OF_INIT_STACK ((unsigned long)&__end_init_stack) -#define task_top_of_stack (task) ((unsigned long)(task_pt_regs(task) + 1)) -/* * Note, this can't be converted to an inline function as this header * file defines 'struct thread_struct' which is used in the task_struct @@ -666,6 +664,9 @@ extern unsigned long __end_init_stack[];#define task_pt_regs (task) ((task)->thread_info.user_pt_regs)#ifdef CONFIG_X86_32 +#define task_top_of_stack (task) ((unsigned long)task_stack_page(task) + THREAD_SIZE \ + - TOP_OF_KERNEL_STACK_PADDING) +#define INIT_THREAD { \ .sp0 = TOP_OF_INIT_STACK, \ .sysenter_cs = __KERNEL_CS, \@@ -673,6 +674,7 @@ extern unsigned long __end_init_stack[];#else extern unsigned long __top_init_kernel_stack[]; +#define task_top_of_stack (task) ((unsigned long)task_stack_page(task) + THREAD_SIZE)#define INIT_THREAD { \ .sp = (unsigned long)&__top_init_kernel_stack, \arch/x86/include/asm/thread_info.h +0
-10@@ -30,10 +30,6 @@* * In vm86 mode, the hardware frame is much longer still, so add 16 * bytes to make room for the real-mode segments. -* -* x86-64 has a fixed-length stack frame, but it depends on whether -* or not FRED is enabled. Future versions of FRED might make this -* dynamic, but for now it is always 2 words longer. */ #ifdef CONFIG_X86_32 # ifdef CONFIG_VM86 @@ -41,12 +37,6 @@# else # define TOP_OF_KERNEL_STACK_PADDING 8# endif -#else /* x86-64 */ -# ifdef CONFIG_X86_FRED -# define TOP_OF_KERNEL_STACK_PADDING (2 * 8) -# else -# define TOP_OF_KERNEL_STACK_PADDING 0 -# endif #endif /* arch/x86/kernel/process.c +1
-3@@ -124,9 +124,8 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)*/ void arch_init_user_pt_regs (struct task_struct *tsk) { -unsigned long top_of_stack = (unsigned long )task_stack_page (tsk) +THREAD_SIZE ; +unsigned long top_of_stack =task_top_of_stack (tsk); - top_of_stack -=TOP_OF_KERNEL_STACK_PADDING ; tsk->thread_info.user_pt_regs = (struct pt_regs *)top_of_stack -1 ; } --
Quoted 2 lines
2.48.1
I'm not sure it's worth fully removing TOP_OF_KERNEL_STACK_PADDING for 64-bit if it results in needing separate definitions of task_top_of_stack(). Leaving it at zero is fine. The other changes are fine though.
Brian Gerst
Xin Li
maintainerRe: [PATCH v3 3/3] x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
Quoted 4 lines · Brian Gerst
I'm not sure it's worth fully removing
TOP_OF_KERNEL_STACK_PADDINGfor 64-bit if it results in needing separate definitions oftask_top_of_stack(). Leaving it at zero is fine. The other changes are fine though.
Let's leave it to x86 maintainers ;-)
But to me, TOP_OF_KERNEL_STACK_PADDING no longer makes sense on 64-bit, and it makes it simpler to remove it. On the other side, 32-bit is to be zapped...
Thanks!
Xin
H. Peter Anvin
maintainerRe: [PATCH v3 3/3] x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
Quoted 6 lines · Xin Li
Quoted 4 lines · Brian Gerst
I'm not sure it's worth fully removing
TOP_OF_KERNEL_STACK_PADDINGfor 64-bit if it results in needing separate definitions oftask_top_of_stack(). Leaving it at zero is fine. The other changes are fine though.
Quoted 9 lines
Let's leave it to x86 maintainers ;-)
But to me,
TOP_OF_KERNEL_STACK_PADDINGno longer makes sense on 64-bit, and it makes it simpler to remove it. On the other side, 32-bit is to be zapped...Thanks!
Xin
For what it's worth, it was there as 0 before the FRED changes, so ...
Xin Li
maintainerRe: [PATCH v3 3/3] x86: Zap TOP_OF_KERNEL_STACK_PADDING on x86_64
Quoted 13 lines · H. Peter Anvin
Quoted 12 lines · Xin Li
Quoted 4 lines · Brian Gerst
I'm not sure it's worth fully removing
TOP_OF_KERNEL_STACK_PADDINGfor 64-bit if it results in needing separate definitions oftask_top_of_stack(). Leaving it at zero is fine. The other changes are fine though.Let's leave it to x86 maintainers ;-)
But to me,
TOP_OF_KERNEL_STACK_PADDINGno longer makes sense on 64-bit, and it makes it simpler to remove it. On the other side, 32-bit is to be zapped...
Quoted 6 lines
Quoted 3 lines
Thanks!
XinFor what it's worth, it was there as 0 before the FRED changes, so ...
Okay, I will drop this patch and send the patch set as v4.
Thanks!
Xin