From patchwork Wed May 16 14:20:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 136004 Delivered-To: patch@linaro.org Received: by 2002:a50:ec09:0:0:0:0:0 with SMTP id g9-v6csp3405301edr; Wed, 16 May 2018 07:21:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoMxrt7A14JlYd14tjbu8KbKB+Z+p4483XeLbVK5A/X1k7dbkdGiS6vbVh9ri0nIzGAtPtG X-Received: by 2002:a63:6185:: with SMTP id v127-v6mr876050pgb.441.1526480469363; Wed, 16 May 2018 07:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526480469; cv=none; d=google.com; s=arc-20160816; b=IUYxOeOPBWYfv+uvgI81tgYtU5+XzKElh1NgorNTcDGPxe/xoPWRPDsBpX6SeCSveT 8W2KfOGAfIczdtzTLqrmcttwcjc3yRdduGsPHeGhpkayFrSB646b/gpf3siaDFcvc5Br KdKSAilLo1Wm/dhNmifv4M1L0EZrhhIA7SrlzeYP3MQgPhQnlBuJRnm1jYmUZxA9HIDE qIaO5NQ5hU2o35dD1j7DJmYOafRJLqy67M5lOamqaS7eukI6l+Rmqdb+7Ii58XQUSGVm 6q3geEe+4JPbaghDqcaNuVm0zsUD76tLArC/oOxAiCTO9JT5OQJe17cbjFOx9eVwnHlz xXjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=4ifaWp5E9uQ9061pWVqrTfaEzUDs1Rnj0pYVHrvhLWE=; b=UK21xYvYGKfsJJ+2XomjNsbQ1UvndIM6dofeVU1uarM6wQwTTrXzRnVJ1HOvPLLlmf zd9kJoU7FxELrkDYFHdNFMNFPmwxYiOBoxsI4bPrKgvL8tnZLrRwVfhaZKYRPvo7TKxu Q/gNjKBxy8pTFkOMYEVJUonCt3riBrnPPFjMzcOWgE9UXDh++WMJUIVAeS64bRyiI19y /G1IUyn/jowoHn1EpQWGrNIVtRYLgDEQi3DA4i/zUpXGIRTCnAmsoycwsn4mjMNGRXVw OYlxBbDgXFy09y3Cv/dX+hygNmTGPbmxd0YCztK5z/sYra95oaZXsLrmqpIKvePGS2a7 h7tQ== ARC-Authentication-Results: i=1; mx.google.com; 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 e66-v6si2129555pgc.466.2018.05.16.07.21.09; Wed, 16 May 2018 07:21:09 -0700 (PDT) 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; 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 S1752542AbeEPOVF (ORCPT + 29 others); Wed, 16 May 2018 10:21:05 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:49468 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752479AbeEPOVC (ORCPT ); Wed, 16 May 2018 10:21:02 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 659341596; Wed, 16 May 2018 07:21:02 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 59F653F24A; Wed, 16 May 2018 07:20:57 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Catalin Marinas , Will Deacon , Tony Luck , Fenghua Yu , Michal Simek , Ralf Baechle , James Hogan , Greentime Hu , Vincent Chen , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Palmer Dabbelt , Albert Ou , Martin Schwidefsky , Heiko Carstens , Yoshinori Sato , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Chris Zankel , Max Filippov Subject: [RFC PATCH] UAPI: Document auxvec AT_* namespace policy and note reservations Date: Wed, 16 May 2018 15:20:47 +0100 Message-Id: <1526480447-18185-1-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are constraints on defining AT_* auxvec tags that are not obvious to the casual maintainer of either the global or the arch-specific headers. This is likely to lead to mistakes. (I certainly fell foul of it...) For the benefit of future maintainers, this patch collects the relevant information in one place, documenting how the namespace needs to be managed, and noting all the values currently in use. Maintaining a global list may result in some merge conflicts, but AT_* values are not added frequently. I'm open to suggestions on the best approach. I also assume that values 38 and 39 may have been used for historical purposes, such as an architecture that is no longer supported. If they have definitely never been used for anything, they could be removed from the "reserved" list. Signed-off-by: Dave Martin Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Tony Luck Cc: Fenghua Yu Cc: Michal Simek Cc: Ralf Baechle Cc: James Hogan Cc: Greentime Hu Cc: Vincent Chen Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Albert Ou Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Chris Zankel Cc: Max Filippov --- arch/alpha/include/uapi/asm/auxvec.h | 5 ++++ arch/arm/include/uapi/asm/auxvec.h | 5 ++++ arch/arm64/include/uapi/asm/auxvec.h | 5 ++++ arch/ia64/include/uapi/asm/auxvec.h | 5 ++++ arch/microblaze/include/uapi/asm/auxvec.h | 4 ++++ arch/mips/include/uapi/asm/auxvec.h | 5 ++++ arch/nds32/include/uapi/asm/auxvec.h | 5 ++++ arch/powerpc/include/uapi/asm/auxvec.h | 5 ++++ arch/riscv/include/uapi/asm/auxvec.h | 5 ++++ arch/s390/include/uapi/asm/auxvec.h | 5 ++++ arch/sh/include/uapi/asm/auxvec.h | 5 ++++ arch/sparc/include/uapi/asm/auxvec.h | 8 ++++--- arch/x86/include/uapi/asm/auxvec.h | 5 ++++ arch/xtensa/include/uapi/asm/auxvec.h | 5 ++++ include/uapi/linux/auxvec.h | 40 ++++++++++++++++++++++++++++--- 15 files changed, 106 insertions(+), 6 deletions(-) -- 2.1.4 diff --git a/arch/alpha/include/uapi/asm/auxvec.h b/arch/alpha/include/uapi/asm/auxvec.h index 57cae87..9370d78 100644 --- a/arch/alpha/include/uapi/asm/auxvec.h +++ b/arch/alpha/include/uapi/asm/auxvec.h @@ -22,6 +22,11 @@ #define AT_L2_CACHESHAPE 36 #define AT_L3_CACHESHAPE 37 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ #endif /* __ASM_ALPHA_AUXVEC_H */ diff --git a/arch/arm/include/uapi/asm/auxvec.h b/arch/arm/include/uapi/asm/auxvec.h index 5c09da5..b5cfba2 100644 --- a/arch/arm/include/uapi/asm/auxvec.h +++ b/arch/arm/include/uapi/asm/auxvec.h @@ -5,4 +5,9 @@ /* VDSO location */ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #endif diff --git a/arch/arm64/include/uapi/asm/auxvec.h b/arch/arm64/include/uapi/asm/auxvec.h index ec0a86d..3da03fc 100644 --- a/arch/arm64/include/uapi/asm/auxvec.h +++ b/arch/arm64/include/uapi/asm/auxvec.h @@ -20,6 +20,11 @@ /* vDSO location */ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ #endif diff --git a/arch/ia64/include/uapi/asm/auxvec.h b/arch/ia64/include/uapi/asm/auxvec.h index 09969a5..a81aec5 100644 --- a/arch/ia64/include/uapi/asm/auxvec.h +++ b/arch/ia64/include/uapi/asm/auxvec.h @@ -9,6 +9,11 @@ #define AT_SYSINFO 32 #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ #endif /* _ASM_IA64_AUXVEC_H */ diff --git a/arch/microblaze/include/uapi/asm/auxvec.h b/arch/microblaze/include/uapi/asm/auxvec.h index 93dd07b..b08c6dc 100644 --- a/arch/microblaze/include/uapi/asm/auxvec.h +++ b/arch/microblaze/include/uapi/asm/auxvec.h @@ -1,2 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Do not add new AT_* definitions here without coordinating with + * + */ diff --git a/arch/mips/include/uapi/asm/auxvec.h b/arch/mips/include/uapi/asm/auxvec.h index 612c2c4..ee94899 100644 --- a/arch/mips/include/uapi/asm/auxvec.h +++ b/arch/mips/include/uapi/asm/auxvec.h @@ -15,6 +15,11 @@ /* Location of VDSO image. */ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ #endif /* __ASM_AUXVEC_H */ diff --git a/arch/nds32/include/uapi/asm/auxvec.h b/arch/nds32/include/uapi/asm/auxvec.h index 56043ce..0173da1 100644 --- a/arch/nds32/include/uapi/asm/auxvec.h +++ b/arch/nds32/include/uapi/asm/auxvec.h @@ -7,6 +7,11 @@ /* VDSO location */ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 1 #endif diff --git a/arch/powerpc/include/uapi/asm/auxvec.h b/arch/powerpc/include/uapi/asm/auxvec.h index 7af21dc..3da0713 100644 --- a/arch/powerpc/include/uapi/asm/auxvec.h +++ b/arch/powerpc/include/uapi/asm/auxvec.h @@ -48,6 +48,11 @@ #define AT_L3_CACHESIZE 46 #define AT_L3_CACHEGEOMETRY 47 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 14 /* entries in ARCH_DLINFO */ #endif diff --git a/arch/riscv/include/uapi/asm/auxvec.h b/arch/riscv/include/uapi/asm/auxvec.h index 1376515..0dd7983 100644 --- a/arch/riscv/include/uapi/asm/auxvec.h +++ b/arch/riscv/include/uapi/asm/auxvec.h @@ -21,4 +21,9 @@ /* vDSO location */ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #endif /* _UAPI_ASM_RISCV_AUXVEC_H */ diff --git a/arch/s390/include/uapi/asm/auxvec.h b/arch/s390/include/uapi/asm/auxvec.h index a056c46..c30090a 100644 --- a/arch/s390/include/uapi/asm/auxvec.h +++ b/arch/s390/include/uapi/asm/auxvec.h @@ -4,6 +4,11 @@ #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ #endif diff --git a/arch/sh/include/uapi/asm/auxvec.h b/arch/sh/include/uapi/asm/auxvec.h index 8eb47ed..e5b6ebc 100644 --- a/arch/sh/include/uapi/asm/auxvec.h +++ b/arch/sh/include/uapi/asm/auxvec.h @@ -34,6 +34,11 @@ #define AT_L1D_CACHESHAPE 35 #define AT_L2_CACHESHAPE 36 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 5 /* entries in ARCH_DLINFO */ #endif /* __ASM_SH_AUXVEC_H */ diff --git a/arch/sparc/include/uapi/asm/auxvec.h b/arch/sparc/include/uapi/asm/auxvec.h index ab8780f..76aba18 100644 --- a/arch/sparc/include/uapi/asm/auxvec.h +++ b/arch/sparc/include/uapi/asm/auxvec.h @@ -3,13 +3,15 @@ #define AT_SYSINFO_EHDR 33 -/* Avoid overlap with other AT_* values since they are consolidated in - * glibc and any overlaps can cause problems - */ #define AT_ADI_BLKSZ 48 #define AT_ADI_NBITS 49 #define AT_ADI_UEONADI 50 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #define AT_VECTOR_SIZE_ARCH 4 #endif /* !(__ASMSPARC_AUXVEC_H) */ diff --git a/arch/x86/include/uapi/asm/auxvec.h b/arch/x86/include/uapi/asm/auxvec.h index 580e3c5..700c0fc 100644 --- a/arch/x86/include/uapi/asm/auxvec.h +++ b/arch/x86/include/uapi/asm/auxvec.h @@ -10,6 +10,11 @@ #endif #define AT_SYSINFO_EHDR 33 +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + /* entries in ARCH_DLINFO: */ #if defined(CONFIG_IA32_EMULATION) || !defined(CONFIG_X86_64) # define AT_VECTOR_SIZE_ARCH 2 diff --git a/arch/xtensa/include/uapi/asm/auxvec.h b/arch/xtensa/include/uapi/asm/auxvec.h index 257dec7..995bbd8 100644 --- a/arch/xtensa/include/uapi/asm/auxvec.h +++ b/arch/xtensa/include/uapi/asm/auxvec.h @@ -1,4 +1,9 @@ #ifndef __XTENSA_AUXVEC_H #define __XTENSA_AUXVEC_H +/* + * Do not add new AT_* definitions here without coordinating with + * + */ + #endif diff --git a/include/uapi/linux/auxvec.h b/include/uapi/linux/auxvec.h index abe5f2b..c19c043 100644 --- a/include/uapi/linux/auxvec.h +++ b/include/uapi/linux/auxvec.h @@ -4,8 +4,19 @@ #include -/* Symbolic values for the entries in the auxiliary table - put on the initial stack */ +/* + * Symbolic values for the entries in the auxiliary table + * put on the initial stack. + * + * Values with definitions here are common to all architectures. + * Individual architectures may define additional values in their + * . + * + * NOTE: Userspace may treat these numbers as a global namespace. + * Any per-architecture definition must not overlap with these or with + * any other architecture's definitions, unless it has identical name + * and number and compatible meaning. + */ #define AT_NULL 0 /* end of vector */ #define AT_IGNORE 1 /* entry should be ignored */ #define AT_EXECFD 2 /* file descriptor of program */ @@ -24,7 +35,11 @@ #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ #define AT_CLKTCK 17 /* frequency at which times() increments */ -/* AT_* values 18 through 22 are reserved */ +/* 18 reserved for AT_FPUCW (sh) */ +/* 19 reserved for AT_DCACHEBSIZE (powerpc) */ +/* 20 reserved for AT_ICACHEBSIZE (powerpc) */ +/* 21 reserved for AT_UCACHEBSIZE (powerpc) */ +/* 22 reserved for AT_IGNOREPPC (powerpc) */ #define AT_SECURE 23 /* secure mode boolean */ #define AT_BASE_PLATFORM 24 /* string identifying real platform, may * differ from AT_PLATFORM. */ @@ -33,5 +48,24 @@ #define AT_EXECFN 31 /* filename of program */ +/* 32 reserved for AT_SYSINFO (alpha ia64 um x86) */ +/* 33 reserved for AT_SYSINFO_EHDR (various architectures) */ +/* 34 reserved for AT_L1I_CACHESHAPE (alpha sh) */ +/* 35 reserved for AT_L1D_CACHESHAPE (alpha sh) */ +/* 36 reserved for AT_L2_CACHESHAPE (alpha sh) */ +/* 37 reserved for AT_L3_CACHESHAPE (alpha) */ +/* 38 reserved, do not allocate */ +/* 39 reserved, do not allocate */ +/* 40 reserved for AT_L1I_CACHESIZE (powerpc) */ +/* 41 reserved for AT_L1I_CACHEGEOMETRY (powerpc) */ +/* 42 reserved for AT_L1D_CACHESIZE (powerpc) */ +/* 43 reserved for AT_L1D_CACHEGEOMETRY (powerpc) */ +/* 44 reserved for AT_L2_CACHESIZE (powerpc) */ +/* 45 reserved for AT_L2_CACHEGEOMETRY (powerpc) */ +/* 46 reserved for AT_L3_CACHESIZE (powerpc) */ +/* 47 reserved for AT_L3_CACHEGEOMETRY (powerpc) */ +/* 48 reserved for AT_ADI_BLKSZ (sparc) */ +/* 49 reserved for AT_ADI_NBITS (sparc) */ +/* 50 reserved for AT_ADI_UEONADI (sparc) */ #endif /* _UAPI_LINUX_AUXVEC_H */