🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Christoph Hellwig Fri, 20 Nov 2026 16:06
Re: [PATCH RFC] vhost: set dirty log bits without pinning pages on x86
#19864
Author: Christoph Hellwig
Date: Fri, 20 Nov 2026 16:06
35 lines
10067 bytes
On Thu, Nov 12, 2026 at 05:53:47AM -0500, Michael S. Tsirkin wrote:
> vhost had a TODO to replace page pinning with a version
> of set_bit that works on userspace memory, since forever.
> 
> It is really best to avoid GUP on fast path entirely.
> Implement set_user_bit and use it in vhost, to do just that.
> 
> Should not be too hard for non-x86 too.
> 
> Reported-by: Khan Zhao <zhaoguohan@kylinos.cn>
> Link: https://lore.kernel.org/all/20261112085631.128819-1-zhaoguohan@kylinos.cn/
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> 
> 
> lightly tested. pls test and resubmit with your tool.
> 
>  arch/x86/include/asm/uaccess.h | 18 ++++++++++++++++++
>  drivers/vhost/vhost.c          |  7 +++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
> index 3a0dd3c2b233e..ba1e7c3f83c8e 100644
> --- a/arch/x86/include/asm/uaccess.h
> +++ b/arch/x86/include/asm/uaccess.h
> @@ -594,6 +594,24 @@ _label:									\
>  	__ret;								\
>  							})
>  
> +/* set_bit() on a byte of user memory; returns -EFAULT on fault. */
> +#define set_bit_user(nr, addr)					\

Please make this an inline that actually has proper __user annotations
for sparse type checking.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads