Skip to content

Commit

Permalink
hv: allocate synic pages for all present CPUs
Browse files Browse the repository at this point in the history
It may happen that not all CPUs are online when we do hv_synic_alloc() and
in case more CPUs come online later we may try accessing these allocated
structures.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Vitaly Kuznetsov authored and Greg Kroah-Hartman committed Jan 10, 2017
1 parent c0bb039 commit 421b8f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hv/hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ int hv_synic_alloc(void)
goto err;
}

for_each_online_cpu(cpu) {
for_each_present_cpu(cpu) {
hv_context.event_dpc[cpu] = kmalloc(size, GFP_ATOMIC);
if (hv_context.event_dpc[cpu] == NULL) {
pr_err("Unable to allocate event dpc\n");
Expand Down Expand Up @@ -482,7 +482,7 @@ void hv_synic_free(void)
int cpu;

kfree(hv_context.hv_numa_map);
for_each_online_cpu(cpu)
for_each_present_cpu(cpu)
hv_synic_free_cpu(cpu);
}

Expand Down

0 comments on commit 421b8f2

Please sign in to comment.