Displaying 4 results from an estimated 4 matches for "old_log".
Did you mean:
o_d_log
2019 May 07
4
[PATCH RFC] vhost: don't use kmap() to log dirty pages
...ning -EFAULT). See Documentation/x86/exception-tables.txt.
- */
-static int set_bit_to_user(int nr, void __user *addr)
+static int set_bit_to_user(int nr, u32 __user *addr)
{
unsigned long log = (unsigned long)addr;
struct page *page;
- void *base;
- int bit = nr + (log % PAGE_SIZE) * 8;
+ u32 old_log;
int r;
r = get_user_pages_fast(log, 1, 1, &page);
if (r < 0)
return r;
BUG_ON(r != 1);
- base = kmap_atomic(page);
- set_bit(bit, base);
- kunmap_atomic(base);
+
+ r = futex_atomic_cmpxchg_inatomic(&old_log, addr, 0, 0);
+ if (r < 0)
+ return r;
+
+ old_log |= 1 <<...
2019 May 07
4
[PATCH RFC] vhost: don't use kmap() to log dirty pages
...ning -EFAULT). See Documentation/x86/exception-tables.txt.
- */
-static int set_bit_to_user(int nr, void __user *addr)
+static int set_bit_to_user(int nr, u32 __user *addr)
{
unsigned long log = (unsigned long)addr;
struct page *page;
- void *base;
- int bit = nr + (log % PAGE_SIZE) * 8;
+ u32 old_log;
int r;
r = get_user_pages_fast(log, 1, 1, &page);
if (r < 0)
return r;
BUG_ON(r != 1);
- base = kmap_atomic(page);
- set_bit(bit, base);
- kunmap_atomic(base);
+
+ r = futex_atomic_cmpxchg_inatomic(&old_log, addr, 0, 0);
+ if (r < 0)
+ return r;
+
+ old_log |= 1 <<...
2019 May 07
0
[PATCH RFC] vhost: don't use kmap() to log dirty pages
...gt;
Also please include the futex maintainers to make sure they are fine
with this first usage of <asm/futex.h> outside of kernel/futex.c.
> +static int set_bit_to_user(int nr, u32 __user *addr)
> {
> unsigned long log = (unsigned long)addr;
> struct page *page;
> + u32 old_log;
> int r;
>
> r = get_user_pages_fast(log, 1, 1, &page);
> if (r < 0)
> return r;
> BUG_ON(r != 1);
> +
> + r = futex_atomic_cmpxchg_inatomic(&old_log, addr, 0, 0);
> + if (r < 0)
> + return r;
> +
> + old_log |= 1 << nr;
> +...
2019 May 08
0
[PATCH RFC] vhost: don't use kmap() to log dirty pages
...n-tables.txt.
> - */
> -static int set_bit_to_user(int nr, void __user *addr)
> +static int set_bit_to_user(int nr, u32 __user *addr)
> {
> unsigned long log = (unsigned long)addr;
> struct page *page;
> - void *base;
> - int bit = nr + (log % PAGE_SIZE) * 8;
> + u32 old_log;
> int r;
>
> r = get_user_pages_fast(log, 1, 1, &page);
> if (r < 0)
> return r;
> BUG_ON(r != 1);
> - base = kmap_atomic(page);
> - set_bit(bit, base);
> - kunmap_atomic(base);
> +
> + r = futex_atomic_cmpxchg_inatomic(&old_log, addr, 0, 0)...