Pull thread_info flag accessor helper updates from Borislav Petkov: "Add a set of thread_info.flags accessors which snapshot it before accesing it in order to prevent any potential data races, and convert all users to those new accessors" * tag 'core_entry_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: powerpc: Snapshot thread flags powerpc: Avoid discarding flags in system_call_exception() openrisc: Snapshot thread flags microblaze: Snapshot thread flags arm64: Snapshot thread flags ARM: Snapshot thread flags alpha: Snapshot thread flags sched: Snapshot thread flags entry: Snapshot thread flags x86: Snapshot thread flags thread_info: Add helpers to snapshot thread flags
Showing the changes to kernel (3 of 19 files). Show all
Unified · Split
| @@ -187,7 +187,7 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, · 186 unmodified lines | ||
| 187 | 187 | /* Check if any of the above work has queued a deferred wakeup */ |
| 188 | 188 | tick_nohz_user_enter_prepare(); |
| 189 | 189 | |
| 190 | − ti_work = READ_ONCE(current_thread_info()->flags); | |
| 190 | + ti_work = read_thread_flags(); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | /* Return the latest work state for arch_exit_to_user_mode() */ |
| @@ -196,7 +196,7 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, · 2 unmodified lines | ||
| 196 | 196 | |
| 197 | 197 | static void exit_to_user_mode_prepare(struct pt_regs *regs) |
| 198 | 198 | { |
| 199 | − unsigned long ti_work = READ_ONCE(current_thread_info()->flags); | |
| 199 | + unsigned long ti_work = read_thread_flags(); | |
| 200 | 200 | |
| 201 | 201 | lockdep_assert_irqs_disabled(); |
| 202 | 202 | |
| @@ -26,7 +26,7 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work) · 25 unmodified lines | ||
| 26 | 26 | if (ret) |
| 27 | 27 | return ret; |
| 28 | 28 | |
| 29 | − ti_work = READ_ONCE(current_thread_info()->flags); | |
| 29 | + ti_work = read_thread_flags(); | |
| 30 | 30 | } while (ti_work & XFER_TO_GUEST_MODE_WORK || need_resched()); |
| 31 | 31 | return 0; |
| 32 | 32 | } |
| @@ -43,7 +43,7 @@ int xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu) · 10 unmodified lines | ||
| 43 | 43 | * disabled in the inner loop before going into guest mode. No need |
| 44 | 44 | * to disable interrupts here. |
| 45 | 45 | */ |
| 46 | − ti_work = READ_ONCE(current_thread_info()->flags); | |
| 46 | + ti_work = read_thread_flags(); | |
| 47 | 47 | if (!(ti_work & XFER_TO_GUEST_MODE_WORK)) |
| 48 | 48 | return 0; |
| 49 | 49 | |
| @@ -8520,7 +8520,7 @@ void sched_show_task(struct task_struct *p) · 8519 unmodified lines | ||
| 8520 | 8520 | rcu_read_unlock(); |
| 8521 | 8521 | pr_cont(" stack:%5lu pid:%5d ppid:%6d flags:0x%08lx\n", |
| 8522 | 8522 | free, task_pid_nr(p), ppid, |
| 8523 | − (unsigned long)task_thread_info(p)->flags); | |
| 8523 | + read_task_thread_flags(p)); | |
| 8524 | 8524 | |
| 8525 | 8525 | print_worker_info(KERN_INFO, p); |
| 8526 | 8526 | print_stop_info(KERN_INFO, p); |