* [PATCH v2] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case
@ 2015-09-22 13:49 Vitaly Kuznetsov
2015-09-22 15:27 ` [tip:x86/urgent] x86/hyperv: Fix build for CONFIG_KEXEC_CORE=n tip-bot for Vitaly Kuznetsov
0 siblings, 1 reply; 2+ messages in thread
From: Vitaly Kuznetsov @ 2015-09-22 13:49 UTC (permalink / raw)
To: x86
Cc: devel, linux-kernel, K. Y. Srinivasan, Haiyang Zhang,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Jim Davis,
Stephen Hemminger, Greg Kroah-Hartman
Recent changes in Hyper-V driver ("Drivers: hv: vmbus: add special crash
handler") broke the build when CONFIG_KEXEC_CORE is not set:
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'
Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE.
Reported-by: Jim Davis <jim.epost@gmail.com>
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
Previously I tried solving the issue by defining native_machine_crash_shutdown
in !CONFIG_KEXEC_CORE case: https://lkml.org/lkml/2015/8/11/417. This was to
avoid having #ifdefs in C code [Greg KH]. Such approach, however, raised a
question on bloating kernel with unneeded stuff [Ingo Molnar].
---
arch/x86/kernel/cpu/mshyperv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 381c8b9..6cec20a 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -98,6 +98,7 @@ void hv_remove_crash_handler(void)
EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
#endif
+#ifdef CONFIG_KEXEC_CORE
static void hv_machine_shutdown(void)
{
if (kexec_in_progress && hv_kexec_handler)
@@ -111,7 +112,7 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
hv_crash_handler(regs);
native_machine_crash_shutdown(regs);
}
-
+#endif
static uint32_t __init ms_hyperv_platform(void)
{
@@ -186,8 +187,10 @@ static void __init ms_hyperv_init_platform(void)
no_timer_check = 1;
#endif
+#ifdef CONFIG_KEXEC_CORE
machine_ops.shutdown = hv_machine_shutdown;
machine_ops.crash_shutdown = hv_machine_crash_shutdown;
+#endif
mark_tsc_unstable("running on Hyper-V");
}
--
2.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:x86/urgent] x86/hyperv: Fix build for CONFIG_KEXEC_CORE=n
2015-09-22 13:49 [PATCH v2] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case Vitaly Kuznetsov
@ 2015-09-22 15:27 ` tip-bot for Vitaly Kuznetsov
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Vitaly Kuznetsov @ 2015-09-22 15:27 UTC (permalink / raw)
To: linux-tip-commits
Cc: mingo, haiyangz, kys, vkuznets, tglx, gregkh, jim.epost, hpa,
linux-kernel, stephen
Commit-ID: ee07b34fd435b7cc5678b36dda7f6468fe6a0e55
Gitweb: http://git.kernel.org/tip/ee07b34fd435b7cc5678b36dda7f6468fe6a0e55
Author: Vitaly Kuznetsov <vkuznets@redhat.com>
AuthorDate: Tue, 22 Sep 2015 15:49:59 +0200
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 22 Sep 2015 17:25:31 +0200
x86/hyperv: Fix build for CONFIG_KEXEC_CORE=n
Recent changes in the Hyper-V driver broke the build when
CONFIG_KEXEC_CORE is not set:
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'
Decorate all kexec related code with #ifdef CONFIG_KEXEC_CORE.
Fixes: b4370df2b1f5: "Drivers: hv: vmbus: add special crash handler"
Reported-by: Jim Davis <jim.epost@gmail.com>
Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: devel@linuxdriverproject.org
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: http://lkml.kernel.org/r/1442929799-28091-1-git-send-email-vkuznets@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/cpu/mshyperv.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 381c8b9..6cec20a 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -98,6 +98,7 @@ void hv_remove_crash_handler(void)
EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
#endif
+#ifdef CONFIG_KEXEC_CORE
static void hv_machine_shutdown(void)
{
if (kexec_in_progress && hv_kexec_handler)
@@ -111,7 +112,7 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
hv_crash_handler(regs);
native_machine_crash_shutdown(regs);
}
-
+#endif
static uint32_t __init ms_hyperv_platform(void)
{
@@ -186,8 +187,10 @@ static void __init ms_hyperv_init_platform(void)
no_timer_check = 1;
#endif
+#ifdef CONFIG_KEXEC_CORE
machine_ops.shutdown = hv_machine_shutdown;
machine_ops.crash_shutdown = hv_machine_crash_shutdown;
+#endif
mark_tsc_unstable("running on Hyper-V");
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-22 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 13:49 [PATCH v2] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case Vitaly Kuznetsov
2015-09-22 15:27 ` [tip:x86/urgent] x86/hyperv: Fix build for CONFIG_KEXEC_CORE=n tip-bot for Vitaly Kuznetsov
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).