x86, mm: pass in 'total' to __copy_from_user_*nocache()
Impact: cleanup, enable future change Add a 'total bytes copied' parameter to __copy_from_user_*nocache(), and update all the callsites. The parameter is not used yet - architecture code can use it to more intelligently decide whether the copy should be cached or non-temporal. Cc: Salman Qazi <sqazi@google.com> Cc: Nick Piggin <npiggin@suse.de> Cc: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@ -157,7 +157,7 @@ __copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||
}
|
||||
|
||||
static __always_inline unsigned long __copy_from_user_nocache(void *to,
|
||||
const void __user *from, unsigned long n)
|
||||
const void __user *from, unsigned long n, unsigned long total)
|
||||
{
|
||||
might_fault();
|
||||
if (__builtin_constant_p(n)) {
|
||||
@ -180,7 +180,7 @@ static __always_inline unsigned long __copy_from_user_nocache(void *to,
|
||||
|
||||
static __always_inline unsigned long
|
||||
__copy_from_user_inatomic_nocache(void *to, const void __user *from,
|
||||
unsigned long n)
|
||||
unsigned long n, unsigned long total)
|
||||
{
|
||||
return __copy_from_user_ll_nocache_nozero(to, from, n);
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ extern long __copy_user_nocache(void *dst, const void __user *src,
|
||||
unsigned size, int zerorest);
|
||||
|
||||
static inline int __copy_from_user_nocache(void *dst, const void __user *src,
|
||||
unsigned size)
|
||||
unsigned size, unsigned long total)
|
||||
{
|
||||
might_sleep();
|
||||
/*
|
||||
@ -205,8 +205,7 @@ static inline int __copy_from_user_nocache(void *dst, const void __user *src,
|
||||
}
|
||||
|
||||
static inline int __copy_from_user_inatomic_nocache(void *dst,
|
||||
const void __user *src,
|
||||
unsigned size)
|
||||
const void __user *src, unsigned size, unsigned total)
|
||||
{
|
||||
if (likely(size >= PAGE_SIZE))
|
||||
return __copy_user_nocache(dst, src, size, 0);
|
||||
|
Reference in New Issue
Block a user