Skip to contentSkip to conversation

x86/hyperv: Add interrupt handler annotations

PATCH Superseded [email protected] 3 participants 4 messages Apr 3, 2018 – Apr 4, 2018

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/hyperv: Add interrupt handler annotations

From: Michael Kelley <[email protected]>

Add standard interrupt handler annotations to
hyperv_vector_handler().

---
Changes in v2:
* Fixed From: line

---
 arch/x86/kernel/cpu/mshyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mshyperv.c +1 -1
index 4488cf0..20f6849 100644
@@ -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);
 
Signature · 6 lines
2.7.4

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
#1 lore raw
Quoted 18 lines · On Tue, Apr 03, 2018 at 01:59:08PM -0700, [email protected] wrote:

From: Michael Kelley <[email protected]>

Add standard interrupt handler annotations to
hyperv_vector_handler().

---
Changes in v2:
* Fixed From: line

---
 arch/x86/kernel/cpu/mshyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mshyperv.c +0 -0
index 4488cf0..20f6849 100644

arch/x86/kernel/cpu/mshyperv.c static void (*hv_stimer0_handler)(void); · line 44

Quoted 5 lines
arch/x86/kernel/cpu/mshyperv.c +1 -1
@@ -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
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#2 lore raw
Quoted 39 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Wednesday, April 4, 2018 1:16 AM
To: Michael Kelley (EOSG) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Stephen Hemminger <[email protected]>; KY Srinivasan <[email protected]>
Subject: Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations

Quoted 18 lines · On Tue, Apr 03, 2018 at 01:59:08PM -0700, [email protected] wrote:

From: Michael Kelley <[email protected]>

Add standard interrupt handler annotations to
hyperv_vector_handler().

---
Changes in v2:
* Fixed From: line

---
 arch/x86/kernel/cpu/mshyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mshyperv.c +0 -0
index 4488cf0..20f6849 100644

arch/x86/kernel/cpu/mshyperv.c static void (*hv_stimer0_handler)(void); · line 44

Quoted 5 lines
arch/x86/kernel/cpu/mshyperv.c +1 -1
@@ -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?

Quoted 2 lines

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

Quoted 4 lines

thanks,

greg k-h

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

#3 lore raw
Quoted 39 lines · Michael Kelley (EOSG)
Quoted 39 lines

-----Original Message-----
From: Greg KH <[email protected]>
Sent: Wednesday, April 4, 2018 1:16 AM
To: Michael Kelley (EOSG) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Stephen Hemminger <[email protected]>; KY Srinivasan <[email protected]>
Subject: Re: [PATCH v2 char-misc 1/1] x86/hyperv: Add interrupt handler annotations

Quoted 18 lines · On Tue, Apr 03, 2018 at 01:59:08PM -0700, [email protected] wrote:

From: Michael Kelley <[email protected]>

Add standard interrupt handler annotations to
hyperv_vector_handler().

---
Changes in v2:
* Fixed From: line

---
 arch/x86/kernel/cpu/mshyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mshyperv.c +0 -0
index 4488cf0..20f6849 100644

arch/x86/kernel/cpu/mshyperv.c static void (*hv_stimer0_handler)(void); · line 44

Quoted 5 lines
arch/x86/kernel/cpu/mshyperv.c +1 -1
@@ -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?

Quoted 6 lines
Quoted 2 lines

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?

Quoted 7 lines

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
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel