# Vm base info configs
#
[base]
# Guest vm id.
id = 1
# Guest vm name.
name = "linux-qemu"
# Virtualization type.
vm_type = 1
# The number of virtual CPUs.
cpu_num = 1
# Guest vm physical cpu sets.
phys_cpu_ids = [0]

#
# Vm kernel configs
#
[kernel]
# The entry point of the kernel image.
entry_point = 0x9020_0000
# The location of image: "memory" | "fs".
# Load from file system.
image_location = "fs"
# The file path of the kernel image.
kernel_path = "/guest/linux/linux-qemu"
# The load address of the kernel image.
kernel_load_addr = 0x9020_0000
# The file path of the device tree blob (DTB).
# dtb_path = "/path/tmp/configs/linux-riscv64-qemu-smp1.dtb"
# The load address of the device tree blob (DTB).
dtb_load_addr = 0x9300_0000

# Memory regions with format (`base_paddr`, `size`, `flags`, `map_type`).
# For `map_type`, 0 means `MAP_ALLOC`, 1 means `MAP_IDENTICAL`, 2 means `MAP_RESERVED`.
memory_regions = [
    [0x9000_0000, 0x0400_0000, 0x7, 1], # System RAM 64M MAP_IDENTICAL for DMA-capable passthrough
]

#
# Device specifications
#
[devices]
# The interrupt mode.
interrupt_mode = "passthrough"

# Pass-through devices.
# Name Base-Ipa Base-Pa Length Alloc-Irq.
passthrough_devices = [
    ["/soc/serial@10000000"],
    ["/soc/virtio_mmio@10001000"],
    ["/soc/virtio_mmio@10002000"],
    ["/soc/virtio_mmio@10003000"],
    ["/soc/virtio_mmio@10004000"],
    ["/soc/virtio_mmio@10005000"],
    ["/soc/virtio_mmio@10006000"],
    ["/soc/virtio_mmio@10007000"],
    ["/soc/virtio_mmio@10008000"],
]

# Passthrough addresses.
# Base-GPA  Length.
passthrough_addresses = [
    [0x1000_0000, 0x1000],     # uart
    [0x1000_1000, 0x8000],     # virtio-mmio
]

# Devices that are not desired to be passed through to the guest
excluded_devices = [
]

# Emu_devices.
# Name Base-Ipa Ipa_len Alloc-Irq Emu-Type EmuConfig.
emu_devices = [
    ["plic", 0x0c00_0000, 0x60_0000, 0, 0x30, [2]],     # [context_num]
]
