From ca1f7fe92c8707c3eb1478dd97a8df9638cdc594 Mon Sep 17 00:00:00 2001 From: Ivan-Velickovic Date: Mon, 10 Jul 2023 12:00:38 +0200 Subject: [PATCH] Simplify guest hash defines in simple example VMM --- examples/simple/vmm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/simple/vmm.c b/examples/simple/vmm.c index b5ee8d5ba..a037ec2f4 100644 --- a/examples/simple/vmm.c +++ b/examples/simple/vmm.c @@ -23,31 +23,35 @@ // Part of the problem is that we might need multiple DTBs for the same example // e.g one DTB for VMM one, one DTB for VMM two. we should be able to hide all // of this in the build system to avoid doing any run-time DTB stuff. + +/* + * As this is just an example, for simplicity we just make the size of the + * guest's "RAM" the same for all platforms. For just booting Linux with a + * simple user-space, 0x10000000 bytes (256MB) is plenty. + */ +#define GUEST_RAM_SIZE 0x10000000 + #if defined(BOARD_qemu_arm_virt_hyp) #define GUEST_DTB_VADDR 0x4f000000 #define GUEST_INIT_RAM_DISK_VADDR 0x4d700000 -#define GUEST_RAM_SIZE 0x10000000 #elif defined(BOARD_rpi4b_hyp) #define GUEST_DTB_VADDR 0x2e000000 #define GUEST_INIT_RAM_DISK_VADDR 0x2d700000 -#define GUEST_RAM_SIZE 0x10000000 #elif defined(BOARD_odroidc2_hyp) #define GUEST_DTB_VADDR 0x2f000000 #define GUEST_INIT_RAM_DISK_VADDR 0x2d700000 -#define GUEST_RAM_SIZE 0x10000000 #elif defined(BOARD_odroidc4_hyp) #define GUEST_DTB_VADDR 0x2f000000 #define GUEST_INIT_RAM_DISK_VADDR 0x2d700000 -#define GUEST_RAM_SIZE 0x10000000 #elif defined(BOARD_imx8mm_evk_hyp) #define GUEST_DTB_VADDR 0x4f000000 #define GUEST_INIT_RAM_DISK_VADDR 0x4d700000 -#define GUEST_RAM_SIZE 0x10000000 #else #error Need to define VM image address and DTB address #endif -/* For simplicity we just enforce the serial IRQ channel to be the same across platforms. */ +/* For simplicity we just enforce the serial IRQ channel number to be the same + * across platforms. */ #define SERIAL_IRQ_CH 1 #if defined(BOARD_qemu_arm_virt_hyp)