From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by sourceware.org (Postfix) with ESMTPS id 9FA0C3857032 for ; Mon, 10 Aug 2020 15:25:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FA0C3857032 Received: by mail-il1-x141.google.com with SMTP id j9so7861001ilc.11 for ; Mon, 10 Aug 2020 08:25:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=09mpyAj5M3blpHeSLKLzTw5vpE/MK3hGJA0Ms35imco=; b=mM5GC/BqSqf1WDpceWbFX0vx1VbeWJsPidzD6V7/lijPNPV0SgqkeYlYZyNaOzxJir e4FUWJeAApM+ck7eBJ6Wez00x2piAkau66GpjuoFZQqcTNGRNOokRX+wKOp6zSFVZGwR lCFtz25A6H1CF8OdPETBQhzOzVkOdv6TBUveXxG+iLn/JGGS7YWCH2qlYtpigKretiho uqy14mGZbCudvNbB09vJCjk3KkKt8d00t7gNTmwymTJbhjMzC42V6eG3ipzGmW548ONF CdRucNZ3hn3FZy9sd6fk/lfkWOdHmvO5Bly4dszH96gaWUUacPQCVXGUwT5IqLoM5Ilc yrqg== X-Gm-Message-State: AOAM531v6iEhjppmn1nYBevC7jfiBdaO4ofuUxEx0bRvt4srgznFVlCp pFIJbJNL5PnHFSwXNSdhw9YOqDN7L628eFggWCHpF6Rx X-Google-Smtp-Source: ABdhPJxEW+0yOMe+/fbuvJ2jFjvYYpCIuh702eUDVhRHOMft7tMxbxGoyLvluPFow1f6DprOhSGLL29VL0tDjw8dk2A= X-Received: by 2002:a05:6e02:ef3:: with SMTP id j19mr7083502ilk.227.1597073151131; Mon, 10 Aug 2020 08:25:51 -0700 (PDT) MIME-Version: 1.0 References: <8c6518f04fc70bebac9b00a171c691feca0d2628.1594568655.git.alistair.francis@wdc.com> In-Reply-To: From: Alistair Francis Date: Mon, 10 Aug 2020 08:15:28 -0700 Message-ID: Subject: Re: [PATCH v3 03/19] RISC-V: Use 64-bit-time syscall numbers with the 32-bit port To: "Maciej W. Rozycki" Cc: Alistair Francis , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 15:25:53 -0000 On Wed, Jul 15, 2020 at 6:58 PM Maciej W. Rozycki via Libc-alpha wrote: > > On Sun, 12 Jul 2020, Alistair Francis via Libc-alpha wrote: > > > This patches adds any required syscall suppression for 32-bit > > off_t/time_t to fixup-asm-unistd.h so arch-syscall.h will have only > > the required definitions. > > This part is not needed; see below. Removed. > > > sysdep.h redefines only the syscall where the generic implementation > > still does not have actual 64-bit time_t support: > > > > /* "workarounds" for generic code needing to handle 64-bit time_t. */ > > I'm not sure why the ARC port developers chose to not to capitalise the > sentence and use quotation marks here. It's not like "workarounds" here > is a metaphor, a quotation, or a keyword (which, oddly, people often don't > wrap into quotation marks for a change). Please use: > > /* Workarounds for generic code needing to handle 64-bit time_t. */ > > then. Likewise with the inline comment below. Fixed in both places. > > > diff --git a/sysdeps/unix/sysv/linux/riscv/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/riscv/fixup-asm-unistd.h > > new file mode 100644 > > index 0000000000..bc8b10e283 > > --- /dev/null > > +++ b/sysdeps/unix/sysv/linux/riscv/fixup-asm-unistd.h > > @@ -0,0 +1,45 @@ > > +/* Regularize definitions. RISC-V version. > > + Copyright (C) 2020 Free Software Foundation, Inc. > > + > > + The GNU C Library is free software; you can redistribute it and/or > > + modify it under the terms of the GNU Lesser General Public > > + License as published by the Free Software Foundation; either > > + version 2.1 of the License, or (at your option) any later version. > > + > > + The GNU C Library is distributed in the hope that it will be useful, > > + but WITHOUT ANY WARRANTY; without even the implied warranty of > > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > > + Lesser General Public License for more details. > > + > > + You should have received a copy of the GNU Lesser General Public > > + License along with the GNU C Library; if not, see > > + . */ > > + > > +/* Adjustments to RISC-V asm-generic syscall for 64-bit time_t support. */ > > + > > +/* fstat64 and fstatat64 need to be replaced with statx. */ > > + > > +#undef __NR_fstat64 > > +#undef __NR_fstatat64 > > + > > +/* Replace all other 32-bit time syscalls with 64-bit variants. */ > > + > > +# undef __NR_clock_adjtime > > +# undef __NR_clock_getres > > +# undef __NR_clock_gettime > > +# undef __NR_clock_nanosleep > > +# undef __NR_clock_settime > > +# undef __NR_futex > > +# undef __NR_mq_timedreceive > > +# undef __NR_mq_timedsend > > +# undef __NR_ppoll > > +# undef __NR_pselect6 > > +# undef __NR_recvmmsg > > +# undef __NR_rt_sigtimedwait > > +# undef __NR_sched_rr_get_interval > > +# undef __NR_semtimedop > > +# undef __NR_timer_gettime > > +# undef __NR_timer_settime > > +# undef __NR_timerfd_gettime > > +# undef __NR_timerfd_settime > > +# undef __NR_utimensat > > None of these #undef's are required, as none of these syscalls (macros) > are actually defined in the first place by Linux for RV32. Removed. > > > diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h > > index 429686cebe..62a9551f50 100644 > > --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h > > +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h > > @@ -22,6 +22,33 @@ > > #include > > #include > > > > +#if __WORDSIZE == 32 > > + > > + > > Extraneous newline. Removed. > > > +/* "workarounds" for generic code needing to handle 64-bit time_t. */ > > + > > +/* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c. */ > > +#define __NR_clock_getres __NR_clock_getres_time64 > > +/* Fix sysdeps/nptl/lowlevellock-futex.h. */ > > +#define __NR_futex __NR_futex_time64 > > +/* Fix sysdeps/unix/sysv/linux/pause.c. */ > > +#define __NR_ppoll __NR_ppoll_time64 > > +/* Fix sysdeps/unix/sysv/linux/select.c. */ > > +#define __NR_pselect6 __NR_pselect6_time64 > > +/* Fix sysdeps/unix/sysv/linux/recvmmsg.c. */ > > +#define __NR_recvmmsg __NR_recvmmsg_time64 > > +/* Fix sysdeps/unix/sysv/linux/sigtimedwait.c. */ > > +#define __NR_rt_sigtimedwait __NR_rt_sigtimedwait_time64 > > +/* Fix sysdeps/unix/sysv/linux/semtimedop.c. */ > > +#define __NR_semtimedop __NR_semtimedop_time64 > > +/* Hack sysdeps/unix/sysv/linux/generic/utimes.c. */ > > +#define __NR_utimensat __NR_utimensat_time64 > > Please use tabs rather than spaces between the LHS and the RHS, and align > the RHS. NB `indent -gnu' can help with such boring mechanical stuff. Fixed. > > > + > > +#undef SYS_ify > > +#define SYS_ify(syscall_name) __NR_##syscall_name > > This has to go along with 02/19, as noted in the review of that change. Done. Alistair > > Maciej