diff mbox series

arch: unexport asm/shmparam.h for all architectures

Message ID 1546904307-11124-1-git-send-email-yamada.masahiro@socionext.com
State Accepted
Commit 36c0f7f0f89984bb21e6d0f92d776faf7be73096
Headers show
Series arch: unexport asm/shmparam.h for all architectures | expand

Commit Message

Masahiro Yamada Jan. 7, 2019, 11:38 p.m. UTC
Most architectures do not export shmparam.h to user-space.

  $ find arch -name shmparam.h  | sort
  arch/alpha/include/asm/shmparam.h
  arch/arc/include/asm/shmparam.h
  arch/arm64/include/asm/shmparam.h
  arch/arm/include/asm/shmparam.h
  arch/csky/include/asm/shmparam.h
  arch/ia64/include/asm/shmparam.h
  arch/mips/include/asm/shmparam.h
  arch/nds32/include/asm/shmparam.h
  arch/nios2/include/asm/shmparam.h
  arch/parisc/include/asm/shmparam.h
  arch/powerpc/include/asm/shmparam.h
  arch/s390/include/asm/shmparam.h
  arch/sh/include/asm/shmparam.h
  arch/sparc/include/asm/shmparam.h
  arch/x86/include/asm/shmparam.h
  arch/xtensa/include/asm/shmparam.h

Strangely, some users of the asm-generic wrapper export shmparam.h

  $ git grep 'generic-y += shmparam.h'
  arch/c6x/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/h8300/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/hexagon/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/m68k/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/microblaze/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/openrisc/include/uapi/asm/Kbuild:generic-y += shmparam.h
  arch/riscv/include/asm/Kbuild:generic-y += shmparam.h
  arch/unicore32/include/uapi/asm/Kbuild:generic-y += shmparam.h

The newly added riscv correctly creates the asm-generic wrapper
in the kernel space, but the others (c6x, h8300, hexagon, m68k,
microblaze, openrisc, unicore32) create the one in the uapi directory.

