Skip to contentSkip to conversation

boot-wrapper: arm64: Xen support

PATCH Superseded Andre Przywara 3 participants 17 messages Jun 20, 2016 – Aug 16, 2016 Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover boot-wrapper: arm64: Xen support

These patches allow to include a Xen hypervisor binary into a boot-wrapper ELF file, so that a Foundation Platform or a Fast Model can boot a Xen system (including a Dom0 kernel).
This has been floating around for a while, I just updated the patches to apply on the latest boot-wrapper tree. Also I increased Xen's load address to accomodate for Dom0 kernels bigger than 16 MB.
For testing this just add: "--with-xen=/path/to/xen/xen/xen" to the ./configure command line and feed the resulting xen-system.axf file to the model.

Cheers,
Andre.

Christoffer Dall (3):
Support for building in a Xen binary
Xen: Support adding DT nodes
Explicitly clean linux-system.axf and xen-system.axf

Ian Campbell (1):
Xen: Select correct dom0 console

 .gitignore    |  1 +
 Makefile.am   | 38 +++++++++++++++++++++++++-------------
 boot_common.c |  4 ++--
 configure.ac  | 26 +++++++++++++++++++++++++-
 model.lds.S   | 14 ++++++++++++++
 5 files changed, 67 insertions(+), 16 deletions(-)
Signature · 1 line
2.9.0
#1 lore raw

PATCH 1/4 Support for building in a Xen binary

From: Christoffer Dall <[email protected]>

Add support for building a Xen binary which includes a Dom0 image and the Dom0 command-line.

If the user specifies --with-xen=<Xen>, where Xen is an appropriate AArch64 Xen binary, the build system will generate a xen-system.axf instead of a linux-system.axf.

Original patch from Ian Campbell, but I modified most of it so all bugs are probably mine.
[Andre: adapt to newest boot-wrapper branch, increase load address]

---
 .gitignore    |  1 +
 Makefile.am   | 12 ++++++++----
 boot_common.c |  4 ++--
 configure.ac  | 14 ++++++++++++++
 model.lds.S   | 14 ++++++++++++++
 5 files changed, 39 insertions(+), 6 deletions(-)
.gitignore +1 -0
index 8653852..80770c0 100644
@@ -14,6 +14,7 @@ configure
 dtc
 fdt.dtb
 Image
+Xen
 install-sh
 Makefile
 Makefile.in
Makefile.am +8 -4
index 692d2cc..1a801c0 100644
@@ -85,7 +85,6 @@ TEXT_LIMIT	:= 0x80080000
 endif
 
 LD_SCRIPT	:= model.lds.S
-IMAGE		:= linux-system.axf
 
 FS_OFFSET	:= 0x10000000
 FILESYSTEM_START:= $(shell echo $$(($(PHYS_OFFSET) + $(FS_OFFSET))))
@@ -108,6 +107,11 @@ CHOSEN_NODE	:= chosen {						\
 		   };
 endif
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+endif
+
 CPPFLAGS	+= $(INITRD_FLAGS)
 CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
 CFLAGS		+= -Wall -fomit-frame-pointer
@@ -117,11 +121,11 @@ LDFLAGS		+= --gc-sections
 OFILES		+= boot_common.o bakery_lock.o platform.o $(GIC) cache.o lib.o
 OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
-all: $(IMAGE)
+all: $(IMAGE) $(XIMAGE)
 
 CLEANFILES = $(IMAGE) $(OFILES) model.lds fdt.dtb
 
-$(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM)
+$(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE)
 	$(LD) $(LDFLAGS) $(OFILES) -o $@ --script=model.lds
 
 %.o: %.S Makefile
@@ -131,7 +135,7 @@ $(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM)
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
 
 model.lds: $(LD_SCRIPT) Makefile
-	$(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DTEXT_LIMIT=$(TEXT_LIMIT) -P -C -o $@ $<
+	$(CPP) $(CPPFLAGS) -ansi -DPHYS_OFFSET=$(PHYS_OFFSET) -DMBOX_OFFSET=$(MBOX_OFFSET) -DKERNEL_OFFSET=$(KERNEL_OFFSET) -DFDT_OFFSET=$(FDT_OFFSET) -DFS_OFFSET=$(FS_OFFSET) $(XEN) -DXEN_OFFSET=$(XEN_OFFSET) -DKERNEL=$(KERNEL_IMAGE) -DFILESYSTEM=$(FILESYSTEM) -DTEXT_LIMIT=$(TEXT_LIMIT) -P -C -o $@ $<
 
 fdt.dtb: $(KERNEL_DTB) Makefile gen-cpu-nodes.sh
 	( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) $(CPUS_NODE) };" ) | $(DTC) -O dtb -o $@ -
