Skip to content

Commit

Permalink
configs: Add cache region to x86 demo cells
Browse files Browse the repository at this point in the history
Assuming we have more than 4 units of L3 cache on systems that support
L3 partitioning, assign the first unit (e.g. 1 MB on a Xeon D 1540) to
apic-demo, the second to tiny-demo and the succeeding 2 to the non-root
Linux config. The latter is supposed to improve the Linux cell latencies
while the former two are not (they are expected to stay in L1/L2 due to
their sizes) but serve as test cases for the partitioning management
logic.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Aug 14, 2015
1 parent 2ec270c commit 2ce8a72
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configs/apic-demo.c
Expand Up @@ -21,13 +21,15 @@ 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 = {
.name = "apic-demo",

.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,
Expand All @@ -53,6 +55,14 @@ struct {
},
},

.cache_regions = {
{
.start = 0,
.size = 1,
.type = JAILHOUSE_CACHE_L3,
},
},

.pio_bitmap = {
[ 0/8 ... 0x3f7/8] = -1,
[ 0x3f8/8 ... 0x3ff/8] = 0, /* serial1 */
Expand Down
10 changes: 10 additions & 0 deletions configs/linux-x86-demo.c
Expand Up @@ -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 = {
Expand All @@ -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 = ARRAY_SIZE(config.pci_devices),
Expand Down Expand Up @@ -73,6 +75,14 @@ struct {
},
},

.cache_regions = {
{
.start = 2,
.size = 2,
.type = JAILHOUSE_CACHE_L3,
},
},

.pio_bitmap = {
[ 0/8 ... 0x3f7/8] = -1,
[ 0x3f8/8 ... 0x3ff/8] = 0, /* serial1 */
Expand Down
10 changes: 10 additions & 0 deletions configs/tiny-demo.c
Expand Up @@ -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 = {
Expand All @@ -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,
Expand All @@ -54,6 +56,14 @@ struct {
},
},

.cache_regions = {
{
.start = 1,
.size = 1,
.type = JAILHOUSE_CACHE_L3,
},
},

.pio_bitmap = {
[ 0/8 ... 0x2f7/8] = -1,
[ 0x2f8/8 ... 0x2ff/8] = 0, /* serial2 */
Expand Down

0 comments on commit 2ce8a72

Please sign in to comment.