Re: [PATCH v9 00/32] virtio pci support VIRTIO_F_RING_RESET (refactor vring)

2022-04-26 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 11:43:14AM +0800, Xuan Zhuo wrote: > The virtio spec already supports the virtio queue reset function. This patch > set > is to add this function to the kernel. The relevant virtio spec information is > here: > > https://github.com/oasis-tcs/virtio-spec/issues/124 > >

Re: [PATCH v9 00/32] virtio pci support VIRTIO_F_RING_RESET (refactor vring)

2022-04-26 Thread Xuan Zhuo
On Tue, 26 Apr 2022 05:55:41 -0400, "Michael S. Tsirkin" wrote: > On Wed, Apr 06, 2022 at 11:43:14AM +0800, Xuan Zhuo wrote: > > The virtio spec already supports the virtio queue reset function. This > > patch set > > is to add this function to the kernel. The relevant virtio spec information >

Re: [PATCH 09/11] nvme: remove a spurious clear of discard_alignment

2022-04-26 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg ___ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um

[PATCH 0/9] ptrace: cleaning up ptrace_stop

2022-04-26 Thread Eric W. Biederman
While looking at how ptrace is broken on PREEMPT_RT I realized that ptrace_stop would be much simpler and more maintainable if tsk->ptrace, tsk->parent, and tsk->real_parent were protected by siglock. Most of the changes are general cleanups in support of this locking change. While making the n

[PATCH 1/9] signal: Rename send_signal send_signal_locked

2022-04-26 Thread Eric W. Biederman
Rename send_signal send_signal_locked and make to make it usable outside of signal.c. Signed-off-by: "Eric W. Biederman" --- include/linux/signal.h | 2 ++ kernel/signal.c| 24 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/linux/signal

[PATCH 2/9] signal: Replace __group_send_sig_info with send_signal_locked

2022-04-26 Thread Eric W. Biederman
The function send_signal_locked does more than __group_send_sig_info so replace it. Signed-off-by: "Eric W. Biederman" --- drivers/tty/tty_jobctrl.c | 4 ++-- include/linux/signal.h | 1 - kernel/signal.c| 8 +--- kernel/time/posix-cpu-timers.c | 6 +++--- 4 file

[PATCH 3/9] ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP

2022-04-26 Thread Eric W. Biederman
User mode linux is the last user of the PT_DTRACE flag. Using the flag to indicate single stepping is a little confusing and worse changing tsk->ptrace without locking could potentionally cause problems. So use a thread info flag with a better name instead of flag in tsk->ptrace. Remove the de

[PATCH 5/9] signal: Protect parent child relationships by childs siglock

2022-04-26 Thread Eric W. Biederman
The functions ptrace_stop and do_signal_stop have to drop siglock and grab tasklist_lock because the parent/child relation ship is guarded by siglock and not siglock. Simplify things by guarding the parent/child relationship with siglock. For the most part this just requires a little bit of code

[PATCH 4/9] ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP

2022-04-26 Thread Eric W. Biederman
xtensa is the last user of the PT_SINGLESTEP flag. Changing tsk->ptrace in user_enable_single_step and user_disable_single_step without locking could potentiallly cause problems. So use a thread info flag instead of a flag in tsk->ptrace. Use TIF_SINGLESTEP that xtensa already had defined but un

[PATCH 6/9] signal: Always call do_notify_parent_cldstop with siglock held

2022-04-26 Thread Eric W. Biederman
Now that siglock keeps tsk->parent and tsk->real_parent constant require that do_notify_parent_cldstop is called with tsk->siglock held instead of the tasklist_lock. As all of the callers of do_notify_parent_cldstop had to drop the siglock and take tasklist_lock this simplifies all of it's callers

[PATCH 7/9] ptrace: Simplify the wait_task_inactive call in ptrace_check_attach

2022-04-26 Thread Eric W. Biederman
Asking wait_task_inactive to verify that tsk->__state == __TASK_TRACED was needed to detect the when ptrace_stop would decide not to stop after calling "set_special_state(TASK_TRACED)". With the recent cleanups ptrace_stop will always stop after calling set_special_state. Take advatnage of this b

[PATCH 8/9] ptrace: Use siglock instead of tasklist_lock in ptrace_check_attach

2022-04-26 Thread Eric W. Biederman
Now that siglock protects tsk->parent and tsk->ptrace there is no need to grab tasklist_lock in ptrace_check_attach. The siglock can handle all of the locking needs of ptrace_check_attach. Signed-off-by: "Eric W. Biederman" --- kernel/ptrace.c | 29 ++--- 1 file changed,

[PATCH 9/9] ptrace: Don't change __state

2022-04-26 Thread Eric W. Biederman
Stop playing with tsk->__state to remove TASK_WAKEKILL while a ptrace command is executing. Instead implement a new jobtl flag JOBCTL_DELAY_WAKEKILL. This new flag is set in jobctl_freeze_task and cleared when ptrace_stop is awoken or in jobctl_unfreeze_task (when ptrace_stop remains asleep). In

Re: [PATCH 4/9] ptrace/xtensa: Replace PT_SINGLESTEP with TIF_SINGLESTEP

2022-04-26 Thread Max Filippov
On Tue, Apr 26, 2022 at 3:52 PM Eric W. Biederman wrote: > > xtensa is the last user of the PT_SINGLESTEP flag. Changing tsk->ptrace in > user_enable_single_step and user_disable_single_step without locking could > potentiallly cause problems. > > So use a thread info flag instead of a flag in ts

Re: [PATCH 5/9] signal: Protect parent child relationships by childs siglock

2022-04-26 Thread Sebastian Andrzej Siewior
On 2022-04-26 17:52:07 [-0500], Eric W. Biederman wrote: > The functions ptrace_stop and do_signal_stop have to drop siglock > and grab tasklist_lock because the parent/child relation ship > is guarded by siglock and not siglock. "is guarded by tasklist_lock and not siglock." ? > Simplify things