diff --git a/.gitignore b/.gitignore index 812cd0b55..1af0e3dcc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ build/ docs/book/ .DS_Store - +TAGS +examples/vmm/vmm/initrd.img +examples/vmm/vmm/linux diff --git a/ci/examples.sh b/ci/examples.sh index 52da1c336..7130599aa 100755 --- a/ci/examples.sh +++ b/ci/examples.sh @@ -16,3 +16,4 @@ MICROKIT_SDK=$2 $LIONSOS/ci/kitty.sh $LIONSOS $MICROKIT_SDK $LIONSOS/ci/webserver.sh $LIONSOS $MICROKIT_SDK $LIONSOS/ci/vmm.sh $LIONSOS $MICROKIT_SDK +$LIONSOS/ci/vmm-virtio.sh $LIONSOS $MICROKIT_SDK diff --git a/ci/vmm-virtio.sh b/ci/vmm-virtio.sh new file mode 100755 index 000000000..e1fc2b68a --- /dev/null +++ b/ci/vmm-virtio.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# This script aims to build an already checked out version of LionsOS. +# + +set -e + +if [ "$#" -ne 2 ]; then + echo "usage: vmm.sh /path/to/lionsos /path/to/microkit/sdk" + exit 1 +fi + +LIONSOS=$1 +MICROKIT_SDK=$2 + +BUILD_DIR=$LIONSOS/ci_build/vmm-virtio +rm -rf $BUILD_DIR + +export BUILD_DIR=$BUILD_DIR +export MICROKIT_SDK=$MICROKIT_SDK +export LIONSOS=$LIONSOS + +cd $LIONSOS/examples/vmm +make VARIANT=virtio diff --git a/dep/sddf b/dep/sddf index 78e1d8fe0..237c81235 160000 --- a/dep/sddf +++ b/dep/sddf @@ -1 +1 @@ -Subproject commit 78e1d8fe00aa492e408e76fab19afa6bcc35d1bf +Subproject commit 237c81235ba85962b65e2c9127ce12cfaba5b5ff diff --git a/examples/vmm/README.MD b/examples/vmm/README.MD index a750d434d..2be820251 100644 --- a/examples/vmm/README.MD +++ b/examples/vmm/README.MD @@ -2,15 +2,13 @@ Simple VM with passthrough ================================ This directory contains what's needed to run a complete VM with -passthrough of all components on an Odroid C4. - -The ethernetsddf branch uses LionsOS console drivers. +passthrough of all components (including the GPU) on an Odroid C4. Such a VM can be used to develop new LionsOS components, and is fairly easy to adapt to other systems. What you need -================ +================= Build and Source dependencies ----------------------------- @@ -31,11 +29,14 @@ target system. The simplest way to get them is to extract them from For Armbian-based systems, the files you need are `/boot/Image` `/boot/initrd.img` and `/boot/dtb/amlogic/meson-sm1-odroid-c4.dtb`. -Use `scp` to transfer these files to your build machine. +Boot your board into Linux, then use `scp` to transfer these files to +your build machine, and put them into the `vmm` subdirectory. -There are versions in the Git repo, but these might not match your -root filesystem --- they were taken from an [Armbian](https://github.com/armbian/community/releases/download/24.5.0-trunk.168/Armbian_community_24.5.0-trunk.168_Odroidc4_jammy_current_6.6.21_gnome_desktop.img.xz) 'Jammy' Ubuntu -system. +The Makefile will fetch some from our website if they are missing from +`vmm`, but there's no guarantee they'll match what's on your root +filesystem --- they were taken from an +[Armbian](https://github.com/armbian/community/releases/download/24.5.0-trunk.168/Armbian_community_24.5.0-trunk.168_Odroidc4_jammy_current_6.6.21_gnome_desktop.img.xz) +'Jammy' Ubuntu system. You will also need to update the commandline in `vmm/overlay.dts`, especially if you are not running Ubuntu Jammy Armbian. @@ -44,22 +45,20 @@ The Microkit ------------ You can use the prebuilt microkit from -[Prebuilt](https://trustworthy.systems/Downloads/microkit/microkit-sdk-dev-7c679ea-linux-x86-64.tar.gz) - -If you choose to build your own. At the moment, -the microkit from [Ivan Velickovic's -repository](https://github.com/Ivan-Velickovic/microkit) on the dev -branch is the one to use. +[Prebuilt](https://github.com/seL4/microkit/releases/download/1.4.1/microkit-sdk-1.4.1-linux-x86-64.tar.gz) -You can build it by following +If you choose to build your own, +you can build it by following the instructions in the -[ReadMe](https://github.com/Ivan-Velickovic/microkit) +[ReadMe](https://github.com/seL4/microkit) + +You need version 1.4.1 Building -------- -You need to have `aarch64-none-elf-gcc` etc in your PATH; plus you -need to set the LionsOS and MICROKIT_SDK environment variables. +You need to have `aarch64-none-elf-gcc` etc., in your PATH; plus you +need to set the LIONSOS and MICROKIT_SDK environment variables. If the vmm-example repository is checked out at the same level in your directory tree as LionsOS the default will work. @@ -67,10 +66,18 @@ directory tree as LionsOS the default will work. Otherwise do: ``` cd vmm-examples -MICROKIT_SDK=.../path-to/microkit-sdk-1.2.6 LionsOS=.../path-to/LionsOS make +MICROKIT_SDK=.../path-to/microkit-sdk-1.4.1 LionsOS=.../path-to/LionsOS make ``` - If all goes well, a directory called `build`,and a bootable image `boot/vmdev.img`, will be created. +There are two variants you can build. The standard variant passes +through _everything_; the `virtio_console` variant uses the sDDF's +UART driver and a virtio console. + +To select, do +``` +make VARIANT=virtio_console MICROKIT_SDK=... ... +``` + diff --git a/examples/vmm/README.md b/examples/vmm/README.md new file mode 100644 index 000000000..cfb638752 --- /dev/null +++ b/examples/vmm/README.md @@ -0,0 +1,5 @@ +VMM Examples +================ + +See https://lionsos.org/docs/examples/vmm/ for documentation and build +instructions. diff --git a/examples/vmm/include/serial_config.h b/examples/vmm/include/serial_config.h new file mode 100644 index 000000000..dac829fe9 --- /dev/null +++ b/examples/vmm/include/serial_config.h @@ -0,0 +1,103 @@ +/* + * Copyright 2024, UNSW + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include +#include +#include +#include + +/* Number of clients */ +#define SERIAL_NUM_CLIENTS 1 + +/* Only support transmission and not receive. */ +#define SERIAL_TX_ONLY 0 + +/* Associate a colour with each client's output. */ +#define SERIAL_WITH_COLOUR 0 + +/* + * Control character to switch input stream - ctrl \. + * To input character input twice. + */ +#define SERIAL_SWITCH_CHAR 28 + +/* Control character to terminate client number input. */ +#define SERIAL_TERMINATE_NUM '\r' + +/* Default baud rate of the uart device */ +#define UART_DEFAULT_BAUD 115200 + +/* String to be printed to start console input */ +#define SERIAL_CONSOLE_BEGIN_STRING "Begin input\n" +#define SERIAL_CONSOLE_BEGIN_STRING_LEN 13 + +#define SERIAL_CLI0_NAME "CLIENT_VM" +#define SERIAL_VIRT_RX_NAME "serial_virt_rx" +#define SERIAL_VIRT_TX_NAME "serial_virt_tx" +#define SERIAL_DRIVER_NAME "uart_driver" + +#define SERIAL_QUEUE_SIZE 0x1000 +#define SERIAL_DATA_REGION_SIZE 0x2000 + +#define SERIAL_TX_DATA_REGION_SIZE_DRIV SERIAL_DATA_REGION_SIZE +#define SERIAL_TX_DATA_REGION_SIZE_CLI0 SERIAL_DATA_REGION_SIZE + +#define SERIAL_RX_DATA_REGION_SIZE_DRIV SERIAL_DATA_REGION_SIZE +#define SERIAL_RX_DATA_REGION_SIZE_CLI0 SERIAL_DATA_REGION_SIZE + +#define SERIAL_MAX_TX_DATA_SIZE MAX( \ + SERIAL_TX_DATA_REGION_SIZE_DRIV, \ + SERIAL_TX_DATA_REGION_SIZE_CLI0 \ + ) +#define SERIAL_MAX_RX_DATA_SIZE MAX( \ + SERIAL_RX_DATA_REGION_SIZE_DRIV, \ + SERIAL_RX_DATA_REGION_SIZE_CLI0 \ + ) +#define SERIAL_MAX_DATA_SIZE MAX( \ + SERIAL_MAX_TX_DATA_SIZE, \ + SERIAL_MAX_RX_DATA_SIZE \ + ) +_Static_assert(SERIAL_MAX_DATA_SIZE < UINT32_MAX, + "Data regions must be smaller than UINT32 max" + " to use the queue data structure correctly."); + +static inline void serial_cli_queue_init_sys( + char *pd_name, serial_queue_handle_t *rx_queue_handle, + serial_queue_t *rx_queue, char *rx_data, + serial_queue_handle_t *tx_queue_handle, + serial_queue_t *tx_queue, char *tx_data) +{ + if (!sddf_strcmp(pd_name, SERIAL_CLI0_NAME)) { + serial_queue_init(rx_queue_handle, rx_queue, SERIAL_RX_DATA_REGION_SIZE_CLI0, rx_data); + serial_queue_init(tx_queue_handle, tx_queue, SERIAL_TX_DATA_REGION_SIZE_CLI0, tx_data); + } +} + +static inline void serial_virt_queue_init_sys( + char *pd_name, serial_queue_handle_t *cli_queue_handle, + serial_queue_t *cli_queue, char *cli_data) +{ + if (!sddf_strcmp(pd_name, SERIAL_VIRT_RX_NAME)) { + serial_queue_init(cli_queue_handle, + cli_queue, + SERIAL_RX_DATA_REGION_SIZE_CLI0, + cli_data); + } else if (!sddf_strcmp(pd_name, SERIAL_VIRT_TX_NAME)) { + serial_queue_init(cli_queue_handle, + cli_queue, + SERIAL_TX_DATA_REGION_SIZE_CLI0, + cli_data); + } +} + +#if SERIAL_WITH_COLOUR +static inline void serial_channel_names_init(char **client_names) +{ + client_names[0] = SERIAL_CLI0_NAME; +} +#endif diff --git a/examples/vmm/vmm-dev.mk b/examples/vmm/vmm-dev.mk index 80a56574a..1cf0e1c63 100644 --- a/examples/vmm/vmm-dev.mk +++ b/examples/vmm/vmm-dev.mk @@ -46,8 +46,10 @@ BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) LIBVMM ?= ${LIONSOS}/dep/libvmm VMM_IMAGE_DIR := ${EXAMPLE_DIR}/vmm -LINUX := 1e6f245cabe25aabf179448e41dea5fe5550c98d-linux -INITRD := 1ef035ae59438f6df6c596a6de7cc36d6a3368ac-initrd.img +LINUX := ${VMM_IMAGE_DIR}/linux +INITRD :=${VMM_IMAGE_DIR}/initrd.img +SAMPLE_LINUX := 1e6f245cabe25aabf179448e41dea5fe5550c98d-linux +SAMPLE_INITRD := 1ef035ae59438f6df6c596a6de7cc36d6a3368ac-initrd.img IMAGES := vmm.elf CFLAGS := \ @@ -85,8 +87,10 @@ all: $(IMAGE_FILE) ${notdir $(ORIGINAL_DTB:.dtb=.dts)}: ${ORIGINAL_DTB} ${MAKEFILE} $(DTC) -q -I dtb -O dts $< > $@ || rm -f $@ -$(INITRD) $(LINUX): - curl -L https://lionsos.org/downloads/examples/vmm/$@ -o $@ +$(INITRD): + curl -L https://lionsos.org/downloads/examples/vmm/${SAMPLE_INITRD} -o $@ +$(LINUX): + curl -L https://lionsos.org/downloads/examples/vmm/${SAMPLE_LINUX} -o $@ dtb.dts: ${notdir $(ORIGINAL_DTB:.dtb=.dts)} ${DT_OVERLAYS} vmm_ram.h ${CHECK_VARIANT} ${LIBVMM}/tools/dtscat ${notdir $(ORIGINAL_DTB:.dtb=.dts)} ${DT_OVERLAYS} | cpp -nostdinc -undef -x assembler-with-cpp -P - > $@ || rm -f $@ diff --git a/examples/vmm/vmm-virtio-console.mk b/examples/vmm/vmm-virtio-console.mk index 805792aee..dbe447847 100644 --- a/examples/vmm/vmm-virtio-console.mk +++ b/examples/vmm/vmm-virtio-console.mk @@ -14,8 +14,8 @@ ifeq ($(strip $(LIBGCC)),) LIBGCC := $(shell dirname $$(aarch64-none-elf-gcc --print-file-name libgcc.a)) endif -ifeq ($(strip $(LionsOS)),) -$(error LionsOS should point to the root of the LionOS source tree) +ifeq ($(strip $(LIONSOS)),) +$(error LIONSOS should point to the root of the LionOS source tree) endif ifeq ($(strip $(SDDF)),) @@ -33,6 +33,8 @@ CPU := cortex-a55 TOOLCHAIN := clang CC := clang LD := ld.lld +RANLIB := llvm-ranlib + TARGET := aarch64-none-elf CHECK_VARIANT:=.variant.$(shell md5sum ${SYSTEM}) @@ -48,14 +50,19 @@ MICROKIT_TOOL ?= $(MICROKIT_SDK)/bin/microkit DTC := dtc BOARD_DIR := $(MICROKIT_SDK)/board/$(MICROKIT_BOARD)/$(MICROKIT_CONFIG) -LIBVMM_DIR ?= ${LionsOS}/dep/libvmm +LIBVMM_DIR ?= ${LIONSOS}/dep/libvmm VMM_IMAGE_DIR := ${EXAMPLE_DIR}/vmm -LINUX := $(VMM_IMAGE_DIR)/Linux +LINUX := ${VMM_IMAGE_DIR}/linux +INITRD :=${VMM_IMAGE_DIR}/initrd.img + +SAMPLE_LINUX := 1e6f245cabe25aabf179448e41dea5fe5550c98d-linux +SAMPLE_INITRD := 1ef035ae59438f6df6c596a6de7cc36d6a3368ac-initrd.img + INITRD := $(VMM_IMAGE_DIR)/initrd.img DT_OVERLAYS := ${VMM_IMAGE_DIR}/overlay-virtcon.dts -IMAGES := vmm.elf uart_driver.elf serial_rx_virt.elf serial_tx_virt.elf +IMAGES := vmm.elf uart_driver.elf serial_virt_rx.elf serial_virt_tx.elf CFLAGS := \ -mtune=$(CPU) \ -mstrict-align \ @@ -64,13 +71,12 @@ CFLAGS := \ -O0 \ -Wall \ -Wno-unused-function \ + -DBOARD_$(MICROKIT_BOARD) \ -I. \ -I$(BOARD_DIR)/include \ -target $(TARGET) \ - -I$(LIBVMM_DIR)/src/arch/aarch64 \ - -I$(LIBVMM_DIR)/src \ - -I$(LIBVMM_DIR)/src/util \ - -DBOARD_$(MICROKIT_BOARD) \ + -I$(LIBVMM_DIR)/include \ + -I${EXAMPLE_DIR}/include \ -I$(SDDF)/include \ -MD \ -DMAC_BASE_ADDRESS=$(MAC_BASE_ADDRESS) @@ -99,6 +105,13 @@ ${notdir $(ORIGINAL_DTB:.dtb=.dts)}: ${ORIGINAL_DTB} ${MAKEFILE} dtb.dts: ${notdir $(ORIGINAL_DTB:.dtb=.dts)} ${DT_OVERLAYS} vmm_ram.h ${LIBVMM_DIR}/tools/dtscat ${notdir $(ORIGINAL_DTB:.dtb=.dts)} ${DT_OVERLAYS} | cpp -nostdinc -undef -x assembler-with-cpp -P - > $@ || rm -f $@ +$(INITRD): + curl -L https://lionsos.org/downloads/examples/vmm/${SAMPLE_INITRD} -o $@ +$(LINUX): + curl -L https://lionsos.org/downloads/examples/vmm/${SAMPLE_LINUX} -o $@ + +vmm-virtio-console.o: vmm_ram.h + package_guest_images.o: $(LIBVMM_DIR)/tools/package_guest_images.S $(LINUX) $(INITRD) dtb.dtb $(CC) -c -g3 -x assembler-with-cpp \ -DGUEST_KERNEL_IMAGE_PATH=\"$(LINUX)\" \ @@ -136,6 +149,8 @@ clobber:: clean # How to build libvmm.a include ${LIBVMM_DIR}/vmm.mk # the UART driver -include ${SDDF}/drivers/serial/meson/uart.mk +include ${SDDF}/drivers/serial/meson/uart_driver.mk # the multiplexers include ${SDDF}/serial/components/serial_components.mk +# and the util library needed by the uart driver and serial components +include ${SDDF}/util/util.mk diff --git a/examples/vmm/vmm-virtio-console.system b/examples/vmm/vmm-virtio-console.system index e16f122cf..9812ce17b 100644 --- a/examples/vmm/vmm-virtio-console.system +++ b/examples/vmm/vmm-virtio-console.system @@ -1,25 +1,24 @@ - + #include "vmm_ram.h" - - - /* + /* * Guest RAM. Size and Address filled in by build system. */ - - /* + + /* * Device regions from Device Tree */ - /* - * Split Bus 2, so he UART can be given to the UART driver + /* + * Split Bus 2, so the UART can be given to the UART driver */ - + @@ -31,52 +30,37 @@ -/* */ +/* */ /* - * Memory regions assigned by tool from RAM + * Memory regions assigned by microkit tool from RAM */ /* * Regions for the shared queues used by the Serial driver and * virtualiser */ - - - - - - + + + + + + + + + + - /* - * Regions for the shared queues between VMM and Serial Virtualiser - */ - - - - - - - - - + + + + + @@ -84,8 +68,8 @@ cached="false" /> - + cached="false" /> + @@ -101,20 +85,17 @@ cached="false" /> */ - - - - - - - - + + + + + + @@ -154,65 +135,71 @@ cached="false" /> */ - + + - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + - - + + - + - + - + diff --git a/examples/vmm/vmm/vmm-virtio-console.c b/examples/vmm/vmm/vmm-virtio-console.c index 0bdfd1710..a4a52f14e 100644 --- a/examples/vmm/vmm/vmm-virtio-console.c +++ b/examples/vmm/vmm/vmm-virtio-console.c @@ -6,18 +6,18 @@ #include #include #include -#include "util/util.h" -#include "arch/aarch64/vgic/vgic.h" -#include "arch/aarch64/linux.h" -#include "arch/aarch64/fault.h" -#include "guest.h" -#include "virq.h" -#include "tcb.h" -#include "vcpu.h" -#include "virtio/virtio.h" -#include "virtio/console.h" +#include "libvmm/util/util.h" +#include "libvmm/arch/aarch64/vgic/vgic.h" +#include "libvmm/arch/aarch64/linux.h" +#include "libvmm/arch/aarch64/fault.h" +#include "libvmm/guest.h" +#include "libvmm/virq.h" +//#include "tcb.h" +//#include "vcpu.h" +#include "libvmm/virtio/virtio.h" +#include "libvmm/virtio/console.h" #include - +#include #include "vmm_ram.h" #define GUEST_DTB_VADDR 0x8f000000 @@ -49,22 +49,18 @@ int passthrough_irq_map[MAX_IRQ_CH]; /* * For the virtual console */ -uintptr_t serial_rx_free; -uintptr_t serial_rx_active; -uintptr_t serial_tx_free; -uintptr_t serial_tx_active; - -uintptr_t serial_rx_data; -uintptr_t serial_tx_data; +/* Virtio Console */ +#define SERIAL_TX_VIRTUALISER_CH 1 +#define SERIAL_RX_VIRTUALISER_CH 1 -serial_queue_handle_t serial_rx_serial_queue; -serial_queue_handle_t serial_tx_serial_queue; -#define SERIAL_TX_VIRTUALISER_CH 1 -#define SERIAL_RX_VIRTUALISER_CH 2 +serial_queue_t *serial_rx_queue; +serial_queue_t *serial_tx_queue; +char *serial_rx_data; +char *serial_tx_data; -static struct virtio_device virtio_console; +static struct virtio_console_device virtio_console; static void passthrough_device_ack(size_t vcpu_id, int irq, void *cookie) { @@ -88,6 +84,7 @@ static void register_passthrough_irq(int irq, microkit_channel irq_ch) { void init(void) { int i; int j; + serial_queue_handle_t serial_rxq, serial_txq; /* Initialise the VMM, the VCPU(s), and start the guest */ LOG_VMM("starting \"%s\"\n", microkit_name); @@ -154,39 +151,16 @@ void init(void) { * Set up queues for virtual serial */ /* Initialise our sDDF queue buffers for the serial device */ - serial_queue_init(&serial_rx_serial_queue, (serial_queue_t *)serial_rx_free, - (serial_queue_t *)serial_rx_active, true, NUM_ENTRIES, NUM_ENTRIES); - for (int i = 0; i < NUM_ENTRIES - 1; i++) { - int ret = serial_enqueue_free(&serial_rx_serial_queue, serial_rx_data + (i * BUFFER_SIZE), BUFFER_SIZE); - if (ret != 0) { - microkit_dbg_puts(microkit_name); - microkit_dbg_puts(": server rx buffer population, unable to enqueue buffer\n"); - } - } - serial_queue_init(&serial_tx_serial_queue, (serial_queue_t *)serial_tx_free, - (serial_queue_t *)serial_tx_active, true, NUM_ENTRIES, NUM_ENTRIES); - for (int i = 0; i < NUM_ENTRIES - 1; i++) { - int ret = serial_enqueue_free(&serial_tx_serial_queue, serial_tx_data + (i * BUFFER_SIZE), BUFFER_SIZE); - assert(ret == 0); - if (ret != 0) { - microkit_dbg_puts(microkit_name); - microkit_dbg_puts(": server tx buffer population, unable to enqueue buffer\n"); - } - } - /* - * Neither queue should be plugged and hence all buffers we send - * should actually end up at the driver. - */ - assert(!serial_queue_plugged(serial_tx_serial_queue.free)); - assert(!serial_queue_plugged(serial_tx_serial_queue.active)); + serial_cli_queue_init_sys(microkit_name, &serial_rxq, serial_rx_queue, serial_rx_data, &serial_txq, serial_tx_queue, serial_tx_data); /* Initialise virtIO console device */ - success = virtio_mmio_device_init(&virtio_console, CONSOLE, - VIRTIO_CONSOLE_BASE, VIRTIO_CONSOLE_SIZE, - VIRTIO_CONSOLE_IRQ, - &serial_rx_serial_queue, &serial_tx_serial_queue, - SERIAL_TX_VIRTUALISER_CH - ); + success = virtio_mmio_console_init(&virtio_console, + VIRTIO_CONSOLE_BASE, + VIRTIO_CONSOLE_SIZE, + VIRTIO_CONSOLE_IRQ, + &serial_rxq, &serial_txq, + SERIAL_TX_VIRTUALISER_CH); + assert(success); @@ -217,13 +191,18 @@ void notified(microkit_channel ch) { * fault-handler. Whenever our guest causes an exception, it gets * delivered to this entry point for the VMM to handle. */ -void fault(microkit_id id, microkit_msginfo msginfo) { +seL4_Bool fault(microkit_child id, + microkit_msginfo msginfo, + microkit_msginfo *reply_msginfo + ) { bool success = fault_handle(id, msginfo); if (success) { /* * Now that we have handled the fault successfully, we reply to it so * that the guest can resume execution. */ - microkit_fault_reply(microkit_msginfo_new(0, 0)); + *reply_msginfo = microkit_msginfo_new(0, 0); + return seL4_True; } + return seL4_False; } diff --git a/examples/vmm/vmm/vmm_ram_input_virtcon.h b/examples/vmm/vmm/vmm_ram_input_virtcon.h index 3879f8cbf..1da118f19 100644 --- a/examples/vmm/vmm/vmm_ram_input_virtcon.h +++ b/examples/vmm/vmm/vmm_ram_input_virtcon.h @@ -36,27 +36,19 @@ * Shared data regions need to be at the same address in every PD * where they're mapped. * Use #defines here to say where they go. + * Queue regions are 1 page; data regions 2 pages */ - -#define SERIAL_TX_FREE_VMM "0x6_000_000" -#define SERIAL_TX_ACTIVE_VMM "0x6_200_000" -#define SERIAL_TX_DATA_VMM "0x6_400_000" -#define SERIAL_RX_FREE_VMM "0x6_600_000" -#define SERIAL_RX_ACTIVE_VMM "0x6_800_000" -#define SERIAL_RX_DATA_VMM "0x6_a00_000" -#define SERIAL_TX_ACTIVE_DRIVER "0x40_000_000" -#define SERIAL_TX_FREE_DRIVER "0x40_200_000" -#define SERIAL_TX_DATA_DRIVER "0x40_400_000" -#define SERIAL_RX_ACTIVE_DRIVER "0x40_600_000" -#define SERIAL_RX_FREE_DRIVER "0x40_800_000" -#define SERIAL_RX_DATA_DRIVER "0x40_A00_000" +#define SERIAL_TX_QUEUE_VMM "0x6_000_000" +#define SERIAL_TX_DATA_VMM "0x6_002_000" +#define SERIAL_RX_QUEUE_VMM "0x6_001_000" +#define SERIAL_RX_DATA_VMM "0x6_004_000" +#define SERIAL_TX_QUEUE_DRIVER "0x4_000_000" +#define SERIAL_TX_DATA_DRIVER "0x4_002_000" +#define SERIAL_RX_QUEUE_DRIVER "0x4_001_000" +#define SERIAL_RX_DATA_DRIVER "0x4_004_000" #define MMIO_CONSOLE_IRQ 42 #define VIRTIO_CONSOLE_IRQ (32 + MMIO_CONSOLE_IRQ) #define VIRTIO_CONSOLE_BASE (VIRTIO_SERIAL_ADDR) #define VIRTIO_CONSOLE_SIZE 0x1000 - - - -