2019-02-08 06:03:19

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH 0/3] generic asm: mman cleanup

Now that we have MAP_SHARED, MAP_PRIVATE and MAP_SHARED_VALIDATE on all
architectures, it probably makes sense to de-duplicate these
and put them into a common header.

Please review and consider merging though the generic tree.

Build tested on x86 only. Has been in linux-next for a while now.

Michael S. Tsirkin (3):
x86/mpx: tweak header name
drm: tweak header name
arch: move common mmap flags to linux/mman.h

arch/alpha/include/uapi/asm/mman.h | 4 +---
arch/mips/include/uapi/asm/mman.h | 4 +---
arch/parisc/include/uapi/asm/mman.h | 4 +---
arch/x86/mm/mpx.c | 2 +-
arch/xtensa/include/uapi/asm/mman.h | 4 +---
include/drm/drmP.h | 3 +--
include/uapi/asm-generic/mman-common.h | 4 +---
include/uapi/linux/mman.h | 4 ++++
8 files changed, 11 insertions(+), 18 deletions(-)

--
MST



2019-02-08 06:03:24

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH 1/3] x86/mpx: tweak header name

Use linux/mman.h to make sure we get all mmap flags we need.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
arch/x86/mm/mpx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index de1851d15699..c805db6236b4 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -9,12 +9,12 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mm_types.h>
+#include <linux/mman.h>
#include <linux/syscalls.h>
#include <linux/sched/sysctl.h>

#include <asm/insn.h>
#include <asm/insn-eval.h>
-#include <asm/mman.h>
#include <asm/mmu_context.h>
#include <asm/mpx.h>
#include <asm/processor.h>
--
MST


2019-02-08 06:03:32

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH 2/3] drm: tweak header name

Use linux/mman.h to make sure we get all mmap flags we need.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
include/drm/drmP.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index bdb0d5548f39..a3184416ddc5 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -57,8 +57,7 @@
#include <linux/workqueue.h>
#include <linux/dma-fence.h>
#include <linux/module.h>
-
-#include <asm/mman.h>
+#include <linux/mman.h>
#include <asm/pgalloc.h>
#include <linux/uaccess.h>

--
MST


2019-02-08 06:03:34

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH 3/3] arch: move common mmap flags to linux/mman.h

Now that we have 3 mmap flags shared by all architectures,
let's move them into the common header.

This will help discourage future architectures from duplicating code.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
arch/alpha/include/uapi/asm/mman.h | 4 +---
arch/mips/include/uapi/asm/mman.h | 4 +---
arch/parisc/include/uapi/asm/mman.h | 4 +---
arch/xtensa/include/uapi/asm/mman.h | 4 +---
include/uapi/asm-generic/mman-common.h | 4 +---
include/uapi/linux/mman.h | 4 ++++
6 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/mman.h b/arch/alpha/include/uapi/asm/mman.h
index f9d4e6b6d4bd..ac23379b7a87 100644
--- a/arch/alpha/include/uapi/asm/mman.h
+++ b/arch/alpha/include/uapi/asm/mman.h
@@ -10,9 +10,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x0f /* Mask for type of mapping (OSF/1 is _wrong_) */
#define MAP_FIXED 0x100 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x10 /* don't use a file */
diff --git a/arch/mips/include/uapi/asm/mman.h b/arch/mips/include/uapi/asm/mman.h
index 3035ca499cd8..c2b40969eb1f 100644
--- a/arch/mips/include/uapi/asm/mman.h
+++ b/arch/mips/include/uapi/asm/mman.h
@@ -27,9 +27,7 @@
/*
* Flags for mmap
*/
-#define MAP_SHARED 0x001 /* Share changes */
-#define MAP_PRIVATE 0x002 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x00f /* Mask for type of mapping */
#define MAP_FIXED 0x010 /* Interpret addr exactly */

diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
index 870fbf8c7088..c98162f494db 100644
--- a/arch/parisc/include/uapi/asm/mman.h
+++ b/arch/parisc/include/uapi/asm/mman.h
@@ -10,9 +10,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x2b /* Mask for type of mapping, includes bits 0x08 and 0x20 */
#define MAP_FIXED 0x04 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x10 /* don't use a file */
diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h
index 58f29a9d895d..be726062412b 100644
--- a/arch/xtensa/include/uapi/asm/mman.h
+++ b/arch/xtensa/include/uapi/asm/mman.h
@@ -34,9 +34,7 @@
/*
* Flags for mmap
*/
-#define MAP_SHARED 0x001 /* Share changes */
-#define MAP_PRIVATE 0x002 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x00f /* Mask for type of mapping */
#define MAP_FIXED 0x010 /* Interpret addr exactly */

diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h
index e7ee32861d51..abd238d0f7a4 100644
--- a/include/uapi/asm-generic/mman-common.h
+++ b/include/uapi/asm-generic/mman-common.h
@@ -15,9 +15,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x0f /* Mask for type of mapping */
#define MAP_FIXED 0x10 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x20 /* don't use a file */
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
index d0f515d53299..fc1a64c3447b 100644
--- a/include/uapi/linux/mman.h
+++ b/include/uapi/linux/mman.h
@@ -12,6 +12,10 @@
#define OVERCOMMIT_ALWAYS 1
#define OVERCOMMIT_NEVER 2

+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+
/*
* Huge page size encoding when MAP_HUGETLB is specified, and a huge page
* size other than the default is desired. See hugetlb_encode.h.
--
MST


2019-02-08 06:04:08

by Michael S. Tsirkin

[permalink] [raw]
Subject: [PATCH 2/2] arch: move common mmap flags to linux/mman.h

Now that we have 3 mmap flags shared by all architectures,
let's move them into the common header.

This will help discourage future architectures from duplicating code.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
arch/alpha/include/uapi/asm/mman.h | 4 +---
arch/mips/include/uapi/asm/mman.h | 4 +---
arch/parisc/include/uapi/asm/mman.h | 4 +---
arch/xtensa/include/uapi/asm/mman.h | 4 +---
include/uapi/asm-generic/mman-common.h | 4 +---
include/uapi/linux/mman.h | 4 ++++
6 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/mman.h b/arch/alpha/include/uapi/asm/mman.h
index f9d4e6b6d4bd..ac23379b7a87 100644
--- a/arch/alpha/include/uapi/asm/mman.h
+++ b/arch/alpha/include/uapi/asm/mman.h
@@ -10,9 +10,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x0f /* Mask for type of mapping (OSF/1 is _wrong_) */
#define MAP_FIXED 0x100 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x10 /* don't use a file */
diff --git a/arch/mips/include/uapi/asm/mman.h b/arch/mips/include/uapi/asm/mman.h
index 3035ca499cd8..c2b40969eb1f 100644
--- a/arch/mips/include/uapi/asm/mman.h
+++ b/arch/mips/include/uapi/asm/mman.h
@@ -27,9 +27,7 @@
/*
* Flags for mmap
*/
-#define MAP_SHARED 0x001 /* Share changes */
-#define MAP_PRIVATE 0x002 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x00f /* Mask for type of mapping */
#define MAP_FIXED 0x010 /* Interpret addr exactly */

diff --git a/arch/parisc/include/uapi/asm/mman.h b/arch/parisc/include/uapi/asm/mman.h
index 870fbf8c7088..c98162f494db 100644
--- a/arch/parisc/include/uapi/asm/mman.h
+++ b/arch/parisc/include/uapi/asm/mman.h
@@ -10,9 +10,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x2b /* Mask for type of mapping, includes bits 0x08 and 0x20 */
#define MAP_FIXED 0x04 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x10 /* don't use a file */
diff --git a/arch/xtensa/include/uapi/asm/mman.h b/arch/xtensa/include/uapi/asm/mman.h
index 58f29a9d895d..be726062412b 100644
--- a/arch/xtensa/include/uapi/asm/mman.h
+++ b/arch/xtensa/include/uapi/asm/mman.h
@@ -34,9 +34,7 @@
/*
* Flags for mmap
*/
-#define MAP_SHARED 0x001 /* Share changes */
-#define MAP_PRIVATE 0x002 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x003 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x00f /* Mask for type of mapping */
#define MAP_FIXED 0x010 /* Interpret addr exactly */

diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h
index e7ee32861d51..abd238d0f7a4 100644
--- a/include/uapi/asm-generic/mman-common.h
+++ b/include/uapi/asm-generic/mman-common.h
@@ -15,9 +15,7 @@
#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */

-#define MAP_SHARED 0x01 /* Share changes */
-#define MAP_PRIVATE 0x02 /* Changes are private */
-#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+/* 0x01 - 0x03 are defined in linux/mman.h */
#define MAP_TYPE 0x0f /* Mask for type of mapping */
#define MAP_FIXED 0x10 /* Interpret addr exactly */
#define MAP_ANONYMOUS 0x20 /* don't use a file */
diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h
index d0f515d53299..fc1a64c3447b 100644
--- a/include/uapi/linux/mman.h
+++ b/include/uapi/linux/mman.h
@@ -12,6 +12,10 @@
#define OVERCOMMIT_ALWAYS 1
#define OVERCOMMIT_NEVER 2