Digging into the git history, now I guess fcc8487d477a ("uapi:
export all headers under uapi directories") was the misconversion.
Prior to that commit, no architecture exported to shmparam.h
As its commit description said, that commit exported shmparam.h
for c6x, h8300, hexagon, m68k, openrisc, unicore32.

83f0124ad81e ("microblaze: remove asm-generic wrapper headers")
accidentally exported shmparam.h for microblaze.

This commit unexports shmparam.h for those architectures.

There is no more reason to export include/uapi/asm-generic/shmparam.h,
so it has been moved to include/asm-generic/shmparam.h

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

---

 arch/c6x/include/asm/Kbuild               | 1 +
 arch/c6x/include/uapi/asm/Kbuild          | 1 -
 arch/h8300/include/asm/Kbuild             | 1 +
 arch/h8300/include/uapi/asm/Kbuild        | 1 -
 arch/hexagon/include/asm/Kbuild           | 1 +
 arch/hexagon/include/uapi/asm/Kbuild      | 1 -
 arch/m68k/include/asm/Kbuild              | 1 +
 arch/m68k/include/uapi/asm/Kbuild         | 1 -
 arch/microblaze/include/asm/Kbuild        | 1 +
 arch/microblaze/include/uapi/asm/Kbuild   | 1 -
 arch/openrisc/include/asm/Kbuild          | 1 +
 arch/openrisc/include/uapi/asm/Kbuild     | 1 -
 arch/unicore32/include/asm/Kbuild         | 1 +
 arch/unicore32/include/uapi/asm/Kbuild    | 1 -
 include/{uapi => }/asm-generic/shmparam.h | 0
 15 files changed, 7 insertions(+), 7 deletions(-)
 rename include/{uapi => }/asm-generic/shmparam.h (100%)

-- 
2.7.4

Comments

Geert Uytterhoeven Jan. 8, 2019, 7:56 a.m. UTC | #1
Hi Yamada-san,

On Tue, Jan 8, 2019 at 12:41 AM Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> Most architectures do not export shmparam.h to user-space.

>

>   $ find arch -name shmparam.h  | sort

>   arch/alpha/include/asm/shmparam.h

>   arch/arc/include/asm/shmparam.h

>   arch/arm64/include/asm/shmparam.h

>   arch/arm/include/asm/shmparam.h

>   arch/csky/include/asm/shmparam.h

>   arch/ia64/include/asm/shmparam.h

>   arch/mips/include/asm/shmparam.h

>   arch/nds32/include/asm/shmparam.h

>   arch/nios2/include/asm/shmparam.h

>   arch/parisc/include/asm/shmparam.h

>   arch/powerpc/include/asm/shmparam.h

>   arch/s390/include/asm/shmparam.h

>   arch/sh/include/asm/shmparam.h

>   arch/sparc/include/asm/shmparam.h

>   arch/x86/include/asm/shmparam.h

>   arch/xtensa/include/asm/shmparam.h

>

> Strangely, some users of the asm-generic wrapper export shmparam.h

>

>   $ git grep 'generic-y += shmparam.h'

>   arch/c6x/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/h8300/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/hexagon/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/m68k/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/microblaze/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/openrisc/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/riscv/include/asm/Kbuild:generic-y += shmparam.h

>   arch/unicore32/include/uapi/asm/Kbuild:generic-y += shmparam.h

>

> The newly added riscv correctly creates the asm-generic wrapper

> in the kernel space, but the others (c6x, h8300, hexagon, m68k,

> microblaze, openrisc, unicore32) create the one in the uapi directory.

>

> Digging into the git history, now I guess fcc8487d477a ("uapi:

> export all headers under uapi directories") was the misconversion.

> Prior to that commit, no architecture exported to shmparam.h

> As its commit description said, that commit exported shmparam.h

> for c6x, h8300, hexagon, m68k, openrisc, unicore32.

>

> 83f0124ad81e ("microblaze: remove asm-generic wrapper headers")

> accidentally exported shmparam.h for microblaze.

>

> This commit unexports shmparam.h for those architectures.

>

> There is no more reason to export include/uapi/asm-generic/shmparam.h,

> so it has been moved to include/asm-generic/shmparam.h

>

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


Thanks for your patch!

include/uapi/asm-generic/shmparam.h contains a single definition:

    #define SHMLBA PAGE_SIZE         /* attach addr a multiple of this */

So this definition is not used by userspace?

Note that it is refered to by include/uapi/linux/shm.h, albeit in a comment:

    #define SHM_RND         020000  /* round attach address to SHMLBA
boundary */

Glibc provides its own definition in /usr/include/x86_64-linux-gnu/bits/shm.h

    #define SHMLBA (__getpagesize ())

So probably this is safe.

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Stafford Horne Jan. 8, 2019, 11:10 a.m. UTC | #2
Hi Masahiro,

On Tue, Jan 08, 2019 at 08:38:27AM +0900, Masahiro Yamada wrote:
> Most architectures do not export shmparam.h to user-space.

> 

>   $ find arch -name shmparam.h  | sort

>   arch/alpha/include/asm/shmparam.h

>   arch/arc/include/asm/shmparam.h

>   arch/arm64/include/asm/shmparam.h

>   arch/arm/include/asm/shmparam.h

>   arch/csky/include/asm/shmparam.h

>   arch/ia64/include/asm/shmparam.h

>   arch/mips/include/asm/shmparam.h

>   arch/nds32/include/asm/shmparam.h

>   arch/nios2/include/asm/shmparam.h

>   arch/parisc/include/asm/shmparam.h

>   arch/powerpc/include/asm/shmparam.h

>   arch/s390/include/asm/shmparam.h

>   arch/sh/include/asm/shmparam.h

>   arch/sparc/include/asm/shmparam.h

>   arch/x86/include/asm/shmparam.h

>   arch/xtensa/include/asm/shmparam.h

> 

> Strangely, some users of the asm-generic wrapper export shmparam.h

> 

>   $ git grep 'generic-y += shmparam.h'

>   arch/c6x/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/h8300/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/hexagon/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/m68k/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/microblaze/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/openrisc/include/uapi/asm/Kbuild:generic-y += shmparam.h

>   arch/riscv/include/asm/Kbuild:generic-y += shmparam.h

>   arch/unicore32/include/uapi/asm/Kbuild:generic-y += shmparam.h

> 

> The newly added riscv correctly creates the asm-generic wrapper

> in the kernel space, but the others (c6x, h8300, hexagon, m68k,

> microblaze, openrisc, unicore32) create the one in the uapi directory.

> 

> Digging into the git history, now I guess fcc8487d477a ("uapi:

> export all headers under uapi directories") was the misconversion.

> Prior to that commit, no architecture exported to shmparam.h

> As its commit description said, that commit exported shmparam.h

> for c6x, h8300, hexagon, m68k, openrisc, unicore32.

> 

> 83f0124ad81e ("microblaze: remove asm-generic wrapper headers")

> accidentally exported shmparam.h for microblaze.

> 

> This commit unexports shmparam.h for those architectures.

> 

> There is no more reason to export include/uapi/asm-generic/shmparam.h,

> so it has been moved to include/asm-generic/shmparam.h

> 

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

> ---

> 

>  arch/c6x/include/asm/Kbuild               | 1 +

>  arch/c6x/include/uapi/asm/Kbuild          | 1 -

>  arch/h8300/include/asm/Kbuild             | 1 +

>  arch/h8300/include/uapi/asm/Kbuild        | 1 -

>  arch/hexagon/include/asm/Kbuild           | 1 +

>  arch/hexagon/include/uapi/asm/Kbuild      | 1 -

>  arch/m68k/include/asm/Kbuild              | 1 +

>  arch/m68k/include/uapi/asm/Kbuild         | 1 -

>  arch/microblaze/include/asm/Kbuild        | 1 +

>  arch/microblaze/include/uapi/asm/Kbuild   | 1 -

>  arch/openrisc/include/asm/Kbuild          | 1 +

>  arch/openrisc/include/uapi/asm/Kbuild     | 1 -

>  arch/unicore32/include/asm/Kbuild         | 1 +

>  arch/unicore32/include/uapi/asm/Kbuild    | 1 -

>  include/{uapi => }/asm-generic/shmparam.h | 0

>  15 files changed, 7 insertions(+), 7 deletions(-)

>  rename include/{uapi => }/asm-generic/shmparam.h (100%)

> 


[...]

> diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild

> index eb87cd8..1f04844b 100644

> --- a/arch/openrisc/include/asm/Kbuild

> +++ b/arch/openrisc/include/asm/Kbuild

> @@ -34,6 +34,7 @@ generic-y += qrwlock_types.h

>  generic-y += qrwlock.h

>  generic-y += sections.h

>  generic-y += segment.h

> +generic-y += shmparam.h

>  generic-y += string.h

>  generic-y += switch_to.h

>  generic-y += topology.h

> diff --git a/arch/openrisc/include/uapi/asm/Kbuild b/arch/openrisc/include/uapi/asm/Kbuild

> index 6c6f630..0febf1a 100644

> --- a/arch/openrisc/include/uapi/asm/Kbuild

> +++ b/arch/openrisc/include/uapi/asm/Kbuild

> @@ -1,5 +1,4 @@

>  include include/uapi/asm-generic/Kbuild.asm

>  

>  generic-y += kvm_para.h

> -generic-y += shmparam.h

>  generic-y += ucontext.h


What is this patch based on?  I tried to apply it to 5.0-rc1 and am having an
issue with applying the arch/openrisc/include/uapi/asm/Kbuild part.

    $ ~/work/bin/am-incoming PATCH_arch_unexport_asm-shmparam.h_for_all_architectures.patch
    Applying: arch: unexport asm/shmparam.h for all architectures
    error: patch failed: arch/c6x/include/uapi/asm/Kbuild:1
    error: arch/c6x/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/h8300/include/uapi/asm/Kbuild:1
    error: arch/h8300/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/hexagon/include/uapi/asm/Kbuild:1
    error: arch/hexagon/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/m68k/include/uapi/asm/Kbuild:2
    error: arch/m68k/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/microblaze/include/uapi/asm/Kbuild:2
    error: arch/microblaze/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/openrisc/include/uapi/asm/Kbuild:1
    error: arch/openrisc/include/uapi/asm/Kbuild: patch does not apply
    error: patch failed: arch/unicore32/include/uapi/asm/Kbuild:1
    error: arch/unicore32/include/uapi/asm/Kbuild: patch does not apply
    Patch failed at 0001 arch: unexport asm/shmparam.h for all architectures
    hint: Use 'git am --show-current-patch' to see the failed patch

It seems shmparam.h is not there. It was removed with the others in your
("d6e4b3e326d8") arch: remove redundant UAPI generic-y defines, commit a few
days ago.

Note, I can't compile 5.0-rc1 without the first part of this patch.  So please
get it merged asap :)

-Stafford
Masahiro Yamada Jan. 8, 2019, 3:32 p.m. UTC | #3
Hi Stafford,



On Tue, Jan 8, 2019 at 8:12 PM Stafford Horne <shorne@gmail.com> wrote:
>

> What is this patch based on?  I tried to apply it to 5.0-rc1 and am having an

> issue with applying the arch/openrisc/include/uapi/asm/Kbuild part.



Based on Linus' latest tree.
(commit 3bd6e94be)

v5.0-rc1 is NOT the latest.



> It seems shmparam.h is not there. It was removed with the others in your

> ("d6e4b3e326d8") arch: remove redundant UAPI generic-y defines, commit a few

> days ago.

>

> Note, I can't compile 5.0-rc1 without the first part of this patch.  So please

> get it merged asap :)



I notice the breakage of several arches after v5.0-rc1 release,
so I asked Linus to pick up 3d6e94be.

I had already noticed
having shmparam.h in uapi is werid,
but I decided to fix the build errors first.


-- 
Best Regards
Masahiro Yamada
Stafford Horne Jan. 8, 2019, 10:19 p.m. UTC | #4
On Wed, Jan 09, 2019 at 12:32:28AM +0900, Masahiro Yamada wrote:
> Hi Stafford,

> 

> 

> 

> On Tue, Jan 8, 2019 at 8:12 PM Stafford Horne <shorne@gmail.com> wrote:

> >

> > What is this patch based on?  I tried to apply it to 5.0-rc1 and am having an

> > issue with applying the arch/openrisc/include/uapi/asm/Kbuild part.

> 

> 

> Based on Linus' latest tree.

> (commit 3bd6e94be)

> 

> v5.0-rc1 is NOT the latest.


OK, understood, in that case:

Acked-by: Stafford Horne <shorne@gmail.com>


(though I see its already being picked up on the -mm tree)

> > It seems shmparam.h is not there. It was removed with the others in your

> > ("d6e4b3e326d8") arch: remove redundant UAPI generic-y defines, commit a few

> > days ago.

> >

> > Note, I can't compile 5.0-rc1 without the first part of this patch.  So please

> > get it merged asap :)

