From patchwork Mon May 14 17:14:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135752 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2053638lji; Mon, 14 May 2018 10:19:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpTIsXtiTWj4SITxX8gAPqYJet3l0QewVCFkjHWqoB4mjhSy+eJrzeKNkUYedDFg3CfeQnS X-Received: by 2002:a65:4301:: with SMTP id j1-v6mr9175777pgq.356.1526318356636; Mon, 14 May 2018 10:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318356; cv=none; d=google.com; s=arc-20160816; b=Hhl3MtnBi7UnnBkFGgXGfqfpZmXPsxmAxXS8i8uDnReu41s0aqJ0LHSuZy7WlfoJaS WVmsChfWjfCqaXFtLatNol5KDQ1mebmwmYjjBNaPC3sH/+Qd7xvTS9ZNJSj8bWd+3Q60 FKuuciY9hTGxrs++kfHHMkvI2IvvwNiveek0fllzSFZtuPRAkHuAFV93g3pgIjJ8pPQD T7hxfeNhrh3a2mH1HvH82D8kyMW9qHRrUcecTiK4wIWLO8mPDTk89vC8fPA6EKtuQTet 5CXCXIxCe33Ii1W9QAm3rbtmjUQlsOC9k+7/ixpnSyCrKfoo0Fm9oqA7L9IokWKKoEQQ EHhA== 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=n4HPjnCwYTt/lqOJ8Taw2RpSvSmM3BkbtyHjlBNZSI0=; b=0CcMjsHctwLzotZKpp7f9vwaRzlbuIJTFbTUzECXz4kiyao16paBRE8HMv/KfL0pgM 7mD8aiq/XPbtYs2JSIeMGab8Bidd7MpgFn2qHj/KxYNVY7l/BsiYB4vliKPTGeuabyHw 5/obB3lHhvCUYvWP/gRknYYaO9F/EcHpaL3065fgBqzMI8+KgNn4PH5smlc/xSPt0hZK YHmyIrwZPW1M8HnwBjfhkSCiNirlGbcf3pgvtfzfaG1rwCb8l01vJXVSVEI16tkdHy6v vIlGb8F3iq6w5RlpLHeCHYnAnxszZv22f9VkaK4cFk5EN0AdOzDhBej9dKcl5771stYS lzBA== 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 ba9-v6si10065590plb.110.2018.05.14.10.19.16; Mon, 14 May 2018 10:19:16 -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 S1754452AbeENRSO (ORCPT + 29 others); Mon, 14 May 2018 13:18:14 -0400 Received: from foss.arm.com ([217.140.101.70]:46960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004AbeENRP2 (ORCPT ); Mon, 14 May 2018 13:15:28 -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 93DDC165C; Mon, 14 May 2018 10:15:28 -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 CCF413F59F; Mon, 14 May 2018 10:15:27 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, Ralf Baechle , James Hogan Subject: [RFC PATCH 04/11] MIPS: Move arch-specific prctls out of core code Date: Mon, 14 May 2018 18:14:20 +0100 Message-Id: <1526318067-4964-5-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 MIPS-specific prctl call implementations out of core code and removes redundant boilerplate associated with them. No functional change. Signed-off-by: Dave Martin Cc: Ralf Baechle Cc: James Hogan --- arch/mips/Kconfig | 1 + arch/mips/include/asm/processor.h | 3 --- arch/mips/kernel/syscall.c | 14 ++++++++++++++ kernel/sys.c | 12 ------------ 4 files changed, 15 insertions(+), 15 deletions(-) -- 2.1.4 diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 225c95d..99eb2ef 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -61,6 +61,7 @@ config MIPS select HAVE_NMI select HAVE_OPROFILE select HAVE_PERF_EVENTS + select HAVE_PRCTL_ARCH select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_SYSCALL_TRACEPOINTS select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index 8f06608..4a8079a 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h @@ -420,7 +420,4 @@ extern int mips_get_process_fp_mode(struct task_struct *task); extern int mips_set_process_fp_mode(struct task_struct *task, unsigned int value); -#define GET_FP_MODE() mips_get_process_fp_mode() -#define SET_FP_MODE(value) mips_set_process_fp_mode(value) - #endif /* _ASM_PROCESSOR_H */ diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 15f33f0..aa8157c 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -237,6 +238,19 @@ SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) return -ENOSYS; } +int prctl_arch(int option, unsigned long arg2, unsigned long arg3, + unsigned long arg4, unsigned long arg5) +{ + switch (option) { + case PR_SET_FP_MODE: + return mips_set_process_fp_mode(arg2); + case PR_GET_FP_MODE: + return mips_get_process_fp_mode(); + default: + return -EINVAL; + } +} + /* * If we ever come here the user sp is bad. Zap the process right away. * Due to the bad stack signaling wouldn't work. diff --git a/kernel/sys.c b/kernel/sys.c index 520d2e8..63228e7 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -107,12 +107,6 @@ #ifndef MPX_DISABLE_MANAGEMENT # define MPX_DISABLE_MANAGEMENT() (-EINVAL) #endif -#ifndef GET_FP_MODE -# define GET_FP_MODE() (-EINVAL) -#endif -#ifndef SET_FP_MODE -# define SET_FP_MODE(a) (-EINVAL) -#endif /* * this is where the system-wide overflow UID and GID are defined, for @@ -2432,12 +2426,6 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, return -EINVAL; error = MPX_DISABLE_MANAGEMENT(); break; - case PR_SET_FP_MODE: - error = SET_FP_MODE(arg2); - break; - case PR_GET_FP_MODE: - error = GET_FP_MODE(); - break; default: error = prctl_arch(option, arg2, arg3, arg4, arg5); break;