From patchwork Fri Jan 4 17:49:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Hansen X-Patchwork-Id: 10748615 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 237CA18A6 for ; Fri, 4 Jan 2019 17:50:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15FC628536 for ; Fri, 4 Jan 2019 17:50:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A63028581; Fri, 4 Jan 2019 17:50:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9726B28573 for ; Fri, 4 Jan 2019 17:50:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E9668E00AE; Fri, 4 Jan 2019 12:49:53 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 823178E00FD; Fri, 4 Jan 2019 12:49:53 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C34F8E00AE; Fri, 4 Jan 2019 12:49:53 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id DC7428E00FA for ; Fri, 4 Jan 2019 12:49:52 -0500 (EST) Received: by mail-pg1-f199.google.com with SMTP id f125so30907066pgc.20 for ; Fri, 04 Jan 2019 09:49:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=HjgC+v9b8LW7lq2MNiQNAvC9jHoJz4xrF+8TKmoEWIs=; b=PnWKC8XCiwrM1UsJrX9XCamypasY9gpjQVBgBCkcUh6nMboUzVnpwB/UF12z8lMcz2 RKyEbmDY4jDYAIuBOsQNcAI9hcKsbDzLOg/jSuNm9AFh66s/VxlRNrtv33A/gYq2yxiv IfwRdP3z71z/GyWMXkrnzAxi6IlEX5mVkJfd+V3Dvp6t3fJxKLKiqn/Ih70r0JlEidp0 RBxNYmSzLIZco1U/3jk5J4HUiJf2g3FFWWicwUmAW4jTsRLtbt8Pc56SKyFk6jT/8RK0 YTAXSeRmP8XvAcmeBLfwG+qFzSMxk9yUxdu8mbvoAfzuUymh6OuSMe78f+JCGyMIb72K Rq0g== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dave@ray.jf.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=dave@ray.jf.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AA+aEWbbzFhL9H2n2K/C8VjNVYOav5W0zn85dOC0vbow3+t2Dx99W258 XxVq3bS94l/jOQC6o5jKRfckX5VvMAtMmtUvsLTq42oVJoG+UAg2oQ4iw1LiFPxcMzL9HPTpsbS WQ7LIJvnxD0YEe6tF5xlOkwZ7lw08qZykefimmcooyGSAGGQBSrEAKSvwo7oxIqPOAw== X-Received: by 2002:a62:d701:: with SMTP id b1mr52183986pfh.34.1546624192455; Fri, 04 Jan 2019 09:49:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vqg80PKvyum6CBweuAWQledTLePT7O8jQ6nvVVMTpvgYQRfJTw3ibqyBqnC/h5p8axvjg8 X-Received: by 2002:a62:d701:: with SMTP id b1mr52183945pfh.34.1546624191597; Fri, 04 Jan 2019 09:49:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546624191; cv=none; d=google.com; s=arc-20160816; b=Du8Yb9HrhP21YkQT2xQcAuouy3QHhgoi8d2CTlqSGe/r689OkxrgSJGqin0chrIeU9 sx1xDVlkUqXNErSu7k3+OnrOTN/kO0vZmR5WEX0+2zqZdLXEEjFZbOJS1dy9BlXkv3Cj K/vgTNw/vgGoTvzxcFYWuuGta1FUM+PyxmEgJ/lAE46cLBee1b4KOb3Xg/WnOpjc8gaU 1xcyUHFN9EJD5UEkn/fMRn35RzymRQetfz3s5oxhg2Q6JrMxd4BWwflE3PxPmRmk74t1 5Jt1STNk3RVFL3YqkSY58tML5d+1xoYj2bLxSNuTZ+rjUTNdtWFuTKwa7oqbOIUcIIoh Z/Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=HjgC+v9b8LW7lq2MNiQNAvC9jHoJz4xrF+8TKmoEWIs=; b=ihKHlZDERIoLI7R/YqHe1zL7PtM352fJrdhrWZ8ruAD/3M0phlsNQXxuVj3yaJwAPm YN7ki0EphbaXjb88Qzfq2qYlKTETKtBc5fjdQido9Gx1yY8gfrs0fuYkcnOJ1rhpdqg9 o3cOYfWKNR/7HB7d0DTX1wsikSltl6z4YhfyXfFYdNJ+tzPAW4T969G5gpCpc+5cRubn l0sT1oMLamwO0spBCGuSe/CsoaFtsbYCNXoCoHwhGy/eUuHg0OLK1Umva3eM+RHpYWkg lpVQRUfWwnJGkiVP+zU8rKNwhbGpD+EYRn62vLNWWb4Y5msOo96/89cWSGOL63/uS1TR rPIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dave@ray.jf.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=dave@ray.jf.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga14.intel.com (mga14.intel.com. [192.55.52.115]) by mx.google.com with ESMTPS id o32si17404229pld.407.2019.01.04.09.49.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 09:49:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dave@ray.jf.intel.com designates 192.55.52.115 as permitted sender) client-ip=192.55.52.115; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dave@ray.jf.intel.com designates 192.55.52.115 as permitted sender) smtp.mailfrom=dave@ray.jf.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2019 09:49:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,439,1539673200"; d="scan'208";a="131590776" Received: from unknown (HELO ray) ([10.251.0.234]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2019 09:49:50 -0800 Received: by ray (Postfix, from userid 1000) id 65CB6E063D; Fri, 4 Jan 2019 09:49:50 -0800 (PST) From: Dave Hansen To: dave.hansen@intel.com Cc: x86@kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Paolo Bonzini , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 1/5] x86/mpx: remove MPX APIs Date: Fri, 4 Jan 2019 09:49:39 -0800 Message-Id: <1546624183-26543-2-git-send-email-dave.hansen@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1546624183-26543-1-git-send-email-dave.hansen@linux.intel.com> References: <1546624183-26543-1-git-send-email-dave.hansen@linux.intel.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Dave Hansen MPX is being removed from the kernel due to a lack of support in the toolchain going forward (gcc). The first thing we need to do is remove the userspace-visible ABIs so that applications will stop using it. The most visible one are the enable/disable prctl()s. Remove them first. This is the most minimal and least invasive patch needed to start removing MPX. Signed-off-by: Dave Hansen --- include/uapi/linux/prctl.h | 2 +- kernel/sys.c | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/uapi/linux/prctl.h b/include/uapi/linux/prctl.h index b4875a9..78fcee3 100644 --- a/include/uapi/linux/prctl.h +++ b/include/uapi/linux/prctl.h @@ -181,7 +181,7 @@ struct prctl_mm_map { #define PR_GET_THP_DISABLE 42 /* - * Tell the kernel to start/stop helping userspace manage bounds tables. + * No longer implemented, but left here to ensure the numbers stay reserved: */ #define PR_MPX_ENABLE_MANAGEMENT 43 #define PR_MPX_DISABLE_MANAGEMENT 44 diff --git a/kernel/sys.c b/kernel/sys.c index a48cbf1..5fd7991 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -103,12 +103,6 @@ #ifndef SET_TSC_CTL # define SET_TSC_CTL(a) (-EINVAL) #endif -#ifndef MPX_ENABLE_MANAGEMENT -# define MPX_ENABLE_MANAGEMENT() (-EINVAL) -#endif -#ifndef MPX_DISABLE_MANAGEMENT -# define MPX_DISABLE_MANAGEMENT() (-EINVAL) -#endif #ifndef GET_FP_MODE # define GET_FP_MODE(a) (-EINVAL) #endif @@ -2448,15 +2442,9 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, up_write(&me->mm->mmap_sem); break; case PR_MPX_ENABLE_MANAGEMENT: - if (arg2 || arg3 || arg4 || arg5) - return -EINVAL; - error = MPX_ENABLE_MANAGEMENT(); - break; case PR_MPX_DISABLE_MANAGEMENT: - if (arg2 || arg3 || arg4 || arg5) - return -EINVAL; - error = MPX_DISABLE_MANAGEMENT(); - break; + /* No longer implemented: */ + return -EINVAL; case PR_SET_FP_MODE: error = SET_FP_MODE(me, arg2); break;