Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4578631pxv; Tue, 27 Jul 2021 10:41:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjubLa5R2A/7bV2e/J7In+RECr9ZLHq7w8nS/kj3qVAjJjtL8OdLrta9d/sAytcDWPOlfG X-Received: by 2002:a6b:6f11:: with SMTP id k17mr19658133ioc.114.1627407691430; Tue, 27 Jul 2021 10:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627407691; cv=none; d=google.com; s=arc-20160816; b=tTn7mD6EsjGj03PU0RFvyc7PiUlYev/IdJkHZJQTvJ+1Pa+52G4jXxtln+OQgD4yyF II5kPNfp7LlERfA8iQRLFLEhD+l5dl4q9GXrG7kxLkCgoe3PAn4Yt5wZezFl0fc6HUU7 lUcpQYhxtYIiCdWOhLbL4OiBdM9XgUnbDnKjeYqQDuhiTmk1P7PRgRR32KRsCFaD2+EP urQ5j9o9LjwbwU9Elea4f6DQ4OU4ch8Wqq5bEB/Cbx7YtS4yUS62ZR7ixGCpwu0BnAbq VaBu+Wfj9foR6l4MvtK0G1EEtlQmiV+SBS+XBzga2GL0rPeS9NLTFMrKDehWc4Vxgm+D WyqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FKWvmWlrsA2g5ce+NFzDTxVEnRj2tEEK239B8ai9glo=; b=OLHWs0n4FXMefAmD4dX9OJFjiWQGGx5odLczc/VZyrviKrGmMA+0IVWDFIilBlIkbm +jerdYr3wN0ZE3XbOUVuSECSSZh1Cnnfod0qLUWF+QwGN7qqyL/sX24sG45GxUYqWmY6 wlQ0ykU+M/cNGomx4j+n7Xbv4mxU5S6Igu20x0OWwQXgMMliQx3WnMu1+ruBsaHx/ElN YJfxxd6P2fI23cbAQkmydpOw7Y2+SEpPBddyUQyMQpfhlxcaL8cjXkh8RuR3Oqh8japd XCdjVwx4exwqQAFuWNYGZeb/yVFHDWXZFm5nMZJnuL+PNymVVAqgpfLLFthWVnNBgX6z r3pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="riMxmf/d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si4007884ios.10.2021.07.27.10.41.19; Tue, 27 Jul 2021 10:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="riMxmf/d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbhG0Rkf (ORCPT + 99 others); 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-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-kernel@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