From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [RFC PATCH 02/11] arm64: Move arch-specific prctls out of core code Date: Mon, 21 May 2018 19:30:14 +0100 Message-ID: <20180521183014.GD19122@arm.com> References: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> <1526318067-4964-3-git-send-email-Dave.Martin@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1526318067-4964-3-git-send-email-Dave.Martin@arm.com> Sender: linux-kernel-owner@vger.kernel.org To: Dave Martin Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Catalin Marinas , marc.zyngier@arm.com List-Id: linux-arch.vger.kernel.org On Mon, May 14, 2018 at 06:14:18PM +0100, Dave Martin wrote: > 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(-) > > 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; > + } > +} If we think this might grow, then it might be worth adding a prctl.c to collect these together. Anyhow: Acked-by: Will Deacon Will From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:54940 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750773AbeEUS3r (ORCPT ); Mon, 21 May 2018 14:29:47 -0400 Date: Mon, 21 May 2018 19:30:14 +0100 From: Will Deacon Subject: Re: [RFC PATCH 02/11] arm64: Move arch-specific prctls out of core code Message-ID: <20180521183014.GD19122@arm.com> References: <1526318067-4964-1-git-send-email-Dave.Martin@arm.com> <1526318067-4964-3-git-send-email-Dave.Martin@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1526318067-4964-3-git-send-email-Dave.Martin@arm.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Dave Martin Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Catalin Marinas , marc.zyngier@arm.com Message-ID: <20180521183014.Jp1jws0z2DrABJkZi1ESVGJq4A4u04-GGqAQz-_sEM8@z> On Mon, May 14, 2018 at 06:14:18PM +0100, Dave Martin wrote: > 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(-) > > 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; > + } > +} If we think this might grow, then it might be worth adding a prctl.c to collect these together. Anyhow: Acked-by: Will Deacon Will