From patchwork Mon May 14 17:14:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135753 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2053998lji; Mon, 14 May 2018 10:19:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrUXMP3DeMNA1G3IEb8FEMnhQJYVpNO/fidZa5xEP/OL1LDebsE3ROXFLxCJAp2nlyamIce X-Received: by 2002:a62:a48:: with SMTP id s69-v6mr11427458pfi.134.1526318377672; Mon, 14 May 2018 10:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318377; cv=none; d=google.com; s=arc-20160816; b=vonnhaXm9nkYWorlNC47760UZlY3nnnuI92hZRKksAmMcMOVrNGhfx/9dXxk7wsOQP I88s8nibGRbSof7D3XyW9UOeykDtNuoVEejWb4oRWrHUe0fnS9QCSrLod/LdIf0CLC1j 8dZNVh++RfYyGAVyZnil80W41cmEIJwGwzA2AJkM3JRQWgG0nYCk0VUL7tvVdELto4+0 BU8Np7j3qPiBJPGSOq9mg9GTohehTejfW5KdoVBzqow2PdA3lqS7ptnwENwqVH5iW+AO SpQqVU3Ywp7DGyKyvlSLxj30uQz/29FqHRTiwp+UQEIwASgIAaVn83pbh65hLWglNoem 5Gbg== 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=+bfe/I3v5lg4n6vqdw/d8FttfxrB9tL6F1tvKdrda8I=; b=e1/8tsojFHmKPO2eKKUFj+cQda2/5wdkvO3uJj72aOPxw4IpbW5Egx25EVQX6e4MSn PtJN5pzN5FypyyWPYejHt4hgPvMwUpmw62O4K4oSe/Sco8gK2l7aM8yMWS3cBHywe9su 3vjPYGXn++Lji1rJXk21DIPnomMi1MZ4cQTE2798dUfhszc3aSO+/jwdcCeGsBdP9aD+ A6MfRo/IHPYxOtRdUbnU9pHg7iA/xOi57ujOT70VywEcpf1jhquiRSGmFdDrYM47Bbaw vlqTqmdGao+pmjOy5lwDXrVywPA/uiuR6im2JZIfrXcO8bQW8Hx3wZBQbxfN6jHTOS50 1smw== 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 a90-v6si9693975plc.329.2018.05.14.10.19.37; Mon, 14 May 2018 10:19:37 -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 S1752668AbeENRTe (ORCPT + 29 others); Mon, 14 May 2018 13:19:34 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46948 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015AbeENRP0 (ORCPT ); Mon, 14 May 2018 13:15:26 -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 87F15165C; Mon, 14 May 2018 10:15:26 -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 C11043F59F; Mon, 14 May 2018 10:15:25 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, Catalin Marinas , Will Deacon Subject: [RFC PATCH 02/11] arm64: Move arch-specific prctls out of core code Date: Mon, 14 May 2018 18:14:18 +0100 Message-Id: <1526318067-4964-3-git-send-email-Dave.Martin@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> References: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch moves the arm64-specific prctl call implementations out of core code and removes redundant boilerplate associated with them. No functional change. Signed-off-by: Dave Martin Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/processor.h | 4 ---- arch/arm64/kernel/sys.c | 15 +++++++++++++++ kernel/sys.c | 12 ------------ 4 files changed, 16 insertions(+), 16 deletions(-) -- 2.1.4 Acked-by: Will Deacon diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index eb2cf49..6b706af 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -123,6 +123,7 @@ config ARM64 select HAVE_PERF_EVENTS select HAVE_PERF_REGS select HAVE_PERF_USER_STACK_DUMP + select HAVE_PRCTL_ARCH select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RCU_TABLE_FREE select HAVE_SYSCALL_TRACEPOINTS diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 7675989..b1d262f 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h @@ -244,9 +244,5 @@ void cpu_enable_pan(const struct arm64_cpu_capabilities *__unused); void cpu_enable_cache_maint_trap(const struct arm64_cpu_capabilities *__unused); void cpu_clear_disr(const struct arm64_cpu_capabilities *__unused); -/* Userspace interface for PR_SVE_{SET,GET}_VL prctl()s: */ -#define SVE_SET_VL(arg) sve_set_current_vl(arg) -#define SVE_GET_VL() sve_get_current_vl() - #endif /* __ASSEMBLY__ */ #endif /* __ASM_PROCESSOR_H */ diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c index 72981ba..597ff35 100644 --- a/arch/arm64/kernel/sys.c +++ b/arch/arm64/kernel/sys.c @@ -22,10 +22,12 @@ #include #include #include +#include #include #include #include #include +#include asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, @@ -45,6 +47,19 @@ SYSCALL_DEFINE1(arm64_personality, unsigned int, personality) return sys_personality(personality); } +int prctl_arch(int option, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5) +{ + switch (option) { + case PR_SVE_SET_VL: + return sve_set_current_vl(arg2); + case PR_SVE_GET_VL: + return sve_get_current_vl(); + default: + return -EINVAL; + } +} + /* * Wrappers to pass the pt_regs argument. */ diff --git a/kernel/sys.c b/kernel/sys.c index 5077f1e..f917d78 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -113,12 +113,6 @@ #ifndef SET_FP_MODE # define SET_FP_MODE(a,b) (-EINVAL) #endif -#ifndef SVE_SET_VL -# define SVE_SET_VL(a) (-EINVAL) -#endif -#ifndef SVE_GET_VL -# define SVE_GET_VL() (-EINVAL) -#endif /* * this is where the system-wide overflow UID and GID are defined, for @@ -2444,12 +2438,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, case PR_GET_FP_MODE: error = GET_FP_MODE(me); break; - case PR_SVE_SET_VL: - error = SVE_SET_VL(arg2); - break; - case PR_SVE_GET_VL: - error = SVE_GET_VL(); - break; default: error = prctl_arch(option, arg2, arg3, arg4, arg5); break;