From patchwork Mon Jul 16 16:10:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 142042 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2604069ljj; Mon, 16 Jul 2018 09:12:03 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1pyF9eT0XxYZfN9+Jq3iAHz5gz5mAGcFkiQjMfkrtIQXPPXgCmztv7ga/zXGTlXDHjW8W X-Received: by 2002:a63:2404:: with SMTP id k4-v6mr15922718pgk.191.1531757523399; Mon, 16 Jul 2018 09:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531757523; cv=none; d=google.com; s=arc-20160816; b=L11l2u8SSsE4ZnMNxtH0ilBZguJ8q13ylDN1oGBTLs1B9Wa7R9WGoDX9+u6fCs0DEp Vg3KJ7sQ0hj8AJRyheOe7DgFKaRALkhFJR9v3tTmcyb2gcWweUkD/8nATIibKOPjQ6nW 1nAJ8SEFMoFw0odVp4ZoZgv6KRJO2urwtt7B+1A9zVx9XZsyOU+IhxLEeEPm61kWb2hJ DQ5Zb9TqWjFM445q9MQIlNJ9jcRrdGvH6yBER4EE55AH1/aUUVdNEzdWU8r87zCuvIiy R6qteB653bbdC/LybVQTvhKtre3rEGDRlnr9lf2XbLqWrQRoGtsO+5giEA9hBLqJIc5V MX/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=CDqe8uQ+zg5OyUP80GatEzJAtc7A7srpwZQRTZj6h44=; b=j/9+U3tjhJBDzdWAYlmhMx0GGxfjaw2Ct9XG+Je+VpDXBXo0LANeC2pUZ8pHfpqp+N 6g6WK3c5WmEDU6Iull/xe99zqqQYsA4WinrOQG2r0MYFcPdbP70vGNwj3/OS+eHhVcoV HgtJ1G5AoQj8at5gDH/0xs7y/BbxVvODVTy6qimNvcioLL9vsZldd1Uq6oPOl7cDIgve NjxL/jOzEnifEvvGqbAZ8vLZrDdFKPCRYjI5k/Z6+M1JvYhNyfys9eai5rZgEedmzACV WomVDC3mYlQ4TgkiyBeMYm3RkG01Cn5tg+Y8vE4zlqSQQUZUgWNCrQfp8cCUQkQJ2/WU uL9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 x18-v6si30410996pfh.84.2018.07.16.09.12.03; Mon, 16 Jul 2018 09:12:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730531AbeGPQkH (ORCPT + 10 others); Mon, 16 Jul 2018 12:40:07 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:54564 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730229AbeGPQkH (ORCPT ); Mon, 16 Jul 2018 12:40:07 -0400 Received: from wuerfel.lan ([46.223.138.35]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lowim-1gHTho0u2u-00eqWw; Mon, 16 Jul 2018 18:11:08 +0200 From: Arnd Bergmann To: tglx@linutronix.de Cc: y2038@lists.linaro.org, hch@infradead.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, libc-alpha@sourceware.org, albert.aribaud@3adev.fr, netdev@vger.kernel.org, viro@zeniv.linux.org.uk, peterz@infradead.org, dvhart@infradead.org, ebiederm@xmission.com, linux@dominikbrodowski.net, Arnd Bergmann Subject: [PATCH v2 03/17] y2038: Remove stat64 family from default syscall set Date: Mon, 16 Jul 2018 18:10:49 +0200 Message-Id: <20180716161103.16239-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20180716161103.16239-1-arnd@arndb.de> References: <20180716161103.16239-1-arnd@arndb.de> X-Provags-ID: V03:K1:pY3F8YnfIK+B2l3m6BYnkWH8KFBj9SXQmwbAyO67HA9gWdBZGce M7wUucvVhu+N/FOykNBYpuzFS8x1ZDj5NbJaJUkZkrGKnOcqA89A4eeFdGoNfPgE33YbjrA lKsVqiSbJr0vSX/wNZgs4QV5/hLhPS9ysNTt2rGielj0pHdHyRYkgakqkhxf3z/HS5iXBwc DAYtiPtXKq6Ao5fvz0rsQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:+3Yg8jS244w=:X4zdws2qkbP8M+mj/SWYXV S5gGYl5ulZrI1GddFyZPHplrYzC0yiI4474UC3B+7zJDsjWh1Y2rvVXrMPaLXMKyvInEW+rF0 NSTAgOZpitwI7N8X1vcZTLG4Md3K8axaGQwp5FazQ+ziHtkQ45qQw4dMDSj9WBmny8fCFVF3o JijJKmuigbMCMX5FUrFqWrDA88p8l26KnwX3jYxJ6EZk9PqJ01CwjmAMDVNfeP0C3MfidKWv3 Wzcvp59/k0kiJJ5RcbTvRYyjE/pgPZYaq09b9T5QjVvHbUE6VyTvtA8K9wRbakLDXP48TRFuQ p90Z2h5RjLO73QmNSQV9O+VH1FhkeSzF6QGPQE86SpeL3sZA6N/+dIauLXb4H8BjYLlJtEJQK WvD+aE+h1El+vCQElBdrEVAoy/A9mLjp2pfcQEDO7jxGiCVoNI+rg7oBAswkgi6JOvDEPocIK v4xH0hPCyCOMOAk3dMquEr4k5GysXaGaLO8JNDCqR5p/ZKKLOactPPecAW6S1buS4SoXjLXAD iNQtIXEBvx2ErLA8v1Vs3IQ1oXg6IUZfeI9bR2T11kAPZc6Ox3j6+4YH5Dlv4xNDzgoUfYnel 9Z16dK+1+wW/cL7DPvatCvogVOL1pFxVCRKwRJRNV3uUeZIXEZ7VXvhd4I/KcGI0dWiAwHdLx sVyunfrGwBN9mw8NOnAmElrIJERUQ+tNmfwMmZ47iKuzuTg4M9e00Sn5QG8/ZyqIgea4= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org New architectures should no longer need stat64, which is not y2038 safe and has been replaced by statx(). This removes the 'select __ARCH_WANT_STAT64' statement from asm-generic/unistd.h and instead moves it into the respective asm/unistd.h UAPI header files for each architecture that uses it today. In the generic file, the system call number and entry points are now made conditional, so newly added architectures (e.g. riscv32 or csky) will never need to carry backwards compatiblity for it. arm64 is the only 64-bit architecture using the asm-generic/unistd.h file, and it already sets __ARCH_WANT_NEW_STAT in its headers, and I use the same #ifdef here: future 64-bit architectures therefore won't see newstat or stat64 any more. They don't suffer from the y2038 time_t overflow, but for consistency it seems best to also let them use statx(). Signed-off-by: Arnd Bergmann --- arch/arc/include/uapi/asm/unistd.h | 1 + arch/c6x/include/uapi/asm/unistd.h | 1 + arch/h8300/include/uapi/asm/unistd.h | 1 + arch/hexagon/include/uapi/asm/unistd.h | 1 + arch/nds32/include/uapi/asm/unistd.h | 1 + arch/nios2/include/uapi/asm/unistd.h | 1 + arch/openrisc/include/uapi/asm/unistd.h | 1 + arch/unicore32/include/uapi/asm/unistd.h | 1 + include/asm-generic/unistd.h | 1 - include/uapi/asm-generic/unistd.h | 2 ++ 10 files changed, 10 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/arch/arc/include/uapi/asm/unistd.h b/arch/arc/include/uapi/asm/unistd.h index 517178b1daef..3b3543fd151c 100644 --- a/arch/arc/include/uapi/asm/unistd.h +++ b/arch/arc/include/uapi/asm/unistd.h @@ -17,6 +17,7 @@ #define _UAPI_ASM_ARC_UNISTD_H #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/c6x/include/uapi/asm/unistd.h b/arch/c6x/include/uapi/asm/unistd.h index 0d2daf7f9809..6b2fe792de9d 100644 --- a/arch/c6x/include/uapi/asm/unistd.h +++ b/arch/c6x/include/uapi/asm/unistd.h @@ -16,6 +16,7 @@ */ #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_CLONE /* Use the standard ABI for syscalls. */ diff --git a/arch/h8300/include/uapi/asm/unistd.h b/arch/h8300/include/uapi/asm/unistd.h index 7dd20ef7625a..628195823816 100644 --- a/arch/h8300/include/uapi/asm/unistd.h +++ b/arch/h8300/include/uapi/asm/unistd.h @@ -1,5 +1,6 @@ #define __ARCH_NOMMU #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #include diff --git a/arch/hexagon/include/uapi/asm/unistd.h b/arch/hexagon/include/uapi/asm/unistd.h index ea181e79162e..c91ca7d02461 100644 --- a/arch/hexagon/include/uapi/asm/unistd.h +++ b/arch/hexagon/include/uapi/asm/unistd.h @@ -29,6 +29,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_EXECVE #define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_VFORK diff --git a/arch/nds32/include/uapi/asm/unistd.h b/arch/nds32/include/uapi/asm/unistd.h index 6e95901cabe3..603e826e0449 100644 --- a/arch/nds32/include/uapi/asm/unistd.h +++ b/arch/nds32/include/uapi/asm/unistd.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (C) 2005-2017 Andes Technology Corporation +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYNC_FILE_RANGE2 /* Use the standard ABI for syscalls */ diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h index b6bdae04bc84..d9948d88790b 100644 --- a/arch/nios2/include/uapi/asm/unistd.h +++ b/arch/nios2/include/uapi/asm/unistd.h @@ -19,6 +19,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 /* Use the standard ABI for syscalls */ #include diff --git a/arch/openrisc/include/uapi/asm/unistd.h b/arch/openrisc/include/uapi/asm/unistd.h index 11c5a58ab333..ec37df18d8ed 100644 --- a/arch/openrisc/include/uapi/asm/unistd.h +++ b/arch/openrisc/include/uapi/asm/unistd.h @@ -20,6 +20,7 @@ #define sys_mmap2 sys_mmap_pgoff #define __ARCH_WANT_RENAMEAT +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_FORK #define __ARCH_WANT_SYS_CLONE diff --git a/arch/unicore32/include/uapi/asm/unistd.h b/arch/unicore32/include/uapi/asm/unistd.h index 65856eaab163..1e8fe5941b8a 100644 --- a/arch/unicore32/include/uapi/asm/unistd.h +++ b/arch/unicore32/include/uapi/asm/unistd.h @@ -15,4 +15,5 @@ /* Use the standard ABI for syscalls. */ #include +#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_CLONE diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index cdf904265caf..ea74eca8463f 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h @@ -8,6 +8,5 @@ * be selected by default. */ #if __BITS_PER_LONG == 32 -#define __ARCH_WANT_STAT64 #define __ARCH_WANT_SYS_LLSEEK #endif diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index df4bedb9b01c..538546edbfbd 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -242,10 +242,12 @@ __SYSCALL(__NR_tee, sys_tee) /* fs/stat.c */ #define __NR_readlinkat 78 __SYSCALL(__NR_readlinkat, sys_readlinkat) +#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) #define __NR3264_fstatat 79 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) #define __NR3264_fstat 80 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) +#endif /* fs/sync.c */ #define __NR_sync 81