From patchwork Mon May 14 17:14:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 135742 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2048743lji; Mon, 14 May 2018 10:14:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/6Ey27uuTzikUPXQhbnI7JIv+9OJiSSIp0aqRc3zHQxyFgR3ct0NBnvtoUnpBhLmbiqn9 X-Received: by 2002:a65:44c3:: with SMTP id g3-v6mr8506649pgs.428.1526318088584; Mon, 14 May 2018 10:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526318088; cv=none; d=google.com; s=arc-20160816; b=pAIy++vtAU2gMQvAdMfPBMVs5cvpkeNyu3iJr4+oymo/f5DsaJ0uldM+0N7iBn46Yc pASFWu7fdhoxppcHSYJNzpLsfgazx0GP4+4PuD2+t2pPMpKDPEQPumoOjzWC8T7b7vdg EqqW/Tk1IYPMCENv0SGYV6nvsoL5EwbbJDa41h7eOCTK2GifI8EYmxz0+J77ijkCy9aM XSke+PivHJEV3xOX2Y7CdoqpvuTYVy7Y/xZXDKRnrF7T9Ueng/ZLXFiaoyKkbTyiFOSm XBuxQJov8tOKrAwqM+2BphgC3g0UZHpQ6VN41+A6xsU1mATmCcRh7oj7wcCP4HDHHf7/ Onlw== 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=XMJCg10vUtKtxQm6VbSocC0nT/CZMohDgsLg++NqznY=; b=POfZHSsZ9CMYWZHZ/Z7F4gbtwFn8QO7BnxOPegB/TRaiOCug531pXGRR40Z1Z1OvDg Tpqts6ccSozYTwX12oQV+4cqrttETCLMPpeo10/zOJpfLtXBIp7LXzEVD2oQ/OxJWwnO kJ/pRMcyORRt0F76TiafBOd79CHv+91nh1BstOXgmN4iNlvEMp5HUJmegytiWYJbO5VS kNH3Jf/VMZTefJwzZXYH+kx2cTp1rdz81PZhuP0RnS27JJ3Rd1lgets/EAHgDO4hBGjC y+qDyfFmcsOPXoeAHPADGvZhFCXF0lLE7RMf3+PnAQi8rV5ykS4QZHi5YmAQqDkLd5xC hrQw== 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 w135-v6si9627946pff.340.2018.05.14.10.14.48; Mon, 14 May 2018 10:14:48 -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 S1753863AbeENROp (ORCPT + 29 others); Mon, 14 May 2018 13:14:45 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46848 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbeENROm (ORCPT ); Mon, 14 May 2018 13:14:42 -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 D8473165C; Mon, 14 May 2018 10:14:41 -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 7CD973F59F; Mon, 14 May 2018 10:14:38 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, Andrew Morton , Benjamin Herrenschmidt , Catalin Marinas , Fenghua Yu , "H. Peter Anvin" , Ingo Molnar , Ivan Kokshaysky , James Hogan , Kees Cook , Matt Turner , Michael Ellerman , Paul Mackerras , Ralf Baechle , Richard Henderson , Rich Felker , Thomas Gleixner , Tony Luck , Will Deacon , x86@kernel.org, Yoshinori Sato Subject: [RFC PATCH 00/11] prctl: Modernise wiring for optional prctl() calls Date: Mon, 14 May 2018 18:14:16 +0100 Message-Id: <1526318067-4964-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 [Reviewer note: this is a cross-arch series. To reduce spam, I have tried not to Cc people on patches they aren't likely to care about. The complete series can be found in the LKML or linux-arch archives.] The core framework for the prctl() syscall is unloved and looking rather crusty these days. It also relies on defining ancillary boilerplate macros for each prctl() in order to control conditional compilation of the different prctl calls. We have better ways to do this now. This series attempts to modernise the code by defining a couple of new Kconfig variables HAVE_PRCTL_ARCH and HAVE_ARCH_PR_SET_GET_UNALIGN to allow architectures to provide hooks for arch-dependent prctls. For now this series has had minimal testing: some basic testing of arch-specific prctls using PR_SVE_SET_VL on arm64; build-tested on x86; otherwise untested. This is not polished yet... but I'm interested to know what people think about the approach. Cheers ---Dave Dave Martin (11): prctl: Support movement of arch prctls out of common code arm64: Move arch-specific prctls out of core code MIPS: Remove unused task argument from prctl functions MIPS: Move arch-specific prctls out of core code x86: Move arch-specific prctls out of core code powerpc: Remove unused task argument from prctl functions powerpc: Move arch-specific prctls out of core code ia64: Remove unused task argument from prctl functions ia64: Move arch-specific prctls out of core code prctl: Remove redundant task argument from PR_{SET,GET}_UNALIGN backends prctl: Refactor PR_{SET,GET}_UNALIGN to reduce boilerplate arch/Kconfig | 6 ++ arch/alpha/Kconfig | 1 + arch/alpha/include/asm/thread_info.h | 23 -------- arch/alpha/kernel/Makefile | 2 +- arch/alpha/kernel/sys.c | 36 ++++++++++++ arch/arm64/Kconfig | 1 + arch/arm64/include/asm/processor.h | 4 -- arch/arm64/kernel/sys.c | 15 +++++ arch/ia64/Kconfig | 2 + arch/ia64/include/asm/processor.h | 24 -------- arch/ia64/kernel/sys_ia64.c | 37 ++++++++++++ arch/mips/Kconfig | 1 + arch/mips/include/asm/processor.h | 3 - arch/mips/kernel/process.c | 23 ++++---- arch/mips/kernel/syscall.c | 15 +++++ arch/parisc/Kconfig | 1 + arch/parisc/include/asm/processor.h | 14 ----- arch/parisc/kernel/sys_parisc.c | 15 +++++ arch/powerpc/Kconfig | 2 + arch/powerpc/include/asm/processor.h | 20 ++----- arch/powerpc/kernel/process.c | 38 ++++++------ arch/powerpc/kernel/syscalls.c | 17 ++++++ arch/sh/Kconfig | 1 + arch/sh/include/asm/processor.h | 7 --- arch/sh/mm/alignment.c | 12 ++-- arch/x86/Kconfig | 1 + arch/x86/include/asm/processor.h | 6 -- arch/x86/kernel/Makefile | 1 + arch/x86/kernel/sys.c | 26 +++++++++ include/linux/prctl.h | 27 +++++++++ include/uapi/linux/prctl.h | 6 +- kernel/sys.c | 110 ++++------------------------------- tools/include/uapi/linux/prctl.h | 6 +- 33 files changed, 263 insertions(+), 240 deletions(-) create mode 100644 arch/alpha/kernel/sys.c create mode 100644 arch/x86/kernel/sys.c create mode 100644 include/linux/prctl.h -- 2.1.4