]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
drivers: hv: Increase the number of VCPUs supported in the guest
authorK. Y. Srinivasan <kys@microsoft.com>
Fri, 3 Feb 2012 00:56:51 +0000 (16:56 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 16:32:44 +0000 (08:32 -0800)
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>
drivers/hv/hv.c
drivers/hv/hyperv_vmbus.h

index 12aa97f31f935c202d1427539f11fc1a3071f73e..15956bd48b48b327744a36338bb420e957731944 100644 (file)
@@ -155,9 +155,9 @@ int hv_init(void)
        union hv_x64_msr_hypercall_contents hypercall_msr;
        void *virtaddr = NULL;
 
-       memset(hv_context.synic_event_page, 0, sizeof(void *) * MAX_NUM_CPUS);
+       memset(hv_context.synic_event_page, 0, sizeof(void *) * NR_CPUS);
        memset(hv_context.synic_message_page, 0,
-              sizeof(void *) * MAX_NUM_CPUS);
+              sizeof(void *) * NR_CPUS);
 
        if (!query_hypervisor_presence())
                goto cleanup;
index 6d7d286d54407789de589b9de83e07b85fc2c0ef..699f0d8e59ed798a6a9bc03227d8eee9d3b70f89 100644 (file)
@@ -457,7 +457,6 @@ static const uuid_le VMBUS_SERVICE_ID = {
        },
 };
 
-#define MAX_NUM_CPUS   32
 
 
 struct hv_input_signal_event_buffer {
@@ -483,8 +482,8 @@ struct hv_context {
        /* 8-bytes aligned of the buffer above */
        struct hv_input_signal_event *signal_event_param;
 
-       void *synic_message_page[MAX_NUM_CPUS];
-       void *synic_event_page[MAX_NUM_CPUS];
+       void *synic_message_page[NR_CPUS];
+       void *synic_event_page[NR_CPUS];
 };
 
 extern struct hv_context hv_context;