All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package
@ 2020-07-12 16:34 Romain Naour
  2020-07-12 16:34 ` [Buildroot] [PATCH 2/4] board/qemu/aarch64-virt/linux.config: enable ACPI Romain Naour
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Romain Naour @ 2020-07-12 16:34 UTC (permalink / raw)
  To: buildroot

Linaro provide pre-built versions of the binary firmware images of
UEFI [1] based on the TianoCore edk2 project [2].

The qemu_aarch64_virt_defconfig will be updated by a follow up commit to
use those firmware to test Aarch64 efi system under Qemu.

Building edk2 firmware from source require to build edk2 package for
the host using a script based buildsystem. Instead we use firmware
provided by Linaro to avoid the maintainance burden.
There is a limited added value to build them just for Qemu testing
purpose.

Building edk2 firmware could be intersting for secure boot or for
other target than Qemu.

We need to package the edk2 Aarch64 and ARM firmware in two separate
packages since the downloaded files are using the same name
(QEMU_EFI.fd and QEMU_VARS.fd). The ARM firmware will be added by
a follow up patch.

[1] http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/
[2] https://github.com/tianocore/edk2

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 DEVELOPERS                                    |  1 +
 package/Config.in.host                        |  1 +
 package/edk2-aarch64-bin/Config.in.host       | 12 ++++++++++
 .../edk2-aarch64-bin/edk2-aarch64-bin.hash    |  3 +++
 package/edk2-aarch64-bin/edk2-aarch64-bin.mk  | 24 +++++++++++++++++++
 5 files changed, 41 insertions(+)
 create mode 100644 package/edk2-aarch64-bin/Config.in.host
 create mode 100644 package/edk2-aarch64-bin/edk2-aarch64-bin.hash
 create mode 100644 package/edk2-aarch64-bin/edk2-aarch64-bin.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index ed9f1388a3..0cb76226bb 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2191,6 +2191,7 @@ F:	package/binutils/
 F:	package/bullet/
 F:	package/clang/
 F:	package/clinfo/
+F:	package/edk2-aarch64-bin/
 F:	package/efl/
 F:	package/enet/
 F:	package/enlightenment/
diff --git a/package/Config.in.host b/package/Config.in.host
index 647fc24841..28ccc33037 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -18,6 +18,7 @@ menu "Host utilities"
 	source "package/dtc/Config.in.host"
 	source "package/e2fsprogs/Config.in.host"
 	source "package/e2tools/Config.in.host"
+	source "package/edk2-aarch64-bin/Config.in.host"
 	source "package/erofs-utils/Config.in.host"
 	source "package/eudev/Config.in.host"
 	source "package/exfatprogs/Config.in.host"
diff --git a/package/edk2-aarch64-bin/Config.in.host b/package/edk2-aarch64-bin/Config.in.host
new file mode 100644
index 0000000000..b4ec08cb48
--- /dev/null
+++ b/package/edk2-aarch64-bin/Config.in.host
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_EDK2_AARCH64_BIN
+	bool "host-edk2-aarch64-bin"
+	depends on BR2_aarch64
+	help
+	  This package will install pre-built versions of the binary
+	  firmware images of UEFI based on the TianoCore project.
+
+	  This image is intended to be used by host-qemu to boot UEFI
+	  images for Aarch64 target.
+
+	  https://github.com/tianocore/edk2
+	  http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/
diff --git a/package/edk2-aarch64-bin/edk2-aarch64-bin.hash b/package/edk2-aarch64-bin/edk2-aarch64-bin.hash
new file mode 100644
index 0000000000..3166b09dae
--- /dev/null
+++ b/package/edk2-aarch64-bin/edk2-aarch64-bin.hash
@@ -0,0 +1,3 @@
+# From http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-aarch64/SHA256SUMS
+sha256  43301ef5f620945a082c5f47ae933e154e0cff0976ed22a8cff66033020f6020  QEMU_EFI.fd
+sha256  8b634c1e6bd11607850b69111f6c4dbd1583dbbd1460dac72dbacbdc1a4a130a  QEMU_VARS.fd
diff --git a/package/edk2-aarch64-bin/edk2-aarch64-bin.mk b/package/edk2-aarch64-bin/edk2-aarch64-bin.mk
new file mode 100644
index 0000000000..78818cdc81
--- /dev/null
+++ b/package/edk2-aarch64-bin/edk2-aarch64-bin.mk
@@ -0,0 +1,24 @@
+################################################################################
+#
+# edk2-aarch64-bin
+#
+################################################################################
+
+EDK2_AARCH64_BIN_VERSION = 19.03
+EDK2_AARCH64_BIN_SITE = http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/$(EDK2_AARCH64_BIN_VERSION)/release/qemu-aarch64
+EDK2_AARCH64_BIN_LICENSE = BSD-2-Clause (edk2), ISC (uefi-tools), BSD-3-Clause (ATF)
+
+HOST_EDK2_AARCH64_BIN_SOURCE = QEMU_EFI.fd
+HOST_EDK2_AARCH64_BIN_EXTRA_DOWNLOADS = $(EDK2_AARCH64_BIN_SITE)/QEMU_VARS.fd
+
+define HOST_EDK2_AARCH64_BIN_EXTRACT_CMDS
+	cp $(HOST_EDK2_AARCH64_BIN_DL_DIR)/QEMU_EFI.fd $(@D)/QEMU_EFI.fd
+	cp $(HOST_EDK2_AARCH64_BIN_DL_DIR)/QEMU_VARS.fd $(@D)/QEMU_VARS.fd
+endef
+
+define HOST_EDK2_AARCH64_BIN_INSTALL_CMDS
+	$(INSTALL) -D -m 644 $(@D)/QEMU_EFI.fd $(HOST_DIR)/usr/share/edk2/aarch64/QEMU_EFI.fd
+	$(INSTALL) -D -m 644 $(@D)/QEMU_VARS.fd $(HOST_DIR)/usr/share/edk2/aarch64/QEMU_VARS.fd
+endef
+
+$(eval $(host-generic-package))
-- 
2.25.4

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

* [Buildroot] [PATCH 2/4] board/qemu/aarch64-virt/linux.config: enable ACPI
  2020-07-12 16:34 [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Romain Naour
@ 2020-07-12 16:34 ` Romain Naour
  2020-07-12 16:34 ` [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi Romain Naour
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Romain Naour @ 2020-07-12 16:34 UTC (permalink / raw)
  To: buildroot

The Qemu aarch64 support ACPI Generic Event Device (GED) for device memory
cold/hot plug with ACPI boot [1].

ACPI support is required to allow booting the kernel in efi mode with
grub bootloader.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=cff51ac978c4fa0b3d0de0fd62d772d9003f123e

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 board/qemu/aarch64-virt/linux.config | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/qemu/aarch64-virt/linux.config b/board/qemu/aarch64-virt/linux.config
index 02e0812ffd..657acaf04f 100644
--- a/board/qemu/aarch64-virt/linux.config
+++ b/board/qemu/aarch64-virt/linux.config
@@ -9,6 +9,7 @@ CONFIG_ARCH_VEXPRESS=y
 CONFIG_COMPAT=y
 CONFIG_FW_CFG_SYSFS=y
 CONFIG_FW_CFG_SYSFS_CMDLINE=y
+CONFIG_ACPI=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_BLK_DEV_BSGLIB=y
-- 
2.25.4

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

* [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi
  2020-07-12 16:34 [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Romain Naour
  2020-07-12 16:34 ` [Buildroot] [PATCH 2/4] board/qemu/aarch64-virt/linux.config: enable ACPI Romain Naour
