]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: config-create: Account for larger sets of CPUs
authorHenning Schild <henning.schild@siemens.com>
Thu, 24 Jul 2014 14:07:15 +0000 (16:07 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 28 Jul 2014 04:35:56 +0000 (06:35 +0200)
Reserves as many cpu set words as actually required. Format the
initialization in hex to improve readability with large numbers of CPUs.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: fixed trailing whitespace]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/root-cell-config.c.tmpl

index d5e7241e02846d4822f00e4d97401bf8bc2af3b5..455da63f1986b4bdbb1d5f734264d4b0fee7afb3 100644 (file)
@@ -20,7 +20,7 @@
 
 struct {
        struct jailhouse_system header;
-       __u64 cpus[1];
+       __u64 cpus[${int((cpucount + 63) / 64)}];
        struct jailhouse_memory mem_regions[${len(regions)}];
        struct jailhouse_irqchip irqchips[1];
        __u8 pio_bitmap[0x2000];
@@ -49,7 +49,12 @@ struct {
        },
 
        .cpus = {
-               0b${'1'*cpucount},
+               % for n in range(int(cpucount / 64)):
+               0xffffffffffffffff,
+               % endfor
+               % if (cpucount % 64):
+               ${'0x%016x,' % ((1 << (cpucount % 64)) - 1)}
+               % endif
        },
 
        .mem_regions = {