boot_common.c +2 -2
index 4947fe3..e7b8e1d 100644
@@ -9,7 +9,7 @@
 #include <cpu.h>
 #include <spin.h>
 
-extern unsigned long kernel;
+extern unsigned long entrypoint;
 extern unsigned long dtb;
 
 void init_platform(void);
@@ -67,7 +67,7 @@ void __noreturn first_spin(unsigned int cpu, unsigned long *mbox,
 	if (cpu == 0) {
 		init_platform();
 
-		*mbox = (unsigned long)&kernel;
+		*mbox = (unsigned long)&entrypoint;
 		sevl();
 		spin(mbox, invalid, 1);
 	} else {
configure.ac +14 -0
index ab8f5b3..2441f8b 100644
@@ -40,6 +40,15 @@ AC_ARG_WITH([dtb],
 	AS_HELP_STRING([--with-dtb], [Specify a particular DTB to use]),
 	[KERN_DTB="$withval"])
 
+AC_ARG_WITH([xen],
+	AS_HELP_STRING([--with-xen], [Compile for Xen, and Specify a particular Xen to use]),
+	X_IMAGE=$withval)
+
+AS_IF([test "x$X_IMAGE" == "x"], [],
+	[AC_CHECK_FILE([$X_IMAGE], [], AC_MSG_ERROR([No such file or directory: $X_IMAGE]))])
+AC_SUBST([XEN_IMAGE], [$X_IMAGE])
+AM_CONDITIONAL([XEN], [test "x$X_IMAGE" != "x"])
+
 # Ensure that the user has provided us with a sane kernel dir.
 m4_define([CHECKFILES], [KERN_DIR,
 	KERN_DTB,
@@ -50,6 +59,10 @@ m4_foreach([checkfile], [CHECKFILES],
 
 AC_SUBST([KERNEL_IMAGE], [$KERN_IMAGE])
 AC_SUBST([KERNEL_DTB], [$KERN_DTB])
+AS_IF([test "x$X_IMAGE" != "x"],
+      [AC_SUBST([IMAGE], ["xen-system.axf"])],
+      [AC_SUBST([IMAGE], ["linux-system.axf"])]
+)
 
 # Allow a user to pass --enable-psci
 AC_ARG_ENABLE([psci],
@@ -119,4 +132,5 @@ echo "  CPU IDs:                           ${CPU_IDS}"
 echo "  Use GICv3?                         ${USE_GICV3}"
 echo "  Boot-wrapper execution state:      AArch${BOOTWRAPPER_ES}"
 echo "  Kernel execution state:            AArch${KERNEL_ES}"
+echo "  Xen image                          ${X_IMAGE:-NONE}"
 echo ""
model.lds.S +14 -0
index 51c5684..511f552 100644
@@ -16,6 +16,9 @@ OUTPUT_ARCH(aarch64)
 #endif
 TARGET(binary)
 
+#ifdef XEN
+INPUT(XEN)
+#endif
 INPUT(KERNEL)
 INPUT(./fdt.dtb)
 
@@ -36,6 +39,17 @@ SECTIONS
 		KERNEL
 	}
 
+#ifdef XEN
+	.xen (PHYS_OFFSET + XEN_OFFSET): {
+		xen = .;
+		XEN
+	}
+
+	entrypoint = xen;
+#else
+	entrypoint = kernel;
+#endif
+
 	.dtb (PHYS_OFFSET + FDT_OFFSET): {
 		dtb = .;
 		./fdt.dtb
Signature · 7 lines
2.9.0


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw

PATCH 1/4 Support for building in a Xen binary

Hi Andre,

Quoted 25 lines · Andre Przywara
Makefile.am +5 -1
index 692d2cc..1a801c0 100644
@@ -85,7 +85,6 @@ TEXT_LIMIT	:= 0x80080000
  endif
 
  LD_SCRIPT	:= model.lds.S
-IMAGE		:= linux-system.axf
 
  FS_OFFSET	:= 0x10000000
  FILESYSTEM_START:= $(shell echo $$(($(PHYS_OFFSET) + $(FS_OFFSET))))
@@ -108,6 +107,11 @@ CHOSEN_NODE	:= chosen {						\
  		   };
  endif
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+endif
+
  CPPFLAGS	+= $(INITRD_FLAGS)
  CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
  CFLAGS		+= -Wall -fomit-frame-pointer

Makefile.am LDFLAGS += --gc-sections · line 124

Quoted 5 lines
Makefile.am +1 -1
@@ -117,11 +121,11 @@ LDFLAGS		+= --gc-sections
  OFILES		+= boot_common.o bakery_lock.o platform.o $(GIC) cache.o lib.o
  OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
-all: $(IMAGE)
+all: $(IMAGE) $(XIMAGE)

I cannot find where XIMAGE is set. What XIMAGE is used for?

Regards,

Signature · 1 line
Julien Grall
#3 lore raw

PATCH 1/4 Support for building in a Xen binary

Quoted 31 lines · Julien Grall

Hi Andre,

Quoted 28 lines · Andre Przywara
Makefile.am +5 -1
index 692d2cc..1a801c0 100644
@@ -85,7 +85,6 @@ TEXT_LIMIT	:= 0x80080000
 endif
 
 LD_SCRIPT	:= model.lds.S
-IMAGE		:= linux-system.axf
 
 FS_OFFSET	:= 0x10000000
 FILESYSTEM_START:= $(shell echo $$(($(PHYS_OFFSET) + $(FS_OFFSET))))
@@ -108,6 +107,11 @@ CHOSEN_NODE	:= chosen {						\
 		   };
 endif
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+endif
+
 CPPFLAGS	+= $(INITRD_FLAGS)
 CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
 CFLAGS		+= -Wall -fomit-frame-pointer
@@ -117,11 +121,11 @@ LDFLAGS		+= --gc-sections
 OFILES		+= boot_common.o bakery_lock.o platform.o $(GIC) cache.o lib.o
 OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
Quoted 5 lines

Makefile.am LDFLAGS += --gc-sections · line 124

Quoted 2 lines
Makefile.am +1 -1
-all: $(IMAGE)
+all: $(IMAGE) $(XIMAGE)

I cannot find where XIMAGE is set. What XIMAGE is used for?

I can't remember (it's been ages since I wrote this patch, then something happened that required a more substantial rewrite of the whole bootwrapper, which I think was then aborted anyhow, and this got lost somehow, or something like that, and I've sort of lost momentum here), but I think the idea was that you would build the normal linux Image IMAGE, and XIMAGE for the xen image, so that a single build would output both images so you could test with the same settings if the basic build worked, and then test with Xen.

-Christoffer

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#4 lore raw

PATCH 2/4 Xen: Support adding DT nodes

In reply to Andre Przywara

From: Christoffer Dall <[email protected]>

Support adding xen,xen-bootargs node via --with-xen-bootargs to the configure script and automatically add the Dom0 node to the DT as well.

---
 Makefile.am  | 34 +++++++++++++++++++++-------------
 configure.ac |  9 +++++++++
 2 files changed, 30 insertions(+), 13 deletions(-)
Makefile.am +21 -13
index 1a801c0..d83b417 100644
@@ -93,24 +93,32 @@ FILESYSTEM_END	:= $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE))))
 
 FDT_OFFSET	:= 0x08000000
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+KERNEL_SIZE	:= $(shell stat -Lc %s $(KERNEL_IMAGE) 2>/dev/null || echo 0)
+DOM0_OFFSET	:= $(shell echo $$(($(PHYS_OFFSET) + $(KERNEL_OFFSET))))
+XEN_BOOTARGS	:= xen,xen-bootargs = \"$(BOOTARGS)\";			\
+		   \#address-cells = <2>;				\
+		   \#size-cells = <2>;					\
+		   module@1 {						\
+			compatible = \"xen,linux-zimage\", \"xen,multiboot-module\"; \
+			reg = <0x0 $(DOM0_OFFSET) 0x0 $(KERNEL_SIZE)>;	\
+		   };
+endif
+
+
 if INITRD
 INITRD_FLAGS	:= -DUSE_INITRD
+INITRD_CHOSEN   := linux,initrd-start = <$(FILESYSTEM_START)>;	\
+		   linux,initrd-end = <$(FILESYSTEM_END)>;
+endif
+
 CHOSEN_NODE	:= chosen {						\
 			bootargs = \"$(CMDLINE)\";			\
-			linux,initrd-start = <$(FILESYSTEM_START)>;	\
-			linux,initrd-end = <$(FILESYSTEM_END)>;		\
-		   };
-else
-INITRD_FLAGS	:=
-CHOSEN_NODE	:= chosen {						\
-			bootargs = \"$(CMDLINE)\";			\
+			$(INITRD_CHOSEN)				\
+			$(XEN_BOOTARGS)					\
 		   };
-endif
-
-if XEN
-XEN		:= -DXEN=$(XEN_IMAGE)
-XEN_OFFSET	:= 0x08200000
-endif
 
 CPPFLAGS	+= $(INITRD_FLAGS)
 CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
configure.ac +9 -0
index 2441f8b..b001939 100644
@@ -95,6 +95,12 @@ AC_ARG_WITH([cmdline],
 	[C_CMDLINE=$withval])
 AC_SUBST([CMDLINE], [$C_CMDLINE])
 
+X_BOOTARGS="console=dtuart dtuart=serial0 no-bootscrub"
+AC_ARG_WITH([xen-bootargs],
+	AS_HELP_STRING([--with-xen-bootargs], [set Xen bootargs]),
+	[X_BOOTARGS=$withval])
+AC_SUBST([BOOTARGS], [$X_BOOTARGS])
+
 # Allow a user to pass --enable-gicv3
 AC_ARG_ENABLE([gicv3],
 	AS_HELP_STRING([--enable-gicv3], [enable GICv3 instead of GICv2]),
@@ -133,4 +139,7 @@ echo "  Use GICv3?                         ${USE_GICV3}"
 echo "  Boot-wrapper execution state:      AArch${BOOTWRAPPER_ES}"
 echo "  Kernel execution state:            AArch${KERNEL_ES}"
 echo "  Xen image                          ${X_IMAGE:-NONE}"
+if test "x${X_IMAGE}" != "x"; then
+echo "  Xen Bootargs:                      ${X_BOOTARGS}"
+fi
 echo ""
Signature · 7 lines
2.9.0


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#5 lore raw

PATCH 2/4 Xen: Support adding DT nodes

Hi Andre,

Quoted 17 lines · Andre Przywara

From: Christoffer Dall <[email protected]>

Support adding xen,xen-bootargs node via --with-xen-bootargs to the configure script and automatically add the Dom0 node to the DT as well.

---
  Makefile.am  | 34 +++++++++++++++++++++-------------
  configure.ac |  9 +++++++++
  2 files changed, 30 insertions(+), 13 deletions(-)
Makefile.am +0 -0
index 1a801c0..d83b417 100644

Makefile.am FILESYSTEM_END := $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE)))) · line 101

Quoted 9 lines
Makefile.am +6 -0
@@ -93,24 +93,32 @@ FILESYSTEM_END	:= $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE))))
 
  FDT_OFFSET	:= 0x08000000
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+KERNEL_SIZE	:= $(shell stat -Lc %s $(KERNEL_IMAGE) 2>/dev/null || echo 0)
+DOM0_OFFSET	:= $(shell echo $$(($(PHYS_OFFSET) + $(KERNEL_OFFSET))))
+XEN_BOOTARGS	:= xen,xen-bootargs = \"$(BOOTARGS)\";			\

