xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Support for building in a Xen binary
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
@ 2016-06-20 15:09 ` Andre Przywara
  2016-07-12 10:40   ` Julien Grall
  2016-06-20 15:09 ` [PATCH 2/4] Xen: Support adding DT nodes Andre Przywara
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2016-06-20 15:09 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Jean-Philippe Brucker, Julien Grall, Christoffer Dall,
	Ian Campbell, xen-devel, linux-arm-kernel

From: Christoffer Dall <christoffer.dall@linaro.org>

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]

Cc: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .gitignore    |  1 +
 Makefile.am   | 12 ++++++++----
 boot_common.c |  4 ++--
 configure.ac  | 14 ++++++++++++++
 model.lds.S   | 14 ++++++++++++++
 5 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/.gitignore b/.gitignore
index 8653852..80770c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ configure
 dtc
 fdt.dtb
 Image
+Xen
 install-sh
 Makefile
 Makefile.in
diff --git a/Makefile.am b/Makefile.am
index 692d2cc..1a801c0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 $@ -
diff --git a/boot_common.c b/boot_common.c
index 4947fe3..e7b8e1d 100644
--- a/boot_common.c
+++ b/boot_common.c
@@ -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 {
diff --git a/configure.ac b/configure.ac
index ab8f5b3..2441f8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 ""
diff --git a/model.lds.S b/model.lds.S
index 51c5684..511f552 100644
--- a/model.lds.S
+++ b/model.lds.S
@@ -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
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH 2/4] Xen: Support adding DT nodes
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
  2016-06-20 15:09 ` [PATCH 1/4] Support for building in a Xen binary Andre Przywara
@ 2016-06-20 15:09 ` Andre Przywara
  2016-07-12 10:48   ` Julien Grall
  2016-06-20 15:09 ` [PATCH 3/4] Xen: Select correct dom0 console Andre Przywara
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2016-06-20 15:09 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Jean-Philippe Brucker, Julien Grall, Christoffer Dall,
	Ian Campbell, xen-devel, linux-arm-kernel

From: Christoffer Dall <christoffer.dall@linaro.org>

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.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Makefile.am  | 34 +++++++++++++++++++++-------------
 configure.ac |  9 +++++++++
 2 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1a801c0..d83b417 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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/
diff --git a/configure.ac b/configure.ac
index 2441f8b..b001939 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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 ""
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH 3/4] Xen: Select correct dom0 console
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
  2016-06-20 15:09 ` [PATCH 1/4] Support for building in a Xen binary Andre Przywara
  2016-06-20 15:09 ` [PATCH 2/4] Xen: Support adding DT nodes Andre Przywara
@ 2016-06-20 15:09 ` Andre Przywara
  2016-07-12 10:49   ` Julien Grall
  2016-06-20 15:09 ` [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf Andre Przywara
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2016-06-20 15:09 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Jean-Philippe Brucker, Julien Grall, Christoffer Dall,
	Ian Campbell, xen-devel, linux-arm-kernel

From: Ian Campbell <ian.campbell@citrix.com>

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

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b001939..f381a80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
                   ` (2 preceding siblings ...)
  2016-06-20 15:09 ` [PATCH 3/4] Xen: Select correct dom0 console Andre Przywara
@ 2016-06-20 15:09 ` Andre Przywara
  2016-07-12 10:58   ` Julien Grall
  2016-07-12 10:31 ` [PATCH 0/4] boot-wrapper: arm64: Xen support Julien Grall
  2016-08-16 18:01 ` Julien Grall
  5 siblings, 1 reply; 11+ messages in thread
From: Andre Przywara @ 2016-06-20 15:09 UTC (permalink / raw)
  To: Mark Rutland
  Cc: Jean-Philippe Brucker, Julien Grall, Christoffer Dall,
	Ian Campbell, xen-devel, linux-arm-kernel

From: Christoffer Dall <christoffer.dall@linaro.org>

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.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index d83b417..cd022e9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH 0/4] boot-wrapper: arm64: Xen support
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
                   ` (3 preceding siblings ...)
  2016-06-20 15:09 ` [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf Andre Przywara
@ 2016-07-12 10:31 ` Julien Grall
  2016-08-16 18:01 ` Julien Grall
  5 siblings, 0 replies; 11+ messages in thread
From: Julien Grall @ 2016-07-12 10:31 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andre,

On 20/06/16 16:09, Andre Przywara wrote:
> 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.

Tested-by: Julien Grall <julien.grall@arm.com>

Regards,

> 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(-)
>

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 1/4] Support for building in a Xen binary
  2016-06-20 15:09 ` [PATCH 1/4] Support for building in a Xen binary Andre Przywara
@ 2016-07-12 10:40   ` Julien Grall
  2016-07-15 10:12     ` Christoffer Dall
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Grall @ 2016-07-12 10:40 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andre,

On 20/06/16 16:09, Andre Przywara wrote:
> diff --git a/Makefile.am b/Makefile.am
> index 692d2cc..1a801c0 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -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)

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

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 2/4] Xen: Support adding DT nodes
  2016-06-20 15:09 ` [PATCH 2/4] Xen: Support adding DT nodes Andre Przywara
