From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj6ep-00ExbL-L4 for kexec@lists.infradead.org; Tue, 18 May 2021 20:49:41 +0000 From: David Laight Subject: RE: [PATCH v3 2/4] mm: simplify compat_sys_move_pages Date: Tue, 18 May 2021 20:49:34 +0000 Message-ID: References: <20210517203343.3941777-1-arnd@kernel.org> <20210517203343.3941777-3-arnd@kernel.org> In-Reply-To: <20210517203343.3941777-3-arnd@kernel.org> MIME-Version: 1.0 Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: 'Arnd Bergmann' , "linux-arch@vger.kernel.org" Cc: Arnd Bergmann , Christoph Hellwig , Alexander Viro , Andrew Morton , Borislav Petkov , Brian Gerst , Eric Biederman , Ingo Molnar , "H. Peter Anvin" , Thomas Gleixner , Linux ARM , "linux-kernel@vger.kernel.org" , Linux-MM , "kexec@lists.infradead.org" From: Arnd Bergmann > Sent: 17 May 2021 21:34 > > The compat move_pages() implementation uses compat_alloc_user_space() > for converting the pointer array. Moving the compat handling into > the function itself is a bit simpler and lets us avoid the > compat_alloc_user_space() call. > > Signed-off-by: Arnd Bergmann > --- > mm/migrate.c | 45 ++++++++++++++++++++++++++++++--------------- > 1 file changed, 30 insertions(+), 15 deletions(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index b234c3f3acb7..a68d07f19a1a 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1855,6 +1855,23 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages, > mmap_read_unlock(mm); > } > > +static int put_compat_pages_array(const void __user *chunk_pages[], > + const void __user * __user *pages, > + unsigned long chunk_nr) > +{ Should that be get_compat_pages_array() ? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec