search for: arch_futex_atomic_op_in_user

Displaying 5 results from an estimated 5 matches for "arch_futex_atomic_op_in_user".

2019 May 10
2
[RFC PATCH V2] vhost: don't use kmap() to log dirty pages
...o you don't expect > arch_futex_atomic_op_inuser below to fail. get_user_pages_fast > guarantees page is not going away but does it guarantee PTE won't be > invaidated or write protected? Good point, then I think we probably need to do manual fixup through fixup_user_fault() if arch_futex_atomic_op_in_user() fail. > >> if (r < 0) >> return r; >> BUG_ON(r != 1); >> - base = kmap_atomic(page); >> - set_bit(bit, base); >> - kunmap_atomic(base); >> + >> + r = arch_futex_atomic_op_inuser(FUTEX_OP_ADD, 1 << nr, &old, addr); >&gt...
2019 May 10
2
[RFC PATCH V2] vhost: don't use kmap() to log dirty pages
...o you don't expect > arch_futex_atomic_op_inuser below to fail. get_user_pages_fast > guarantees page is not going away but does it guarantee PTE won't be > invaidated or write protected? Good point, then I think we probably need to do manual fixup through fixup_user_fault() if arch_futex_atomic_op_in_user() fail. > >> if (r < 0) >> return r; >> BUG_ON(r != 1); >> - base = kmap_atomic(page); >> - set_bit(bit, base); >> - kunmap_atomic(base); >> + >> + r = arch_futex_atomic_op_inuser(FUTEX_OP_ADD, 1 << nr, &old, addr); >&gt...
2019 May 10
0
[RFC PATCH V2] vhost: don't use kmap() to log dirty pages
...; arch_futex_atomic_op_inuser below to fail.? get_user_pages_fast >> guarantees page is not going away but does it guarantee PTE won't be >> invaidated or write protected? > > > Good point, then I think we probably need to do manual fixup through > fixup_user_fault() if arch_futex_atomic_op_in_user() fail. This looks like a overkill, we don't need to atomic environment here actually. Instead, just keep pagefault enabled should work. So just introduce arch_futex_atomic_op_inuser_inatomic() variant with pagefault disabled there just for futex should be sufficient. Thanks
2019 May 09
2
[RFC PATCH V2] vhost: don't use kmap() to log dirty pages
Vhost log dirty pages directly to a userspace bitmap through GUP and kmap_atomic() since kernel doesn't have a set_bit_to_user() helper. This will cause issues for the arch that has virtually tagged caches. The way to fix is to keep using userspace virtual address. Fortunately, futex has arch_futex_atomic_op_inuser() which could be used for setting a bit to user. Note: - There're archs
2019 May 09
2
[RFC PATCH V2] vhost: don't use kmap() to log dirty pages
Vhost log dirty pages directly to a userspace bitmap through GUP and kmap_atomic() since kernel doesn't have a set_bit_to_user() helper. This will cause issues for the arch that has virtually tagged caches. The way to fix is to keep using userspace virtual address. Fortunately, futex has arch_futex_atomic_op_inuser() which could be used for setting a bit to user. Note: - There're archs