Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1231302
| From | Vitaly Kuznetsov <vkuznets@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case |
| Date | 2015-09-23 12:10 +0200 |
| Message-ID | <qbP9T-Z0-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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>
---
Changes since v2:
- Hide hv_kexec_handler/hv_crash_handler under IS_ENABLED(CONFIG_HYPERV)
to avoid warings in !CONFIG_HYPERV && !CONFIG_KEXEC case [kbuild robot]
Changes since v1:
- 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 | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
index 381c8b9..20e242e 100644
--- a/arch/x86/kernel/cpu/mshyperv.c
+++ b/arch/x86/kernel/cpu/mshyperv.c
@@ -34,11 +34,10 @@
struct ms_hyperv_info ms_hyperv;
EXPORT_SYMBOL_GPL(ms_hyperv);
-static void (*hv_kexec_handler)(void);
-static void (*hv_crash_handler)(struct pt_regs *regs);
-
#if IS_ENABLED(CONFIG_HYPERV)
static void (*vmbus_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)
{
@@ -96,8 +95,8 @@ void hv_remove_crash_handler(void)
hv_crash_handler = NULL;
}
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 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
hv_crash_handler(regs);
native_machine_crash_shutdown(regs);
}
-
+#endif /* CONFIG_KEXEC_CORE */
+#endif /* CONFIG_HYPERV */
static uint32_t __init ms_hyperv_platform(void)
{
@@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void)
no_timer_check = 1;
#endif
+#if IS_ENABLED(CONFIG_HYPERV) && defined(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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v3] x86: hyperv: fix build in !CONFIG_KEXEC_CORE case Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-09-23 12:10 +0200
[tip:x86/urgent] x86: Hyperv: fix build in %21CONFIG_KEXEC_CORE case tip-bot for Vitaly Kuznetsov <tipbot@zytor.com> - 2015-09-28 18:40 +0200
[tip:x86/urgent] x86/hyperv: Fix the build in the CONFIG_KEXEC_CORE=y case tip-bot for Vitaly Kuznetsov <tipbot@zytor.com> - 2015-09-29 09:50 +0200
Re: [tip:x86/urgent] x86/hyperv: Fix the build in the CONFIG_KEXEC_CORE=y case Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-09-29 14:00 +0200
Re: [tip:x86/urgent] x86/hyperv: Fix the build in the CONFIG_KEXEC_CORE=y case Ingo Molnar <mingo@kernel.org> - 2015-09-30 07:50 +0200
[tip:x86/urgent] x86/hyperv: Fix the build in the !CONFIG_KEXEC_CORE case tip-bot for Vitaly Kuznetsov <tipbot@zytor.com> - 2015-09-30 07:50 +0200
csiph-web