summaryrefslogtreecommitdiffstats
path: root/drivers/hv
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2017-01-28 14:37:14 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 05:05:58 -0500
commitd6f3609d2b4c6d0eec01f398cb685e50da3e6013 (patch)
treee4810aaa4fee18f5876d13c6a0376ed72685fc6d /drivers/hv
parent17244623a4c0f68d3f02c9c74d9b6ae259425826 (diff)
Drivers: hv: restore hypervcall page cleanup before kexec
We need to cleanup the hypercall page before doing kexec/kdump or the new kernel may crash if it tries to use it. Reuse the now-empty hv_cleanup function renaming it to hyperv_cleanup and moving to the arch specific code. Fixes: 8730046c1498 ("Drivers: hv vmbus: Move Hypercall page setup out of common code") Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r--drivers/hv/hv.c10
-rw-r--r--drivers/hv/hyperv_vmbus.h2
-rw-r--r--drivers/hv/vmbus_drv.c10
3 files changed, 3 insertions, 19 deletions
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 60594fa3250d..0f73237bed0a 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -71,16 +71,6 @@ int hv_init(void)
71} 71}
72 72
73/* 73/*
74 * hv_cleanup - Cleanup routine.
75 *
76 * This routine is called normally during driver unloading or exiting.
77 */
78void hv_cleanup(bool crash)
79{
80
81}
82
83/*
84 * hv_post_message - Post a message using the hypervisor message IPC. 74 * hv_post_message - Post a message using the hypervisor message IPC.
85 * 75 *
86 * This involves a hypercall. 76 * This involves a hypercall.
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 2463ef93c1f6..86b56b677dc3 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -255,8 +255,6 @@ struct hv_ring_buffer_debug_info {
255 255
256extern int hv_init(void); 256extern int hv_init(void);
257 257
258extern void hv_cleanup(bool crash);
259
260extern int hv_post_message(union hv_connection_id connection_id, 258extern int hv_post_message(union hv_connection_id connection_id,
261 enum hv_message_type message_type, 259 enum hv_message_type message_type,
262 void *payload, size_t payload_size); 260 void *payload, size_t payload_size);
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 8e81346114d4..f8ebe13cf251 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -962,7 +962,7 @@ static int vmbus_bus_init(void)
962 962
963 ret = bus_register(&hv_bus); 963 ret = bus_register(&hv_bus);
964 if (ret) 964 if (ret)
965 goto err_cleanup; 965 return ret;
966 966
967 hv_setup_vmbus_irq(vmbus_isr); 967 hv_setup_vmbus_irq(vmbus_isr);
968 968
@@ -1004,9 +1004,6 @@ err_alloc:
1004 1004
1005 bus_unregister(&hv_bus); 1005 bus_unregister(&hv_bus);
1006 1006
1007err_cleanup:
1008 hv_cleanup(false);
1009
1010 return ret; 1007 return ret;
1011} 1008}
1012 1009
@@ -1462,7 +1459,7 @@ static void hv_kexec_handler(void)
1462 /* Make sure conn_state is set as hv_synic_cleanup checks for it */ 1459 /* Make sure conn_state is set as hv_synic_cleanup checks for it */
1463 mb(); 1460 mb();
1464 cpuhp_remove_state(hyperv_cpuhp_online); 1461 cpuhp_remove_state(hyperv_cpuhp_online);
1465 hv_cleanup(false); 1462 hyperv_cleanup();
1466}; 1463};
1467 1464
1468static void hv_crash_handler(struct pt_regs *regs) 1465static void hv_crash_handler(struct pt_regs *regs)
@@ -1475,7 +1472,7 @@ static void hv_crash_handler(struct pt_regs *regs)
1475 */ 1472 */
1476 vmbus_connection.conn_state = DISCONNECTED; 1473 vmbus_connection.conn_state = DISCONNECTED;
1477 hv_synic_cleanup(smp_processor_id()); 1474 hv_synic_cleanup(smp_processor_id());
1478 hv_cleanup(true); 1475 hyperv_cleanup();
1479}; 1476};
1480 1477
1481static int __init hv_acpi_init(void) 1478static int __init hv_acpi_init(void)
@@ -1535,7 +1532,6 @@ static void __exit vmbus_exit(void)
1535 &hyperv_panic_block); 1532 &hyperv_panic_block);
1536 } 1533 }
1537 bus_unregister(&hv_bus); 1534 bus_unregister(&hv_bus);
1538 hv_cleanup(false);
1539 for_each_online_cpu(cpu) { 1535 for_each_online_cpu(cpu) {
1540 tasklet_kill(hv_context.event_dpc[cpu]); 1536 tasklet_kill(hv_context.event_dpc[cpu]);
1541 } 1537 }