+#define MAP_SHARED 0x01 /* Share changes */
+#define MAP_PRIVATE 0x02 /* Changes are private */
+#define MAP_SHARED_VALIDATE 0x03 /* share + validate extension flags */
+
/*
* Huge page size encoding when MAP_HUGETLB is specified, and a huge page
* size other than the default is desired. See hugetlb_encode.h.
--
MST


2019-02-08 08:57:54

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH 2/3] drm: tweak header name

On Fri, Feb 08, 2019 at 01:02:58AM -0500, Michael S. Tsirkin wrote:
> Use linux/mman.h to make sure we get all mmap flags we need.
>
> Signed-off-by: Michael S. Tsirkin <[email protected]>

drmP.h is seriously deprecated (and a monster mess). If this fixes
anything, I think would be better to include the right header in the right
places, and leave drmP.h to die quietly ...

What exactly does this fix?
-Daniel

> ---
> include/drm/drmP.h | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index bdb0d5548f39..a3184416ddc5 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -57,8 +57,7 @@
> #include <linux/workqueue.h>
> #include <linux/dma-fence.h>
> #include <linux/module.h>
> -
> -#include <asm/mman.h>
> +#include <linux/mman.h>
> #include <asm/pgalloc.h>
> #include <linux/uaccess.h>
>
> --
> MST
>

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

2019-02-08 12:56:06

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH 2/3] drm: tweak header name

On Fri, Feb 08, 2019 at 09:56:59AM +0100, Daniel Vetter wrote:
> On Fri, Feb 08, 2019 at 01:02:58AM -0500, Michael S. Tsirkin wrote:
> > Use linux/mman.h to make sure we get all mmap flags we need.
> >
> > Signed-off-by: Michael S. Tsirkin <[email protected]>
>
> drmP.h is seriously deprecated (and a monster mess). If this fixes
> anything, I think would be better to include the right header in the right
> places, and leave drmP.h to die quietly ...
>
> What exactly does this fix?
> -Daniel

I don't know. I am moving flags from asm/mman.h and if there
are direct users which there should not be, some code
might break. Even if it's a bad header people copy
code around, so why leave wrong examples there?
What's the harm in being proactive?


> > ---
> > include/drm/drmP.h | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> > index bdb0d5548f39..a3184416ddc5 100644
> > --- a/include/drm/drmP.h
> > +++ b/include/drm/drmP.h
> > @@ -57,8 +57,7 @@
> > #include <linux/workqueue.h>
> > #include <linux/dma-fence.h>
> > #include <linux/module.h>
> > -
> > -#include <asm/mman.h>
> > +#include <linux/mman.h>
> > #include <asm/pgalloc.h>
> > #include <linux/uaccess.h>
> >
> > --
> > MST
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

2019-02-08 15:43:10

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mpx: tweak header name

On Fri, Feb 08, 2019 at 01:02:53AM -0500, Michael S. Tsirkin wrote:
> Use linux/mman.h to make sure we get all mmap flags we need.

Why, asm/mman.h is not enough or is this fixing a build issue or what is that
patch supposed to address?

>
> Signed-off-by: Michael S. Tsirkin <[email protected]>
> ---
> arch/x86/mm/mpx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
> index de1851d15699..c805db6236b4 100644
> --- a/arch/x86/mm/mpx.c
> +++ b/arch/x86/mm/mpx.c
> @@ -9,12 +9,12 @@
> #include <linux/kernel.h>
> #include <linux/slab.h>
> #include <linux/mm_types.h>
> +#include <linux/mman.h>
> #include <linux/syscalls.h>
> #include <linux/sched/sysctl.h>
>
> #include <asm/insn.h>
> #include <asm/insn-eval.h>
> -#include <asm/mman.h>
> #include <asm/mmu_context.h>
> #include <asm/mpx.h>
> #include <asm/processor.h>
> --

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

2019-02-08 18:14:33

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 0/3] generic asm: mman cleanup

On Fri, Feb 08, 2019 at 01:02:51AM -0500, Michael S. Tsirkin wrote:
> Now that we have MAP_SHARED, MAP_PRIVATE and MAP_SHARED_VALIDATE on all
> architectures, it probably makes sense to de-duplicate these
> and put them into a common header.

I like the idea, but it seems there are more asm/mman.h users than just mpx
and drm.

Any reason only those were updated to include linux/mman.h?


> Please review and consider merging though the generic tree.
>
> Build tested on x86 only. Has been in linux-next for a while now.
>
> Michael S. Tsirkin (3):
> x86/mpx: tweak header name
> drm: tweak header name
> arch: move common mmap flags to linux/mman.h
>
> arch/alpha/include/uapi/asm/mman.h | 4 +---
> arch/mips/include/uapi/asm/mman.h | 4 +---
> arch/parisc/include/uapi/asm/mman.h | 4 +---
> arch/x86/mm/mpx.c | 2 +-
> arch/xtensa/include/uapi/asm/mman.h | 4 +---
> include/drm/drmP.h | 3 +--
> include/uapi/asm-generic/mman-common.h | 4 +---
> include/uapi/linux/mman.h | 4 ++++
> 8 files changed, 11 insertions(+), 18 deletions(-)
>
> --
> MST
>

--
Sincerely yours,
Mike.


2019-02-08 21:19:56

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH 0/3] generic asm: mman cleanup

On Fri, Feb 08, 2019 at 08:12:47PM +0200, Mike Rapoport wrote:
> On Fri, Feb 08, 2019 at 01:02:51AM -0500, Michael S. Tsirkin wrote:
> > Now that we have MAP_SHARED, MAP_PRIVATE and MAP_SHARED_VALIDATE on all
> > architectures, it probably makes sense to de-duplicate these
> > and put them into a common header.
>
> I like the idea, but it seems there are more asm/mman.h users than just mpx
> and drm.
>
> Any reason only those were updated to include linux/mman.h?


They are all .c files. So since they keep building I know
nothing else will break. Fixing them would be an unrelated
cleanup.



>
> > Please review and consider merging though the generic tree.
> >
> > Build tested on x86 only. Has been in linux-next for a while now.
> >
> > Michael S. Tsirkin (3):
> > x86/mpx: tweak header name
> > drm: tweak header name
> > arch: move common mmap flags to linux/mman.h
> >
> > arch/alpha/include/uapi/asm/mman.h | 4 +---
> > arch/mips/include/uapi/asm/mman.h | 4 +---
> > arch/parisc/include/uapi/asm/mman.h | 4 +---
> > arch/x86/mm/mpx.c | 2 +-
> > arch/xtensa/include/uapi/asm/mman.h | 4 +---
> > include/drm/drmP.h | 3 +--
> > include/uapi/asm-generic/mman-common.h | 4 +---
> > include/uapi/linux/mman.h | 4 ++++
> > 8 files changed, 11 insertions(+), 18 deletions(-)
> >
> > --
> > MST
> >
>
> --
> Sincerely yours,
> Mike.

2019-02-08 21:44:42

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mpx: tweak header name

On Fri, Feb 08, 2019 at 04:42:39PM +0100, Borislav Petkov wrote:
> On Fri, Feb 08, 2019 at 01:02:53AM -0500, Michael S. Tsirkin wrote:
> > Use linux/mman.h to make sure we get all mmap flags we need.
>
> Why, asm/mman.h is not enough or is this fixing a build issue or what is that
> patch supposed to address?

Coding style violation: if a linux/foo.h exists then it must
be included in preference to asm/foo.h

And the specific issue is that a follow-up patch moves code from
asm/mman.h to linux/mman.h so if any one was indirectly using
this header it will now miss the symbols that are being moved.





> >
> > Signed-off-by: Michael S. Tsirkin <[email protected]>
> > ---
> > arch/x86/mm/mpx.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
> > index de1851d15699..c805db6236b4 100644
> > --- a/arch/x86/mm/mpx.c
> > +++ b/arch/x86/mm/mpx.c
> > @@ -9,12 +9,12 @@
> > #include <linux/kernel.h>
> > #include <linux/slab.h>
> > #include <linux/mm_types.h>
> > +#include <linux/mman.h>
> > #include <linux/syscalls.h>
> > #include <linux/sched/sysctl.h>
> >
> > #include <asm/insn.h>
> > #include <asm/insn-eval.h>
> > -#include <asm/mman.h>
> > #include <asm/mmu_context.h>
> > #include <asm/mpx.h>
> > #include <asm/processor.h>
> > --
>
> Thx.
>
> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.

2019-02-08 21:51:16

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mpx: tweak header name

On 2/8/19 1:43 PM, Michael S. Tsirkin wrote:
> On Fri, Feb 08, 2019 at 04:42:39PM +0100, Borislav Petkov wrote:
>> On Fri, Feb 08, 2019 at 01:02:53AM -0500, Michael S. Tsirkin wrote:
>>> Use linux/mman.h to make sure we get all mmap flags we need.
>> Why, asm/mman.h is not enough or is this fixing a build issue or what is that
>> patch supposed to address?
> Coding style violation: if a linux/foo.h exists then it must
> be included in preference to asm/foo.h

Huh, I don't see that one in Documentation/process/coding-style.rst

> And the specific issue is that a follow-up patch moves code from
> asm/mman.h to linux/mman.h so if any one was indirectly using
> this header it will now miss the symbols that are being moved.

Fair enough. But, if this is the real reason, it belongs in the changelog.




2019-02-08 21:53:12

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mpx: tweak header name

On Fri, Feb 08, 2019 at 04:43:37PM -0500, Michael S. Tsirkin wrote:
> Coding style violation: if a linux/foo.h exists then it must
> be included in preference to asm/foo.h
>
> And the specific issue is that a follow-up patch moves code from
> asm/mman.h to linux/mman.h so if any one was indirectly using
> this header it will now miss the symbols that are being moved.

Ok, so first of all, this should be your commit message - not what you
have there now.

Then, please send full patchsets to recipients - I have only this patch
in my mbox and have no clue what the whole patchset is addressing.

Further, do you want an ACK only or should I pick this up?

Finally, this whole file is going away:

https://lkml.kernel.org/r/[email protected]

so your patch might become obsolete by then. Depends on what goes first.

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

2019-02-10 00:21:25

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mpx: tweak header name

On Fri, Feb 08, 2019 at 10:52:32PM +0100, Borislav Petkov wrote:
> On Fri, Feb 08, 2019 at 04:43:37PM -0500, Michael S. Tsirkin wrote:
> > Coding style violation: if a linux/foo.h exists then it must
> > be included in preference to asm/foo.h
> >
> > And the specific issue is that a follow-up patch moves code from
> > asm/mman.h to linux/mman.h so if any one was indirectly using
> > this header it will now miss the symbols that are being moved.
>
> Ok, so first of all, this should be your commit message - not what you
> have there now.
>
> Then, please send full patchsets to recipients - I have only this patch
> in my mbox and have no clue what the whole patchset is addressing.

I can copy you on all patches, sure.

> Further, do you want an ACK only or should I pick this up?


If you can pick it up then great.

> Finally, this whole file is going away:
>
> https://lkml.kernel.org/r/[email protected]
>
> so your patch might become obsolete by then. Depends on what goes first.
>
> Thx.


> --
> Regards/Gruss,
> Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.

2019-02-11 04:21:03

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH 0/3] generic asm: mman cleanup

On Fri, Feb 08, 2019 at 01:02:51AM -0500, Michael S. Tsirkin wrote:
> Now that we have MAP_SHARED, MAP_PRIVATE and MAP_SHARED_VALIDATE on all
> architectures, it probably makes sense to de-duplicate these
> and put them into a common header.
>
> Please review and consider merging though the generic tree.
>
> Build tested on x86 only. Has been in linux-next for a while now.

Arnd, would you consider merging at least the cleanups 2/3 and 3/3?
In linux-next they had no ill effects and make things
slightly cleaner IMO.


> Michael S. Tsirkin (3):
> x86/mpx: tweak header name
> drm: tweak header name
> arch: move common mmap flags to linux/mman.h
>
> arch/alpha/include/uapi/asm/mman.h | 4 +---
> arch/mips/include/uapi/asm/mman.h | 4 +---
> arch/parisc/include/uapi/asm/mman.h | 4 +---
> arch/x86/mm/mpx.c | 2 +-
> arch/xtensa/include/uapi/asm/mman.h | 4 +---
> include/drm/drmP.h | 3 +--
> include/uapi/asm-generic/mman-common.h | 4 +---
> include/uapi/linux/mman.h | 4 ++++
> 8 files changed, 11 insertions(+), 18 deletions(-)
>
> --
> MST
>

2019-02-18 14:26:35

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 0/3] generic asm: mman cleanup

On Mon, Feb 11, 2019 at 5:20 AM Michael S. Tsirkin <[email protected]> wrote:
>
> On Fri, Feb 08, 2019 at 01:02:51AM -0500, Michael S. Tsirkin wrote:
> > Now that we have MAP_SHARED, MAP_PRIVATE and MAP_SHARED_VALIDATE on all
> > architectures, it probably makes sense to de-duplicate these
> > and put them into a common header.
> >
> > Please review and consider merging though the generic tree.
> >
> > Build tested on x86 only. Has been in linux-next for a while now.
>
> Arnd, would you consider merging at least the cleanups 2/3 and 3/3?
> In linux-next they had no ill effects and make things
> slightly cleaner IMO.

I applied patches 2 and 3 now, sorry for the late reply.

Arnd