Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de>
---
 configs/riscv/qemu-riscv64-tiny-demo.c | 63 ++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 configs/riscv/qemu-riscv64-tiny-demo.c

diff --git a/configs/riscv/qemu-riscv64-tiny-demo.c 
b/configs/riscv/qemu-riscv64-tiny-demo.c
new file mode 100644
index 00000000..076e0ffb
--- /dev/null
+++ b/configs/riscv/qemu-riscv64-tiny-demo.c
@@ -0,0 +1,63 @@
+/*
+ * Jailhouse, a Linux-based partitioning hypervisor
+ *
+ * Minimal configuration for RISC-V demo inmate, 1 CPU, 1MiB RAM
+ *
+ * Copyright (c) OTH Regensburg 2022
+ *
+ * Authors:
+ *  Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ */
+
+#include <jailhouse/types.h>
+#include <jailhouse/cell-config.h>
+
+struct {
+       struct jailhouse_cell_desc cell;
+       struct jailhouse_cpu cpus[1];
+       struct jailhouse_memory mem_regions[2];
+} __attribute__((packed)) config = {
+       .cell = {
+               .signature = JAILHOUSE_CELL_DESC_SIGNATURE,
+               .revision = JAILHOUSE_CONFIG_REVISION,
+               .name = "tiny-demo",
+               .flags = JAILHOUSE_CELL_PASSIVE_COMMREG |
+                       JAILHOUSE_CELL_TEST_DEVICE |
+                       JAILHOUSE_CELL_VIRTUAL_CONSOLE_PERMITTED |
+                       JAILHOUSE_CELL_VIRTUAL_CONSOLE_ACTIVE,
+
+               .num_cpus = ARRAY_SIZE(config.cpus),
+               .num_memory_regions = ARRAY_SIZE(config.mem_regions),
+               .num_irqchips = 0,
+               .num_pci_devices = 0,
+
+               .console = {
+                       .type = JAILHOUSE_CON_TYPE_RISCV_SBI,
+               },
+       },
+
+       .cpus = {
+               {
+                       .phys_id = 1,
+               },
+       },
+
+       .mem_regions = {
+               /* RAM */ {
+                       .phys_start = 0xbf800000,
+                       .virt_start = 0x0,
+                       .size = 1 * 1024 * 1024,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_LOADABLE,
+               },
+               /* communication region */ {
+                       .virt_start = 0x00100000,
+                       .size = 0x00001000,
+                       .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
+                               JAILHOUSE_MEM_COMM_REGION,
+               },
+       },
+};
-- 
2.36.1

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jailhouse-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20220627132905.4338-36-ralf.ramsauer%40oth-regensburg.de.

Reply via email to