Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp951288ybf; Fri, 28 Feb 2020 10:47:41 -0800 (PST) X-Google-Smtp-Source: APXvYqwEiimVi5uvSj3EFuLqW4gTLqx448aJ8G6dJySRTqlVwG7tkG/xwCw6AX17V6ttQjOeKRRl X-Received: by 2002:a9d:638f:: with SMTP id w15mr3749173otk.239.1582915661588; Fri, 28 Feb 2020 10:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582915661; cv=none; d=google.com; s=arc-20160816; b=PGrDemmAsFFIliCZ9ULhE/bEPsmWfOWPrJ3+Zd7A3FFoqaxl35e6sKzjaFDt9cygk2 3Fz/R9JYKt3MwWWOlBF/oDsprOnTbffkvQm1LsRkwoO3MTokN3qwf+Y467imE3wN6Mo8 OJ4+dFV/MaxVhr9gHRQyq+q3wF1pJG9vnnizg97aMVdIPD6bWRpY05BLbXOIoKnQ4QeV qJo4LZ2qLBr2kBfI22u8nHsJCgltsGZRqVhsGa1AhgZoXcCIvctKKdR6Ds+ovt/ZYcJ6 GGexNHELBgCQQ5zaEH9v57KIOznWsmmEPBVrcieJD0gQjI3wy6yfJVdYAwOKh0dUUbso 5iOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=US7seyI36TzsHiaip+eL3CB05F/jhIoIRoK2/9lS6Us=; b=gWWimjWYdM3tDGciPXMEqzYpr0hdU2Haqei7oyfhnSfmN1FLT1+GlGuZjCPZm29ynf GoVg/STEzH0fS0lq5pGakmlGeOwzQlSxH00yMjzTWhy1pIdUDd0wupEFL3bE30YOTade +9gDWmBssH/rXxSSuSedwkEY0mayPmwmvOEFSUqyL1Wxfld8eMY4zRRUqvUeUEm5G/SH pK9Qv9rzClliZ0KzrqV4kgEcgp/zmIHJ6r1PIW5afkESVEci5FNCOj67A3XAfxVvuhz1 5B0GZZnc1/NXYsLJTt92R/PEMA/WjYK549kI+nY4ObcVL75AFXajNUfk+qJLyU2ZwafY dQaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b57hkR+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 74si1942011otd.45.2020.02.28.10.47.28; Fri, 28 Feb 2020 10:47:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b57hkR+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726277AbgB1SrJ (ORCPT + 99 others); Fri, 28 Feb 2020 13:47:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:41360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgB1SrJ (ORCPT ); Fri, 28 Feb 2020 13:47:09 -0500 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCC882469F for ; Fri, 28 Feb 2020 18:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582915629; bh=kskxhZvQ39ItP8wb+LeaJo3d5PU60DJHeaW+XT0a0Vw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=b57hkR+y2RHTVdMrS19zE2t13g1EmPGZ+DoDcprpL26Hvg5tGy/Y00tCGUkc+gWZ/ 7IZKUIzl7r9VWDN2qRazoXozaLFXLG5Ehu6D1IEzs3tuTOvit5VJdcMZEjNsxiuGwo PgOPgp2zQ/3/hONG0BiO6qa3wMH6SavNMbzWdjKo= Received: by mail-wr1-f45.google.com with SMTP id l5so4167150wrx.4 for ; Fri, 28 Feb 2020 10:47:08 -0800 (PST) X-Gm-Message-State: APjAAAX3qPsDHuibVlrR7ZKgBltKVd2CezJXmJQU9KTVISWanwMbKELt LGv8ydtQV/H1/6gFJnSgjw3h8b6szg5DJv1edqL1lA== X-Received: by 2002:adf:ea85:: with SMTP id s5mr5927227wrm.75.1582915627219; Fri, 28 Feb 2020 10:47:07 -0800 (PST) MIME-Version: 1.0 References: <20200227132826.195669-1-brgerst@gmail.com> <20200227132826.195669-6-brgerst@gmail.com> In-Reply-To: <20200227132826.195669-6-brgerst@gmail.com> From: Andy Lutomirski Date: Fri, 28 Feb 2020 10:46:55 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 5/8] x86: Move 32-bit compat syscalls to common location To: Brian Gerst Cc: LKML , X86 ML , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , Andy Lutomirski , Dominik Brodowski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 27, 2020 at 5:28 AM Brian Gerst wrote: > > Move the 32-bit wrappers for syscalls that take 64-bit arguments (loff_t) > to a common location so that native 32-bit can use them in preparation for > enabling pt_regs-based syscalls. Can you clarify the purpose? Even having read the series up to this point, I have no idea what this has to do with pt_regs. I think some renaming is in order. Consider: > > -COMPAT_SYSCALL_DEFINE3(x86_ftruncate64, unsigned int, fd, > - unsigned long, offset_low, unsigned long, offset_high) It used to be at least a little bit clear what was going on. There's this compat-only mess that changes arguments for ftruncate64. But now: > +SYSCALL_DEFINE3(x86_ftruncate64, unsigned int, fd, > + unsigned long, offset_low, unsigned long, offset_high) > { > return ksys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low); > } What is this "x86" ftruncate64 thing? Maybe call it ia32_ftructate? Or at least do something to indicate that this is for a specific ABI. > diff --git a/arch/x86/um/sys_call_table_32.c b/arch/x86/um/sys_call_table_32.c > index 9649b5ad2ca2..d5520e92f89d 100644 > --- a/arch/x86/um/sys_call_table_32.c > +++ b/arch/x86/um/sys_call_table_32.c > @@ -26,6 +26,16 @@ > > #define old_mmap sys_old_mmap > > +#define sys_x86_pread sys_pread64 > +#define sys_x86_pwrite sys_pwrite64 > +#define sys_x86_truncate64 sys_truncate64 > +#define sys_x86_ftruncate64 sys_ftruncate64 > +#define sys_x86_readahead sys_readahead > +#define sys_x86_fadvise64 sys_fadvise64 > +#define sys_x86_fadvise64_64 sys_fadvise64_64 > +#define sys_x86_sync_file_range sys_sync_file_range > +#define sys_x86_fallocate sys_fallocate Can this not be killed by changing the table itself instead of adding a bunch of defines?