linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/irqflags: mark native_restore_fl extern inline
@ 2018-08-27 21:40 Nick Desaulniers
  2018-08-28  5:13 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Nick Desaulniers @ 2018-08-27 21:40 UTC (permalink / raw)
  To: tglx, mingo
  Cc: Nick Desaulniers, stable, H. Peter Anvin, x86, Juergen Gross,
	Boris Ostrovsky, Greg Kroah-Hartman, linux-kernel

Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
native_save_fl")

This should have been marked extern inline in order to pick up the out
of line definition in arch/x86/kernel/irqflags.S.

Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/x86/include/asm/irqflags.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index c14f2a74b2be..15450a675031 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
 	return flags;
 }
 
-static inline void native_restore_fl(unsigned long flags)
+extern inline void native_restore_fl(unsigned long flags);
+extern inline void native_restore_fl(unsigned long flags)
 {
 	asm volatile("push %0 ; popf"
 		     : /* no output */
-- 
2.19.0.rc0.228.g281dcd1b4d0-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline
  2018-08-27 21:40 [PATCH] x86/irqflags: mark native_restore_fl extern inline Nick Desaulniers
@ 2018-08-28  5:13 ` Greg Kroah-Hartman
  2018-08-28  6:02   ` Juergen Gross
  2018-08-28  6:01 ` Juergen Gross
  2018-08-30  9:40 ` [tip:x86/urgent] x86/irqflags: Mark " tip-bot for Nick Desaulniers
  2 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2018-08-28  5:13 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: tglx, mingo, stable, H. Peter Anvin, x86, Juergen Gross,
	Boris Ostrovsky, linux-kernel

On Mon, Aug 27, 2018 at 02:40:09PM -0700, Nick Desaulniers wrote:
> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
> native_save_fl")
> 
> This should have been marked extern inline in order to pick up the out
> of line definition in arch/x86/kernel/irqflags.S.
> 
> Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  arch/x86/include/asm/irqflags.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
> index c14f2a74b2be..15450a675031 100644
> --- a/arch/x86/include/asm/irqflags.h
> +++ b/arch/x86/include/asm/irqflags.h
> @@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
>  	return flags;
>  }
>  
> -static inline void native_restore_fl(unsigned long flags)
> +extern inline void native_restore_fl(unsigned long flags);
> +extern inline void native_restore_fl(unsigned long flags)

This looks odd to me, but my coffee hasn't kicked in yet this morning.
Why do you need both lines here?  Shouldn't the actual function be
sufficient?  If not, a comment explaining this would be nice.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline
  2018-08-27 21:40 [PATCH] x86/irqflags: mark native_restore_fl extern inline Nick Desaulniers
  2018-08-28  5:13 ` Greg Kroah-Hartman
@ 2018-08-28  6:01 ` Juergen Gross
  2018-08-30  9:40 ` [tip:x86/urgent] x86/irqflags: Mark " tip-bot for Nick Desaulniers
  2 siblings, 0 replies; 7+ messages in thread
From: Juergen Gross @ 2018-08-28  6:01 UTC (permalink / raw)
  To: Nick Desaulniers, tglx, mingo
  Cc: stable, H. Peter Anvin, x86, Boris Ostrovsky, Greg Kroah-Hartman,
	linux-kernel

On 27/08/18 23:40, Nick Desaulniers wrote:
> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
> native_save_fl")
> 
> This should have been marked extern inline in order to pick up the out
> of line definition in arch/x86/kernel/irqflags.S.
> 
> Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline
  2018-08-28  5:13 ` Greg Kroah-Hartman
@ 2018-08-28  6:02   ` Juergen Gross
  2018-08-28 12:43     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Juergen Gross @ 2018-08-28  6:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Nick Desaulniers
  Cc: tglx, mingo, stable, H. Peter Anvin, x86, Boris Ostrovsky, linux-kernel

On 28/08/18 07:13, Greg Kroah-Hartman wrote:
> On Mon, Aug 27, 2018 at 02:40:09PM -0700, Nick Desaulniers wrote:
>> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
>> native_save_fl")
>>
>> This should have been marked extern inline in order to pick up the out
>> of line definition in arch/x86/kernel/irqflags.S.
>>
>> Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
>> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>> ---
>>  arch/x86/include/asm/irqflags.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
>> index c14f2a74b2be..15450a675031 100644
>> --- a/arch/x86/include/asm/irqflags.h
>> +++ b/arch/x86/include/asm/irqflags.h
>> @@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
>>  	return flags;
>>  }
>>  
>> -static inline void native_restore_fl(unsigned long flags)
>> +extern inline void native_restore_fl(unsigned long flags);
>> +extern inline void native_restore_fl(unsigned long flags)
> 
> This looks odd to me, but my coffee hasn't kicked in yet this morning.
> Why do you need both lines here?  Shouldn't the actual function be
> sufficient?  If not, a comment explaining this would be nice.

Look just some lines further up:

/* Declaration required for gcc < 4.9 to prevent
-Werror=missing-prototypes */
extern inline unsigned long native_save_fl(void);
extern inline unsigned long native_save_fl(void)


Juergen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline
  2018-08-28  6:02   ` Juergen Gross
@ 2018-08-28 12:43     ` Greg Kroah-Hartman
  2018-08-28 22:41       ` Nick Desaulniers
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2018-08-28 12:43 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Nick Desaulniers, tglx, mingo, stable, H. Peter Anvin, x86,
	Boris Ostrovsky, linux-kernel

On Tue, Aug 28, 2018 at 08:02:37AM +0200, Juergen Gross wrote:
> On 28/08/18 07:13, Greg Kroah-Hartman wrote:
> > On Mon, Aug 27, 2018 at 02:40:09PM -0700, Nick Desaulniers wrote:
> >> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
> >> native_save_fl")
> >>
> >> This should have been marked extern inline in order to pick up the out
> >> of line definition in arch/x86/kernel/irqflags.S.
> >>
> >> Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
> >> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> >> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> >> ---
> >>  arch/x86/include/asm/irqflags.h | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
> >> index c14f2a74b2be..15450a675031 100644
> >> --- a/arch/x86/include/asm/irqflags.h
> >> +++ b/arch/x86/include/asm/irqflags.h
> >> @@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
> >>  	return flags;
> >>  }
> >>  
> >> -static inline void native_restore_fl(unsigned long flags)
> >> +extern inline void native_restore_fl(unsigned long flags);
> >> +extern inline void native_restore_fl(unsigned long flags)
> > 
> > This looks odd to me, but my coffee hasn't kicked in yet this morning.
> > Why do you need both lines here?  Shouldn't the actual function be
> > sufficient?  If not, a comment explaining this would be nice.
> 
> Look just some lines further up:
> 
> /* Declaration required for gcc < 4.9 to prevent
> -Werror=missing-prototypes */
> extern inline unsigned long native_save_fl(void);
> extern inline unsigned long native_save_fl(void)

