* [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
@ 2019-11-14 6:32 Michael Kelley
2019-11-14 10:04 ` Vitaly Kuznetsov
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Michael Kelley @ 2019-11-14 6:32 UTC (permalink / raw)
To: linux-kernel, vkuznets, KY Srinivasan, Stephen Hemminger, sashal,
Dexuan Cui, linux-hyperv
Cc: Michael Kelley
The crash handler calls hv_synic_cleanup() to shutdown the
Hyper-V synthetic interrupt controller. But if the CPU
that calls hv_synic_cleanup() has a VMbus channel interrupt
assigned to it (which is likely the case in smaller VM sizes),
hv_synic_cleanup() returns an error and the synthetic
interrupt controller isn't shutdown. While the lack of
being shutdown hasn't caused a known problem, it still
should be fixed for highest reliability.
So directly call hv_synic_disable_regs() instead of
hv_synic_cleanup(), which ensures that the synic is always
shutdown.
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
---
drivers/hv/vmbus_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 664a415..665920d 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -2305,7 +2305,7 @@ static void hv_crash_handler(struct pt_regs *regs)
vmbus_connection.conn_state = DISCONNECTED;
cpu = smp_processor_id();
hv_stimer_cleanup(cpu);
- hv_synic_cleanup(cpu);
+ hv_synic_disable_regs(cpu);
hyperv_cleanup();
};
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
2019-11-14 6:32 [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic Michael Kelley
@ 2019-11-14 10:04 ` Vitaly Kuznetsov
2019-11-15 6:56 ` Dexuan Cui
2019-11-19 13:23 ` Sasha Levin
2 siblings, 0 replies; 4+ messages in thread
From: Vitaly Kuznetsov @ 2019-11-14 10:04 UTC (permalink / raw)
To: Michael Kelley
Cc: linux-kernel, KY Srinivasan, Stephen Hemminger, sashal,
Dexuan Cui, linux-hyperv
Michael Kelley <mikelley@microsoft.com> writes:
> The crash handler calls hv_synic_cleanup() to shutdown the
> Hyper-V synthetic interrupt controller. But if the CPU
> that calls hv_synic_cleanup() has a VMbus channel interrupt
> assigned to it (which is likely the case in smaller VM sizes),
> hv_synic_cleanup() returns an error and the synthetic
> interrupt controller isn't shutdown. While the lack of
> being shutdown hasn't caused a known problem, it still
> should be fixed for highest reliability.
>
> So directly call hv_synic_disable_regs() instead of
> hv_synic_cleanup(), which ensures that the synic is always
> shutdown.
Generally, when performing kdump doing as little work as possible is
always preferred and hv_synic_cleanup() does too much: taking mutex,
walking through channel list,...
Also, hv_synic_cleanup() was calling hv_stimer_cleanup() and we have a
second redundant invocation in hv_crash_handler().
>
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
> drivers/hv/vmbus_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 664a415..665920d 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -2305,7 +2305,7 @@ static void hv_crash_handler(struct pt_regs *regs)
> vmbus_connection.conn_state = DISCONNECTED;
> cpu = smp_processor_id();
> hv_stimer_cleanup(cpu);
> - hv_synic_cleanup(cpu);
> + hv_synic_disable_regs(cpu);
> hyperv_cleanup();
> };
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
--
Vitaly
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
2019-11-14 6:32 [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic Michael Kelley
2019-11-14 10:04 ` Vitaly Kuznetsov
@ 2019-11-15 6:56 ` Dexuan Cui
2019-11-19 13:23 ` Sasha Levin
2 siblings, 0 replies; 4+ messages in thread
From: Dexuan Cui @ 2019-11-15 6:56 UTC (permalink / raw)
To: Michael Kelley, linux-kernel, vkuznets, KY Srinivasan,
Stephen Hemminger, sashal, linux-hyperv
> From: Michael Kelley <mikelley@microsoft.com>
> Sent: Wednesday, November 13, 2019 10:32 PM
> To: linux-kernel@vger.kernel.org; vkuznets <vkuznets@redhat.com>; KY
> Srinivasan <kys@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; sashal@kernel.org; Dexuan Cui
> <decui@microsoft.com>; linux-hyperv@vger.kernel.org
> Cc: Michael Kelley <mikelley@microsoft.com>
> Subject: [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V
> synic
>
> The crash handler calls hv_synic_cleanup() to shutdown the
> Hyper-V synthetic interrupt controller. But if the CPU
> that calls hv_synic_cleanup() has a VMbus channel interrupt
> assigned to it (which is likely the case in smaller VM sizes),
> hv_synic_cleanup() returns an error and the synthetic
> interrupt controller isn't shutdown. While the lack of
> being shutdown hasn't caused a known problem, it still
> should be fixed for highest reliability.
>
> So directly call hv_synic_disable_regs() instead of
> hv_synic_cleanup(), which ensures that the synic is always
> shutdown.
>
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>
> ---
> drivers/hv/vmbus_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 664a415..665920d 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -2305,7 +2305,7 @@ static void hv_crash_handler(struct pt_regs *regs)
> vmbus_connection.conn_state = DISCONNECTED;
> cpu = smp_processor_id();
> hv_stimer_cleanup(cpu);
> - hv_synic_cleanup(cpu);
> + hv_synic_disable_regs(cpu);
> hyperv_cleanup();
> };
>
> --
Reviewed-by: Dexuan Cui <decui@microsoft.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic
2019-11-14 6:32 [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic Michael Kelley
2019-11-14 10:04 ` Vitaly Kuznetsov
2019-11-15 6:56 ` Dexuan Cui
@ 2019-11-19 13:23 ` Sasha Levin
2 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2019-11-19 13:23 UTC (permalink / raw)
To: Michael Kelley
Cc: linux-kernel, vkuznets, KY Srinivasan, Stephen Hemminger,
Dexuan Cui, linux-hyperv
On Thu, Nov 14, 2019 at 06:32:01AM +0000, Michael Kelley wrote:
>The crash handler calls hv_synic_cleanup() to shutdown the
>Hyper-V synthetic interrupt controller. But if the CPU
>that calls hv_synic_cleanup() has a VMbus channel interrupt
>assigned to it (which is likely the case in smaller VM sizes),
>hv_synic_cleanup() returns an error and the synthetic
>interrupt controller isn't shutdown. While the lack of
>being shutdown hasn't caused a known problem, it still
>should be fixed for highest reliability.
>
>So directly call hv_synic_disable_regs() instead of
>hv_synic_cleanup(), which ensures that the synic is always
>shutdown.
>
>Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Queued up, thank you.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-19 13:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 6:32 [PATCH 1/1] Drivers: hv: vmbus: Fix crash handler reset of Hyper-V synic Michael Kelley
2019-11-14 10:04 ` Vitaly Kuznetsov
2019-11-15 6:56 ` Dexuan Cui
2019-11-19 13:23 ` Sasha Levin
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).