Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp583516img; Mon, 18 Mar 2019 09:38:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1B6Vi4WEMtk5X8B2GbK4S0mEVFDo7DVlj676Z/F5A4n5z9OpAYNjGd3rBKSVjPsOROtMH X-Received: by 2002:a17:902:284b:: with SMTP id e69mr20144332plb.11.1552927082167; Mon, 18 Mar 2019 09:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552927082; cv=none; d=google.com; s=arc-20160816; b=LTR3Uq/g1HchYLpMG4wxW7g4F3qxje1CM/hC4N7p5QcBy42Vvm1Y4JHoj1KmpE7zff 2Rm762bOfXtAt6i4mdQbpy38E/Lkb1H1n4YWgYc7y87zL43aIsCS8nSN7p7U4vCU+iDV ZAR0hG/gMEwIMS/R2OgjX+OCNuTlKR33rXlRU2n9qMo5JOmJu+MRZm3YYRHvAkYJfb5i LiJAMmtADroJEB9sY/8bwx3Tq+rf76Ct+lycpEqyfAawbCOHWziniUWhPYMChsq6Ct39 0eZYH2qQrW4aG2TI9mL8djruifW9Hy712pgCzpd1UBDjBfRtbfV2t9U3p/HeDFcLnLjL /JQA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ezRVeTwRbKjwyCBcJ/VbvBoL5xr9mdv2L018wxn1S2c=; b=mLMhZ2tUOFsWmgZvHYc1BPfOuWjfoXcsnfY+ElXW537xwhVfxptXkLl8ZakIUBiUwF d8XZoXn07DStDyYhfFMa2pNDxmXYG/uxqjysjPJR5tXyfSixb2ZsnEy5jjoRO/dBw5vJ 1R/5PSN1nfSHBnJRsOmv9VSp21asRiwv8NiCEf0PuaMthFmikTmjMycmw2bM85gUbYqZ +uQORUL1cPI+4uh7LQsEVtIfLDyiSuRWryeg5BEyGYuV3HoNXW3rerZEzbCTg7zuEMI1 K0alh4xkbSO8e9SVD2qsZ++SLe6BQ/nGWnY6roDScdXIbYDD7K6ffltJyieOIRKkddYu 0Gdw== 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 o8si9528828pgl.23.2019.03.18.09.37.47; Mon, 18 Mar 2019 09:38:02 -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 S1727859AbfCRQgT (ORCPT + 99 others); Mon, 18 Mar 2019 12:36:19 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:37392 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726806AbfCRQgS (ORCPT ); Mon, 18 Mar 2019 12:36:18 -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 623681A25; Mon, 18 Mar 2019 09:36:18 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D9E83F614; Mon, 18 Mar 2019 09:36:12 -0700 (PDT) From: Vincenzo Frascino To: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Arnaldo Carvalho de Melo , Branislav Rankov , Catalin Marinas , Chintan Pandya , Daniel Borkmann , Dave Martin , "David S. Miller" , Dmitry Vyukov , Eric Dumazet , Evgeniy Stepanov , Graeme Barnes , Greg Kroah-Hartman , Ingo Molnar , Jacob Bramley , Kate Stewart , Kees Cook , Kevin Brodsky , "Kirill A . Shutemov" , Kostya Serebryany , Lee Smith , Luc Van Oostenryck , Mark Rutland , Peter Zijlstra , Ramana Radhakrishnan , Robin Murphy , Ruben Ayrapetyan , Shuah Khan , Steven Rostedt , Szabolcs Nagy , Will Deacon Subject: [PATCH v2 4/4] arm64: elf: Advertise relaxed ABI Date: Mon, 18 Mar 2019 16:35:33 +0000 Message-Id: <20190318163533.26838-5-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190318163533.26838-1-vincenzo.frascino@arm.com> References: <20190318163533.26838-1-vincenzo.frascino@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On arm64 the TCR_EL1.TBI0 bit has been always enabled hence the userspace (EL0) is allowed to set a non-zero value in the top byte but the resulting pointers are not allowed at the user-kernel syscall ABI boundary. Set ARM64_AT_FLAGS_SYSCALL_TBI (bit[0]) in the AT_FLAGS to advertise the relaxation of the ABI to the userspace. Cc: Catalin Marinas Cc: Will Deacon CC: Andrey Konovalov Signed-off-by: Vincenzo Frascino --- arch/arm64/include/asm/atflags.h | 7 +++++++ arch/arm64/include/asm/elf.h | 5 +++++ arch/arm64/include/uapi/asm/atflags.h | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 arch/arm64/include/asm/atflags.h create mode 100644 arch/arm64/include/uapi/asm/atflags.h diff --git a/arch/arm64/include/asm/atflags.h b/arch/arm64/include/asm/atflags.h new file mode 100644 index 000000000000..b20093d61bf2 --- /dev/null +++ b/arch/arm64/include/asm/atflags.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_ATFLAGS_H +#define __ASM_ATFLAGS_H + +#include + +#endif diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index 6adc1a90e7e6..73d5184a4dd9 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h @@ -16,6 +16,7 @@ #ifndef __ASM_ELF_H #define __ASM_ELF_H +#include #include /* @@ -167,6 +168,10 @@ do { \ NEW_AUX_ENT(AT_IGNORE, 0); \ } while (0) +/* Platform specific AT_FLAGS */ +#define ELF_AT_FLAGS ARM64_AT_FLAGS_SYSCALL_TBI +#define COMPAT_ELF_AT_FLAGS 0 + #define ARCH_HAS_SETUP_ADDITIONAL_PAGES struct linux_binprm; extern int arch_setup_additional_pages(struct linux_binprm *bprm, diff --git a/arch/arm64/include/uapi/asm/atflags.h b/arch/arm64/include/uapi/asm/atflags.h new file mode 100644 index 000000000000..1cf25692ffd6 --- /dev/null +++ b/arch/arm64/include/uapi/asm/atflags.h @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __UAPI_ASM_ATFLAGS_H +#define __UAPI_ASM_ATFLAGS_H + +/* Platform specific AT_FLAGS */ +#define ARM64_AT_FLAGS_SYSCALL_TBI (1 << 0) + +#endif -- 2.21.0