提交 a3cadf38 编写于 作者: K K. Y. Srinivasan 提交者: Greg Kroah-Hartman

Drivers: hv: vmbus: Get rid of unnecessary state in hv_context

Currently we are replicating state in struct hv_context that is unnecessary -
this state can be retrieved from the hypervisor. Furthermore, this is a per-cpu
state that is being maintained as a global state in struct hv_context.
Get rid of this state in struct hv_context.
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 78ef4193
...@@ -33,9 +33,7 @@ ...@@ -33,9 +33,7 @@
#include "hyperv_vmbus.h" #include "hyperv_vmbus.h"
/* The one and only */ /* The one and only */
struct hv_context hv_context = { struct hv_context hv_context;
.synic_initialized = false,
};
/* /*
* If false, we're using the old mechanism for stimer0 interrupts * If false, we're using the old mechanism for stimer0 interrupts
...@@ -326,8 +324,6 @@ int hv_synic_init(unsigned int cpu) ...@@ -326,8 +324,6 @@ int hv_synic_init(unsigned int cpu)
hv_set_synic_state(sctrl.as_uint64); hv_set_synic_state(sctrl.as_uint64);
hv_context.synic_initialized = true;
/* /*
* Register the per-cpu clockevent source. * Register the per-cpu clockevent source.
*/ */
...@@ -373,7 +369,8 @@ int hv_synic_cleanup(unsigned int cpu) ...@@ -373,7 +369,8 @@ int hv_synic_cleanup(unsigned int cpu)
bool channel_found = false; bool channel_found = false;
unsigned long flags; unsigned long flags;
if (!hv_context.synic_initialized) hv_get_synic_state(sctrl.as_uint64);
if (sctrl.enable != 1)
return -EFAULT; return -EFAULT;
/* /*
...@@ -435,7 +432,6 @@ int hv_synic_cleanup(unsigned int cpu) ...@@ -435,7 +432,6 @@ int hv_synic_cleanup(unsigned int cpu)
hv_set_siefp(siefp.as_uint64); hv_set_siefp(siefp.as_uint64);
/* Disable the global synic bit */ /* Disable the global synic bit */
hv_get_synic_state(sctrl.as_uint64);
sctrl.enable = 0; sctrl.enable = 0;
hv_set_synic_state(sctrl.as_uint64); hv_set_synic_state(sctrl.as_uint64);
......
...@@ -230,8 +230,6 @@ struct hv_context { ...@@ -230,8 +230,6 @@ struct hv_context {
void *tsc_page; void *tsc_page;
bool synic_initialized;
struct hv_per_cpu_context __percpu *cpu_context; struct hv_per_cpu_context __percpu *cpu_context;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册