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