From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D92EAC433B4 for ; Tue, 18 May 2021 20:49:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5D2661355 for ; Tue, 18 May 2021 20:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351917AbhERUvI convert rfc822-to-8bit (ORCPT ); Tue, 18 May 2021 16:51:08 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:43288 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238356AbhERUvG (ORCPT ); Tue, 18 May 2021 16:51:06 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-154-NzcuNrSXNs2GIOJ9Fn180Q-1; Tue, 18 May 2021 21:49:35 +0100 X-MC-Unique: NzcuNrSXNs2GIOJ9Fn180Q-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 May 2021 21:49:34 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Tue, 18 May 2021 21:49:34 +0100 From: David Laight 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" Subject: RE: [PATCH v3 2/4] mm: simplify compat_sys_move_pages Thread-Topic: [PATCH v3 2/4] mm: simplify compat_sys_move_pages Thread-Index: AQHXS1wYCu76VfkYCU+t8Sv5x7/YH6rpt7nQ 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> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C536BC433B4 for ; Tue, 18 May 2021 20:51:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91677611BD for ; Tue, 18 May 2021 20:51:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91677611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KFBJksHZrTrFjD5o10UsHd4gD5CbCvx7gKrf+PhLIR0=; b=b7BQ6u48E9UFUClZMdQol41dH /4MPtv4VVwIEgvLqr+SnYMIHhC26bUkElQHp9Ki9wjvYjUHNtq+11rZZ8LN6g6nabO/nzME+I/Dco 1k39Zmw2eeZ1+KMPVIdlzRhFA00FVF/TOXZolVke0qiXWvBwTkThhrDfvdU8sf+IbhjFrQXO6fpGO MKXP4YpdKEO7FHKQ0VAo2x0sXnyXay4p4Qc4Ie7nJ1FQu7peUaylhgHvPwED+7+fCQcYHW5xM+0jw 8pnsSg89dmrVSgdEA318fDK3CwGCBoncME/NF5YvYNqskgHvN0q+DN9hzHhAX1UgkcTIjW55B/P7V ey4r+cNjg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lj6f0-001rmB-Q4; Tue, 18 May 2021 20:49:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lj6ev-001rl4-M9 for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 20:49:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:In-Reply-To:References:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=nD+fitCq5BYy7U5SIuZQ06EDli/HsR1/RaNBCoCKi3U=; b=wwLLeFtY5wDypAbOHI0lRhwZFw YG6t3UKlnTXbcimOE9QmsWqbp5YaSrhHgwVvuTvbJuptlvH9zyaw6FshwznVACoyrcwkp55Qx7Xa7 SSoUAFKN/ujz4PfPZjkijYuDv7hq2hLT9+CrreBYvONQO/ugRXeP/St7paEHPljWMKjQcfLWn+370 xprnTjkuRWAMHqKH4JxDV1ThF5P7F7tHSHNEK443GtCVNVDNG+nIXRYdKqhoLMAq7mbAK3RX4V5CI X/AeZolnzuee+7cYrlRRDo5QwBHy6Mld930IJY+0MPGqDn4isdqx45Lls9kDyzHnUJVIqK4rX6LBT h+y4wGEA==; 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-00ExbK-L2 for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 20:49:44 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-154-NzcuNrSXNs2GIOJ9Fn180Q-1; Tue, 18 May 2021 21:49:35 +0100 X-MC-Unique: NzcuNrSXNs2GIOJ9Fn180Q-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 18 May 2021 21:49:34 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.015; Tue, 18 May 2021 21:49:34 +0100 From: David Laight 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" Subject: RE: [PATCH v3 2/4] mm: simplify compat_sys_move_pages Thread-Topic: [PATCH v3 2/4] mm: simplify compat_sys_move_pages Thread-Index: AQHXS1wYCu76VfkYCU+t8Sv5x7/YH6rpt7nQ 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> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_134940_003406_4561256A X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@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) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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