@ 2016-07-12 10:48   ` Julien Grall
  0 siblings, 0 replies; 11+ messages in thread
From: Julien Grall @ 2016-07-12 10:48 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andre,

On 20/06/16 16:09, Andre Przywara wrote:
> From: Christoffer Dall <christoffer.dall@linaro.org>
>
> 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.
>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>   Makefile.am  | 34 +++++++++++++++++++++-------------
>   configure.ac |  9 +++++++++
>   2 files changed, 30 insertions(+), 13 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 1a801c0..d83b417 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -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.

> +		   \#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

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

>
>   CPPFLAGS	+= $(INITRD_FLAGS)
>   CFLAGS		+= -Iinclude/ -I$(ARCH_SRC)/include/
> diff --git a/configure.ac b/configure.ac
> index 2441f8b..b001939 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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.

> +	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".

> +fi
>   echo ""
>

Regards,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 3/4] Xen: Select correct dom0 console
  2016-06-20 15:09 ` [PATCH 3/4] Xen: Select correct dom0 console Andre Przywara
@ 2016-07-12 10:49   ` Julien Grall
  0 siblings, 0 replies; 11+ messages in thread
From: Julien Grall @ 2016-07-12 10:49 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andrew,

On 20/06/16 16:09, Andre Przywara wrote:
> From: Ian Campbell <ian.campbell@citrix.com>
>
> If Xen is enabled, tell Dom0 to use the 'hvc0' console, and fall back to
> the usual ttyAMA0 otherwise.
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Julien Grall <julien.grall@arm.com>

Regards,

> ---
>   configure.ac | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configure.ac b/configure.ac
> index b001939..f381a80 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -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])
>

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf
  2016-06-20 15:09 ` [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf Andre Przywara
@ 2016-07-12 10:58   ` Julien Grall
  0 siblings, 0 replies; 11+ messages in thread
From: Julien Grall @ 2016-07-12 10:58 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andre,

On 20/06/16 16:09, Andre Przywara wrote:
> From: Christoffer Dall <christoffer.dall@linaro.org>
>
> 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.
>
> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Reviewed-by: Julien Grall <julien.grall@arm.com>

Regards,

> ---
>   Makefile.am | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index d83b417..cd022e9 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -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
>

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 1/4] Support for building in a Xen binary
  2016-07-12 10:40   ` Julien Grall
@ 2016-07-15 10:12     ` Christoffer Dall
  0 siblings, 0 replies; 11+ messages in thread
From: Christoffer Dall @ 2016-07-15 10:12 UTC (permalink / raw)
  To: Julien Grall
  Cc: Mark Rutland, Jean-Philippe Brucker, Andre Przywara,
	Ian Campbell, xen-devel, linux-arm-kernel

On Tue, Jul 12, 2016 at 11:40:28AM +0100, Julien Grall wrote:
> Hi Andre,
> 
> On 20/06/16 16:09, Andre Przywara wrote:
> >diff --git a/Makefile.am b/Makefile.am
> >index 692d2cc..1a801c0 100644
> >--- a/Makefile.am
> >+++ b/Makefile.am
> >@@ -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)
> 
> 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
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

* Re: [PATCH 0/4] boot-wrapper: arm64: Xen support
       [not found] <20160620150934.1729-1-andre.przywara@arm.com>
                   ` (4 preceding siblings ...)
  2016-07-12 10:31 ` [PATCH 0/4] boot-wrapper: arm64: Xen support Julien Grall
@ 2016-08-16 18:01 ` Julien Grall
  5 siblings, 0 replies; 11+ messages in thread
From: Julien Grall @ 2016-08-16 18:01 UTC (permalink / raw)
  To: Andre Przywara, Mark Rutland
  Cc: Jean-Philippe Brucker, xen-devel, linux-arm-kernel,
	Christoffer Dall, Ian Campbell

Hi Andre,

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

Cheers,

On 20/06/2016 16:09, Andre Przywara wrote:
> 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(-)
>

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

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

end of thread, other threads:[~2016-08-16 18:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20160620150934.1729-1-andre.przywara@arm.com>
2016-06-20 15:09 ` [PATCH 1/4] Support for building in a Xen binary Andre Przywara
2016-07-12 10:40   ` Julien Grall
2016-07-15 10:12     ` Christoffer Dall
2016-06-20 15:09 ` [PATCH 2/4] Xen: Support adding DT nodes Andre Przywara
2016-07-12 10:48   ` Julien Grall
2016-06-20 15:09 ` [PATCH 3/4] Xen: Select correct dom0 console Andre Przywara
2016-07-12 10:49   ` Julien Grall
2016-06-20 15:09 ` [PATCH 4/4] Explicitly clean linux-system.axf and xen-system.axf Andre Przywara
2016-07-12 10:58   ` Julien Grall
2016-07-12 10:31 ` [PATCH 0/4] boot-wrapper: arm64: Xen support Julien Grall
2016-08-16 18:01 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).