lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH v1 7/7] selftests/vm: anon_cow: add R/O longterm tests via gup_test
From
On 27.09.22 13:01, David Hildenbrand wrote:
> Let's trigger a R/O longterm pin on three cases of R/O mapped anonymous
> pages:
> * exclusive (never shared)
> * shared (child still alive)
> * previously shared (child no longer alive)
>
> ... and make sure that the pin is reliable: whatever we write via the page
> tables has to be observable via the pin.
>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---

The following on top should silence the warning on 32bit:

https://lore.kernel.org/all/202210182101.XOyPZEQV-lkp@intel.com/T/#u


diff --git a/mm/gup_test.c b/mm/gup_test.c
index 2bbfacd31f5a..57c343f2dc51 100644
--- a/mm/gup_test.c
+++ b/mm/gup_test.c
@@ -299,7 +299,8 @@ static inline int pin_longterm_test_read(unsigned long arg)
for (i = 0; i < pin_longterm_test_nr_pages; i++) {
void *addr = page_to_virt(pin_longterm_test_pages[i]);

- if (copy_to_user((void __user *)user_addr, addr, PAGE_SIZE))
+ if (copy_to_user((void __user *)(unsigned long)user_addr, addr,
+ PAGE_SIZE))
return -EFAULT;
user_addr += PAGE_SIZE;
}

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2022-10-19 14:52    [W:0.112 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site