From 9633953b21e2f67f8a9553f8a79c43b2bfdc3532 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 11 Aug 2015 09:20:41 +0200 Subject: [PATCH] configs: Add cache region to x86 demo cells Assuming we have more than 4 units of L3 cache on systems that support L3 partitioning, assign the first 2 units (e.g. 2 MB on a Xeon D 1540) to apic-demo, the 3rd to tiny-demo. Also the non-root Linux config gets the first 2 units (it cannot run in parallel to the other demos). All this is for testing the management logic and will later be used to benchmark the partitioning. Signed-off-by: Jan Kiszka --- configs/apic-demo.c | 10 ++++++++++ configs/linux-x86-demo.c | 10 ++++++++++ configs/tiny-demo.c | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/configs/apic-demo.c b/configs/apic-demo.c index 1351496..af338c6 100644 --- a/configs/apic-demo.c +++ b/configs/apic-demo.c @@ -21,6 +21,7 @@ struct { struct jailhouse_cell_desc cell; __u64 cpus[1]; struct jailhouse_memory mem_regions[2]; + struct jailhouse_cache cache_regions[1]; __u8 pio_bitmap[0x2000]; } __attribute__((packed)) config = { .cell = { @@ -29,6 +30,7 @@ struct { .cpu_set_size = sizeof(config.cpus), .num_memory_regions = ARRAY_SIZE(config.mem_regions), + .num_cache_regions = ARRAY_SIZE(config.cache_regions), .num_irqchips = 0, .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap), .num_pci_devices = 0, @@ -54,6 +56,14 @@ struct { }, }, + .cache_regions = { + { + .start = 0, + .size = 2, + .type = JAILHOUSE_CACHE_L3, + }, + }, + .pio_bitmap = { [ 0/8 ... 0x3f7/8] = -1, [ 0x3f8/8 ... 0x3ff/8] = 0, /* serial1 */ diff --git a/configs/linux-x86-demo.c b/configs/linux-x86-demo.c index 539104f..e874aeb 100644 --- a/configs/linux-x86-demo.c +++ b/configs/linux-x86-demo.c @@ -21,6 +21,7 @@ struct { struct jailhouse_cell_desc cell; __u64 cpus[1]; struct jailhouse_memory mem_regions[4]; + struct jailhouse_cache cache_regions[1]; __u8 pio_bitmap[0x2000]; struct jailhouse_pci_device pci_devices[1]; } __attribute__((packed)) config = { @@ -31,6 +32,7 @@ struct { .cpu_set_size = sizeof(config.cpus), .num_memory_regions = ARRAY_SIZE(config.mem_regions), + .num_cache_regions = ARRAY_SIZE(config.cache_regions), .num_irqchips = 0, .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap), .num_pci_devices = ARRAY_SIZE(config.pci_devices), @@ -74,6 +76,14 @@ struct { }, }, + .cache_regions = { + { + .start = 0, + .size = 2, + .type = JAILHOUSE_CACHE_L3, + }, + }, + .pio_bitmap = { [ 0/8 ... 0x3f7/8] = -1, [ 0x3f8/8 ... 0x3ff/8] = 0, /* serial1 */ diff --git a/configs/tiny-demo.c b/configs/tiny-demo.c index b3f612b..71515a4 100644 --- a/configs/tiny-demo.c +++ b/configs/tiny-demo.c @@ -21,6 +21,7 @@ struct { struct jailhouse_cell_desc cell; __u64 cpus[1]; struct jailhouse_memory mem_regions[2]; + struct jailhouse_cache cache_regions[1]; __u8 pio_bitmap[0x2000]; } __attribute__((packed)) config = { .cell = { @@ -30,6 +31,7 @@ struct { .cpu_set_size = sizeof(config.cpus), .num_memory_regions = ARRAY_SIZE(config.mem_regions), + .num_cache_regions = ARRAY_SIZE(config.cache_regions), .num_irqchips = 0, .pio_bitmap_size = ARRAY_SIZE(config.pio_bitmap), .num_pci_devices = 0, @@ -55,6 +57,14 @@ struct { }, }, + .cache_regions = { + { + .start = 2, + .size = 1, + .type = JAILHOUSE_CACHE_L3, + }, + }, + .pio_bitmap = { [ 0/8 ... 0x2f7/8] = -1, [ 0x2f8/8 ... 0x2ff/8] = 0, /* serial2 */ -- 2.39.2