Skip to content

Commit 8aa0fb0

Browse files
committed
riscv: rely on core code to keep thread_info::cpu updated
Now that the core code switched back to using thread_info::cpu to keep a task's CPU number, we no longer need to keep it in sync explicitly. So just drop the code that does this. Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Palmer Dabbelt <[email protected]> Acked-by: Mark Rutland <[email protected]>
1 parent 336868a commit 8aa0fb0

File tree

3 files changed

+0
-7
lines changed

3 files changed

+0
-7
lines changed

arch/riscv/kernel/asm-offsets.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ void asm_offsets(void)
3333
OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
3434
OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp);
3535
OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp);
36-
OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
3736

3837
OFFSET(TASK_THREAD_F0, task_struct, thread.fstate.f[0]);
3938
OFFSET(TASK_THREAD_F1, task_struct, thread.fstate.f[1]);

arch/riscv/kernel/entry.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,6 @@ ENTRY(__switch_to)
544544
REG_L s9, TASK_THREAD_S9_RA(a4)
545545
REG_L s10, TASK_THREAD_S10_RA(a4)
546546
REG_L s11, TASK_THREAD_S11_RA(a4)
547-
/* Swap the CPU entry around. */
548-
lw a3, TASK_TI_CPU(a0)
549-
lw a4, TASK_TI_CPU(a1)
550-
sw a3, TASK_TI_CPU(a1)
551-
sw a4, TASK_TI_CPU(a0)
552547
/* The offset of thread_info in task_struct is zero. */
553548
move tp, a1
554549
ret

arch/riscv/kernel/head.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ clear_bss_done:
317317
call setup_trap_vector
318318
/* Restore C environment */
319319
la tp, init_task
320-
sw zero, TASK_TI_CPU(tp)
321320
la sp, init_thread_union + THREAD_SIZE
322321

323322
#ifdef CONFIG_KASAN

0 commit comments

Comments
 (0)