I would prefer BOOTARGS with XEN_ to avoid confusion.

Quoted 23 lines
Makefile.am +13 -6
+		   \#address-cells = <2>;				\
+		   \#size-cells = <2>;					\
+		   module at 1 {						\
+			compatible = \"xen,linux-zimage\", \"xen,multiboot-module\"; \
+			reg = <0x0 $(DOM0_OFFSET) 0x0 $(KERNEL_SIZE)>;	\
+		   };
+endif
+
+
  if INITRD
  INITRD_FLAGS	:= -DUSE_INITRD
+INITRD_CHOSEN   := linux,initrd-start = <$(FILESYSTEM_START)>;	\
+		   linux,initrd-end = <$(FILESYSTEM_END)>;
+endif
+
  CHOSEN_NODE	:= chosen {						\
  			bootargs = \"$(CMDLINE)\";			\
-			linux,initrd-start = <$(FILESYSTEM_START)>;	\
-			linux,initrd-end = <$(FILESYSTEM_END)>;		\
-		   };
-else
-INITRD_FLAGS	:=
-CHOSEN_NODE	:= chosen {						\

Makefile.am FILESYSTEM_END := $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE)))) · line 113

Quoted 10 lines
Makefile.am +2 -7
-			bootargs = \"$(CMDLINE)\";			\
+			$(INITRD_CHOSEN)				\
+			$(XEN_BOOTARGS)					\
  		   };
-endif
-
-if XEN
-XEN		:= -DXEN=$(XEN_IMAGE)
-XEN_OFFSET	:= 0x08200000
-endif

This code was added in the previous patch. Can you add the code in the correct place directly in patch #1?

configure.ac AC_ARG_WITH([cmdline], · line 99

Quoted 13 lines
Makefile.am +0 -0
  CPPFLAGS	+= $(INITRD_FLAGS)
  CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
configure.ac +2 -0
index 2441f8b..b001939 100644
@@ -95,6 +95,12 @@ AC_ARG_WITH([cmdline],
  	[C_CMDLINE=$withval])
  AC_SUBST([CMDLINE], [$C_CMDLINE])
 
+X_BOOTARGS="console=dtuart dtuart=serial0 no-bootscrub"
+AC_ARG_WITH([xen-bootargs],

I would name the option xen-cmdline to stay inline with the kernel one.

configure.ac echo " Use GICv3? ${USE_GICV3}" · line 143

Quoted 13 lines
configure.ac +6 -0
+	AS_HELP_STRING([--with-xen-bootargs], [set Xen bootargs]),
+	[X_BOOTARGS=$withval])
+AC_SUBST([BOOTARGS], [$X_BOOTARGS])
+
  # Allow a user to pass --enable-gicv3
  AC_ARG_ENABLE([gicv3],
  	AS_HELP_STRING([--enable-gicv3], [enable GICv3 instead of GICv2]),
@@ -133,4 +139,7 @@ echo "  Use GICv3?                         ${USE_GICV3}"
  echo "  Boot-wrapper execution state:      AArch${BOOTWRAPPER_ES}"
  echo "  Kernel execution state:            AArch${KERNEL_ES}"
  echo "  Xen image                          ${X_IMAGE:-NONE}"
+if test "x${X_IMAGE}" != "x"; then
+echo "  Xen Bootargs:                      ${X_BOOTARGS}"

Same suggestion here "Xen command line".

configure.ac echo " Use GICv3? ${USE_GICV3}" · line 145

Quoted 3 lines
configure.ac +1 -0
+fi
  echo ""

Regards,

Signature · 1 line
Julien Grall
#6 lore raw

Re: [PATCH 2/4] Xen: Support adding DT nodes

In reply to Andre Przywara

Hi Andre,

Quoted 17 lines · Andre Przywara

From: Christoffer Dall <[email protected]>

Support adding xen,xen-bootargs node via --with-xen-bootargs to the configure script and automatically add the Dom0 node to the DT as well.

---
  Makefile.am  | 34 +++++++++++++++++++++-------------
  configure.ac |  9 +++++++++
  2 files changed, 30 insertions(+), 13 deletions(-)
Makefile.am +0 -0
index 1a801c0..d83b417 100644

Makefile.am FILESYSTEM_END := $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE)))) · line 101