@ 2020-07-12 16:34 ` Romain Naour
  2020-07-12 19:28   ` Thomas Petazzoni
  2020-07-12 16:34 ` [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug Romain Naour
  2021-05-17 16:23 ` [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Yann E. MORIN
  3 siblings, 1 reply; 9+ messages in thread
From: Romain Naour @ 2020-07-12 16:34 UTC (permalink / raw)
  To: buildroot

The current qemu_aarch64_virt_defconfig boot with just the kernel, so ACPI
tables are missing and the plug and play support is disabled.

dmesg:
ACPI: Interpreter disabled.
[...]
pnp: PnP ACPI: disabled

The ACPI support is already available in the kernel defconfig, the
memory hotplug support will be added by the next patch.

Borrow the post image script, genimage and bootloader configuration from
aarch64_efi_defconfig to build the disk image used to boot the system
in efi mode.

As a side effect, the bootloader grub2 is now runtime tested in the
Buildroot gitlab-ci while testing this defconfig.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 board/qemu/aarch64-virt/genimage-efi.cfg  | 30 +++++++++++++++++++++++
 board/qemu/aarch64-virt/grub.cfg          |  6 +++++
 board/qemu/aarch64-virt/post-image-efi.sh | 11 +++++++++
 board/qemu/aarch64-virt/readme.txt        |  2 +-
 configs/qemu_aarch64_virt_defconfig       | 19 +++++++++++++-
 5 files changed, 66 insertions(+), 2 deletions(-)
 create mode 100644 board/qemu/aarch64-virt/genimage-efi.cfg
 create mode 100644 board/qemu/aarch64-virt/grub.cfg
 create mode 100755 board/qemu/aarch64-virt/post-image-efi.sh

diff --git a/board/qemu/aarch64-virt/genimage-efi.cfg b/board/qemu/aarch64-virt/genimage-efi.cfg
new file mode 100644
index 0000000000..f93ab9d64f
--- /dev/null
+++ b/board/qemu/aarch64-virt/genimage-efi.cfg
@@ -0,0 +1,30 @@
+image efi-part.vfat {
+  vfat {
+    file startup.nsh {
+      image = "efi-part/startup.nsh"
+    }
+    file EFI {
+      image = "efi-part/EFI"
+    }
+    file Image {
+      image = "Image"
+    }
+  }
+  size = 32M
+}
+
+image disk.img {
+
+  hdimage {
+  }
+
+  partition boot {
+    partition-type = 0xEF
+    image = "efi-part.vfat"
+  }
+
+  partition root {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+  }
+}
diff --git a/board/qemu/aarch64-virt/grub.cfg b/board/qemu/aarch64-virt/grub.cfg
new file mode 100644
index 0000000000..ab88da91b9
--- /dev/null
+++ b/board/qemu/aarch64-virt/grub.cfg
@@ -0,0 +1,6 @@
+set default="0"
+set timeout="5"
+
+menuentry "Buildroot" {
+	linux /Image root=/dev/vda2 rootwait console=ttyAMA0
+}
diff --git a/board/qemu/aarch64-virt/post-image-efi.sh b/board/qemu/aarch64-virt/post-image-efi.sh
new file mode 100755
index 0000000000..d781f3368e
--- /dev/null
+++ b/board/qemu/aarch64-virt/post-image-efi.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+BOARD_DIR="$(dirname $0)"
+
+cp -f ${BOARD_DIR}/grub.cfg ${BINARIES_DIR}/efi-part/EFI/BOOT/grub.cfg
+
+support/scripts/genimage.sh -c "${BOARD_DIR}/genimage-efi.cfg"
+
+cp ${HOST_DIR}/usr/share/edk2/aarch64/QEMU_EFI.fd ${BINARIES_DIR}/QEMU_EFI.fd
diff --git a/board/qemu/aarch64-virt/readme.txt b/board/qemu/aarch64-virt/readme.txt
index db35a3a7a8..53df3f4380 100644
--- a/board/qemu/aarch64-virt/readme.txt
+++ b/board/qemu/aarch64-virt/readme.txt
@@ -1,5 +1,5 @@
 Run the emulation with:
 
-  qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -smp 1 -kernel output/images/Image -append "rootwait root=/dev/vda console=ttyAMA0" -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/rootfs.ext4,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig
+  qemu-system-aarch64 -M virt -m 512 -cpu cortex-a53 -nographic -smp 1 -bios output/images/QEMU_EFI.fd -netdev user,id=eth0 -device virtio-net-device,netdev=eth0 -drive file=output/images/disk.img,if=none,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 # qemu_aarch64_virt_defconfig
 
 The login prompt will appear in the terminal that started Qemu.
diff --git a/configs/qemu_aarch64_virt_defconfig b/configs/qemu_aarch64_virt_defconfig
index 9f22987694..6901da505d 100644
--- a/configs/qemu_aarch64_virt_defconfig
+++ b/configs/qemu_aarch64_virt_defconfig
@@ -2,17 +2,30 @@
 BR2_aarch64=y
 BR2_cortex_a53=y
 
+# Toolchain, required for eudev and grub
+BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
+
 # System
 BR2_SYSTEM_DHCP="eth0"
 BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
+
+## Required tools to create bootable media
+BR2_PACKAGE_HOST_GENIMAGE=y
+
+# Bootloader
+BR2_TARGET_GRUB2=y
+BR2_TARGET_GRUB2_ARM64_EFI=y
+BR2_PACKAGE_HOST_EDK2_AARCH64_BIN=y
 
 # Filesystem
 BR2_TARGET_ROOTFS_EXT2=y
 BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="200M"
 # BR2_TARGET_ROOTFS_TAR is not set
 
 # Image
-BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh board/qemu/aarch64-virt/post-image-efi.sh"
 BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
 
 # Linux headers same as kernel, a 5.4 series
@@ -26,6 +39,10 @@ BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
 BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
 
+# Host tools for genimage
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_MTOOLS=y
+
 # host-qemu for gitlab testing
 BR2_PACKAGE_HOST_QEMU=y
 BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y
-- 
2.25.4

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

* [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug
  2020-07-12 16:34 [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Romain Naour
  2020-07-12 16:34 ` [Buildroot] [PATCH 2/4] board/qemu/aarch64-virt/linux.config: enable ACPI Romain Naour
  2020-07-12 16:34 ` [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi Romain Naour
@ 2020-07-12 16:34 ` Romain Naour
  2020-07-12 19:27   ` Thomas Petazzoni
  2021-05-17 16:23 ` [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Yann E. MORIN
  3 siblings, 1 reply; 9+ messages in thread
From: Romain Naour @ 2020-07-12 16:34 UTC (permalink / raw)
  To: buildroot

To test memory hotplug [1], add -m 1G,slots=3,maxmem=4G to the qemu command
line, boot the system and enter the following command in the Qemu monitor
to add another 1GB to the guest:
(use ctrl+a c to switch from the serial port and Qemu monitor):

   (qemu) object_add memory-backend-ram,id=mem1,size=1G
   (qemu) device_add pc-dimm,id=dimm1,memdev=mem1

[1] https://git.qemu.org/?p=qemu.git;a=blob;f=docs/memory-hotplug.txt;h=6aa5e17e26090f619787de7b71888093fb9d0117;hb=fdd76fecdde1ad444ff4deb7f1c4f7e4a1ef97d6#l9

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 board/qemu/aarch64-virt/linux.config | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/board/qemu/aarch64-virt/linux.config b/board/qemu/aarch64-virt/linux.config
index 657acaf04f..b81d78349b 100644
--- a/board/qemu/aarch64-virt/linux.config
+++ b/board/qemu/aarch64-virt/linux.config
@@ -10,10 +10,13 @@ CONFIG_COMPAT=y
 CONFIG_FW_CFG_SYSFS=y
 CONFIG_FW_CFG_SYSFS_CMDLINE=y
 CONFIG_ACPI=y
+CONFIG_ACPI_HOTPLUG_MEMORY=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_BLK_DEV_BSGLIB=y
 CONFIG_BINFMT_MISC=y
+CONFIG_MEMORY_HOTPLUG=y
+CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
 CONFIG_NET=y
 CONFIG_PACKET=y
@@ -27,6 +30,8 @@ CONFIG_BRIDGE=m
 CONFIG_NET_SCHED=y
 CONFIG_VSOCKETS=y
 CONFIG_PCI=y
+CONFIG_HOTPLUG_PCI=y
+CONFIG_HOTPLUG_PCI_ACPI=y
 CONFIG_PCI_HOST_GENERIC=y
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
-- 
2.25.4

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

* [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug
  2020-07-12 16:34 ` [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug Romain Naour
@ 2020-07-12 19:27   ` Thomas Petazzoni
  2020-07-13 21:24     ` Romain Naour
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2020-07-12 19:27 UTC (permalink / raw)
  To: buildroot

On Sun, 12 Jul 2020 18:34:22 +0200
Romain Naour <romain.naour@gmail.com> wrote:

> To test memory hotplug [1], add -m 1G,slots=3,maxmem=4G to the qemu command
> line, boot the system and enter the following command in the Qemu monitor
> to add another 1GB to the guest:
> (use ctrl+a c to switch from the serial port and Qemu monitor):
> 
>    (qemu) object_add memory-backend-ram,id=mem1,size=1G
>    (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
> 
> [1] https://git.qemu.org/?p=qemu.git;a=blob;f=docs/memory-hotplug.txt;h=6aa5e17e26090f619787de7b71888093fb9d0117;hb=fdd76fecdde1ad444ff4deb7f1c4f7e4a1ef97d6#l9
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>

Is this really something we want to enable in a defconfig ? It feels
like a very advanced/specific feature, not really relevant for a
demo/test defconfig IMO.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi
  2020-07-12 16:34 ` [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi Romain Naour
@ 2020-07-12 19:28   ` Thomas Petazzoni
  2020-07-13 21:21     ` Romain Naour
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Petazzoni @ 2020-07-12 19:28 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 12 Jul 2020 18:34:21 +0200
Romain Naour <romain.naour@gmail.com> wrote:

> The current qemu_aarch64_virt_defconfig boot with just the kernel, so ACPI
> tables are missing and the plug and play support is disabled.
> 
> dmesg:
> ACPI: Interpreter disabled.
> [...]
> pnp: PnP ACPI: disabled
> 
> The ACPI support is already available in the kernel defconfig, the
> memory hotplug support will be added by the next patch.
> 
> Borrow the post image script, genimage and bootloader configuration from
> aarch64_efi_defconfig to build the disk image used to boot the system
> in efi mode.
> 
> As a side effect, the bootloader grub2 is now runtime tested in the
> Buildroot gitlab-ci while testing this defconfig.
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>

But isn't this making qemu_aarch64_virt_defconfig too similar to
aarch64_efi_defconfig ?

Shouldn't we keep qemu_aarch64_virt_defconfig as-is, and simply add
runtime testing for aarch64_efi_defconfig ?

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi
  2020-07-12 19:28   ` Thomas Petazzoni
@ 2020-07-13 21:21     ` Romain Naour
  0 siblings, 0 replies; 9+ messages in thread
From: Romain Naour @ 2020-07-13 21:21 UTC (permalink / raw)
  To: buildroot

Hello Thomas,

Le 12/07/2020 ? 21:28, Thomas Petazzoni a ?crit?:
> Hello,
> 
> On Sun, 12 Jul 2020 18:34:21 +0200
> Romain Naour <romain.naour@gmail.com> wrote:
> 
>> The current qemu_aarch64_virt_defconfig boot with just the kernel, so ACPI
>> tables are missing and the plug and play support is disabled.
>>
>> dmesg:
>> ACPI: Interpreter disabled.
>> [...]
>> pnp: PnP ACPI: disabled
>>
>> The ACPI support is already available in the kernel defconfig, the
>> memory hotplug support will be added by the next patch.
>>
>> Borrow the post image script, genimage and bootloader configuration from
>> aarch64_efi_defconfig to build the disk image used to boot the system
>> in efi mode.
>>
>> As a side effect, the bootloader grub2 is now runtime tested in the
>> Buildroot gitlab-ci while testing this defconfig.
>>
>> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> 
> But isn't this making qemu_aarch64_virt_defconfig too similar to
> aarch64_efi_defconfig ?

Well, that why I suggested to merge the two defconfig. But I'm fine having two
defconfig for different purpose.

> 
> Shouldn't we keep qemu_aarch64_virt_defconfig as-is, and simply add
> runtime testing for aarch64_efi_defconfig ?

I would like to continue enabling features in the qemu_aarch64_virt_defconfig
and some of them require ACPI support. That is why I borrowed the post-image
script, grub defconfig from aarch64_efi_defconfig and packaged the edk2-bin.

If we start enabling qemu runtime testing for other defconfig that the one named
qemu_* we could continue (for example) test the nitrogen6x_defconfig with
qemu-system-arm -M sabrelite. This can be interesting :)

For now, I would like to focus on qemu_* defconfigs.

Best regards,
Romain

> 
> Thomas
> 

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

* [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug
  2020-07-12 19:27   ` Thomas Petazzoni
@ 2020-07-13 21:24     ` Romain Naour
  0 siblings, 0 replies; 9+ messages in thread
From: Romain Naour @ 2020-07-13 21:24 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

Le 12/07/2020 ? 21:27, Thomas Petazzoni a ?crit?:
> On Sun, 12 Jul 2020 18:34:22 +0200
> Romain Naour <romain.naour@gmail.com> wrote:
> 
>> To test memory hotplug [1], add -m 1G,slots=3,maxmem=4G to the qemu command
>> line, boot the system and enter the following command in the Qemu monitor
>> to add another 1GB to the guest:
>> (use ctrl+a c to switch from the serial port and Qemu monitor):
>>
>>    (qemu) object_add memory-backend-ram,id=mem1,size=1G
>>    (qemu) device_add pc-dimm,id=dimm1,memdev=mem1
>>
>> [1] https://git.qemu.org/?p=qemu.git;a=blob;f=docs/memory-hotplug.txt;h=6aa5e17e26090f619787de7b71888093fb9d0117;hb=fdd76fecdde1ad444ff4deb7f1c4f7e4a1ef97d6#l9
>>
>> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> 
> Is this really something we want to enable in a defconfig ? It feels
> like a very advanced/specific feature, not really relevant for a
> demo/test defconfig IMO.

We just the required kernel options need for memory hot-plug, the Qemu command
line in the readme.txt is keep as is.

Best regards,
Romain

> 
> Thomas
> 

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

* [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package
  2020-07-12 16:34 [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Romain Naour
                   ` (2 preceding siblings ...)
  2020-07-12 16:34 ` [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug Romain Naour
@ 2021-05-17 16:23 ` Yann E. MORIN
  3 siblings, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2021-05-17 16:23 UTC (permalink / raw)
  To: buildroot

Romain, All,

Thanks for this series.

Since then, Dick has submitted the support needed to build edk2 from
source, and this has just been merged into the next branch now:
    https://git.buildroot.org/buildroot/commit/?id=1074a37e783b

As such, and as discussed on IRC, I believe this old patchset of yours
is no longer required, so I marked it superseded on patchwork. Thanks
for your initial work on this and your feedback! :-)

Regards,
Yann E. MORIN.

On 2020-07-12 18:34 +0200, Romain Naour spake thusly:
> Linaro provide pre-built versions of the binary firmware images of
> UEFI [1] based on the TianoCore edk2 project [2].
> 
> The qemu_aarch64_virt_defconfig will be updated by a follow up commit to
> use those firmware to test Aarch64 efi system under Qemu.
> 
> Building edk2 firmware from source require to build edk2 package for
> the host using a script based buildsystem. Instead we use firmware
> provided by Linaro to avoid the maintainance burden.
> There is a limited added value to build them just for Qemu testing
> purpose.
> 
> Building edk2 firmware could be intersting for secure boot or for
> other target than Qemu.
> 
> We need to package the edk2 Aarch64 and ARM firmware in two separate
> packages since the downloaded files are using the same name
> (QEMU_EFI.fd and QEMU_VARS.fd). The ARM firmware will be added by
> a follow up patch.
> 
> [1] http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/
> [2] https://github.com/tianocore/edk2
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
>  DEVELOPERS                                    |  1 +
>  package/Config.in.host                        |  1 +
>  package/edk2-aarch64-bin/Config.in.host       | 12 ++++++++++
>  .../edk2-aarch64-bin/edk2-aarch64-bin.hash    |  3 +++
>  package/edk2-aarch64-bin/edk2-aarch64-bin.mk  | 24 +++++++++++++++++++
>  5 files changed, 41 insertions(+)
>  create mode 100644 package/edk2-aarch64-bin/Config.in.host
>  create mode 100644 package/edk2-aarch64-bin/edk2-aarch64-bin.hash
>  create mode 100644 package/edk2-aarch64-bin/edk2-aarch64-bin.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index ed9f1388a3..0cb76226bb 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2191,6 +2191,7 @@ F:	package/binutils/
>  F:	package/bullet/
>  F:	package/clang/
>  F:	package/clinfo/
> +F:	package/edk2-aarch64-bin/
>  F:	package/efl/
>  F:	package/enet/
>  F:	package/enlightenment/
> diff --git a/package/Config.in.host b/package/Config.in.host
> index 647fc24841..28ccc33037 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -18,6 +18,7 @@ menu "Host utilities"
>  	source "package/dtc/Config.in.host"
>  	source "package/e2fsprogs/Config.in.host"
>  	source "package/e2tools/Config.in.host"
> +	source "package/edk2-aarch64-bin/Config.in.host"
>  	source "package/erofs-utils/Config.in.host"
>  	source "package/eudev/Config.in.host"
>  	source "package/exfatprogs/Config.in.host"
> diff --git a/package/edk2-aarch64-bin/Config.in.host b/package/edk2-aarch64-bin/Config.in.host
> new file mode 100644
> index 0000000000..b4ec08cb48
> --- /dev/null
> +++ b/package/edk2-aarch64-bin/Config.in.host
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_HOST_EDK2_AARCH64_BIN
> +	bool "host-edk2-aarch64-bin"
> +	depends on BR2_aarch64
> +	help
> +	  This package will install pre-built versions of the binary
> +	  firmware images of UEFI based on the TianoCore project.
> +
> +	  This image is intended to be used by host-qemu to boot UEFI
> +	  images for Aarch64 target.
> +
> +	  https://github.com/tianocore/edk2
> +	  http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/
> diff --git a/package/edk2-aarch64-bin/edk2-aarch64-bin.hash b/package/edk2-aarch64-bin/edk2-aarch64-bin.hash
> new file mode 100644
> index 0000000000..3166b09dae
> --- /dev/null
> +++ b/package/edk2-aarch64-bin/edk2-aarch64-bin.hash
> @@ -0,0 +1,3 @@
> +# From http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-aarch64/SHA256SUMS
> +sha256  43301ef5f620945a082c5f47ae933e154e0cff0976ed22a8cff66033020f6020  QEMU_EFI.fd
> +sha256  8b634c1e6bd11607850b69111f6c4dbd1583dbbd1460dac72dbacbdc1a4a130a  QEMU_VARS.fd
> diff --git a/package/edk2-aarch64-bin/edk2-aarch64-bin.mk b/package/edk2-aarch64-bin/edk2-aarch64-bin.mk
> new file mode 100644
> index 0000000000..78818cdc81
> --- /dev/null
> +++ b/package/edk2-aarch64-bin/edk2-aarch64-bin.mk
> @@ -0,0 +1,24 @@
> +################################################################################
> +#
> +# edk2-aarch64-bin
> +#
> +################################################################################
> +
> +EDK2_AARCH64_BIN_VERSION = 19.03
> +EDK2_AARCH64_BIN_SITE = http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/$(EDK2_AARCH64_BIN_VERSION)/release/qemu-aarch64
> +EDK2_AARCH64_BIN_LICENSE = BSD-2-Clause (edk2), ISC (uefi-tools), BSD-3-Clause (ATF)
> +
> +HOST_EDK2_AARCH64_BIN_SOURCE = QEMU_EFI.fd
> +HOST_EDK2_AARCH64_BIN_EXTRA_DOWNLOADS = $(EDK2_AARCH64_BIN_SITE)/QEMU_VARS.fd
> +
> +define HOST_EDK2_AARCH64_BIN_EXTRACT_CMDS
> +	cp $(HOST_EDK2_AARCH64_BIN_DL_DIR)/QEMU_EFI.fd $(@D)/QEMU_EFI.fd
> +	cp $(HOST_EDK2_AARCH64_BIN_DL_DIR)/QEMU_VARS.fd $(@D)/QEMU_VARS.fd
> +endef
> +
> +define HOST_EDK2_AARCH64_BIN_INSTALL_CMDS
> +	$(INSTALL) -D -m 644 $(@D)/QEMU_EFI.fd $(HOST_DIR)/usr/share/edk2/aarch64/QEMU_EFI.fd
> +	$(INSTALL) -D -m 644 $(@D)/QEMU_VARS.fd $(HOST_DIR)/usr/share/edk2/aarch64/QEMU_VARS.fd
> +endef
> +
> +$(eval $(host-generic-package))
> -- 
> 2.25.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2021-05-17 16:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 16:34 [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Romain Naour
2020-07-12 16:34 ` [Buildroot] [PATCH 2/4] board/qemu/aarch64-virt/linux.config: enable ACPI Romain Naour
2020-07-12 16:34 ` [Buildroot] [PATCH 3/4] configs/qemu_aarch64_virt_defconfig: boot with grub bootloader with efi Romain Naour
2020-07-12 19:28   ` Thomas Petazzoni
2020-07-13 21:21     ` Romain Naour
2020-07-12 16:34 ` [Buildroot] [PATCH 4/4] board/qemu/aarch64-virt/linux.config: enable memory hotplug Romain Naour
2020-07-12 19:27   ` Thomas Petazzoni
2020-07-13 21:24     ` Romain Naour
2021-05-17 16:23 ` [Buildroot] [PATCH 1/4] package/edk2-aarch64-bin: new package Yann E. MORIN

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.