All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH] xen: add initial riscv64 support
@ 2026-11-26 13:10 Hiago De Franco
  2026-11-27 16:41 ` Ronaldo Nunez
  2026-11-30  4:33 ` Bruce Ashfield
  0 siblings, 2 replies; 4+ messages in thread
From: Hiago De Franco @ 2026-11-26 13:10 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Ronaldo Nunez, Hiago De Franco

Add riscv64 to the Xen architecture mapping and allow the Xen hypervisor
recipe to build for it.

Xen sets its own -march and -mabi flags for RISC-V, so clear TUNE_CCARGS
for riscv64 in the same way as is already done for aarch64.

The Xen tools do not support riscv64 yet, so skip the xen-tools deploy
dependencies on that architecture.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 recipes-extended/xen/xen-arch.inc       |  1 +
 recipes-extended/xen/xen-hypervisor.inc | 22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/recipes-extended/xen/xen-arch.inc b/recipes-extended/xen/xen-arch.inc
index fb0093e3..8c505396 100644
--- a/recipes-extended/xen/xen-arch.inc
+++ b/recipes-extended/xen/xen-arch.inc
@@ -2,6 +2,7 @@
 valid_xen_archs = " \
         x86_64 x86_32 \
         arm32 arm64 \
+        riscv64 \
         "
 
 def map_xen_arch(a, d):
diff --git a/recipes-extended/xen/xen-hypervisor.inc b/recipes-extended/xen/xen-hypervisor.inc
index f448564d..fe987a08 100644
--- a/recipes-extended/xen/xen-hypervisor.inc
+++ b/recipes-extended/xen/xen-hypervisor.inc
@@ -7,7 +7,7 @@ DESCRIPTION = "The Xen hypervisor"
 # to build the different components. eg. 32-bit tools and a 64-bit hypervisor.
 
 # The Xen hypervisor has a narrower compatible platform range than the Xen tools
-COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux'
+COMPATIBLE_HOST = '(x86_64.*).*-linux|aarch64.*-linux|riscv64.*-linux'
 
 inherit deploy python3native cml1
 
@@ -94,12 +94,17 @@ do_deploy() {
 # - add the task before do_build to ensure that deployment has completed when
 #   the recipe build done stamp is written
 addtask deploy after do_compile do_populate_sysroot before do_build
-# To ensure that a deployed hypervisor has matching tools, add a dependency to
-# make sure that the tools have built and been staged:
-do_deploy[depends] += "xen-tools:do_populate_sysroot"
-# Also ensure anything that the tools recipe needs to deploy, such as a
-# XSM policy file, has been deployed first:
-do_deploy[depends] += "xen-tools:do_deploy"
+# To ensure that a deployed hypervisor has matching tools, add dependencies to
+# make sure that the tools have built and been staged, and that anything the
+# tools recipe needs to deploy, such as a XSM policy file, has been deployed
+# first.
+XEN_TOOLS_DEPLOY_DEPENDS = " \
+    xen-tools:do_populate_sysroot \
+    xen-tools:do_deploy \
+    "
+# xen-tools is not yet buildable for riscv64.
+XEN_TOOLS_DEPLOY_DEPENDS:riscv64 = ""
+do_deploy[depends] += "${XEN_TOOLS_DEPLOY_DEPENDS}"
 
 # Enable use of menuconfig directly from bitbake and also within the devshell
 do_devshell[depends] += "ncurses-native:do_populate_sysroot"
@@ -113,5 +118,6 @@ CROSS_CURSES_LIB += "-L${STAGING_LIBDIR_NATIVE}"
 KCONFIG_CONFIG_ROOTDIR = "${S}/xen"
 
 # Xen is setting all CC flags on its own. Make sure that they are not modified
-# for aarch64, e.g. with architecture-specific optimizations.
+# for aarch64 and riscv64, e.g. with architecture-specific optimizations.
 TUNE_CCARGS:aarch64 = ""
+TUNE_CCARGS:riscv64 = ""
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization][PATCH] xen: add initial riscv64 support
  2026-11-26 13:10 [meta-virtualization][PATCH] xen: add initial riscv64 support Hiago De Franco
@ 2026-11-27 16:41 ` Ronaldo Nunez
  2026-11-30  4:33 ` Bruce Ashfield
  1 sibling, 0 replies; 4+ messages in thread
From: Ronaldo Nunez @ 2026-11-27 16:41 UTC (permalink / raw)
  To: Hiago De Franco; +Cc: meta-virtualization

