Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565029 > unrolled thread

[PATCH v4 0/7] uapi: export all headers under uapi directories

Started byNicolas Dichtel <nicolas.dichtel@6wind.com>
First post2017-01-23 16:10 +0100
Last post2017-01-26 20:40 +0100
Articles 18 — 6 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 0/7] uapi: export all headers under uapi directories Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 16:10 +0100
    [PATCH v4 7/7] uapi: export all arch specifics directories Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 16:10 +0100
    [PATCH v4 5/7] Makefile.headersinst: remove destination-y option Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 16:10 +0100
    [PATCH v4 2/7] nios2: put setup.h in uapi Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 16:10 +0100
    Re: [PATCH v4 6/7] uapi: export all headers under uapi directories Christoph Hellwig <hch@infradead.org> - 2017-01-23 16:30 +0100
      Re: [PATCH v4 6/7] uapi: export all headers under uapi directories Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 17:10 +0100
    Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-23 18:00 +0100
      Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-23 18:10 +0100
        Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-23 18:20 +0100
          Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-23 18:30 +0100
            Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Jan Engelhardt <jengelh@inai.de> - 2017-01-23 23:30 +0100
              Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-24 00:00 +0100
            Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Nicolas Dichtel <nicolas.dichtel@6wind.com> - 2017-01-26 17:30 +0100
          Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Christoph Hellwig <hch@infradead.org> - 2017-01-23 18:30 +0100
      Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-01-30 16:10 +0100
        Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-30 16:40 +0100
    Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Ingo Molnar <mingo@kernel.org> - 2017-01-26 20:30 +0100
      Re: [PATCH v4 3/7] x86: put msr-index.h in uapi Borislav Petkov <bp@alien8.de> - 2017-01-26 20:40 +0100

#1565029 — [PATCH v4 0/7] uapi: export all headers under uapi directories

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 16:10 +0100
Subject[PATCH v4 0/7] uapi: export all headers under uapi directories
Message-ID<t2OpP-812-5@gated-at.bofh.it>
Here is the v4 of this series. Seems there was too many people cc'ed, so I've
removed arch specific ml. Hope it's better now.

Patches #1 to #4 are just cleanup: some exported headers were still under
a non-uapi directory.
The patch #5 was spotted by code review: there is no in-tree user of this
functionality.
Patches #6 and #7 remove the need to list explicitly headers. Now all files
under an uapi directory are exported.

This series has been tested with a 'make headers_install' on x86 and a
'make headers_install_all'. I've checked the result of both commands.

This patch is built against linus tree. If I must rebase it against the kbuild
tree, just tell me.

v3 -> v4:
 - first patch has been included
 - patch #4: get back to v2 and remove arch/x86/include/asm/msr-index.h

v2 -> v3:
 - patch #1: remove arch/arm/include/asm/types.h
 - patch #2: remove arch/h8300/include/asm/bitsperlong.h
 - patch #3: remove arch/nios2/include/uapi/asm/setup.h
 - patch #4: don't export msr-index.h
 - patch #5: fix a typo: s/unput-files3-name/input-files3-name
 - patch #6: no change
 - patch #7: fix include/uapi/asm-generic/Kbuild.asm by introducing mandatory-y
 - add patch #8

v1 -> v2:
 - add patch #1 to #6
 - patch #7: remove use of header-y

Comments are welcomed,
Nicolas

[toc] | [next] | [standalone]


#1565033 — [PATCH v4 7/7] uapi: export all arch specifics directories

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 16:10 +0100
Subject[PATCH v4 7/7] uapi: export all arch specifics directories
Message-ID<t2OpR-812-35@gated-at.bofh.it>
In reply to#1565029
This patch removes the need of subdir-y. Now all files/directories under
arch/<arch>/include/uapi/ are exported.

The only change for userland is the layout of the command 'make
headers_install_all': directories asm-<arch> are replaced by arch-<arch>/.
Those new directories contains all files/directories of the specified arch.