> 

> 

> I notice the breakage of several arches after v5.0-rc1 release,

> so I asked Linus to pick up 3d6e94be.

> 

> I had already noticed

> having shmparam.h in uapi is werid,

> but I decided to fix the build errors first.


Yes, that makes sense.

-Stafford
diff mbox series

Patch

diff --git a/arch/c6x/include/asm/Kbuild b/arch/c6x/include/asm/Kbuild
index 33a2c94..63b4a17 100644
--- a/arch/c6x/include/asm/Kbuild
+++ b/arch/c6x/include/asm/Kbuild
@@ -30,6 +30,7 @@  generic-y += pgalloc.h
 generic-y += preempt.h
 generic-y += segment.h
 generic-y += serial.h
+generic-y += shmparam.h
 generic-y += tlbflush.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/c6x/include/uapi/asm/Kbuild b/arch/c6x/include/uapi/asm/Kbuild
index 6c6f630..0febf1a 100644
--- a/arch/c6x/include/uapi/asm/Kbuild
+++ b/arch/c6x/include/uapi/asm/Kbuild
@@ -1,5 +1,4 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index cd400d3..961c1dc 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -40,6 +40,7 @@  generic-y += preempt.h
 generic-y += scatterlist.h
 generic-y += sections.h
 generic-y += serial.h
