diff mbox

headers_check: don't warn about kexec.h

Message ID 12825174.7oxZXDxNhV@wuerfel (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann Jan. 13, 2015, 4:19 p.m. UTC
We've been getting this warning for ages:

./usr/include/linux/kexec.h:61: userspace cannot reference function or variable defined in the kernel

There is no proper fix for this file, as the declaration is meant for
user space, not for the kernel, so we should work around it the
same way that we treat the seqbuf_dump() definition.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Paul Bolle Jan. 13, 2015, 5:13 p.m. UTC | #1
Hi Arnd,

On Tue, 2015-01-13 at 17:19 +0100, Arnd Bergmann wrote:
> We've been getting this warning for ages:
> 
> ./usr/include/linux/kexec.h:61: userspace cannot reference function or variable defined in the kernel
> 
> There is no proper fix for this file, as the declaration is meant for
> user space, not for the kernel, so we should work around it the
> same way that we treat the seqbuf_dump() definition.

For the seqbuf_dump() stuff there are apparently users. I forgot the
details, but the sound people wanted to keep that declaration (and some
related ancient things) in the header involved to keep some really
ancient stuff buildable.

But the kexec_load declaration isn't very useful for userspace, see the
patch I submitted in
http://lkml.kernel.org/r/1389791824.17407.9.camel@x220 . And After my
attempt the export of that declaration has also been discussed in
http://lkml.kernel.org/r/115373b6ac68ee7a305975896e1c4971e8e51d4c.1408731991.git.geoff@infradead.org 

In that last discussion no one has been able to point to an actual user
of it. So, as far as I can tell, no one actually uses it. Which makes
sense, because including this header by itself doesn't give one access
to a useful definition of kexec_load. So why bother with the
declaration?

The last time that Geoff has been trying to get that patch applied
should be
http://lkml.kernel.org/r/b0702fc4186db21820d686e89afd6480560823db.1415837218.git.geoff@infradead.org  I'd rather see that go in.

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
> index 62320f93e903..fb051848667c 100755
> --- a/scripts/headers_check.pl
> +++ b/scripts/headers_check.pl
> @@ -69,6 +69,10 @@ sub check_declarations
>  	if ($line =~ m/^void seqbuf_dump\(void\);/) {
>  		return;
>  	}
> +	# user-only declaration from kexec.h
> +	if ($line =~ m/^extern int kexec_load/) {
> +		return;
> +	}
>  	if ($line =~ m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
>  		printf STDERR "$filename:$lineno: " .
>  			      "userspace cannot reference function or " .

Regards,


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnd Bergmann Jan. 13, 2015, 8:27 p.m. UTC | #2
On Tuesday 13 January 2015 18:13:32 Paul Bolle wrote:
> 
> For the seqbuf_dump() stuff there are apparently users. I forgot the
> details, but the sound people wanted to keep that declaration (and some
> related ancient things) in the header involved to keep some really
> ancient stuff buildable.
> 
> But the kexec_load declaration isn't very useful for userspace, see the
> patch I submitted in
> http://lkml.kernel.org/r/1389791824.17407.9.camel@x220 . And After my
> attempt the export of that declaration has also been discussed in
> http://lkml.kernel.org/r/115373b6ac68ee7a305975896e1c4971e8e51d4c.1408731991.git.geoff@infradead.org 
> 
> In that last discussion no one has been able to point to an actual user
> of it. So, as far as I can tell, no one actually uses it. Which makes
> sense, because including this header by itself doesn't give one access
> to a useful definition of kexec_load. So why bother with the
> declaration?
> 
> The last time that Geoff has been trying to get that patch applied
> should be
> http://lkml.kernel.org/r/b0702fc4186db21820d686e89afd6480560823db.1415837218.git.geoff@infradead.org  I'd rather see that go in.
> 

Fine with me as well. As long as we can find someone to take one of 
the patches, I'm happy.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Bolle Jan. 13, 2015, 9:05 p.m. UTC | #3
[Dragging Andrew, Linus, and Maximilian into this thread.]

On Tue, 2015-01-13 at 21:27 +0100, Arnd Bergmann wrote:
> On Tuesday 13 January 2015 18:13:32 Paul Bolle wrote:
> > The last time that Geoff has been trying to get that patch applied
> > should be
> > http://lkml.kernel.org/r/b0702fc4186db21820d686e89afd6480560823db.1415837218.git.geoff@infradead.org> 
> > I'd rather see that go in.
> 
> Fine with me as well. As long as we can find someone to take one of 
> the patches, I'm happy.

Since Geoff's patch (and my preceding, identical patch) basically is a
partial revert of commit 29a5c67e7a78 ("kexec: export kexec.h to user
space") that should probably be done by either Andrew or Linus. 

(This short thread starts at
http://lkml.kernel.org/r/12825174.7oxZXDxNhV@wuerfel .)


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Morton Jan. 14, 2015, 12:47 a.m. UTC | #4
On Tue, 13 Jan 2015 22:05:11 +0100 Paul Bolle <pebolle@tiscali.nl> wrote:

> [Dragging Andrew, Linus, and Maximilian into this thread.]
> 
> On Tue, 2015-01-13 at 21:27 +0100, Arnd Bergmann wrote:
> > On Tuesday 13 January 2015 18:13:32 Paul Bolle wrote:
> > > The last time that Geoff has been trying to get that patch applied
> > > should be
> > > http://lkml.kernel.org/r/b0702fc4186db21820d686e89afd6480560823db.1415837218.git.geoff@infradead.org> 
> > > I'd rather see that go in.
> > 
> > Fine with me as well. As long as we can find someone to take one of 
> > the patches, I'm happy.
> 
> Since Geoff's patch (and my preceding, identical patch) basically is a
> partial revert of commit 29a5c67e7a78 ("kexec: export kexec.h to user
> space") that should probably be done by either Andrew or Linus. 
> 
> (This short thread starts at
> http://lkml.kernel.org/r/12825174.7oxZXDxNhV@wuerfel .)

hm, sorry, I can't imagine why I didn't process Geoff's patch series
back in November.  They all look good - I grabbed them.


--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/headers_check.pl b/scripts/headers_check.pl
index 62320f93e903..fb051848667c 100755
--- a/scripts/headers_check.pl
+++ b/scripts/headers_check.pl
@@ -69,6 +69,10 @@  sub check_declarations
 	if ($line =~ m/^void seqbuf_dump\(void\);/) {
 		return;
 	}
+	# user-only declaration from kexec.h
+	if ($line =~ m/^extern int kexec_load/) {
+		return;
+	}
 	if ($line =~ m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
 		printf STDERR "$filename:$lineno: " .
 			      "userspace cannot reference function or " .