diff options
author | K. Y. Srinivasan <kys@microsoft.com> | 2012-02-02 19:56:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-09 11:32:44 -0500 |
commit | 14c1bf8a8920f36f6e0603a2ff920b48eec14387 (patch) | |
tree | 8e461c20788b2939d98f3898fd4a8e4fa634337c | |
parent | 2640335438ca4d7b139e114dae5f0d80e740e106 (diff) |
drivers: hv: Increase the number of VCPUs supported in the guest
The current code arbirarily limited the number of CPUs the guest could have.
Change that so that we can support the maximum number of CPUs the guest can
support. While we use NR_CPUS to size the per-cpu state all we are allocating
based on NR_CPUS are the pointers to per-cpu state that will be allocatted in
the context of the initializing CPU. This patch triggers a checkpatch warning
for the usage of NR_CPU and since all we are allocating a couple of pointers
per CPU, it should be ok.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/hv/hv.c | 4 | ||||
-rw-r--r-- | drivers/hv/hyperv_vmbus.h | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 12aa97f31f93..15956bd48b48 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c | |||
@@ -155,9 +155,9 @@ int hv_init(void) | |||
155 | union hv_x64_msr_hypercall_contents hypercall_msr; | 155 | union hv_x64_msr_hypercall_contents hypercall_msr; |
156 | void *virtaddr = NULL; | 156 | void *virtaddr = NULL; |
157 | 157 | ||
158 | memset(hv_context.synic_event_page, 0, sizeof(void *) * MAX_NUM_CPUS); | 158 | memset(hv_context.synic_event_page, 0, sizeof(void *) * NR_CPUS); |
159 | memset(hv_context.synic_message_page, 0, | 159 | memset(hv_context.synic_message_page, 0, |
160 | sizeof(void *) * MAX_NUM_CPUS); | 160 | sizeof(void *) * NR_CPUS); |
161 | 161 | ||
162 | if (!query_hypervisor_presence()) | 162 | if (!query_hypervisor_presence()) |
163 | goto cleanup; | 163 | goto cleanup; |
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6d7d286d5440..699f0d8e59ed 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h | |||
@@ -457,7 +457,6 @@ static const uuid_le VMBUS_SERVICE_ID = { | |||
457 | }, | 457 | }, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | #define MAX_NUM_CPUS 32 | ||
461 | 460 | ||
462 | 461 | ||
463 | struct hv_input_signal_event_buffer { | 462 | struct hv_input_signal_event_buffer { |
@@ -483,8 +482,8 @@ struct hv_context { | |||
483 | /* 8-bytes aligned of the buffer above */ | 482 | /* 8-bytes aligned of the buffer above */ |
484 | struct hv_input_signal_event *signal_event_param; | 483 | struct hv_input_signal_event *signal_event_param; |
485 | 484 | ||
486 | void *synic_message_page[MAX_NUM_CPUS]; | 485 | void *synic_message_page[NR_CPUS]; |
487 | void *synic_event_page[MAX_NUM_CPUS]; | 486 | void *synic_event_page[NR_CPUS]; |
488 | }; | 487 | }; |
489 | 488 | ||
490 | extern struct hv_context hv_context; | 489 | extern struct hv_context hv_context; |