Note that only cris and tile have more directories than only asm:
 - arch-v[10|32] for cris;
 - arch for tile.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 Documentation/kbuild/makefiles.txt | 15 +--------------
 Makefile                           |  4 ++--
 arch/cris/include/uapi/asm/Kbuild  |  3 ---
 arch/tile/include/uapi/asm/Kbuild  |  2 --
 scripts/Makefile.headersinst       |  3 +--
 5 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 51c072049e45..87a3d7d86776 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -48,7 +48,6 @@ This document describes the Linux kernel Makefiles.
 		--- 7.2 genhdr-y
 		--- 7.3 generic-y
 		--- 7.4 generated-y
-		--- 7.5 subdir-y
 
 	=== 8 Kbuild Variables
 	=== 9 Makefile language
@@ -1264,7 +1263,7 @@ The pre-processing does:
 - drop all sections that are kernel internal (guarded by ifdef __KERNEL__)
 
 All headers under include/uapi/, include/generated/uapi/,
-arch/<arch>/include/uapi/asm/ and arch/<arch>/include/generated/uapi/asm/
+arch/<arch>/include/uapi/ and arch/<arch>/include/generated/uapi/
 are exported.
 
 A Kbuild file may be defined under arch/<arch>/include/uapi/asm/ and
@@ -1331,18 +1330,6 @@ See subsequent chapter for the syntax of the Kbuild file.
 			#arch/x86/include/asm/Kbuild
 			generated-y += syscalls_32.h
 
-	--- 7.5 subdir-y
-
-	subdir-y may be used to specify a subdirectory to be exported.
-
-		Example:
-			#arch/cris/include/uapi/asm/Kbuild
-			subdir-y += ../arch-v10/arch/
-			subdir-y += ../arch-v32/arch/
-
-	The convention is to list one subdir per line and
-	preferably in alphabetic order.
-
 === 8 Kbuild Variables
 
 The top Makefile exports the following variables:
diff --git a/Makefile b/Makefile
index 098840012b9b..46df2b272713 100644
--- a/Makefile
+++ b/Makefile
@@ -1126,7 +1126,7 @@ firmware_install:
 export INSTALL_HDR_PATH = $(objtree)/usr
 
 # If we do an all arch process set dst to asm-$(hdr-arch)
-hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
+hdr-dst = $(if $(KBUILD_HEADERS), dst=include/arch-$(hdr-arch), dst=include)
 
 PHONY += archheaders
 archheaders:
@@ -1147,7 +1147,7 @@ headers_install: __headers
 	$(if $(wildcard $(srctree)/arch/$(hdr-arch)/include/uapi/asm/Kbuild),, \
 	  $(error Headers not exportable for the $(SRCARCH) architecture))
 	$(Q)$(MAKE) $(hdr-inst)=include/uapi
