From patchwork Fri Aug 4 16:31:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 9881681 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 5EF256031B for ; Fri, 4 Aug 2017 16:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42D35287BD for ; Fri, 4 Aug 2017 16:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 351DE2880D; Fri, 4 Aug 2017 16:32:00 +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.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 A9E99287BD for ; Fri, 4 Aug 2017 16:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752614AbdHDQb6 (ORCPT ); Fri, 4 Aug 2017 12:31:58 -0400 Received: from mout.gmx.net ([212.227.15.18]:51420 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbdHDQb5 (ORCPT ); Fri, 4 Aug 2017 12:31:57 -0400 Received: from p100.box ([193.159.17.37]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LmbZb-1d59yX3OPj-00aBFa; Fri, 04 Aug 2017 18:31:50 +0200 Date: Fri, 4 Aug 2017 18:31:48 +0200 From: Helge Deller To: linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org, James Bottomley , John David Anglin Subject: [PATCH] parisc: Fix up generic MADV_* values and add MADV_HWPOISON and MADV_SOFT_OFFLINE Message-ID: <20170804163148.GA29168@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:oKVSya5es4jv7NrQuE/mRCrmSz16+G3dHY/MvpbwXTFLZ9jaqd0 1On6XZKs9f/CcV/2+ydSOTFqwuosfO22fEDXH9ui0iwZX6yb/eScT4Dwxvu9UTezpPghBO9 xZ6w8M7FNNFJPor8xYiuEObOmmt5pfOUjJDx3+GQxFMvnLAYWViBlZ9ZfA2DXLRNt0q2xO2 wlitP4g21qLnOdrtvQKxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:JUENzmb+jlU=:bIMiwhUVVlHT0wzL+1xQfv unyCMlde+2HDS1p0a9+CJUMKAlGRPaKiEfPOGySHWk7sNptFIMz/8QDx+AhrmgcIa5ddQUpJl 5AAk7iL9nNRa193OMfpVMa5/Hcms+SQ021FSIYmECO+g3V2MLvveJDHN1FUpnNk9e6DtKCPR6 TxE5rHMiqQjJsH+3ltBrtbmNEimO3AWhvQLvRQVPOL1qN97/J8JyV7h+YcoPvxaqPkNFwG/uo PcuUsWpBUD3c5bUG9blmPBr6V22GQhtiXUKGf6f6IQDJc2uVPyMSJniN2wNkIeEKmHtl8hd9J pDh195WHn/XYpzfBE80L4yWnzeo/eXAsJBBV9ZkP6255ar5Mm03/RTQXiWSI6nNtvVloLyJVM +y+X9/Uhxn6dI06ZmANkEH7xtTtFfnEHiJm3uLJJNT49OrwqiVowrIWpTDuUXnsEYd+PzBCVQ Cl/zsvsD/aNBWkFpkl+Pc4YHisYtElCmeRwp0FEU/s0ZVstqREMuyoUvPX3d33cOmmQ+BlM1b +ZszI4sJWz+O7GtemSqVXHZ+y3OYyiL1rkrWXnXd+RtSUHc755AicZl5f1e4ilI+l21DOS47A uFgJAvip7QtbSHJIFN9X1rGWFjS8FKeqM2fnLQ9obmyeWyvZ2MfltxoGBlhqoNkxljoJK2Eqw +DqQebqG/8LFzF05BKRx8a9uklPObESURmpm2D0qlH5wL7ulw2mWirILZCPJEM1vSCRxN1k9F 9NEe0BUCHDxY7Ulb9UkttjBZRss6uOWGHwhNc6TBHbjb+Po/+7ntgliq3g4lBbKCnWY7X26lk QaY97YUScHwbpg2EVl3pqUthA6m6g== 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 This patch adds the missing MADV_HWPOISON (100) and MADV_SOFT_OFFLINE (101) defines which are needed for an upcoming patch which adds page-deallocation to parisc. In addition there is a conflict with some the common/generic MADV_* constants between kernel headers and glibc headers. The existing glibc headers on parisc already define those values in the range of 8-17 which should be common between all architectures and which all architectures with the exception of parisc follow. But the parisc kernel still defines those with values above 65 because of an old kernel patch which reserved the range of 12-64 for page size specifications. The old kernel patch never actually used those values in code, so changing those MADV_* constants back to the common values shouldn't break anything and instead make existing userspace applications work as expected. 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 5979745..a34ebf4 100644 --- a/arch/parisc/include/uapi/asm/mman.h +++ b/arch/parisc/include/uapi/asm/mman.h @@ -49,16 +49,18 @@ #define MADV_REMOVE 9 /* remove these pages & resources */ #define MADV_DONTFORK 10 /* don't inherit across fork */ #define MADV_DOFORK 11 /* do inherit across fork */ +#define MADV_HWPOISON 100 /* poison a page for testing */ +#define MADV_SOFT_OFFLINE 101 /* soft offline page for testing */ -#define MADV_MERGEABLE 65 /* KSM may merge identical pages */ -#define MADV_UNMERGEABLE 66 /* KSM may not merge identical pages */ +#define MADV_MERGEABLE 12 /* KSM may merge identical pages */ +#define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ -#define MADV_HUGEPAGE 67 /* Worth backing with hugepages */ -#define MADV_NOHUGEPAGE 68 /* Not worth backing with hugepages */ +#define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ +#define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ -#define MADV_DONTDUMP 69 /* Explicity exclude from the core dump, +#define MADV_DONTDUMP 16 /* Explicity exclude from the core dump, overrides the coredump filter bits */ -#define MADV_DODUMP 70 /* Clear the MADV_NODUMP flag */ +#define MADV_DODUMP 17 /* Clear the MADV_NODUMP flag */ /* compatibility flags */ #define MAP_FILE 0 diff --git a/tools/arch/parisc/include/uapi/asm/mman.h b/tools/arch/parisc/include/uapi/asm/mman.h index 03d8d5b..eb4df3e 100644 --- a/tools/arch/parisc/include/uapi/asm/mman.h +++ b/tools/arch/parisc/include/uapi/asm/mman.h @@ -1,20 +1,22 @@ #ifndef TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H #define TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H -#define MADV_DODUMP 70 -#define MADV_DOFORK 11 -#define MADV_DONTDUMP 69 -#define MADV_DONTFORK 10 -#define MADV_DONTNEED 4 -#define MADV_FREE 8 -#define MADV_HUGEPAGE 67 -#define MADV_MERGEABLE 65 -#define MADV_NOHUGEPAGE 68 #define MADV_NORMAL 0 #define MADV_RANDOM 1 -#define MADV_REMOVE 9 #define MADV_SEQUENTIAL 2 -#define MADV_UNMERGEABLE 66 #define MADV_WILLNEED 3 +#define MADV_DONTNEED 4 +#define MADV_FREE 8 +#define MADV_REMOVE 9 +#define MADV_DONTFORK 10 +#define MADV_DOFORK 11 +#define MADV_HWPOISON 100 +#define MADV_SOFT_OFFLINE 101 +#define MADV_MERGEABLE 12 +#define MADV_UNMERGEABLE 13 +#define MADV_HUGEPAGE 14 +#define MADV_NOHUGEPAGE 15 +#define MADV_DONTDUMP 16 +#define MADV_DODUMP 17 #define MAP_ANONYMOUS 0x10 #define MAP_DENYWRITE 0x0800 #define MAP_EXECUTABLE 0x1000 @@ -36,10 +38,6 @@ #define PROT_READ 0x1 #define PROT_SEM 0x8 #define PROT_WRITE 0x2 -/* MADV_HWPOISON is undefined on parisc, fix it for perf */ -#define MADV_HWPOISON 100 -/* MADV_SOFT_OFFLINE is undefined on parisc, fix it for perf */ -#define MADV_SOFT_OFFLINE 101 /* MAP_32BIT is undefined on parisc, fix it for perf */ #define MAP_32BIT 0 /* MAP_UNINITIALIZED is undefined on parisc, fix it for perf */