+generic-y += shmparam.h
 generic-y += sizes.h
 generic-y += spinlock.h
 generic-y += timex.h
diff --git a/arch/h8300/include/uapi/asm/Kbuild b/arch/h8300/include/uapi/asm/Kbuild
index 6c6f630..0febf1a 100644
--- a/arch/h8300/include/uapi/asm/Kbuild
+++ b/arch/h8300/include/uapi/asm/Kbuild
@@ -1,5 +1,4 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/hexagon/include/asm/Kbuild b/arch/hexagon/include/asm/Kbuild
index 47c4da3..b25fd42 100644
--- a/arch/hexagon/include/asm/Kbuild
+++ b/arch/hexagon/include/asm/Kbuild
@@ -30,6 +30,7 @@  generic-y += rwsem.h
 generic-y += sections.h
 generic-y += segment.h
 generic-y += serial.h
+generic-y += shmparam.h
 generic-y += sizes.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/hexagon/include/uapi/asm/Kbuild b/arch/hexagon/include/uapi/asm/Kbuild
index 61d955c..c1b06dc 100644
--- a/arch/hexagon/include/uapi/asm/Kbuild
+++ b/arch/hexagon/include/uapi/asm/Kbuild
@@ -1,4 +1,3 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index 9f1dd26..95f8f63 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -20,6 +20,7 @@  generic-y += mm-arch-hooks.h
 generic-y += percpu.h
 generic-y += preempt.h
 generic-y += sections.h
+generic-y += shmparam.h
 generic-y += spinlock.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild
index b8b3525..960bf1e 100644
--- a/arch/m68k/include/uapi/asm/Kbuild
+++ b/arch/m68k/include/uapi/asm/Kbuild
@@ -2,4 +2,3 @@  include include/uapi/asm-generic/Kbuild.asm
 
 generated-y += unistd_32.h
 generic-y += kvm_para.h
-generic-y += shmparam.h
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index 9c7d1d2..791cc8d5 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -26,6 +26,7 @@  generic-y += parport.h
 generic-y += percpu.h
 generic-y += preempt.h
 generic-y += serial.h
+generic-y += shmparam.h
 generic-y += syscalls.h
 generic-y += topology.h
 generic-y += trace_clock.h
diff --git a/arch/microblaze/include/uapi/asm/Kbuild b/arch/microblaze/include/uapi/asm/Kbuild
index 28823e3..97823ec 100644
--- a/arch/microblaze/include/uapi/asm/Kbuild
+++ b/arch/microblaze/include/uapi/asm/Kbuild
@@ -2,5 +2,4 @@  include include/uapi/asm-generic/Kbuild.asm
 
 generated-y += unistd_32.h
 generic-y += kvm_para.h
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index eb87cd8..1f04844b 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -34,6 +34,7 @@  generic-y += qrwlock_types.h
 generic-y += qrwlock.h
 generic-y += sections.h
 generic-y += segment.h
+generic-y += shmparam.h
 generic-y += string.h
 generic-y += switch_to.h
 generic-y += topology.h
diff --git a/arch/openrisc/include/uapi/asm/Kbuild b/arch/openrisc/include/uapi/asm/Kbuild
index 6c6f630..0febf1a 100644
--- a/arch/openrisc/include/uapi/asm/Kbuild
+++ b/arch/openrisc/include/uapi/asm/Kbuild
@@ -1,5 +1,4 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
index 1372553..1d1544b 100644
--- a/arch/unicore32/include/asm/Kbuild
+++ b/arch/unicore32/include/asm/Kbuild
@@ -28,6 +28,7 @@  generic-y += preempt.h
 generic-y += sections.h
 generic-y += segment.h
 generic-y += serial.h
+generic-y += shmparam.h
 generic-y += sizes.h
 generic-y += syscalls.h
 generic-y += topology.h
diff --git a/arch/unicore32/include/uapi/asm/Kbuild b/arch/unicore32/include/uapi/asm/Kbuild
index 6c6f630..0febf1a 100644
--- a/arch/unicore32/include/uapi/asm/Kbuild
+++ b/arch/unicore32/include/uapi/asm/Kbuild
@@ -1,5 +1,4 @@ 
 include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += kvm_para.h
-generic-y += shmparam.h
 generic-y += ucontext.h
diff --git a/include/uapi/asm-generic/shmparam.h b/include/asm-generic/shmparam.h
similarity index 100%
rename from include/uapi/asm-generic/shmparam.h
rename to include/asm-generic/shmparam.h