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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 6D09BC4320E for ; Tue, 27 Jul 2021 18:40:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A1C960F9E for ; Tue, 27 Jul 2021 18:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230323AbhG0SkB (ORCPT ); Tue, 27 Jul 2021 14:40:01 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55300 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229716AbhG0SkA (ORCPT ); Tue, 27 Jul 2021 14:40:00 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RIZYit159213; Tue, 27 Jul 2021 14:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=d/4BumVgvtK9RROG6z6FdhebdQ556A1xMyoo6DS29A4=; b=qqRRky/Cn5ZAYNzCDbLY75T2dY8OMMmza3EjtMUJDrhtbK99HbLpEyNO85p/tMReOjiA JvjAJ0171Pn6gJu5IKQsdbMEK48JbBAiBV4V5J4m9KQ9v091n8FS+AQ8OM4IkxWllFCe eROK+fPGXUREt2/TfA4ni0Om93DJqlJE0GQQZk3S1zQRtCU+lt/4K3Qu+6w4/B54JmrW +DUqDS8eP/83foES8MsF69TR5Yhr/KYSoYSItPHV6iBN8aWERKV3fsDf8rgZlxRQoQz6 aqU6se/OCi3jmtZ7ThHrsoc7ujZ9cX/DFwdaK0xWaqwipzZvcWEPgVlBLwgVm2D89WZb 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg98w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:41 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16RIZc3Y159614; Tue, 27 Jul 2021 14:38:40 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg95h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:39 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16RIcbXt000976; Tue, 27 Jul 2021 18:38:37 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 3a235m0ke5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 18:38:37 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16RIcX3P22282602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jul 2021 18:38:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D88A54C044; Tue, 27 Jul 2021 18:38:33 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A84184C040; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Received: from osiris (unknown [9.145.19.157]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Date: Tue, 27 Jul 2021 20:38:31 +0200 From: Heiko Carstens To: Arnd Bergmann Cc: Andrew Morton , Arnd Bergmann , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Vasily Gorbik , Christian Borntraeger , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Al Viro , "Eric W. Biederman" , Christoph Hellwig , Feng Tang , Linux ARM , Linux Kernel Mailing List , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-arch , Linux API , Linux-MM , Christoph Hellwig Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls Message-ID: References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Kwccqqwc5VX735JqhRPAybSOZZQrYCVP X-Proofpoint-ORIG-GUID: YtLX8HDtFqe7pp2VkhD_wrYR0Q9OXJxP X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-27_13:2021-07-27,2021-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 priorityscore=1501 mlxlogscore=955 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270109 Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Tue, Jul 27, 2021 at 07:40:05PM +0200, Arnd Bergmann wrote: > On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > > +static int get_bitmap(unsigned long *mask, const unsigned long __user *nmask, > > > + unsigned long maxnode) > > > +{ > > > + unsigned long nlongs = BITS_TO_LONGS(maxnode); > > > + int ret; > > > + > > > + if (in_compat_syscall()) > > > + ret = compat_get_bitmap(mask, > > > + (const compat_ulong_t __user *)nmask, > > > + maxnode); > > > > compat_ptr() conversion for e.g. nmask is missing with the next patch > > which removes the compat system calls. > > Is that intended or am I missing something? > > I don't think it's needed here, since the pointer comes from the system > call argument, which has the compat_ptr() conversion applied in > arch/s390/include/asm/syscall_wrapper.h, not from a compat_uptr_t > that gets passed indirectly. The compat_get_bitmap() conversion > is only needed for byte order adjustment, not for converting pointers. > > It's also possible that I'm the one who's missing something. What I was trying to say: this patch on its own is ok. However with the next patch you remove the compat system calls and map the regular system calls instead. That is: -COMPAT_SYSCALL_DEFINE6(mbind, compat_ulong_t, start, compat_ulong_t, len, - compat_ulong_t, mode, compat_ulong_t __user *, nmask, - compat_ulong_t, maxnode, compat_ulong_t, flags) -{ - return kernel_mbind(start, len, mode, (unsigned long __user *)nmask, - maxnode, flags); -} and this: -268 common mbind sys_mbind compat_sys_mbind -269 common get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy -270 common set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy +268 common mbind sys_mbind sys_mbind +269 common get_mempolicy sys_get_mempolicy sys_get_mempolicy +270 common set_mempolicy sys_set_mempolicy sys_set_mempolicy would remove compat_ptr() conversion from nmask above if I'm not mistaken. 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=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 C6CDCC4338F for ; Tue, 27 Jul 2021 18:40:16 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 F070860F9E for ; Tue, 27 Jul 2021 18:40:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F070860F9E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GZ5FT72rsz3bjN for ; Wed, 28 Jul 2021 04:40:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=qqRRky/C; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=hca@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=qqRRky/C; dkim-atps=neutral Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GZ5Dt4F51z307v for ; Wed, 28 Jul 2021 04:39:41 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RIZYit159213; Tue, 27 Jul 2021 14:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=d/4BumVgvtK9RROG6z6FdhebdQ556A1xMyoo6DS29A4=; b=qqRRky/Cn5ZAYNzCDbLY75T2dY8OMMmza3EjtMUJDrhtbK99HbLpEyNO85p/tMReOjiA JvjAJ0171Pn6gJu5IKQsdbMEK48JbBAiBV4V5J4m9KQ9v091n8FS+AQ8OM4IkxWllFCe eROK+fPGXUREt2/TfA4ni0Om93DJqlJE0GQQZk3S1zQRtCU+lt/4K3Qu+6w4/B54JmrW +DUqDS8eP/83foES8MsF69TR5Yhr/KYSoYSItPHV6iBN8aWERKV3fsDf8rgZlxRQoQz6 aqU6se/OCi3jmtZ7ThHrsoc7ujZ9cX/DFwdaK0xWaqwipzZvcWEPgVlBLwgVm2D89WZb 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg98w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:41 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16RIZc3Y159614; Tue, 27 Jul 2021 14:38:40 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg95h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:39 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16RIcbXt000976; Tue, 27 Jul 2021 18:38:37 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 3a235m0ke5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 18:38:37 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16RIcX3P22282602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jul 2021 18:38:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D88A54C044; Tue, 27 Jul 2021 18:38:33 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A84184C040; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Received: from osiris (unknown [9.145.19.157]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Date: Tue, 27 Jul 2021 20:38:31 +0200 From: Heiko Carstens To: Arnd Bergmann Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls Message-ID: References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Kwccqqwc5VX735JqhRPAybSOZZQrYCVP X-Proofpoint-ORIG-GUID: YtLX8HDtFqe7pp2VkhD_wrYR0Q9OXJxP X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-27_13:2021-07-27, 2021-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 priorityscore=1501 mlxlogscore=955 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270109 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Feng Tang , "open list:BROADCOM NVRAM DRIVER" , "James E.J. Bottomley" , Linux-MM , Paul Mackerras , "H. Peter Anvin" , sparclinux , Will Deacon , Christoph Hellwig , linux-arch , linux-s390 , Arnd Bergmann , Helge Deller , the arch/x86 maintainers , Christoph Hellwig , Christian Borntraeger , Ingo Molnar , Catalin Marinas , Vasily Gorbik , Borislav Petkov , Al Viro , Thomas Gleixner , Linux ARM , Thomas Bogendoerfer , Parisc List , Linux API , Linux Kernel Mailing List , "Eric W. Biederman" , Andrew Morton , linuxppc-dev , "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Jul 27, 2021 at 07:40:05PM +0200, Arnd Bergmann wrote: > On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > > +static int get_bitmap(unsigned long *mask, const unsigned long __user *nmask, > > > + unsigned long maxnode) > > > +{ > > > + unsigned long nlongs = BITS_TO_LONGS(maxnode); > > > + int ret; > > > + > > > + if (in_compat_syscall()) > > > + ret = compat_get_bitmap(mask, > > > + (const compat_ulong_t __user *)nmask, > > > + maxnode); > > > > compat_ptr() conversion for e.g. nmask is missing with the next patch > > which removes the compat system calls. > > Is that intended or am I missing something? > > I don't think it's needed here, since the pointer comes from the system > call argument, which has the compat_ptr() conversion applied in > arch/s390/include/asm/syscall_wrapper.h, not from a compat_uptr_t > that gets passed indirectly. The compat_get_bitmap() conversion > is only needed for byte order adjustment, not for converting pointers. > > It's also possible that I'm the one who's missing something. What I was trying to say: this patch on its own is ok. However with the next patch you remove the compat system calls and map the regular system calls instead. That is: -COMPAT_SYSCALL_DEFINE6(mbind, compat_ulong_t, start, compat_ulong_t, len, - compat_ulong_t, mode, compat_ulong_t __user *, nmask, - compat_ulong_t, maxnode, compat_ulong_t, flags) -{ - return kernel_mbind(start, len, mode, (unsigned long __user *)nmask, - maxnode, flags); -} and this: -268 common mbind sys_mbind compat_sys_mbind -269 common get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy -270 common set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy +268 common mbind sys_mbind sys_mbind +269 common get_mempolicy sys_get_mempolicy sys_get_mempolicy +270 common set_mempolicy sys_set_mempolicy sys_set_mempolicy would remove compat_ptr() conversion from nmask above if I'm not mistaken. 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=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 7C138C4338F for ; Tue, 27 Jul 2021 18:51:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3D50360FC0 for ; Tue, 27 Jul 2021 18:51:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D50360FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XN4DQVmTA6fIv+f78dTa2k1bVIa5rB1CvmMLEfz+CxI=; b=Xme8GhD5Lob5d1 /T9TSCMQTEYb88Uh22LMjHJxwtDN4HsuOuWt4h501KpKQLqnANEltweezfDdzzhPuj6K9QgokIruV FqCji91Y7BdT6qR1bQjKLQBiOOduIzoPOVHcUlOaC4MKrDbPg7gAfBESuEJ0V87fGVrgxOuxOhO3t KVpkjnJu/FAnvscjthUsVxeLLd6wl+CRsijuslEjSrWaUFw9N5Ui2TU/MNzqteQQJckruinTpPzfM RT2IA0HumJFNW8bvYBUR6aAOPyCDmiTa/ANpzJ0C+LMOorD2JyuDdR0hPRqDao6TJ5eBGCEQ+QOfC UKaDJf3c0mLdrDG9eCwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8S8V-00G0b5-38; Tue, 27 Jul 2021 18:49:04 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8RzN-00FwpS-Cu for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 18:39:39 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16RIZYit159213; Tue, 27 Jul 2021 14:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=d/4BumVgvtK9RROG6z6FdhebdQ556A1xMyoo6DS29A4=; b=qqRRky/Cn5ZAYNzCDbLY75T2dY8OMMmza3EjtMUJDrhtbK99HbLpEyNO85p/tMReOjiA JvjAJ0171Pn6gJu5IKQsdbMEK48JbBAiBV4V5J4m9KQ9v091n8FS+AQ8OM4IkxWllFCe eROK+fPGXUREt2/TfA4ni0Om93DJqlJE0GQQZk3S1zQRtCU+lt/4K3Qu+6w4/B54JmrW +DUqDS8eP/83foES8MsF69TR5Yhr/KYSoYSItPHV6iBN8aWERKV3fsDf8rgZlxRQoQz6 aqU6se/OCi3jmtZ7ThHrsoc7ujZ9cX/DFwdaK0xWaqwipzZvcWEPgVlBLwgVm2D89WZb 5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg98w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:41 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16RIZc3Y159614; Tue, 27 Jul 2021 14:38:40 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 3a2qgfg95h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 14:38:39 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16RIcbXt000976; Tue, 27 Jul 2021 18:38:37 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 3a235m0ke5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jul 2021 18:38:37 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16RIcX3P22282602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jul 2021 18:38:34 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D88A54C044; Tue, 27 Jul 2021 18:38:33 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A84184C040; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Received: from osiris (unknown [9.145.19.157]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 27 Jul 2021 18:38:32 +0000 (GMT) Date: Tue, 27 Jul 2021 20:38:31 +0200 From: Heiko Carstens To: Arnd Bergmann Cc: Andrew Morton , Arnd Bergmann , Catalin Marinas , Will Deacon , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Vasily Gorbik , Christian Borntraeger , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Al Viro , "Eric W. Biederman" , Christoph Hellwig , Feng Tang , Linux ARM , Linux Kernel Mailing List , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-arch , Linux API , Linux-MM , Christoph Hellwig Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls Message-ID: References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Kwccqqwc5VX735JqhRPAybSOZZQrYCVP X-Proofpoint-ORIG-GUID: YtLX8HDtFqe7pp2VkhD_wrYR0Q9OXJxP X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-27_13:2021-07-27, 2021-07-27 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 suspectscore=0 clxscore=1015 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 priorityscore=1501 mlxlogscore=955 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2107270109 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_113937_606367_D9C8A8E9 X-CRM114-Status: GOOD ( 29.11 ) 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 On Tue, Jul 27, 2021 at 07:40:05PM +0200, Arnd Bergmann wrote: > On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > > +static int get_bitmap(unsigned long *mask, const unsigned long __user *nmask, > > > + unsigned long maxnode) > > > +{ > > > + unsigned long nlongs = BITS_TO_LONGS(maxnode); > > > + int ret; > > > + > > > + if (in_compat_syscall()) > > > + ret = compat_get_bitmap(mask, > > > + (const compat_ulong_t __user *)nmask, > > > + maxnode); > > > > compat_ptr() conversion for e.g. nmask is missing with the next patch > > which removes the compat system calls. > > Is that intended or am I missing something? > > I don't think it's needed here, since the pointer comes from the system > call argument, which has the compat_ptr() conversion applied in > arch/s390/include/asm/syscall_wrapper.h, not from a compat_uptr_t > that gets passed indirectly. The compat_get_bitmap() conversion > is only needed for byte order adjustment, not for converting pointers. > > It's also possible that I'm the one who's missing something. What I was trying to say: this patch on its own is ok. However with the next patch you remove the compat system calls and map the regular system calls instead. That is: -COMPAT_SYSCALL_DEFINE6(mbind, compat_ulong_t, start, compat_ulong_t, len, - compat_ulong_t, mode, compat_ulong_t __user *, nmask, - compat_ulong_t, maxnode, compat_ulong_t, flags) -{ - return kernel_mbind(start, len, mode, (unsigned long __user *)nmask, - maxnode, flags); -} and this: -268 common mbind sys_mbind compat_sys_mbind -269 common get_mempolicy sys_get_mempolicy compat_sys_get_mempolicy -270 common set_mempolicy sys_set_mempolicy compat_sys_set_mempolicy +268 common mbind sys_mbind sys_mbind +269 common get_mempolicy sys_get_mempolicy sys_get_mempolicy +270 common set_mempolicy sys_set_mempolicy sys_set_mempolicy would remove compat_ptr() conversion from nmask above if I'm not mistaken. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel