linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
@ 2018-04-03 20:59 mhkelley58
  2018-04-04  8:16 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: mhkelley58 @ 2018-04-03 20:59 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, vkuznets, jasowang,
	leann.ogasawara, marcelo.cerri, sthemmin, kys

From: Michael Kelley <mikelley@microsoft.com>

Add standard interrupt handler annotations to
hyperv_vector_handler().

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
Changes in v2:
* Fixed From: line
---
 arch/x86/kernel/cpu/mshyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 4488cf0..20f6849 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -41,7 +41,7 @@ static void (*hv_stimer0_handler)(void);
 static void (*hv_kexec_handler)(void);
 static void (*hv_crash_handler)(struct pt_regs *regs);
 
-void hyperv_vector_handler(struct pt_regs *regs)
+__visible void __irq_entry hyperv_vector_handler(struct pt_regs *regs)
 {
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
  2018-04-03 20:59 [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations mhkelley58
@ 2018-04-04  8:16 ` Greg KH
  2018-04-04 15:47   ` Michael Kelley (EOSG)
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2018-04-04  8:16 UTC (permalink / raw)
  To: mikelley
  Cc: olaf, sthemmin, jasowang, linux-kernel, marcelo.cerri, apw,
	devel, vkuznets, leann.ogasawara

On Tue, Apr 03, 2018 at 01:59:08PM -0700, mhkelley58@gmail.com wrote:
> From: Michael Kelley <mikelley@microsoft.com>
> 
> Add standard interrupt handler annotations to
> hyperv_vector_handler().
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
> Changes in v2:
> * Fixed From: line
> ---
>  arch/x86/kernel/cpu/mshyperv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index 4488cf0..20f6849 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -41,7 +41,7 @@ static void (*hv_stimer0_handler)(void);
>  static void (*hv_kexec_handler)(void);
>  static void (*hv_crash_handler)(struct pt_regs *regs);
>  
> -void hyperv_vector_handler(struct pt_regs *regs)
> +__visible void __irq_entry hyperv_vector_handler(struct pt_regs *regs)

What bug does this solve?  What is wrong with the existing markings?
What does __visible and __irq_entry give us that we don't already have
and we need?

Are you really using LTO that requires this marking to prevent the code
from being removed?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* RE: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
  2018-04-04  8:16 ` Greg KH
@ 2018-04-04 15:47   ` Michael Kelley (EOSG)
  2018-04-04 15:57     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Kelley (EOSG) @ 2018-04-04 15:47 UTC (permalink / raw)
  To: Greg KH
  Cc: olaf, Stephen Hemminger, jasowang, linux-kernel, marcelo.cerri,
	apw, devel, vkuznets, leann.ogasawara

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Wednesday, April 4, 2018 1:16 AM
> To: Michael Kelley (EOSG) <Michael.H.Kelley@microsoft.com>
> Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com;
> leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen Hemminger
> <sthemmin@microsoft.com>; KY Srinivasan <kys@microsoft.com>
> Subject: Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
> 
> On Tue, Apr 03, 2018 at 01:59:08PM -0700, mhkelley58@gmail.com wrote:
> > From: Michael Kelley <mikelley@microsoft.com>
> >
> > Add standard interrupt handler annotations to
> > hyperv_vector_handler().
> >
> > Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> > ---
> > Changes in v2:
> > * Fixed From: line
> > ---
> >  arch/x86/kernel/cpu/mshyperv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> > index 4488cf0..20f6849 100644
> > --- a/arch/x86/kernel/cpu/mshyperv.c
> > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > @@ -41,7 +41,7 @@ static void (*hv_stimer0_handler)(void);
> >  static void (*hv_kexec_handler)(void);
> >  static void (*hv_crash_handler)(struct pt_regs *regs);
> >
> > -void hyperv_vector_handler(struct pt_regs *regs)
> > +__visible void __irq_entry hyperv_vector_handler(struct pt_regs *regs)
> 
> What bug does this solve?  What is wrong with the existing markings?
> What does __visible and __irq_entry give us that we don't already have
> and we need?
> 
> Are you really using LTO that requires this marking to prevent the code
> from being removed?

Thomas Gleixner commented on Vitaly Kuznetsov's Hyper-V reenlightenment patch
that the interrupt handler should have these annotations: see
https://lkml.org/lkml/2018/1/14/145

I put the same annotations on the interrupt handler for stimer0 Direct Mode,
So this change makes the hyperv_vector_handler() consistent with
hv_stimer0_vector_handler() in the same source file.  It does not fix any
immediate bug -- it's for consistency and alignment with what is apparently
standard practice.

Not sure what LTO is ...

Michael

> 
> thanks,
> 
> greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
  2018-04-04 15:47   ` Michael Kelley (EOSG)
@ 2018-04-04 15:57     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2018-04-04 15:57 UTC (permalink / raw)
  To: Michael Kelley (EOSG)
  Cc: olaf, Stephen Hemminger, jasowang, linux-kernel, apw,
	marcelo.cerri, devel, vkuznets, leann.ogasawara

On Wed, Apr 04, 2018 at 03:47:03PM +0000, Michael Kelley (EOSG) wrote:
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Wednesday, April 4, 2018 1:16 AM
> > To: Michael Kelley (EOSG) <Michael.H.Kelley@microsoft.com>
> > Cc: linux-kernel@vger.kernel.org; devel@linuxdriverproject.org; olaf@aepfle.de;
> > apw@canonical.com; vkuznets@redhat.com; jasowang@redhat.com;
> > leann.ogasawara@canonical.com; marcelo.cerri@canonical.com; Stephen Hemminger
> > <sthemmin@microsoft.com>; KY Srinivasan <kys@microsoft.com>
> > Subject: Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations
> > 
> > On Tue, Apr 03, 2018 at 01:59:08PM -0700, mhkelley58@gmail.com wrote:
> > > From: Michael Kelley <mikelley@microsoft.com>
> > >
> > > Add standard interrupt handler annotations to
> > > hyperv_vector_handler().
> > >
> > > Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> > > ---
> > > Changes in v2:
> > > * Fixed From: line
> > > ---
> > >  arch/x86/kernel/cpu/mshyperv.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> > > index 4488cf0..20f6849 100644
> > > --- a/arch/x86/kernel/cpu/mshyperv.c
> > > +++ b/arch/x86/kernel/cpu/mshyperv.c
> > > @@ -41,7 +41,7 @@ static void (*hv_stimer0_handler)(void);
> > >  static void (*hv_kexec_handler)(void);
> > >  static void (*hv_crash_handler)(struct pt_regs *regs);
> > >
> > > -void hyperv_vector_handler(struct pt_regs *regs)
> > > +__visible void __irq_entry hyperv_vector_handler(struct pt_regs *regs)
> > 
> > What bug does this solve?  What is wrong with the existing markings?
> > What does __visible and __irq_entry give us that we don't already have
> > and we need?
> > 
> > Are you really using LTO that requires this marking to prevent the code
> > from being removed?
> 
> Thomas Gleixner commented on Vitaly Kuznetsov's Hyper-V reenlightenment patch
> that the interrupt handler should have these annotations: see
> https://lkml.org/lkml/2018/1/14/145

Ok, then someone needs to put a "Suggested-by:" or "Requested-by:" or
something like that tag here, right?

> I put the same annotations on the interrupt handler for stimer0 Direct Mode,
> So this change makes the hyperv_vector_handler() consistent with
> hv_stimer0_vector_handler() in the same source file.  It does not fix any
> immediate bug -- it's for consistency and alignment with what is apparently
> standard practice.
> 
> Not sure what LTO is ...

That's what the __visable marking fixes!  Please go at least _read_ the
definition of the marking you are adding to a function before doing it.
Otherwise this is just cargo-cult-coding :(

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2018-04-04 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 20:59 [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations mhkelley58
2018-04-04  8:16 ` Greg KH
2018-04-04 15:47   ` Michael Kelley (EOSG)
2018-04-04 15:57     ` Greg KH

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).