Hi,

I've applied this on top of master branch (commit 89b00d096a432000766729cd721ae647af500112),
buit it with 'bitbake xen' and then tested generated xen binary on QEMU in dom0less mode (no domU).
The system booted and reached "(XEN) All set up" as expected.

On Thu, Nov 26, 2026 at 10:10:35AM -0300, Hiago De Franco wrote:
> Add riscv64 to the Xen architecture mapping and allow the Xen hypervisor
> recipe to build for it.
> 
> Xen sets its own -march and -mabi flags for RISC-V, so clear TUNE_CCARGS
> for riscv64 in the same way as is already done for aarch64.
> 
> The Xen tools do not support riscv64 yet, so skip the xen-tools deploy
> dependencies on that architecture.
> 
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>

Tested-by: Ronaldo Nunez <rnunez@baylibre.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization][PATCH] xen: add initial riscv64 support
  2026-11-26 13:10 [meta-virtualization][PATCH] xen: add initial riscv64 support Hiago De Franco
  2026-11-27 16:41 ` Ronaldo Nunez
@ 2026-11-30  4:33 ` Bruce Ashfield
  2026-11-30 12:25   ` Hiago De Franco
  1 sibling, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2026-11-30  4:33 UTC (permalink / raw)
  To: Hiago De Franco; +Cc: meta-virtualization, Ronaldo Nunez

> Add riscv64 to the Xen architecture mapping and allow the Xen hypervisor
> recipe to build for it.

The changes themselves look fine, but I'm not going to merge this
until there's a description of how to build and boot it.

> The Xen tools do not support riscv64 yet, so skip the xen-tools deploy
> dependencies on that architecture.

Without the tools, xen-image-minimal isn't an option, so I have no
idea what was built or how Xen was loaded on qemu (u-boot, -kernel, a
device tree for dom0less, etc). I can't support something that I can't
build and boot myself.

recipes-extended/images/README-xen.md has a "Build and boot" section
for qemuarm64 and qemux86-64: the local.conf settings, the bitbake
targets, the runqemu command and what you should see once it's up.
Can you add a qemuriscv64 section to it, as a second patch in a v2 ?
Ronaldo's test on this thread would be a good starting point, as long as the
steps let someone else get to "(XEN) All set up" on their own.

Bruce

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [meta-virtualization][PATCH] xen: add initial riscv64 support
  2026-11-30  4:33 ` Bruce Ashfield
@ 2026-11-30 12:25   ` Hiago De Franco
  0 siblings, 0 replies; 4+ messages in thread
From: Hiago De Franco @ 2026-11-30 12:25 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: meta-virtualization, Ronaldo Nunez

Hi Bruce,

On Sun, Nov 29, 2026 at 08:33:42PM -0800, Bruce Ashfield wrote:
> > Add riscv64 to the Xen architecture mapping and allow the Xen hypervisor
> > recipe to build for it.
> 
> The changes themselves look fine, but I'm not going to merge this
> until there's a description of how to build and boot it.
> 
> > The Xen tools do not support riscv64 yet, so skip the xen-tools deploy
> > dependencies on that architecture.
> 
> Without the tools, xen-image-minimal isn't an option, so I have no
> idea what was built or how Xen was loaded on qemu (u-boot, -kernel, a
> device tree for dom0less, etc). I can't support something that I can't
> build and boot myself.
> 
> recipes-extended/images/README-xen.md has a "Build and boot" section
> for qemuarm64 and qemux86-64: the local.conf settings, the bitbake
> targets, the runqemu command and what you should see once it's up.
> Can you add a qemuriscv64 section to it, as a second patch in a v2 ?
> Ronaldo's test on this thread would be a good starting point, as long as the
> steps let someone else get to "(XEN) All set up" on their own.

Sure, I will improve the patch for v2. To fully test we had to use
downstream patches, but with upstream we can at least see the "Setup
done" message from Xen before it halts. So this patch is a minimal
starting point to fully boot Xen once all the RISC-V patches are merged
upstream.

Thanks for the review.

> 
> Bruce

-- 
Hiago

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-30 12:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 13:10 [meta-virtualization][PATCH] xen: add initial riscv64 support Hiago De Franco
2026-11-27 16:41 ` Ronaldo Nunez
2026-11-30  4:33 ` Bruce Ashfield
2026-11-30 12:25   ` Hiago De Franco

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.