Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2511552imu; Tue, 6 Nov 2018 16:20:17 -0800 (PST) X-Google-Smtp-Source: AJdET5dUq8AwY8TBc7/F5qDvQwccdDxcV9aN36L8MQ3f3rKmu05r0XboPyUnXR0lbE/C2ha810Lp X-Received: by 2002:a63:26c1:: with SMTP id m184mr24230792pgm.367.1541550017100; Tue, 06 Nov 2018 16:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541550017; cv=none; d=google.com; s=arc-20160816; b=O2dIU8fmcTyxtno9WX7ULzdgqHV5Jqw9Utq6UQc3U/CvK5Bp5Mi3+SGuYogLR4uq6H IhsoCWTGOB0jati5uEBtJbjdQWSTsdRC9qMl01lvjdRn6V9fzf21bE2MdplteqaiH7Cj MZR3tsn/6pu+ohbmPAVsU96v9FhgpmUFaHjgHCmGn3LfY27v1I0Ms3YtGVjMsT9vZVjr Gua2has9ArY1RF2qMpgwxBoO/KO0eOGH0xcfFTMLa0WEqxG2cBiv7rOWUGrDR7swFNOg sgL5hTOS9JvDD2cfEUf93YF0eko8S/nXjBRvzAdcceLxMMdlb7pFIOMjB0pSGC1JlisL LHnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=hubmrFzQ0plWGuu2K62h+KATnuMFguTUWrWDDvxDlQA=; b=vFeObPfb2d+U+YOK22vsoB69W/CEBAxKvI/5yykpe84afj2K58nHZHJagR20lwlu5l UyOHZse/nAW7CflDgwnbz+Tw7ojNwol28d2E9RYTK1+EaZFY9hC4b5QtiF0HDx+8MAOz rR3fcT/+6PQ4q9ywherxzELp1DPV14J076DgT+wOcPb7u4RF2fCkZJI2d/ao2JSJ3wWx 6ePau9Vqg1+sILYpODMECAGQmPbzQSZltCjm5maAwZ/TBKY0z+BQn0ePQ2zomb3u+9cJ MxcoS71HRYA3+fQO0LRdPpP6FFTFWkNPSJ3V1D84Oas12vniLXJ4CwyYDjC0+Z3Cqe4N 8fYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=TQH6Na6j; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si13957170pgc.237.2018.11.06.16.20.02; Tue, 06 Nov 2018 16:20:17 -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=@sifive.com header.s=google header.b=TQH6Na6j; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731071AbeKGJgC (ORCPT + 99 others); Wed, 7 Nov 2018 04:36:02 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45362 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731002AbeKGJgC (ORCPT ); Wed, 7 Nov 2018 04:36:02 -0500 Received: by mail-pl1-f196.google.com with SMTP id o19-v6so6972288pll.12 for ; Tue, 06 Nov 2018 16:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=hubmrFzQ0plWGuu2K62h+KATnuMFguTUWrWDDvxDlQA=; b=TQH6Na6j0dexD5BQKsAoXyU0XrjFqmJUGL4ucj2LeR4rD3SvMuwSqW2OcgThS5TNiI YElZoSnziQriuTFp3ZW4cPe5Bb5SNcph0V6iV9XfJeXCwFcH1G0b75yYtHveV/pL5jE2 fsb8egP8nn0GxyFeg/O8PLEBjtcnUeb48fcZc6umcD9r08hYC3WJi6m4bmxPAtiDvPX6 bK4rgg2b1Gv6ewHyXwNwh42E3Ud6aRcDhYoq4lF0J4KNfrUa5vjaQ3Rk2uqqUGlTMYVg Q98b0Bps6hhrkzchZJ/s4AdlMzdUzsMpsveymxH52vBxQapo5FAKUQ9TDh/tNe9ADj+a 8DEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=hubmrFzQ0plWGuu2K62h+KATnuMFguTUWrWDDvxDlQA=; b=oxK+pIuZ1uhEE6sp8A8Ud2ztBaqK5Hu25vOa4TmQ7XwjdVdrFuDFu0XCcoVTgCVLUl Teetjnj1tDCk+9XLR1wpUt0nQM5FRap/dKFjnkJUphr6Vse248EEIrjBLjWki2Q3xhng r+7INNAxkTZiZfxqPpqOIoDcQJbAiliRLsQqMA++0Dnm5e06UeNIVoPqGafVCM2N3udQ c2XTos4PdBkHPYJQEl3z90cQ+Y5iLd8s8B5om49+j3+aOVRRE5ME3Bl/5IsFgY5aasLD Lm7c/IZsbZhoSRAjhZS5wCJhRjwSYr/bYyVtkGFhT7CNJkvHC7FFF7APi2C+D37tM+ji Tkiw== X-Gm-Message-State: AGRZ1gIBdThOzA89WHdT8Pfypz3Ah7yIaVHYQ4O2sfVKommF5bv23PF0 5e5xsbsdAyQEDYR6EhQDYKDhfw== X-Received: by 2002:a17:902:162:: with SMTP id 89-v6mr28414420plb.293.1541549293315; Tue, 06 Nov 2018 16:08:13 -0800 (PST) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id a11-v6sm28378058pff.8.2018.11.06.16.08.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 16:08:12 -0800 (PST) Date: Tue, 06 Nov 2018 16:08:12 -0800 (PST) X-Google-Original-Date: Tue, 06 Nov 2018 16:07:51 PST (-0800) Subject: Re: [PATCH] riscv: add asm/unistd.h UAPI header In-Reply-To: CC: david.abdurachmanov@gmail.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, marcin.juszkiewicz@linaro.org, linux@roeck-us.net From: Palmer Dabbelt To: Arnd Bergmann Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 05 Nov 2018 12:56:15 PST (-0800), Arnd Bergmann wrote: > On 11/5/18, David Abdurachmanov wrote: >> Marcin Juszkiewicz reported issues while generating syscall table for riscv >> using 4.20-rc1. The patch refactors our unistd.h files to match some other >> architectures. >> >> - Add asm/unistd.h UAPI header, which has __ARCH_WANT_NEW_STAT >> - Remove asm/syscalls.h UAPI header and merge to asm/unistd.h >> - Adjust kernel asm/unistd.h >> >> So now asm/unistd.h UAPI header should show all syscalls for riscv. >> >> Before this, Makefile simply put `#include ` into >> generated asm/unistd.h UAPI header thus user didn't see: >> >> - __NR_riscv_flush_icache >> - __NR_newfstatat >> - __NR_fstat >> >> which are supported by riscv kernel. >> >> Signed-off-by: David Abdurachmanov >> Cc: Arnd Bergmann >> Cc: Marcin Juszkiewicz >> Cc: Guenter Roeck > > Thanks for addressing this, your patch correctly fixes riscv64, and > I should have noticed the mistake when I originally merged the > broken patch. > > However, looking closer I found another problem with the original > patch that your fix does not address: > > __ARCH_WANT_NEW_STAT should only be set on 64-bit > architectures. > > For a 32-bit architecture, we only want __ARCH_WANT_STAT64 if > any. For 64-bit architectures with compat mode, we still need to > set __ARCH_WANT_STAT64 from the non-uapi file so we get > the syscall implementation. > > If we don't care about the riscv32 ABI changing yet, we can > decide to leave out __ARCH_WANT_STAT64 here, and require > glibc to implement it using statx() like any new architecture. > stat64 is not y2038 safe, and statx replaces it because of that. Thanks for pointing this out. A while ago we decided the rv32 ABI was "slushy": it can change if it has a good reason to. Right now the only planned changes are the y2038 changes, which I consider this a part of. For some reason I thought we'd already done this, but since we haven't then I think it should go in sooner rather than later -- that will help the glibc guys get everything lined up. The target is still the next glibc release (Feb 1st) for a stable RV32I ABI. That's progressing well, with one last blocking issue related to some of our floating-point emulation routines before we can submit the port. This should give us ample time to line up the ABIs correctly so everything works. So I think the correct answer here is to drop __ARCH_WANT_STAT64 from RISC-V. >> Fixes: 67314ec7b025 > > That line should be formatted as > > Fixes: 67314ec7b025 ("RISC-V: Request newstat syscalls") Yep, and I have [pretty] fixes = Fixes: %h (\"%s\") to make that slightly easier for me to remember :).