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=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 6726FC4320E for ; Tue, 27 Jul 2021 17:40:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EBDA60F91 for ; Tue, 27 Jul 2021 17:40:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbhG0Rkf (ORCPT ); Tue, 27 Jul 2021 13:40:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbhG0Rkf (ORCPT ); Tue, 27 Jul 2021 13:40:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6F4C60FD8; Tue, 27 Jul 2021 17:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627407634; bh=PrLaVhJtnv8oDcD5hqybwz9YD9godDZatvRa/JhR9M0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=riMxmf/dvTU1hsiSKcoJ+WSIQNPHXeV+hqeXTH2OUTRPYzLKb9j4cnM1BcbEXRnuE jN2rxmHRCaJTDsHvxWPWBBOVAKmNoE94I3BOILUILCqWTChKj0mp3PjVawv1wkhHf/ tTs5v16S61BPAvtwC/lVATzCerShaYn9n/W7G0vnRtOrOxVtkEoczgL1i8oAKAA28u 372rOdIIWyiFU+DgtS1Avpu5Zv2si7xK4ueSbRYcbooZbBakZA0sKOT5PgJGqdh+Qf AaT1Mk6zQfipgEzaEXKqjuHs32RYGm4woOKqrmStF/NVBUGNazEM0LaB0Wz4HcLM3d +HbR57EMZ1Iqg== Received: by mail-wr1-f49.google.com with SMTP id c16so6292586wrp.13; Tue, 27 Jul 2021 10:40:34 -0700 (PDT) X-Gm-Message-State: AOAM530EYyiFjLb5Mwkk/dBfZ2g36HGylI7keaFk+yTSokVvfMOhPaJS Jl88YiDW6hCN9SGG7DZSFe8tnhCjeVFqf4SuqxA= X-Google-Smtp-Source: ABdhPJwS3rT+yAdjePDzQkl1JqnECPTPxX9jMsyrg697T6BrM+4lIuGtTERdp1j5XGkArSly5ovA2pWeExL5zNS/vV0= X-Received: by 2002:adf:f446:: with SMTP id f6mr13242430wrp.361.1627407622867; Tue, 27 Jul 2021 10:40:22 -0700 (PDT) MIME-Version: 1.0 References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 27 Jul 2021 19:40:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls To: Heiko Carstens 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > > --- > > include/linux/compat.h | 17 ++-- > > mm/mempolicy.c | 175 +++++++++++++---------------------------- > > 2 files changed, 63 insertions(+), 129 deletions(-) > ... > > +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. Arnd 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=-11.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 CAF1AC4338F for ; Tue, 27 Jul 2021 17:40:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 66FAF60F91 for ; Tue, 27 Jul 2021 17:40:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66FAF60F91 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 062556B0036; Tue, 27 Jul 2021 13:40:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 012C18D0001; Tue, 27 Jul 2021 13:40:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E43116B006C; Tue, 27 Jul 2021 13:40:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0129.hostedemail.com [216.40.44.129]) by kanga.kvack.org (Postfix) with ESMTP id C77806B0036 for ; Tue, 27 Jul 2021 13:40:38 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 69155184A8 for ; Tue, 27 Jul 2021 17:40:38 +0000 (UTC) X-FDA: 78409082556.16.B6580C0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf03.hostedemail.com (Postfix) with ESMTP id C017C300A2CD for ; Tue, 27 Jul 2021 17:40:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 546E860F8F for ; Tue, 27 Jul 2021 17:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627407635; bh=PrLaVhJtnv8oDcD5hqybwz9YD9godDZatvRa/JhR9M0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IXy7dy/E6HvlzyRFJzUFggLgVaHAvF9F7JL2rJM5VeRZOMZdg/HxMtLK5pYciS9Ot CRJjiKFBHYy+qOHmBpmK9ybk1PCp987bNID/VVLMECfL8FQmO2v0h9OhJkkAlAjN6G wPLOK/PK5sD90XP9UMVhR9xaAyglmJe73UxiqWo+AUdFveMkdG4lXMlVtNb2KrA+jy LRhX7wo1K5E0RfxzNuSj2IT5uL3xfWnZnQC6fn0bWN2O6Bf0erf9oXDHVDAOYAYFuC GlTTrJw4eX17JIH5B+hSg99c/W/SJZdqYF2l1guDZo1JcZODNQ8IJQluR8ADj/C452 iRJE3wKX38H3A== Received: by mail-lf1-f51.google.com with SMTP id h2so23137001lfu.4 for ; Tue, 27 Jul 2021 10:40:35 -0700 (PDT) X-Gm-Message-State: AOAM532zYoQwqE3szvM+og3peKNlREmnLHSG1da5XmCRZRsld2Maitv0 5d7FKrtFY9G4a7nn6CLSvaP6hVMWHC63A0IKFS8= X-Google-Smtp-Source: ABdhPJwS3rT+yAdjePDzQkl1JqnECPTPxX9jMsyrg697T6BrM+4lIuGtTERdp1j5XGkArSly5ovA2pWeExL5zNS/vV0= X-Received: by 2002:adf:f446:: with SMTP id f6mr13242430wrp.361.1627407622867; Tue, 27 Jul 2021 10:40:22 -0700 (PDT) MIME-Version: 1.0 References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 27 Jul 2021 19:40:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls To: Heiko Carstens 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 Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C017C300A2CD Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="IXy7dy/E"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of arnd@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=arnd@kernel.org X-Stat-Signature: ekorrg758dhzf9hytym9pjxdz38icfqd X-HE-Tag: 1627407637-217778 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jul 27, 2021 at 7:27 PM Heiko Carstens wrote: > > On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > > --- > > include/linux/compat.h | 17 ++-- > > mm/mempolicy.c | 175 +++++++++++++---------------------------- > > 2 files changed, 63 insertions(+), 129 deletions(-) > ... > > +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. Arnd 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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 62338C4338F for ; Tue, 27 Jul 2021 17:41:08 +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 89CD360F57 for ; Tue, 27 Jul 2021 17:41:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 89CD360F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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 4GZ3xG187hz3cjX for ; Wed, 28 Jul 2021 03:41:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=IXy7dy/E; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=arnd@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=IXy7dy/E; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 4GZ3wk3gK7z2y6C for ; Wed, 28 Jul 2021 03:40:38 +1000 (AEST) Received: by mail.kernel.org (Postfix) with ESMTPSA id 34E9560FC2 for ; Tue, 27 Jul 2021 17:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627407635; bh=PrLaVhJtnv8oDcD5hqybwz9YD9godDZatvRa/JhR9M0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IXy7dy/E6HvlzyRFJzUFggLgVaHAvF9F7JL2rJM5VeRZOMZdg/HxMtLK5pYciS9Ot CRJjiKFBHYy+qOHmBpmK9ybk1PCp987bNID/VVLMECfL8FQmO2v0h9OhJkkAlAjN6G wPLOK/PK5sD90XP9UMVhR9xaAyglmJe73UxiqWo+AUdFveMkdG4lXMlVtNb2KrA+jy LRhX7wo1K5E0RfxzNuSj2IT5uL3xfWnZnQC6fn0bWN2O6Bf0erf9oXDHVDAOYAYFuC GlTTrJw4eX17JIH5B+hSg99c/W/SJZdqYF2l1guDZo1JcZODNQ8IJQluR8ADj/C452 iRJE3wKX38H3A== Received: by mail-ed1-f54.google.com with SMTP id l6so14489770edc.5 for ; Tue, 27 Jul 2021 10:40:35 -0700 (PDT) X-Gm-Message-State: AOAM533IFL5pUEtpCGaceT9YwDu402xmybe+JiGCFM+KSH90NvYLAycc xJK92Yf5mw2dUhYR8IHu8F7Dh4iiiYvDPsUz3Ew= X-Google-Smtp-Source: ABdhPJwS3rT+yAdjePDzQkl1JqnECPTPxX9jMsyrg697T6BrM+4lIuGtTERdp1j5XGkArSly5ovA2pWeExL5zNS/vV0= X-Received: by 2002:adf:f446:: with SMTP id f6mr13242430wrp.361.1627407622867; Tue, 27 Jul 2021 10:40:22 -0700 (PDT) MIME-Version: 1.0 References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 27 Jul 2021 19:40:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls To: Heiko Carstens Content-Type: text/plain; charset="UTF-8" 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 7:27 PM Heiko Carstens wrote: > > On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > > --- > > include/linux/compat.h | 17 ++-- > > mm/mempolicy.c | 175 +++++++++++++---------------------------- > > 2 files changed, 63 insertions(+), 129 deletions(-) > ... > > +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. Arnd 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=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 BE93EC4338F for ; Tue, 27 Jul 2021 17:42:42 +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 8199C600CD for ; Tue, 27 Jul 2021 17:42:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8199C600CD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6nG3Djsq8jwvoVQYoBVIuHoNFsqg9Qy+9Aam5lU+aYk=; b=PV0qpnxndoq3VC yd6XRD0d7kzRgNkgTS5e06MJEYEcX15uCM9F2LgX2qgBQCVnPor4aW6rJrklivNQv5H0XA0nsDItc lg5cJnFriNHb8dqlliAzDQX4NarU1oulMt/Joz292kiwoIKNHkLpfNVSn0hZBN8Ix8A+8fP31LFIS ALZLcpbnR8riLH7/43AUp4z465yjRSPQxQN6aAi46KpG4HyT/u7SRLECO8T2DB6HKkFIu57pTTiO/ rV+I/PWy4iPd1bcT8/XpMCLs+VLDo2EIkL/l2wzUD/08t7mELI2vh5u/CBRI8hUTde8nc8oF9oHlk fO/WTBbpLO0NI5aYmYyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8R4J-00FagI-6t; Tue, 27 Jul 2021 17:40:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m8R4E-00Fafb-Tb for linux-arm-kernel@lists.infradead.org; Tue, 27 Jul 2021 17:40:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D09560F91 for ; Tue, 27 Jul 2021 17:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627407634; bh=PrLaVhJtnv8oDcD5hqybwz9YD9godDZatvRa/JhR9M0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=riMxmf/dvTU1hsiSKcoJ+WSIQNPHXeV+hqeXTH2OUTRPYzLKb9j4cnM1BcbEXRnuE jN2rxmHRCaJTDsHvxWPWBBOVAKmNoE94I3BOILUILCqWTChKj0mp3PjVawv1wkhHf/ tTs5v16S61BPAvtwC/lVATzCerShaYn9n/W7G0vnRtOrOxVtkEoczgL1i8oAKAA28u 372rOdIIWyiFU+DgtS1Avpu5Zv2si7xK4ueSbRYcbooZbBakZA0sKOT5PgJGqdh+Qf AaT1Mk6zQfipgEzaEXKqjuHs32RYGm4woOKqrmStF/NVBUGNazEM0LaB0Wz4HcLM3d +HbR57EMZ1Iqg== Received: by mail-lf1-f43.google.com with SMTP id h2so23136921lfu.4 for ; Tue, 27 Jul 2021 10:40:34 -0700 (PDT) X-Gm-Message-State: AOAM533Iw0Y6MiQhT4k7HvqN34c6ROQ/+5FNLsW5B5HBTthyYBfG8tid 2oEtkf3FHFQDUZ+5yQcL/WCh10ysU9q8G3kSOrg= X-Google-Smtp-Source: ABdhPJwS3rT+yAdjePDzQkl1JqnECPTPxX9jMsyrg697T6BrM+4lIuGtTERdp1j5XGkArSly5ovA2pWeExL5zNS/vV0= X-Received: by 2002:adf:f446:: with SMTP id f6mr13242430wrp.361.1627407622867; Tue, 27 Jul 2021 10:40:22 -0700 (PDT) MIME-Version: 1.0 References: <20210727144859.4150043-1-arnd@kernel.org> <20210727144859.4150043-5-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 27 Jul 2021 19:40:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 4/6] mm: simplify compat numa syscalls To: Heiko Carstens 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210727_104035_014944_B97D1AF4 X-CRM114-Status: GOOD ( 18.70 ) 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 7:27 PM Heiko Carstens wrote: > > On Tue, Jul 27, 2021 at 04:48:57PM +0200, Arnd Bergmann wrote: > > --- > > include/linux/compat.h | 17 ++-- > > mm/mempolicy.c | 175 +++++++++++++---------------------------- > > 2 files changed, 63 insertions(+), 129 deletions(-) > ... > > +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. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel