Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
From 888c94e7a121d96aa88f84c58fe7e2bd771fc5ac Mon Sep 17 00:00:00 2001
From: Julien Olivain <ju.o@free.fr>
Date: Fri, 25 Aug 2023 21:56:37 +0200
Subject: [PATCH] TOOLS: d2c.py: explicitly use the python3 interpreter
When compiling Xvisor on a system not providing the "python"
interpreter binary, compilation fails with output:
(d2c) core/vio/keymaps/modifiers.c
/bin/sh: 1: /build/xvisor-0.3.2/tools/scripts/d2c.py: not found
This commit fixes the issue following the PEP 394 recommendation:
https://peps.python.org/pep-0394/
It sets the "shebang" to `#! /usr/bin/env python3` to allow using other
interpreters in the PATH, or virtual environment.
Signed-off-by: Julien Olivain <ju.o@free.fr>
Upstream: https://github.com/xvisor/xvisor/commit/888c94e7a121d96aa88f84c58fe7e2bd771fc5ac
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
tools/scripts/d2c.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/scripts/d2c.py b/tools/scripts/d2c.py
index b46a7bc468..daac4a5450 100755
--- a/tools/scripts/d2c.py
+++ b/tools/scripts/d2c.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#! /usr/bin/env python3
#/**
# Copyright (c) 2013 Anup Patel.
# All rights reserved.

View File

@@ -0,0 +1,46 @@
From 8491908238c4b3397571e9cff55765d59da03a45 Mon Sep 17 00:00:00 2001
From: Julien Olivain <ju.o@free.fr>
Date: Wed, 2 Aug 2023 23:57:17 +0200
Subject: [PATCH] RISC-V: Force no-pie code generation and static link
Some toolchains are now enabling PIE for security reasons by default.
When XVisor is built with such a RISC-V toolchain, it is crashing
just after OpenSBI, in early Xvisor startup (before any message is
printed on the console).
Hangs looks like those described in:
https://github.com/xvisor/xvisor/issues/144
https://github.com/xvisor/xvisor/issues/159
Forcing -fno-pie code generation and -static link will explicitly disable
PIE with those toolchains, hence fixing those issues.
This issue was observed while using a riscv64 gcc toolchain from:
https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64-lp64d/tarballs/riscv64-lp64d--glibc--bleeding-edge-2022.08-1.tar.bz2
Signed-off-by: Julien Olivain <ju.o@free.fr>
Upstream: https://github.com/xvisor/xvisor/pull/170
---
arch/riscv/cpu/generic/objects.mk | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/riscv/cpu/generic/objects.mk b/arch/riscv/cpu/generic/objects.mk
index 230da2a1..576603f6 100644
--- a/arch/riscv/cpu/generic/objects.mk
+++ b/arch/riscv/cpu/generic/objects.mk
@@ -67,6 +67,11 @@ cpu-cflags += -fno-strict-aliasing -O2
cpu-asflags += $(arch-cflags-y) -march=$(march-nonld-isa-y)
cpu-ldflags += $(arch-ldflags-y) -march=$(march-ld-isa-y)
+cpu-cflags += -fno-pie
+cpu-asflags += -fno-pie
+cpu-ldflags += -static
+cpu-mergeflags += -static
+
cpu-objs-y+= cpu_entry.o
cpu-objs-y+= cpu_proc.o
cpu-objs-y+= cpu_tlb.o
--
2.41.0

View File

@@ -0,0 +1,40 @@
From 53a53af30ce1704b7de806a51d822472fbcc57de Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@smile.fr>
Date: Sun, 24 Aug 2025 18:26:52 +0200
Subject: [PATCH] Makefile: Use '-std=gnu11' to fix build with GCC 15
GCC 15 changed the default C standard version to C23 [1], resulting in
errors from the xvisor definitions of bool from core/include/vmm_types.h,
which is a reserved keyword under C23.
Since CFLAGS are hardcoded in the main Makefile, add '-std=gnu11' to
'cflags' to resolve the error.
[1] https://gcc.gnu.org/gcc-15/porting_to.html
Upstream: https://github.com/xvisor/xvisor/pull/200
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/11042295047
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 1984408c..8731ece0 100644
--- a/Makefile
+++ b/Makefile
@@ -166,7 +166,7 @@ cppflags+=-I$(libs_dir)/include
cppflags+=$(cpu-cppflags)
cppflags+=$(board-cppflags)
cppflags+=$(libs-cppflags-y)
-cflags=-g -Wall -nostdlib --sysroot=$(drivers_dir)/include -fno-builtin -fno-stack-protector -D__VMM__
+cflags=-std=gnu11 -g -Wall -nostdlib --sysroot=$(drivers_dir)/include -fno-builtin -fno-stack-protector -D__VMM__
cflags+=$(board-cflags)
cflags+=$(cpu-cflags)
cflags+=$(libs-cflags-y)
--
2.50.1

69
package/xvisor/Config.in Normal file
View File