Ugh, my fault, I'll go shut up now...

stupid gcc...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] x86/irqflags: mark native_restore_fl extern inline
  2018-08-28 12:43     ` Greg Kroah-Hartman
@ 2018-08-28 22:41       ` Nick Desaulniers
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Desaulniers @ 2018-08-28 22:41 UTC (permalink / raw)
  To: Greg KH
  Cc: jgross, Thomas Gleixner, mingo, stable, hpa, x86, boris.ostrovsky, LKML

On Tue, Aug 28, 2018 at 5:43 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Tue, Aug 28, 2018 at 08:02:37AM +0200, Juergen Gross wrote:
> > On 28/08/18 07:13, Greg Kroah-Hartman wrote:
> > > On Mon, Aug 27, 2018 at 02:40:09PM -0700, Nick Desaulniers wrote:
> > >> Fixes commit 208cbb325589 ("x86/irqflags: Provide a declaration for
> > >> native_save_fl")
> > >>
> > >> This should have been marked extern inline in order to pick up the out
> > >> of line definition in arch/x86/kernel/irqflags.S.
> > >>
> > >> Cc: stable@vger.kernel.org # 4.18, 4.14, 4.9, 4.4
> > >> Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
> > >> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> > >> ---
> > >>  arch/x86/include/asm/irqflags.h | 3 ++-
> > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
> > >> index c14f2a74b2be..15450a675031 100644
> > >> --- a/arch/x86/include/asm/irqflags.h
> > >> +++ b/arch/x86/include/asm/irqflags.h
> > >> @@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
> > >>    return flags;
> > >>  }
> > >>
> > >> -static inline void native_restore_fl(unsigned long flags)
> > >> +extern inline void native_restore_fl(unsigned long flags);
> > >> +extern inline void native_restore_fl(unsigned long flags)
> > >
> > > This looks odd to me, but my coffee hasn't kicked in yet this morning.
> > > Why do you need both lines here?  Shouldn't the actual function be
> > > sufficient?  If not, a comment explaining this would be nice.

That's a valid concern.  I did hesitate while writing the commit
message whether to describe that part or not.  The reason to include
the seemingly-additional-declaration was to prevent another case of
commit 208cbb325589 ("x86/irqflags: Provide a declaration for
native_save_fl").  It doesn't hurt to provide more info in the commit
message, so next time I'll prefer to explain more in my commit
messages than less.

Thanks Juergen and Greg for reviewing the patch.

-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:x86/urgent] x86/irqflags: Mark native_restore_fl extern inline
  2018-08-27 21:40 [PATCH] x86/irqflags: mark native_restore_fl extern inline Nick Desaulniers
  2018-08-28  5:13 ` Greg Kroah-Hartman
  2018-08-28  6:01 ` Juergen Gross
@ 2018-08-30  9:40 ` tip-bot for Nick Desaulniers
  2 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Nick Desaulniers @ 2018-08-30  9:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: ndesaulniers, mingo, linux-kernel, jgross, ben.hutchings, hpa,
	tglx, boris.ostrovsky, gregkh

Commit-ID:  1f59a4581b5ecfe9b4f049a7a2cf904d8352842d
Gitweb:     https://git.kernel.org/tip/1f59a4581b5ecfe9b4f049a7a2cf904d8352842d
Author:     Nick Desaulniers <ndesaulniers@google.com>
AuthorDate: Mon, 27 Aug 2018 14:40:09 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 30 Aug 2018 11:37:09 +0200

x86/irqflags: Mark native_restore_fl extern inline

This should have been marked extern inline in order to pick up the out
of line definition in arch/x86/kernel/irqflags.S.

Fixes: 208cbb325589 ("x86/irqflags: Provide a declaration for native_save_fl")
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180827214011.55428-1-ndesaulniers@google.com

---
 arch/x86/include/asm/irqflags.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index c14f2a74b2be..15450a675031 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -33,7 +33,8 @@ extern inline unsigned long native_save_fl(void)
 	return flags;
 }
 
-static inline void native_restore_fl(unsigned long flags)
+extern inline void native_restore_fl(unsigned long flags);
+extern inline void native_restore_fl(unsigned long flags)
 {
 	asm volatile("push %0 ; popf"
 		     : /* no output */

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-30  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 21:40 [PATCH] x86/irqflags: mark native_restore_fl extern inline Nick Desaulniers
2018-08-28  5:13 ` Greg Kroah-Hartman
2018-08-28  6:02   ` Juergen Gross
2018-08-28 12:43     ` Greg Kroah-Hartman
2018-08-28 22:41       ` Nick Desaulniers
2018-08-28  6:01 ` Juergen Gross
2018-08-30  9:40 ` [tip:x86/urgent] x86/irqflags: Mark " tip-bot for Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).