From patchwork Mon Sep 25 22:21:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9970553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 272C7602CB for ; Mon, 25 Sep 2017 22:21:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1873428D75 for ; Mon, 25 Sep 2017 22:21:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C85028DC4; Mon, 25 Sep 2017 22:21:41 +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=-6.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A5F028D75 for ; Mon, 25 Sep 2017 22:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935291AbdIYWVj (ORCPT ); Mon, 25 Sep 2017 18:21:39 -0400 Received: from mout.gmx.net ([212.227.15.18]:53270 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934948AbdIYWVg (ORCPT ); Mon, 25 Sep 2017 18:21:36 -0400 Received: from ls3530.fritz.box ([91.36.205.52]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LsChr-1dDlWX26Wd-013yua; Tue, 26 Sep 2017 00:21:30 +0200 Date: Tue, 26 Sep 2017 00:21:27 +0200 From: Helge Deller To: linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH][RFC] parisc: Convert MAP_TYPE to cover 4 bits on parisc Message-ID: <20170925222127.GA29387@ls3530.fritz.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.0 (2017-09-02) X-Provags-ID: V03:K0:Wy9nDD4cOc4dKkAYEtyuV66dm88oa6+gdSDyu8yfC2rk16cPRXM nxefXA/hCaopgNZJwqImaIMkmFqjnvN+mi4Q8AZ5WdOcoDr9zWP3bfRYkNyKLtVeaVC+h/z bb0rKDbmptQjwp/pPqs9NKBLZaMnU5mzVKhXppSBNxEfJblWlSFcbFv6CI93eQYRAqp0Fp6 cAAhVMwmtT5oDaSOGlvYQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:S1nYcXH1f98=:oK9kDjSqpg/1AV5WsWYlkq 4cVAl1gDrvvZJkCdaTTDSN+nkRYYeKlYBw6hBCzb1d9qCNeNYsKNu6YKE6JY5dCqy/bcGs/OL 9dahJN0F48k+Nn2pW/gFbFqwNXxCW1ygYuvihI99eEvEHl0CArBMvAMSu1PkvSy8pONhaRCnk R95U/A01fy7OxNgXG84YwTAluXIw4PpNio4GUhZET1E7l9mVX8DDgnGe3hws2KtRULf3apY94 svVCv2AyqlXzdzYE3pBA/FH02Q8znRbKY69+/314q1jOSthv2F7RbvZwm1AXh30w7bLXD8LWP m5UpbHtxRyYlKS/elVVzM1g76rdl0U87SyBITCNdrdqFxAmm7CmeEtw2MFYoYY5Ikdf8gs30a x1uq8dbXkzdFARJAvKKoAjNl/f/HPTqpGFw4Cb3p6WAwmhhGGqKpMtv341QvfWzepNOiRZ9Zx 72ztm/iTCu0RIaTKx20+IuIjfI1xFgPl+2TRgaEF5BuENM4WQ8qgA/9Fe3ZcHI6ukR6ifNos7 JaO3vS3+F2VDLS0u8HNOP03E3MhkfGqMzPWZKOf6WdiVcGujc73vPS4ZPGbRWUZXHt2FZQlfO 0N99DfAd13I/emgS8SaCaVA8KjFJ5axSMpLSOBcycQhG7YLkf9kC47PXC50dQajIyTv2B/MCL Dqq+8lY3cQS4VMmiN67SHVWCsg1slfRi6f7NupRu516kQ57LgpyOuudSdX6HTyJUiLk97Gsdi rRR7BCGqr25Mv4PVqa1+5iHZRFvCECF3EV9GhXLO36fLy7d4rkwf7HFxtQHVZ7LkDMf7AU4CG 9bJR8VbLmbSL993Ym0ERo1BDPo+zA== Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On parisc we want to be as much as possible compatible to the major architectures like x86. Those architectures have MAP_TYPE defined as 0x0f which covers MAP_SHARED and MAP_PRIVATE and leaves two more bits unused. In contrast, on parisc we have MAP_TYPE defined to 0x03 which covers MAP_SHARED and MAP_PRIVATE only. But we don't have the 2 bits free as x86. Usually that's not a problem, but during the discussions for pmem+dax support the idea came up to use the two remaining bits of MAP_TYPE (on x86 and others) for the new MAP_DIRECT and MAP_SYNC flags. One requirement is, that an old kernel should correctly handle MAP_DIRECT and MAP_SYNC and fail on those if set. This only works if MAP_TYPE has 4 bits. That said, this patch adds the two missing bits in order to gain compatibility to x86 and to be maybe prepared if at some point in future we will add pmem+dax support (or any other use case as it's done for x86). The patch as it is now will not break any old kernel, and if those bits will be used at some point in future, it's a requirement that users will need to run a kernel with this patch installed. Link: http://lkml.org/lkml/2017/8/25/502 Link: http://lkml.org/r/4de21e8d-5e10-ec40-c731-0c079953cf48@gmx.de Cc: stable@vger.kernel.org Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h index 775b5d5e41a1..71b0d58dcacd 100644 --- a/arch/parisc/include/uapi/asm/mman.h +++ b/arch/parisc/include/uapi/asm/mman.h @@ -11,9 +11,11 @@ #define MAP_SHARED 0x01 /* Share changes */ #define MAP_PRIVATE 0x02 /* Changes are private */ -#define MAP_TYPE 0x03 /* Mask for type of mapping */ +#define MAP_TYPE (MAP_SHARED|MAP_PRIVATE|MAP_RESRVD1|MAP_RESRVD2) /* Mask for type of mapping */ #define MAP_FIXED 0x04 /* Interpret addr exactly */ +#define MAP_RESRVD1 0x08 /* reserved for 3rd bit of MAP_TYPE */ #define MAP_ANONYMOUS 0x10 /* don't use a file */ +#define MAP_RESRVD2 0x20 /* reserved for 4th bit of MAP_TYPE */ #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ #define MAP_EXECUTABLE 0x1000 /* mark it as an executable */