-	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst)
+	$(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi $(hdr-dst)
 
 PHONY += headers_check_all
 headers_check_all: headers_install_all
diff --git a/arch/cris/include/uapi/asm/Kbuild b/arch/cris/include/uapi/asm/Kbuild
index d0c5471856e0..b15bf6bc0e94 100644
--- a/arch/cris/include/uapi/asm/Kbuild
+++ b/arch/cris/include/uapi/asm/Kbuild
@@ -1,5 +1,2 @@
 # UAPI Header export list
 include include/uapi/asm-generic/Kbuild.asm
-
-subdir-y += ../arch-v10/arch/
-subdir-y += ../arch-v32/arch/
diff --git a/arch/tile/include/uapi/asm/Kbuild b/arch/tile/include/uapi/asm/Kbuild
index e0a50111e07f..0c74c3c5ebfa 100644
--- a/arch/tile/include/uapi/asm/Kbuild
+++ b/arch/tile/include/uapi/asm/Kbuild
@@ -2,5 +2,3 @@
 include include/uapi/asm-generic/Kbuild.asm
 
 generic-y += ucontext.h
-
-subdir-y += ../arch
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 16ac3e71050e..cafaca2d9a23 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -2,7 +2,7 @@
 # Installing headers
 #
 # All headers under include/uapi, include/generated/uapi,
-# arch/<arch>/include/uapi/asm and arch/<arch>/include/generated/uapi/asm are
+# arch/<arch>/include/uapi and arch/<arch>/include/generated/uapi are
 # exported.
 # They are preprocessed to remove __KERNEL__ section of the file.
 #
@@ -28,7 +28,6 @@ include scripts/Kbuild.include
 installdir    := $(INSTALL_HDR_PATH)/$(subst uapi/,,$(_dst))
 
 subdirs       := $(patsubst $(srctree)/$(obj)/%/.,%,$(wildcard $(srctree)/$(obj)/*/.))
-subdirs       += $(subdir-y)
 header-files  := $(notdir $(wildcard $(srctree)/$(obj)/*.h))
 header-files  += $(notdir $(wildcard $(srctree)/$(obj)/*.agh))
 genhdr-files  := $(notdir $(wildcard $(srctree)/$(gen)/*.h))
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1565038 — [PATCH v4 5/7] Makefile.headersinst: remove destination-y option

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 16:10 +0100
Subject[PATCH v4 5/7] Makefile.headersinst: remove destination-y option
Message-ID<t2OpS-812-71@gated-at.bofh.it>
In reply to#1565029
This option was added in commit c7bb349e7c25 ("kbuild: introduce destination-y
for exported headers") but never used in-tree.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
 Documentation/kbuild/makefiles.txt | 23 ++++-------------------
 scripts/Makefile.headersinst       |  2 +-
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 9b9c4797fc55..37b525d329ae 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -46,9 +46,8 @@ This document describes the Linux kernel Makefiles.
 	=== 7 Kbuild syntax for exported headers
 		--- 7.1 header-y
 		--- 7.2 genhdr-y
-		--- 7.3 destination-y
-		--- 7.4 generic-y
-		--- 7.5 generated-y
+		--- 7.3 generic-y
+		--- 7.4 generated-y
 
 	=== 8 Kbuild Variables
 	=== 9 Makefile language
@@ -1295,21 +1294,7 @@ See subsequent chapter for the syntax of the Kbuild file.
 			#include/linux/Kbuild
 			genhdr-y += version.h
 
-	--- 7.3 destination-y
-
-	When an architecture has a set of exported headers that needs to be
-	exported to a different directory destination-y is used.
-	destination-y specifies the destination directory for all exported
-	headers in the file where it is present.
-
-		Example:
-			#arch/xtensa/platforms/s6105/include/platform/Kbuild
-			destination-y := include/linux
-
-	In the example above all exported headers in the Kbuild file
-	will be located in the directory "include/linux" when exported.
-
-	--- 7.4 generic-y
+	--- 7.3 generic-y
 
 	If an architecture uses a verbatim copy of a header from
 	include/asm-generic then this is listed in the file
@@ -1336,7 +1321,7 @@ See subsequent chapter for the syntax of the Kbuild file.
 		Example: termios.h
 			#include <asm-generic/termios.h>
 
-	--- 7.5 generated-y
+	--- 7.4 generated-y
 
 	If an architecture generates other header files alongside generic-y
 	wrappers, and not included in genhdr-y, then generated-y specifies
diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 3e20d03432d2..876b42cfede4 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -14,7 +14,7 @@ kbuild-file := $(srctree)/$(obj)/Kbuild
 include $(kbuild-file)
 
 # called may set destination dir (when installing to asm/)
-_dst := $(if $(destination-y),$(destination-y),$(if $(dst),$(dst),$(obj)))
+_dst := $(if $(dst),$(dst),$(obj))
 
 old-kbuild-file := $(srctree)/$(subst uapi/,,$(obj))/Kbuild
 ifneq ($(wildcard $(old-kbuild-file)),)
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1565039 — [PATCH v4 2/7] nios2: put setup.h in uapi

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 16:10 +0100
Subject[PATCH v4 2/7] nios2: put setup.h in uapi
Message-ID<t2OpR-812-61@gated-at.bofh.it>
In reply to#1565029
This header file is exported, but from a userland pov, it's just a wrapper
to asm-generic/setup.h.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
---
 arch/nios2/include/uapi/asm/Kbuild | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/nios2/include/uapi/asm/Kbuild b/arch/nios2/include/uapi/asm/Kbuild
index e0bb972a50d7..69c965304146 100644
--- a/arch/nios2/include/uapi/asm/Kbuild
+++ b/arch/nios2/include/uapi/asm/Kbuild
@@ -2,4 +2,5 @@ include include/uapi/asm-generic/Kbuild.asm
 
 header-y += elf.h
 
+generic-y += setup.h
 generic-y += ucontext.h
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1565053 — Re: [PATCH v4 6/7] uapi: export all headers under uapi directories

FromChristoph Hellwig <hch@infradead.org>
Date2017-01-23 16:30 +0100
SubjectRe: [PATCH v4 6/7] uapi: export all headers under uapi directories
Message-ID<t2OJc-885-23@gated-at.bofh.it>
In reply to#1565029
> .install

> linux/genwqe/.install
> linux/genwqe/..install.cmd

...

If these aren't just a mistake in your list the patches need to be
fixed not to install this build system internal file.

And I'm pretty sure I already pointed this out last time.

[toc] | [prev] | [next] | [standalone]


#1565091 — Re: [PATCH v4 6/7] uapi: export all headers under uapi directories

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 17:10 +0100
SubjectRe: [PATCH v4 6/7] uapi: export all headers under uapi directories
Message-ID<t2PlU-9t-31@gated-at.bofh.it>
In reply to#1565053
Le 23/01/2017 à 16:25, Christoph Hellwig a écrit :
>> .install
> 
>> linux/genwqe/.install
>> linux/genwqe/..install.cmd
> 
> ...
> 
> If these aren't just a mistake in your list the patches need to be
> fixed not to install this build system internal file.
> 
> And I'm pretty sure I already pointed this out last time.
> 
Yes, it was already pointed out. But, as I said, this is done for *every*
exported directory. My patch just follows how it is done currently:
$ find . -name '.install' | wc -l
105
$ find . -name '..install.cmd' | wc -l
105
$ find . -type d | wc -l
105

I'm not against removing these files, but this should be done in another patch,
it's not related to this series.
Fell free to send a patch.


Regards,
Nicolas

[toc] | [prev] | [next] | [standalone]


#1565140 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-23 18:00 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2Q8j-qo-41@gated-at.bofh.it>
In reply to#1565029
On Mon, Jan 23, 2017 at 03:58:37PM +0100, Nicolas Dichtel wrote:
> This header file is exported, thus move it to uapi.

Why? Why is this damn thing exported in the first place?

The moment we decide to change an MSR name or even remove it from that
file, we break userspace. And what for, because userspace is using some
arbitrary header file which was meant to be for the kernel solely.

NAKed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [next] | [standalone]


#1565151 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-23 18:10 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2QhY-Jd-29@gated-at.bofh.it>
In reply to#1565140
+ Peter Anvin and Ingo Molnar

Le 23/01/2017 à 17:52, Borislav Petkov a écrit :
> On Mon, Jan 23, 2017 at 03:58:37PM +0100, Nicolas Dichtel wrote:
>> This header file is exported, thus move it to uapi.
> 
> Why? Why is this damn thing exported in the first place?
It is exported because it is listed in arch/x86/include/uapi/asm/Kbuild:
header-y += msr-index.h (see also patch #4).

> 
> The moment we decide to change an MSR name or even remove it from that
> file, we break userspace. And what for, because userspace is using some
> arbitrary header file which was meant to be for the kernel solely.
I understand your concerns but my patch does not change anything. And I think
David's comment is right: if I remove it, I break the uapi.

After digging a bit, it seems you have already tried to remove it in commit
b72e7464e4cf ("x86/uapi: Do not export <asm/msr-index.h> as part of the user API
headers"), but because this file is still listed in the Kbuild file, it is still
exported.

It would be great if we could find a consensus about what to do with this file
because it blocks patch #4 and the rest of the series.


Thank you,
Nicolas

[toc] | [prev] | [next] | [standalone]


#1565161 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-23 18:20 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2QrD-Nm-9@gated-at.bofh.it>
In reply to#1565151
On Mon, Jan 23, 2017 at 06:06:52PM +0100, Nicolas Dichtel wrote:
> After digging a bit, it seems you have already tried to remove it in commit
> b72e7464e4cf ("x86/uapi: Do not export <asm/msr-index.h> as part of the user API
> headers"), but because this file is still listed in the Kbuild file, it is still
> exported.

Oh great. :-\

> It would be great if we could find a consensus about what to do with
> this file because it blocks patch #4 and the rest of the series.

The reasoning in b72e7464e4cf was valid then and is valid now. This
thing should not have been exported in the first place. And it's not
like I didn't try then. Dammit!

I know, we should not ever break userspace but if it were me, I'd remove
that export and see what breaks. If at all.

But let's see what the others think first.

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [next] | [standalone]


#1565176 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-23 18:30 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2QBk-Qy-15@gated-at.bofh.it>
In reply to#1565161
On Mon, Jan 23, 2017 at 09:21:03AM -0800, Christoph Hellwig wrote:
> Or keep the exported version as-is and never changed it, and use
> a different copy for the kernel itself.

Yeah, that's a good idea, thanks Christoph.

I guess we'll have to do that if something in userspace has put its
sticky fingers on that file and cannot be fixed. Which I hardly doubt
but we can't break that damn userspace.

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [next] | [standalone]


#1565334 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromJan Engelhardt <jengelh@inai.de>
Date2017-01-23 23:30 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2VhE-3Vc-15@gated-at.bofh.it>
In reply to#1565176
On Monday 2017-01-23 18:26, Borislav Petkov wrote:

>On Mon, Jan 23, 2017 at 09:21:03AM -0800, Christoph Hellwig wrote:
>> Or keep the exported version as-is and never changed it, and use
>> a different copy for the kernel itself.
>
>I guess we'll have to do that if something in userspace has put its
>sticky fingers on that file and cannot be fixed. Which I hardly doubt
>but we can't break that damn userspace.

The importance of uapi headers presence is a bit overrated.

If you look at, for example, iptables (and further projects in that 
area), copies of uapi headers have been made (and this process is likely 
to continue) because it could be compiled on a variety of vintage 
systems that do not have all required #defines yet.

Similarly, it may be built on a variety of _modern_ systems whose 
kernels no longer have a particular thing (e.g. ipt_SAME), so it also 
ships copies of those headers.

So if some userspace component depends on that particular msr header (which,
unlike ipt_SAME, was not intended for export), is it not reasonable to expect
them to make a copy if and when they need it?

[toc] | [prev] | [next] | [standalone]


#1565347 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-24 00:00 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2VKG-48m-7@gated-at.bofh.it>
In reply to#1565334
On Mon, Jan 23, 2017 at 11:24:02PM +0100, Jan Engelhardt wrote:
> So if some userspace component depends on that particular msr header
> (which, unlike ipt_SAME, was not intended for export), is it not
> reasonable to expect them to make a copy if and when they need it?

Yeah, either copy the whole header or better yet use own defines.
Especially in this particular case, where we have a bunch of MSRs which
are in the processor manuals. Exporting the defines is pretty pointless
and even disadvantageous for the kernel.

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [next] | [standalone]


#1567585 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromNicolas Dichtel <nicolas.dichtel@6wind.com>
Date2017-01-26 17:30 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t3V5U-1ao-21@gated-at.bofh.it>
In reply to#1565176
Le 23/01/2017 à 18:26, Borislav Petkov a écrit :
> On Mon, Jan 23, 2017 at 09:21:03AM -0800, Christoph Hellwig wrote:
>> Or keep the exported version as-is and never changed it, and use
>> a different copy for the kernel itself.
> 
> Yeah, that's a good idea, thanks Christoph.
> 
> I guess we'll have to do that if something in userspace has put its
> sticky fingers on that file and cannot be fixed. Which I hardly doubt
> but we can't break that damn userspace.
> 
So do you agree with the current patch (a build-fix is also needed :/)?

[toc] | [prev] | [next] | [standalone]


#1565181 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromChristoph Hellwig <hch@infradead.org>
Date2017-01-23 18:30 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t2QBk-Qy-17@gated-at.bofh.it>
In reply to#1565161
On Mon, Jan 23, 2017 at 06:17:32PM +0100, Borislav Petkov wrote:
> I know, we should not ever break userspace but if it were me, I'd remove
> that export and see what breaks. If at all.

Or keep the exported version as-is and never changed it, and use
a different copy for the kernel itself.

[toc] | [prev] | [next] | [standalone]


#1569811 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromRussell King - ARM Linux <linux@armlinux.org.uk>
Date2017-01-30 16:10 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t5lKH-5uN-41@gated-at.bofh.it>
In reply to#1565140
On Mon, Jan 23, 2017 at 05:52:45PM +0100, Borislav Petkov wrote:
> On Mon, Jan 23, 2017 at 03:58:37PM +0100, Nicolas Dichtel wrote:
> > This header file is exported, thus move it to uapi.
> 
> Why? Why is this damn thing exported in the first place?
> 
> The moment we decide to change an MSR name or even remove it from that
> file, we break userspace. And what for, because userspace is using some
> arbitrary header file which was meant to be for the kernel solely.
> 
> NAKed-by: Borislav Petkov <bp@suse.de>

Here on my Fedora system:

$ less /usr/include/asm/msr-index.h
#ifndef _ASM_X86_MSR_INDEX_H
#define _ASM_X86_MSR_INDEX_H

/* CPU model specific register (MSR) numbers */

/* x86-64 specific MSRs */
#define MSR_EFER                0xc0000080 /* extended feature register */
#define MSR_STAR                0xc0000081 /* legacy mode SYSCALL target */
#define MSR_LSTAR               0xc0000082 /* long mode SYSCALL target */
...

Like it or not, it is _already_ exported to userspace, so it forms
part of the user ABI.  You can try to remove it from userspace view,
but if anyone has already started to use it, removing it will already
cause a userspace regression.

So, I don't think we have any grounds to NAK these patches on the
basis of "we don't want this to be visible to userspace because it
may cause a userspace regression."  Removing it from userspace view
is likely to cause a userspace regression.

This patch just makes sure that such a regression doesn't happen when
kbuild stops exporting files in _non_-uapi directories.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

[toc] | [prev] | [next] | [standalone]


#1569845 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-30 16:40 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t5mdI-5F2-35@gated-at.bofh.it>
In reply to#1569811
On Mon, Jan 30, 2017 at 02:51:51PM +0000, Russell King - ARM Linux wrote:
> Like it or not, it is _already_ exported to userspace, so it forms

Well, I did try to stop it then too:

  b72e7464e4cf ("x86/uapi: Do not export <asm/msr-index.h> as part of the user API headers")

And yet this wankery trickled out to userspace anyway.

> part of the user ABI.  You can try to remove it from userspace view,
> but if anyone has already started to use it, removing it will already
> cause a userspace regression.

Well, if it were me, I'd still remove the header and see if anything
breaks.

If it does - which I doubt very much - we can do Christoph's idea of
leaving the current version of the header exported but then untangling
it from the whole uapi crap and use our own kernel version which we can
change as much as we can.

In the end of the day, it is a maintainer decision what's going to
happen.

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [next] | [standalone]


#1567658 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromIngo Molnar <mingo@kernel.org>
Date2017-01-26 20:30 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t3XU5-2Qh-11@gated-at.bofh.it>
In reply to#1565029
* Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:

> This header file is exported, thus move it to uapi.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>  arch/x86/include/asm/msr-index.h      | 698 ----------------------------------
>  arch/x86/include/uapi/asm/msr-index.h | 698 ++++++++++++++++++++++++++++++++++

For the reasons Boris outlined:

  NAKed-by: Ingo Molnar <mingo@kernel.org>

Please remove this patch from linux-next as well, until you get an Acked-by from 
an x86 maintainer.

Thanks,

	Ingo

[toc] | [prev] | [next] | [standalone]


#1567662 — Re: [PATCH v4 3/7] x86: put msr-index.h in uapi

FromBorislav Petkov <bp@alien8.de>
Date2017-01-26 20:40 +0100
SubjectRe: [PATCH v4 3/7] x86: put msr-index.h in uapi
Message-ID<t3Y3M-2To-15@gated-at.bofh.it>
In reply to#1567658
On Thu, Jan 26, 2017 at 08:04:52PM +0100, Ingo Molnar wrote:
> Please remove this patch from linux-next as well, until you get an
> Acked-by from an x86 maintainer.

... and the header export from arch/x86/include/uapi/asm/Kbuild too pls.

-- 
Regards/Gruss,
    Boris.

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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web