]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
x86: Report number of CPUs via communication region
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 15 May 2015 06:20:35 +0000 (08:20 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Fri, 15 May 2015 07:14:00 +0000 (09:14 +0200)
Append a field to the x86-specific part of the communication region to
inform non-root cells about the number of CPUs they can expect to show
up during boot.

We can generalize this when ARM has a need as well, but it's more likely
that it will use device trees instead (which are underdeveloped on x86).

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Documentation/hypervisor-interfaces.txt
hypervisor/arch/x86/control.c
hypervisor/arch/x86/include/asm/jailhouse_hypercall.h

index 03f44068e68ee4e10630cdd775b35b2375b72c9a..517c30c5218d769d2df59387d9831db6369ec4b0 100644 (file)
@@ -321,6 +321,8 @@ Platform Information for x86
         :   generic part, see above    :   (lower address)
         +------------------------------+
         |   PM Timer Address (16 bit)  |
+        +------------------------------+
+        |   Number of CPUs (16 bit)    |
         +------------------------------+ - higher address
 
 
index a9e21728bc2852d0b303f8e0760b47d54759c46c..3ba7b566e418dbf74f95a10c1be01b208422a464 100644 (file)
@@ -32,6 +32,7 @@ struct exception_frame {
 
 int arch_cell_create(struct cell *cell)
 {
+       unsigned int cpu;
        int err;
 
        err = vcpu_cell_init(cell);
@@ -52,6 +53,9 @@ int arch_cell_create(struct cell *cell)
 
        cell->comm_page.comm_region.pm_timer_address =
                system_config->platform_info.x86.pm_timer_address;
+       cell->comm_page.comm_region.num_cpus = 0;
+       for_each_cpu(cpu, cell->cpu_set)
+               cell->comm_page.comm_region.num_cpus++;
 
        return 0;
 
index 10df9ebb6e548c9df53b9c838a59560d49e35891..db3ed592ac4c92d3e4966b2f5820959e8a121d62 100644 (file)
@@ -97,6 +97,7 @@ struct jailhouse_comm_region {
        COMM_REGION_GENERIC_HEADER;
 
        __u16 pm_timer_address;
+       __u16 num_cpus;
 };
 
 static inline __u32 jailhouse_call(__u32 num)