aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorK. Y. Srinivasan <kys@microsoft.com>2014-12-15 02:34:51 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-12 08:04:10 -0500
commit87712bf81dd092821c406ea3fb47a07222484a64 (patch)
tree9c88e241ed4b2b9ce37925cd58773db3827b3974
parentca04455fba937eb2d85f437900cd1726166192e6 (diff)
Drivers: hv: vmbus: Use get_cpu() to get the current CPU
Replace calls for smp_processor_id() to get_cpu() to get the CPU ID of the current CPU. In these instances, there is no correctness issue with regards to preemption, we just need the current CPU ID. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/hv/channel_mgmt.c4
-rw-r--r--drivers/hv/connection.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
index 2c59f030546b..1d7df2576b1c 100644
--- a/drivers/hv/channel_mgmt.c
+++ b/drivers/hv/channel_mgmt.c
@@ -815,7 +815,7 @@ cleanup:
815struct vmbus_channel *vmbus_get_outgoing_channel(struct vmbus_channel *primary) 815struct vmbus_channel *vmbus_get_outgoing_channel(struct vmbus_channel *primary)
816{ 816{
817 struct list_head *cur, *tmp; 817 struct list_head *cur, *tmp;
818 int cur_cpu = hv_context.vp_index[smp_processor_id()]; 818 int cur_cpu;
819 struct vmbus_channel *cur_channel; 819 struct vmbus_channel *cur_channel;
820 struct vmbus_channel *outgoing_channel = primary; 820 struct vmbus_channel *outgoing_channel = primary;
821 int cpu_distance, new_cpu_distance; 821 int cpu_distance, new_cpu_distance;
@@ -823,6 +823,8 @@ struct vmbus_channel *vmbus_get_outgoing_channel(struct vmbus_channel *primary)
823 if (list_empty(&primary->sc_list)) 823 if (list_empty(&primary->sc_list))
824 return outgoing_channel; 824 return outgoing_channel;
825 825
826 cur_cpu = hv_context.vp_index[get_cpu()];
827 put_cpu();
826 list_for_each_safe(cur, tmp, &primary->sc_list) { 828 list_for_each_safe(cur, tmp, &primary->sc_list) {
827 cur_channel = list_entry(cur, struct vmbus_channel, sc_list); 829 cur_channel = list_entry(cur, struct vmbus_channel, sc_list);
828 if (cur_channel->state != CHANNEL_OPENED_STATE) 830 if (cur_channel->state != CHANNEL_OPENED_STATE)
diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
index e206619b946e..a63a795300b9 100644
--- a/drivers/hv/connection.c
+++ b/drivers/hv/connection.c
@@ -80,8 +80,10 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
80 msg->interrupt_page = virt_to_phys(vmbus_connection.int_page); 80 msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
81 msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]); 81 msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]);
82 msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]); 82 msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]);
83 if (version == VERSION_WIN8_1) 83 if (version == VERSION_WIN8_1) {
84 msg->target_vcpu = hv_context.vp_index[smp_processor_id()]; 84 msg->target_vcpu = hv_context.vp_index[get_cpu()];
85 put_cpu();
86 }
85 87
86 /* 88 /*
87 * Add to list before we send the request since we may 89 * Add to list before we send the request since we may