Quoted 9 lines
Makefile.am +6 -0
@@ -93,24 +93,32 @@ FILESYSTEM_END	:= $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE))))
 
  FDT_OFFSET	:= 0x08000000
 
+if XEN
+XEN		:= -DXEN=$(XEN_IMAGE)
+XEN_OFFSET	:= 0x08200000
+KERNEL_SIZE	:= $(shell stat -Lc %s $(KERNEL_IMAGE) 2>/dev/null || echo 0)
+DOM0_OFFSET	:= $(shell echo $$(($(PHYS_OFFSET) + $(KERNEL_OFFSET))))
+XEN_BOOTARGS	:= xen,xen-bootargs = \"$(BOOTARGS)\";			\

I would prefer BOOTARGS with XEN_ to avoid confusion.

Quoted 23 lines
Makefile.am +13 -6
+		   \#address-cells = <2>;				\
+		   \#size-cells = <2>;					\
+		   module@1 {						\
+			compatible = \"xen,linux-zimage\", \"xen,multiboot-module\"; \
+			reg = <0x0 $(DOM0_OFFSET) 0x0 $(KERNEL_SIZE)>;	\
+		   };
+endif
+
+
  if INITRD
  INITRD_FLAGS	:= -DUSE_INITRD
+INITRD_CHOSEN   := linux,initrd-start = <$(FILESYSTEM_START)>;	\
+		   linux,initrd-end = <$(FILESYSTEM_END)>;
+endif
+
  CHOSEN_NODE	:= chosen {						\
  			bootargs = \"$(CMDLINE)\";			\
-			linux,initrd-start = <$(FILESYSTEM_START)>;	\
-			linux,initrd-end = <$(FILESYSTEM_END)>;		\
-		   };
-else
-INITRD_FLAGS	:=
-CHOSEN_NODE	:= chosen {						\

Makefile.am FILESYSTEM_END := $(shell echo $$(($(FILESYSTEM_START) + $(FILESYSTEM_SIZE)))) · line 113

Quoted 10 lines
Makefile.am +2 -7
-			bootargs = \"$(CMDLINE)\";			\
+			$(INITRD_CHOSEN)				\
+			$(XEN_BOOTARGS)					\
  		   };
-endif
-
-if XEN
-XEN		:= -DXEN=$(XEN_IMAGE)
-XEN_OFFSET	:= 0x08200000
-endif

This code was added in the previous patch. Can you add the code in the correct place directly in patch #1?

configure.ac AC_ARG_WITH([cmdline], · line 99

Quoted 13 lines
Makefile.am +0 -0
  CPPFLAGS	+= $(INITRD_FLAGS)
  CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
configure.ac +2 -0
index 2441f8b..b001939 100644
@@ -95,6 +95,12 @@ AC_ARG_WITH([cmdline],
  	[C_CMDLINE=$withval])
  AC_SUBST([CMDLINE], [$C_CMDLINE])
 
+X_BOOTARGS="console=dtuart dtuart=serial0 no-bootscrub"
+AC_ARG_WITH([xen-bootargs],

I would name the option xen-cmdline to stay inline with the kernel one.

configure.ac echo " Use GICv3? ${USE_GICV3}" · line 143

Quoted 13 lines
configure.ac +6 -0
+	AS_HELP_STRING([--with-xen-bootargs], [set Xen bootargs]),
+	[X_BOOTARGS=$withval])
+AC_SUBST([BOOTARGS], [$X_BOOTARGS])
+
  # Allow a user to pass --enable-gicv3
  AC_ARG_ENABLE([gicv3],
  	AS_HELP_STRING([--enable-gicv3], [enable GICv3 instead of GICv2]),
@@ -133,4 +139,7 @@ echo "  Use GICv3?                         ${USE_GICV3}"
  echo "  Boot-wrapper execution state:      AArch${BOOTWRAPPER_ES}"
  echo "  Kernel execution state:            AArch${KERNEL_ES}"
  echo "  Xen image                          ${X_IMAGE:-NONE}"
+if test "x${X_IMAGE}" != "x"; then
+echo "  Xen Bootargs:                      ${X_BOOTARGS}"

Same suggestion here "Xen command line".

configure.ac echo " Use GICv3? ${USE_GICV3}" · line 145

Quoted 3 lines
configure.ac +1 -0
+fi
  echo ""

Regards,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#7 lore raw

PATCH 3/4 Xen: Select correct dom0 console

In reply to Andre Przywara

From: Ian Campbell <[email protected]>

If Xen is enabled, tell Dom0 to use the 'hvc0' console, and fall back to the usual ttyAMA0 otherwise.

---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +2 -1
index b001939..f381a80 100644
@@ -89,7 +89,8 @@ AC_ARG_WITH([initrd],
 AC_SUBST([FILESYSTEM], [$USE_INITRD])
 AM_CONDITIONAL([INITRD], [test "x$USE_INITRD" != "x"])
 
-C_CMDLINE="console=ttyAMA0 earlyprintk=pl011,0x1c090000"
+AS_IF([test "x$X_IMAGE" = "x"],[C_CONSOLE="ttyAMA0"],[C_CONSOLE="hvc0"])
+C_CMDLINE="console=$C_CONSOLE earlyprintk=pl011,0x1c090000"
 AC_ARG_WITH([cmdline],
 	AS_HELP_STRING([--with-cmdline], [set a command line for the kernel]),
 	[C_CMDLINE=$withval])
Signature · 7 lines
2.9.0


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#8 lore raw

PATCH 3/4 Xen: Select correct dom0 console

Hi Andrew,

Quoted 8 lines · Andre Przywara

From: Ian Campbell <[email protected]>

If Xen is enabled, tell Dom0 to use the 'hvc0' console, and fall back to the usual ttyAMA0 otherwise.

Regards,

Quoted 19 lines
---
  configure.ac | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +2 -1
index b001939..f381a80 100644
@@ -89,7 +89,8 @@ AC_ARG_WITH([initrd],
  AC_SUBST([FILESYSTEM], [$USE_INITRD])
  AM_CONDITIONAL([INITRD], [test "x$USE_INITRD" != "x"])
 
-C_CMDLINE="console=ttyAMA0 earlyprintk=pl011,0x1c090000"
+AS_IF([test "x$X_IMAGE" = "x"],[C_CONSOLE="ttyAMA0"],[C_CONSOLE="hvc0"])
+C_CMDLINE="console=$C_CONSOLE earlyprintk=pl011,0x1c090000"
  AC_ARG_WITH([cmdline],
  	AS_HELP_STRING([--with-cmdline], [set a command line for the kernel]),
  	[C_CMDLINE=$withval])
Signature · 1 line
Julien Grall
Reviewed-by on v1 3/4
#9 lore raw

Re: [PATCH 3/4] Xen: Select correct dom0 console

In reply to Andre Przywara

Hi Andrew,

Quoted 8 lines · Andre Przywara

From: Ian Campbell <[email protected]>

If Xen is enabled, tell Dom0 to use the 'hvc0' console, and fall back to the usual ttyAMA0 otherwise.

Regards,

Quoted 19 lines
---
  configure.ac | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
configure.ac +2 -1
index b001939..f381a80 100644
@@ -89,7 +89,8 @@ AC_ARG_WITH([initrd],
  AC_SUBST([FILESYSTEM], [$USE_INITRD])
  AM_CONDITIONAL([INITRD], [test "x$USE_INITRD" != "x"])
 
-C_CMDLINE="console=ttyAMA0 earlyprintk=pl011,0x1c090000"
+AS_IF([test "x$X_IMAGE" = "x"],[C_CONSOLE="ttyAMA0"],[C_CONSOLE="hvc0"])
+C_CMDLINE="console=$C_CONSOLE earlyprintk=pl011,0x1c090000"
  AC_ARG_WITH([cmdline],
  	AS_HELP_STRING([--with-cmdline], [set a command line for the kernel]),
  	[C_CMDLINE=$withval])
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#10 lore raw

PATCH 4/4 Explicitly clean linux-system.axf and xen-system.axf

In reply to Andre Przywara

From: Christoffer Dall <[email protected]>

When doing a make clean, only the output image currently configured to build is being removed. However, one would expect all build artifacts to be removed when doing a 'make clean' and when switching between Xen and Linux builds, it is easy to accidentally run an older build than intended. Simply hardcode the axf image file names.

---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index d83b417..cd022e9 100644
@@ -131,7 +131,7 @@ OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
 all: $(IMAGE) $(XIMAGE)
 
-CLEANFILES = $(IMAGE) $(OFILES) model.lds fdt.dtb
+CLEANFILES = $(IMAGE) linux-system.axf xen-system.axf $(OFILES) model.lds fdt.dtb
 
 $(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE)
 	$(LD) $(LDFLAGS) $(OFILES) -o $@ --script=model.lds
Signature · 7 lines
2.9.0


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#11 lore raw

PATCH 4/4 Explicitly clean linux-system.axf and xen-system.axf

Hi Andre,

Quoted 10 lines · Andre Przywara

From: Christoffer Dall <[email protected]>

When doing a make clean, only the output image currently configured to build is being removed. However, one would expect all build artifacts to be removed when doing a 'make clean' and when switching between Xen and Linux builds, it is easy to accidentally run an older build than intended. Simply hardcode the axf image file names.

Regards,

Quoted 18 lines
---
  Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index d83b417..cd022e9 100644
@@ -131,7 +131,7 @@ OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
  all: $(IMAGE) $(XIMAGE)
 
-CLEANFILES = $(IMAGE) $(OFILES) model.lds fdt.dtb
+CLEANFILES = $(IMAGE) linux-system.axf xen-system.axf $(OFILES) model.lds fdt.dtb
 
  $(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE)
  	$(LD) $(LDFLAGS) $(OFILES) -o $@ --script=model.lds
Signature · 1 line
Julien Grall
Reviewed-by on v1 4/4
#12 lore raw

Re: [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf

In reply to Andre Przywara

Hi Andre,

Quoted 10 lines · Andre Przywara

From: Christoffer Dall <[email protected]>

When doing a make clean, only the output image currently configured to build is being removed. However, one would expect all build artifacts to be removed when doing a 'make clean' and when switching between Xen and Linux builds, it is easy to accidentally run an older build than intended. Simply hardcode the axf image file names.

Regards,

Quoted 18 lines
---
  Makefile.am | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Makefile.am +1 -1
index d83b417..cd022e9 100644
@@ -131,7 +131,7 @@ OFILES		+= $(addprefix $(ARCH_SRC),boot.o stack.o $(BOOTMETHOD) utils.o)
 
  all: $(IMAGE) $(XIMAGE)
 
-CLEANFILES = $(IMAGE) $(OFILES) model.lds fdt.dtb
+CLEANFILES = $(IMAGE) linux-system.axf xen-system.axf $(OFILES) model.lds fdt.dtb
 
  $(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM) $(XEN_IMAGE)
  	$(LD) $(LDFLAGS) $(OFILES) -o $@ --script=model.lds
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#13 lore raw

cover boot-wrapper: arm64: Xen support

In reply to Andre Przywara

Hi Andre,

Quoted 9 lines · Andre Przywara

These patches allow to include a Xen hypervisor binary into a boot-wrapper ELF file, so that a Foundation Platform or a Fast Model can boot a Xen system (including a Dom0 kernel).
This has been floating around for a while, I just updated the patches to apply on the latest boot-wrapper tree. Also I increased Xen's load address to accomodate for Dom0 kernels bigger than 16 MB.
For testing this just add: "--with-xen=/path/to/xen/xen/xen" to the ./configure command line and feed the resulting xen-system.axf file to the model.

Regards,

Quoted 18 lines

Cheers,
Andre.

Christoffer Dall (3):
Support for building in a Xen binary
Xen: Support adding DT nodes
Explicitly clean linux-system.axf and xen-system.axf

Ian Campbell (1):
Xen: Select correct dom0 console

  .gitignore    |  1 +
  Makefile.am   | 38 +++++++++++++++++++++++++-------------
  boot_common.c |  4 ++--
  configure.ac  | 26 +++++++++++++++++++++++++-
  model.lds.S   | 14 ++++++++++++++
  5 files changed, 67 insertions(+), 16 deletions(-)
Signature · 1 line
Julien Grall
Tested-by on the v1 series
#14 lore raw
In reply to Andre Przywara

Hi Andre,

Quoted 9 lines · Andre Przywara

These patches allow to include a Xen hypervisor binary into a boot-wrapper ELF file, so that a Foundation Platform or a Fast Model can boot a Xen system (including a Dom0 kernel).
This has been floating around for a while, I just updated the patches to apply on the latest boot-wrapper tree. Also I increased Xen's load address to accomodate for Dom0 kernels bigger than 16 MB.
For testing this just add: "--with-xen=/path/to/xen/xen/xen" to the ./configure command line and feed the resulting xen-system.axf file to the model.

Regards,

Quoted 18 lines

Cheers,
Andre.

Christoffer Dall (3):
Support for building in a Xen binary
Xen: Support adding DT nodes
Explicitly clean linux-system.axf and xen-system.axf

Ian Campbell (1):
Xen: Select correct dom0 console

  .gitignore    |  1 +
  Makefile.am   | 38 +++++++++++++++++++++++++-------------
  boot_common.c |  4 ++--
  configure.ac  | 26 +++++++++++++++++++++++++-
  model.lds.S   | 14 ++++++++++++++
  5 files changed, 67 insertions(+), 16 deletions(-)
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#15 lore raw

cover boot-wrapper: arm64: Xen support

In reply to Andre Przywara

Hi Andre,

Do you plan to send a new version of this series?

Cheers,

Quoted 28 lines · Andre Przywara

These patches allow to include a Xen hypervisor binary into a boot-wrapper ELF file, so that a Foundation Platform or a Fast Model can boot a Xen system (including a Dom0 kernel).
This has been floating around for a while, I just updated the patches to apply on the latest boot-wrapper tree. Also I increased Xen's load address to accomodate for Dom0 kernels bigger than 16 MB.
For testing this just add: "--with-xen=/path/to/xen/xen/xen" to the ./configure command line and feed the resulting xen-system.axf file to the model.

Cheers,
Andre.

Christoffer Dall (3):
Support for building in a Xen binary
Xen: Support adding DT nodes
Explicitly clean linux-system.axf and xen-system.axf

Ian Campbell (1):
Xen: Select correct dom0 console

 .gitignore    |  1 +
 Makefile.am   | 38 +++++++++++++++++++++++++-------------
 boot_common.c |  4 ++--
 configure.ac  | 26 +++++++++++++++++++++++++-
 model.lds.S   | 14 ++++++++++++++
 5 files changed, 67 insertions(+), 16 deletions(-)
Signature · 1 line
Julien Grall
#16 lore raw
In reply to Andre Przywara

Hi Andre,

Do you plan to send a new version of this series?

Cheers,

Quoted 28 lines · Andre Przywara

These patches allow to include a Xen hypervisor binary into a boot-wrapper ELF file, so that a Foundation Platform or a Fast Model can boot a Xen system (including a Dom0 kernel).
This has been floating around for a while, I just updated the patches to apply on the latest boot-wrapper tree. Also I increased Xen's load address to accomodate for Dom0 kernels bigger than 16 MB.
For testing this just add: "--with-xen=/path/to/xen/xen/xen" to the ./configure command line and feed the resulting xen-system.axf file to the model.

Cheers,
Andre.

Christoffer Dall (3):
Support for building in a Xen binary
Xen: Support adding DT nodes
Explicitly clean linux-system.axf and xen-system.axf

Ian Campbell (1):
Xen: Select correct dom0 console

 .gitignore    |  1 +
 Makefile.am   | 38 +++++++++++++++++++++++++-------------
 boot_common.c |  4 ++--
 configure.ac  | 26 +++++++++++++++++++++++++-
 model.lds.S   | 14 ++++++++++++++
 5 files changed, 67 insertions(+), 16 deletions(-)
Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel