Skip to contentSkip to conversation

X86: mshyperv.c: Fix a compilation issue.

PATCH In review K. Y. Srinivasan 3 participants 4 messages Aug 6, 2015 – Aug 10, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 X86: mshyperv.c: Fix a compilation issue.

Building with a random configuration file, this build failure was reported:

arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown'

This patch fixes the problem

---
 arch/x86/kernel/cpu/mshyperv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +2 -0
index f794bfa..0faed5e0 100644
@@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
 {
 	if (hv_crash_handler)
 		hv_crash_handler(regs);
+#ifdef CONFIG_KEXEC_CORE
 	native_machine_crash_shutdown(regs);
+#endif
 }
 
 
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 20 lines · K. Y. Srinivasan

Building with a random configuration file, this build failure was reported:

arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown'

This patch fixes the problem

---
 arch/x86/kernel/cpu/mshyperv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/x86/kernel/cpu/mshyperv.c +0 -0
index f794bfa..0faed5e0 100644

arch/x86/kernel/cpu/mshyperv.c static void hv_machine_crash_shutdown(struct pt_regs *regs) · line 114

Quoted 6 lines
arch/x86/kernel/cpu/mshyperv.c +2 -0
@@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
 {
 	if (hv_crash_handler)
 		hv_crash_handler(regs);
+#ifdef CONFIG_KEXEC_CORE
 	native_machine_crash_shutdown(regs);
+#endif

Why is kexec the factor here? And if it really does, can't it just be CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that you don't have to have a #ifdef in a .c file?

thanks,

greg k-h

#2 lore raw
Quoted 35 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Thursday, August 6, 2015 2:11 PM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang <[email protected]>
Subject: Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.

Quoted 9 lines · K. Y. Srinivasan

Building with a random configuration file, this build failure was reported:

arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown'

This patch fixes the problem

Review

Quoted 7 lines
---
 arch/x86/kernel/cpu/mshyperv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/x86/kernel/cpu/mshyperv.c

arch/x86/kernel/cpu/mshyperv.c static void hv_machine_crash_shutdown(struct

Quoted 4 lines

index f794bfa..0faed5e0 100644

arch/x86/kernel/cpu/mshyperv.c +0 -0
@@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct

pt_regs *regs)

Quoted 10 lines

arch/x86/kernel/cpu/mshyperv.c static void hv_machine_crash_shutdown(struct pt_regs *regs) · line 114

Quoted 6 lines
arch/x86/kernel/cpu/mshyperv.c +2 -0
 {
 	if (hv_crash_handler)
 		hv_crash_handler(regs);
+#ifdef CONFIG_KEXEC_CORE
 	native_machine_crash_shutdown(regs);
+#endif

Why is kexec the factor here? And if it really does, can't it just be CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that you don't have to have a #ifdef in a .c file?

Greg,

I am on vacation till next Tuesday. I will address your concern after I get back if Vitaly has not addressed it by then.

Regards,

K. Y

#3 lore raw
Quoted 42 lines · KY Srinivasan
Quoted 26 lines

-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Thursday, August 6, 2015 2:11 PM
To: KY Srinivasan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Haiyang Zhang <[email protected]>
Subject: Re: [PATCH 1/1] X86: mshyperv.c: Fix a compilation issue.

Quoted 15 lines · K. Y. Srinivasan

Building with a random configuration file, this build failure was reported:

arch/x86/built-in.o: In function `hv_machine_crash_shutdown':
arch/x86/kernel/cpu/mshyperv.c:112: undefined reference to `native_machine_crash_shutdown'

This patch fixes the problem

---
 arch/x86/kernel/cpu/mshyperv.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Quoted 15 lines

arch/x86/kernel/cpu/mshyperv.c static void hv_machine_crash_shutdown(struct pt_regs *regs) · line 114

Quoted 11 lines
arch/x86/kernel/cpu/mshyperv.c +2 -0
index f794bfa..0faed5e0 100644
@@ -109,7 +109,9 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
 {
 	if (hv_crash_handler)
 		hv_crash_handler(regs);
+#ifdef CONFIG_KEXEC_CORE
 	native_machine_crash_shutdown(regs);
+#endif

Why is kexec the factor here? And if it really does, can't it just be CONFIG_KEXEC, or, can kexec provide a "dummy" inline function so that you don't have to have a #ifdef in a .c file?

Quoted 4 lines

Greg,

I am on vacation till next Tuesday. I will address your concern after I get back if Vitaly has not addressed it by then.

I think the issue is not Hyper-V-related: we have native_machine_crash_shutdown() defined in asm/reboot.h but its implementation in kernel/crash.c is only being compiled with CONFIG_KEXEC. I suggest we fix it with something like the following:

arch/x86/include/asm/reboot.h +0 -0
index a82c4f1..6763e3e 100644
@@ -16,8 +16,15 @@ struct machine_ops {
 

extern struct machine_ops machine_ops;

-void native_machine_crash_shutdown(struct pt_regs *regs); void native_machine_shutdown(void);
+#ifdef CONFIG_KEXEC
+void native_machine_crash_shutdown(struct pt_regs *regs); +#else
+static inline void native_machine_crash_shutdown(struct pt_regs *regs) +{
+ native_machine_shutdown();
+}
+#endif
void __noreturn machine_real_restart(unsigned int type);
/* These must match dispatch in arch/x86/realmore/rm/reboot.S */
#define MRR_BIOS 0

I'll post a patch if there are no objections.

Signature · 1 line
  Vitaly