@@ -0,0 +1,69 @@
config BR2_PACKAGE_XVISOR_ARCH_SUPPORTS
bool
default y if BR2_aarch64
default y if BR2_cortex_a7 || BR2_cortex_a12 || BR2_cortex_a15 || BR2_cortex_a17
default y if BR2_riscv
default y if BR2_x86_64
depends on BR2_USE_MMU
menuconfig BR2_PACKAGE_XVISOR
bool "xvisor"
depends on BR2_PACKAGE_XVISOR_ARCH_SUPPORTS
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
help
Xvisor is an open-source type-1 hypervisor, which aims at
providing a monolithic, light-weight, portable, and flexible
virtualization solution.
http://www.xhypervisor.org/
if BR2_PACKAGE_XVISOR
choice
prompt "Xvisor configuration"
default BR2_PACKAGE_XVISOR_USE_DEFCONFIG
config BR2_PACKAGE_XVISOR_USE_DEFCONFIG
bool "Using an in-tree defconfig file"
config BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG
bool "Using a custom (def)config file"
endchoice
config BR2_PACKAGE_XVISOR_DEFCONFIG
string "Defconfig name"
default "generic-v7-ve" if BR2_ARM_CPU_ARMV7A
default "generic-v8" if BR2_aarch64
default "generic-32b" if BR2_RISCV_32
default "generic-64b" if BR2_RISCV_64
default "x86_64_generic" if BR2_x86_64
depends on BR2_PACKAGE_XVISOR_USE_DEFCONFIG
help
Name of the Xvisor defconfig file to use, without the
trailing -defconfig. The defconfig is located in
arch/<arch>/configs in the source tree.
config BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE
string "Configuration file path"
depends on BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG
help
Path to the Xvisor configuration file
config BR2_PACKAGE_XVISOR_CREATE_UBOOT_IMAGE
bool "Create U-Boot image of Xvisor"
depends on BR2_arm
select BR2_PACKAGE_HOST_UBOOT_TOOLS
help
Create an image file of Xvisor loadable from Das U-Boot.
config BR2_PACKAGE_XVISOR_BUILD_TEST_DTB
bool "Build test device-tree blobs"
help
Build test device-tree blobs for popular boards.
endif
comment "xvisor needs a toolchain w/ gcc >= 4.9"
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
depends on BR2_PACKAGE_XVISOR_ARCH_SUPPORTS

View File

@@ -0,0 +1,3 @@
# Locally generated
sha256 fbced0f74b75758d4859d329b86c213bd24662168179ebfb2b02b987a1070215 xvisor-0.3.2.tar.xz
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING

88
package/xvisor/xvisor.mk Normal file
View File

@@ -0,0 +1,88 @@
################################################################################
#
# xvisor
#
################################################################################
XVISOR_VERSION = 0.3.2
XVISOR_SOURCE = xvisor-$(XVISOR_VERSION).tar.xz
XVISOR_SITE = http://www.xhypervisor.org/tarball
XVISOR_LICENSE = GPL-2.0+
XVISOR_LICENSE_FILES = COPYING
XVISOR_INSTALL_IMAGES = YES
XVISOR_INSTALL_TARGET = NO
XVISOR_DEPENDENCIES = host-bison host-dtc host-flex $(BR2_PYTHON3_HOST_DEPENDENCY)
XVISOR_MAKE_TARGETS = all
ifeq ($(BR2_PACKAGE_XVISOR_BUILD_TEST_DTB),y)
XVISOR_MAKE_TARGETS += dtbs
endif
XVISOR_KCONFIG_DOTCONFIG = build/openconf/.config
ifeq ($(BR2_PACKAGE_XVISOR_USE_DEFCONFIG),y)
XVISOR_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_PACKAGE_XVISOR_DEFCONFIG))-defconfig
else ifeq ($(BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG),y)
XVISOR_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE))
endif
XVISOR_KCONFIG_EDITORS = menuconfig
ifeq ($(BR2_x86_64),y)
XVISOR_ARCH = x86
else ifeq ($(BR2_arm)$(BR2_aarch64),y)
XVISOR_ARCH = arm
else ifeq ($(BR2_riscv),y)
XVISOR_ARCH = riscv
endif
ifeq ($(BR2_PACKAGE_XVISOR)$(BR_BUILDING),yy)
ifeq ($(XVISOR_ARCH),)
$(error "Architecture not supported by XVisor")
endif
endif
XVISOR_MAKE_ENV = \
ARCH=$(XVISOR_ARCH) \
CROSS_COMPILE=$(TARGET_CROSS)
XVISOR_MAKE_OPTS = $(if $(VERBOSE),VERBOSE=1)
define XVISOR_BUILD_CMDS
$(TARGET_MAKE_ENV) $(XVISOR_MAKE_ENV) $(MAKE) $(XVISOR_MAKE_OPTS) \
-C $(@D) $(XVISOR_MAKE_TARGETS)
endef
define XVISOR_INSTALL_IMAGES_CMDS
$(INSTALL) -m 0644 -D $(@D)/build/vmm.bin $(BINARIES_DIR)/vmm.bin
endef
ifeq ($(BR2_PACKAGE_XVISOR_CREATE_UBOOT_IMAGE),y)
XVISOR_DEPENDENCIES += host-uboot-tools
define XVISOR_CREATE_UBOOT_IMAGE
$(MKIMAGE) -A $(MKIMAGE_ARCH) -O linux -T kernel -C none \
-a 0x00008000 -e 0x00008000 \
-n Xvisor -d $(BINARIES_DIR)/vmm.bin $(BINARIES_DIR)/uvmm.bin
endef
endif
XVISOR_POST_INSTALL_IMAGES_HOOKS += XVISOR_CREATE_UBOOT_IMAGE
# Checks to give errors that the user can understand
ifeq ($(BR_BUILDING),y)
ifeq ($(BR2_PACKAGE_XVISOR_USE_DEFCONFIG),y)
ifeq ($(call qstrip,$(BR2_PACKAGE_XVISOR_DEFCONFIG)),)
$(error No Xvisor defconfig name specified, check your BR2_PACKAGE_XVISOR_DEFCONFIG setting)
endif
endif
ifeq ($(BR2_PACKAGE_XVISOR_USE_CUSTOM_CONFIG),y)
ifeq ($(BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE),)
$(error No Xvisor configuration file specified, check your BR2_PACKAGE_XVISOR_CUSTOM_CONFIG_FILE setting)
endif
endif
endif
$(eval $(kconfig-package))