All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule
@ 2019-01-18 22:33 Laszlo Ersek
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:33 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

Igor's series

  [Qemu-devel] [PATCH 00/14] tests: acpi: add UEFI (ARM) testing support
  http://mid.mail-archive.com/1547566866-129386-1-git-send-email-imammedo@redhat.com

worked with my edk2 (guest firmware) series

  [edk2] [PATCH 0/4] OvmfPkg, ArmVirtPkg: add ACPI Test Support
  http://mid.mail-archive.com/20181125100152.25675-1-lersek@redhat.com

as long as the guest firmware was built with the necessary extra build
flag.

However, in the discussion under Igor's series, we seemed to reconsider
a standalone UEFI application for the QEMU tree to carry. This series
seeks to implement that option.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>

Thanks,
Laszlo

Laszlo Ersek (5):
  roms: add the edk2 project as a git submodule
  roms: build the EfiRom utility from the roms/edk2 submodule
  tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app
  tests/uefi-test-tools: add build scripts
  tests/data: introduce "uefi-boot-images" with the "bios-tables-test"
    ISOs

 .gitmodules                                                              |   3 +
 Makefile                                                                 |   6 +-
 roms/Makefile                                                            |  13 +-
 roms/edk2                                                                |   1 +
 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2           | Bin 0 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2               | Bin 0 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2              | Bin 0 -> 12800 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2            | Bin 0 -> 13312 bytes
 tests/uefi-test-tools/.gitignore                                         |   3 +
 tests/uefi-test-tools/LICENSE                                            |  25 ++++
 tests/uefi-test-tools/Makefile                                           |  92 +++++++++++++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 130 ++++++++++++++++++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  41 ++++++
 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  67 +++++++++
 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec              |  27 ++++
 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc              |  69 ++++++++++
 tests/uefi-test-tools/build.sh                                           | 145 ++++++++++++++++++++
 17 files changed, 614 insertions(+), 8 deletions(-)
 create mode 160000 roms/edk2
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2
 create mode 100644 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2
 create mode 100644 tests/uefi-test-tools/.gitignore
 create mode 100644 tests/uefi-test-tools/LICENSE
 create mode 100644 tests/uefi-test-tools/Makefile
 create mode 100644 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
 create mode 100644 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
 create mode 100644 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
 create mode 100644 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec
 create mode 100644 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc
 create mode 100755 tests/uefi-test-tools/build.sh

-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
@ 2019-01-18 22:33 ` Laszlo Ersek
  2019-01-21  7:35   ` Gerd Hoffmann
  2019-01-21 11:25   ` Philippe Mathieu-Daudé
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule Laszlo Ersek
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:33 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

The roms/edk2 submodule can help with three goals:
- build the OVMF and ArmVirtQemu virtual UEFI firmware platforms (to be
  implemented later),
- build the EfiRom tool on the fly, which is used in roms/Makefile, for
  building the "efirom" target,
- build UEFI test applications (to be run in guests), for qtest support.

Edk2 commit 85588389222a3636baf0f9ed8227f2434af4c3f9 stands for the latest
"stable tag", namely "edk2-stable201811".

The edk2 repository tracks some binary files that should not be removed by
QEMU's top-level "make clean"; exempt the full pathnames from the "find"
command.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 Makefile    | 6 +++++-
 .gitmodules | 3 +++
 roms/edk2   | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index dccba1dca27f..1f768e2bcf8f 100644
--- a/Makefile
+++ b/Makefile
@@ -602,7 +602,11 @@ clean:
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
 	rm -f *.msi
-	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
+	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
+		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
+		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
+		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
+		-exec rm {} +
 	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
 	rm -f fsdev/*.pod scsi/*.pod
 	rm -f qemu-img-cmds.h
diff --git a/.gitmodules b/.gitmodules
index 6b91176098c8..ceafb0ee29a0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,3 +49,6 @@
 [submodule "tests/fp/berkeley-softfloat-3"]
 	path = tests/fp/berkeley-softfloat-3
 	url = https://github.com/cota/berkeley-softfloat-3
+[submodule "roms/edk2"]
+	path = roms/edk2
+	url = https://github.com/tianocore/edk2.git
diff --git a/roms/edk2 b/roms/edk2
new file mode 160000
index 000000000000..85588389222a
--- /dev/null
+++ b/roms/edk2
@@ -0,0 +1 @@
+Subproject commit 85588389222a3636baf0f9ed8227f2434af4c3f9
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
@ 2019-01-18 22:33 ` Laszlo Ersek
  2019-01-21  7:35   ` Gerd Hoffmann
  2019-01-21 11:27   ` Philippe Mathieu-Daudé
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 3/5] tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app Laszlo Ersek
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:33 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

Building the EfiRom utility from "roms/edk2/BaseTools" should make
"roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
EfiRom for building the combined iPXE option ROMs, but call the sibling
utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 roms/Makefile | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/roms/Makefile b/roms/Makefile
index a6043eff37e9..78d5dd18c301 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
 # We need that to combine multiple images (legacy bios,
 # efi ia32, efi x64) into a single rom binary.
 #
-# We try to find it in the path.  You can also pass the location on
-# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
-#
-EFIROM ?= $(shell which EfiRom 2>/dev/null)
+EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
 
 default:
 	@echo "nothing is build by default"
@@ -59,8 +56,7 @@ default:
 	@echo "  vgabios        -- update vgabios binaries (seabios)"
 	@echo "  sgabios        -- update sgabios binaries"
 	@echo "  pxerom         -- update nic roms (bios only)"
-	@echo "  efirom         -- update nic roms (bios+efi, this needs"
-	@echo "                    the EfiRom utility from edk2 / tianocore)"
+	@echo "  efirom         -- update nic roms (bios+efi)"
 	@echo "  slof           -- update slof.bin"
 	@echo "  skiboot        -- update skiboot.lid"
 	@echo "  u-boot.e500    -- update u-boot.e500"
@@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
 
 efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
 
-efi-rom-%: build-pxe-roms build-efi-roms
+efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
 	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
 		-b ipxe/src/bin/$(VID)$(DID).rom \
 		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
@@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
 		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
 		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
 
+$(EFIROM):
+	$(MAKE) -C edk2/BaseTools
 
 slof:
 	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
@@ -150,6 +148,7 @@ clean:
 	$(MAKE) -C sgabios clean
 	rm -f sgabios/.depend
 	$(MAKE) -C ipxe/src veryclean
+	$(MAKE) -C edk2/BaseTools clean
 	$(MAKE) -C SLOF clean
 	rm -rf u-boot/build.e500
 	$(MAKE) -C u-boot-sam460ex distclean
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 3/5] tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app
  2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule Laszlo Ersek
@ 2019-01-18 22:33 ` Laszlo Ersek
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts Laszlo Ersek
  2019-01-18 22:34 ` [Qemu-devel] [PATCH 5/5] tests/data: introduce "uefi-boot-images" with the "bios-tables-test" ISOs Laszlo Ersek
  4 siblings, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:33 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

The "bios-tables-test" program in QEMU's test suite locates the RSD PTR
ACPI table in guest RAM, and (chasing pointers to other ACPI tables)
performs various sanity checks on the QEMU-generated and
firmware-installed tables.

Currently this set of test cases doesn't work with UEFI guests. The ACPI
spec defines distinct methods for OSPM to locate the RSD PTR on
traditional BIOS vs. UEFI platforms, and the UEFI method is more difficult
to implement from the hypervisor side with just raw guest memory access.

Add a UEFI application (to be booted in the UEFI guest) that populates a
small, MB-aligned structure in guest RAM. The structure begins with a
signature GUID. The hypervisor should loop over all MB-aligned pages in
guest RAM until one matches the signature GUID at offset 0, at which point
the hypervisor can fetch the RSDP address field(s) from the structure.

QEMU's test logic currently spins on a pre-determined guest address, until
that address assumes a magic value. The method described in this patch is
conceptually the same ("busy loop until match is found"), except there is
no hard-coded address. This plays a lot more nicely with UEFI guest
firmware (we'll be able to use the normal page allocation UEFI service).
Given the size of EFI_GUID (16 bytes -- 128 bits), mismatches should be
astronomically unlikely. In addition, given the typical guest RAM size for
such tests (128 MB), there are 128 locations to check in one iteration of
the "outer" loop, which shouldn't introduce an intolerable delay after the
guest stores the RSDP address(es), and then the GUID.

The GUID that the hypervisor should search for is

  AB87A6B1-2034-BDA0-71BD-375007757785

Expressed as a byte array:

 {
   0xb1, 0xa6, 0x87, 0xab,
   0x34, 0x20,
   0xa0, 0xbd,
   0x71, 0xbd, 0x37, 0x50, 0x07, 0x75, 0x77, 0x85
 }

Note that in the patch, we define "gBiosTablesTestGuid" with all bits
inverted. This is a simple method to prevent the UEFI binary, which
incorporates "gBiosTablesTestGuid", from matching the actual GUID in guest
RAM.

The UEFI application is written against the edk2 framework, which was
introduced earlier as a git submodule. The next patch will provide build
scripts for maintainers.

The source code follows the edk2 coding style, and is licensed under the
2-clause BSDL (in case someone would like to include UefiTestToolsPkg
content in a different edk2 platform).

The "UefiTestToolsPkg.dsc" platform description file resolves the used
edk2 library classes to instances (= library implementations) such that
the UEFI binaries inherit no platform dependencies. They are expected to
run on any system that conforms to the UEFI-2.3.1 spec (which was released
in 2012). The arch-specific build options are carried over from edk2's
ArmVirtPkg and OvmfPkg platforms.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    If that's necessary, I'd be glad to be designated as Maintainer or
    Reviewer in "MAINTAINERS" for "tests/uefi-test-tools/", I just couldn't
    figure out under what subsystem I should add the magic lines.
    "MAINTAINERS" needs a Table of Contents! :)

 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec              |  27 ++++
 tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc              |  69 +++++++++++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf |  41 ++++++
 tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h     |  67 ++++++++++
 tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c   | 130 ++++++++++++++++++++
 tests/uefi-test-tools/LICENSE                                            |  25 ++++
 6 files changed, 359 insertions(+)

diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec b/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec
new file mode 100644
index 000000000000..ed3a2fe11084
--- /dev/null
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dec
@@ -0,0 +1,27 @@
+## @file
+# edk2 package declaration for the test helper UEFI applications that run in
+# guests.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License that accompanies this
+# distribution. The full text of the license may be found at
+# <http://opensource.org/licenses/bsd-license.php>.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+##
+
+[Defines]
+  DEC_SPECIFICATION = 1.27
+  PACKAGE_NAME      = UefiTestToolsPkg
+  PACKAGE_GUID      = 7b3f1794-0c85-4b27-a536-44dbf0b0669c
+  PACKAGE_VERSION   = 0.1
+
+[Includes]
+  Include
+
+[Guids]
+  gBiosTablesTestGuid = {0x5478594e, 0xdfcb, 0x425f, {0x8e, 0x42, 0xc8, 0xaf, 0xf8, 0x8a, 0x88, 0x7a}}
+
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc b/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc
new file mode 100644
index 000000000000..c8511cd732bc
--- /dev/null
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc
@@ -0,0 +1,69 @@
+## @file
+# edk2 platform description for the test helper UEFI applications that run in
+# guests.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License that accompanies this
+# distribution. The full text of the license may be found at
+# <http://opensource.org/licenses/bsd-license.php>.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+##
+
+[Defines]
+  DSC_SPECIFICATION       = 1.28
+  PLATFORM_GUID           = 6750ccc1-8365-49f0-8437-948e516a9f55
+  PLATFORM_VERSION        = 0.1
+  PLATFORM_NAME           = UefiTestTools
+  SKUID_IDENTIFIER        = DEFAULT
+  SUPPORTED_ARCHITECTURES = ARM|AARCH64|IA32|X64
+  BUILD_TARGETS           = DEBUG
+
+[BuildOptions.IA32]
+  GCC:*_*_IA32_CC_FLAGS = -mno-mmx -mno-sse
+
+[BuildOptions.X64]
+  GCC:*_*_X64_CC_FLAGS = -mno-mmx -mno-sse
+
+[BuildOptions.ARM.EDKII.UEFI_APPLICATION]
+  GCC:*_*_ARM_DLINK_FLAGS = -z common-page-size=0x1000
+
+[BuildOptions.AARCH64.EDKII.UEFI_APPLICATION]
+  GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x1000
+
+[BuildOptions]
+  GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+
+[SkuIds]
+  0|DEFAULT
+
+[LibraryClasses]
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+  DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf
+  MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
+  UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
+[LibraryClasses.IA32, LibraryClasses.X64]
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+
+[PcdsFixedAtBuild]
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8040004F
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+
+[Components]
+  UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
new file mode 100644
index 000000000000..924d8a80d00b
--- /dev/null
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf
@@ -0,0 +1,41 @@
+## @file
+# Populate the BIOS_TABLES_TEST structure.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License that accompanies this
+# distribution. The full text of the license may be found at
+# <http://opensource.org/licenses/bsd-license.php>.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+##
+
+[Defines]
+  INF_VERSION                = 1.27
+  BASE_NAME                  = BiosTablesTest
+  UEFI_SPECIFICATION_VERSION = 2.31
+  FILE_GUID                  = 87f00433-3b7c-45c3-ae78-a56495bd4e62
+  MODULE_TYPE                = UEFI_APPLICATION
+  ENTRY_POINT                = BiosTablesTestMain
+
+[Sources]
+  BiosTablesTest.c
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  MemoryAllocationLib
+  UefiApplicationEntryPoint
+  UefiBootServicesTableLib
+  UefiLib
+
+[Guids]
+  gBiosTablesTestGuid
+  gEfiAcpi10TableGuid
+  gEfiAcpi20TableGuid
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiTestToolsPkg/UefiTestToolsPkg.dec
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
new file mode 100644
index 000000000000..0b72c61254af
--- /dev/null
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h
@@ -0,0 +1,67 @@
+/** @file
+  Expose the address(es) of the ACPI RSD PTR table(s) in a MB-aligned structure
+  to the hypervisor.
+
+  The hypervisor locates the MB-aligned structure based on the signature GUID
+  that is at offset 0 in the structure. Once the RSD PTR address(es) are
+  retrieved, the hypervisor may perform various ACPI checks.
+
+  This feature is a development aid, for supporting ACPI table unit tests in
+  hypervisors. Do not enable in production builds.
+
+  Copyright (C) 2019, Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License that accompanies this
+  distribution. The full text of the license may be found at
+  <http://opensource.org/licenses/bsd-license.php>.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef __BIOS_TABLES_TEST_H__
+#define __BIOS_TABLES_TEST_H__
+
+#include <Uefi/UefiBaseType.h>
+
+#define BIOS_TABLES_TEST_GUID                          \
+  {                                                    \
+    0x5478594e,                                        \
+    0xdfcb,                                            \
+    0x425f,                                            \
+    { 0x8e, 0x42, 0xc8, 0xaf, 0xf8, 0x8a, 0x88, 0x7a } \
+  }
+
+extern EFI_GUID gBiosTablesTestGuid;
+
+//
+// The following structure must be allocated in Boot Services Data type memory,
+// aligned at a 1MB boundary.
+//
+#pragma pack (1)
+typedef struct {
+  //
+  // The signature GUID is written to the MB-aligned structure from
+  // gBiosTablesTestGuid, but with all bits inverted. That's the actual GUID
+  // value that the hypervisor should look for at each MB boundary, looping
+  // over all guest RAM pages with that alignment, until a match is found. The
+  // bit-flipping occurs in order not to store the actual GUID in any UEFI
+  // executable, which might confuse guest memory analysis. Note that EFI_GUID
+  // has little endian representation.
+  //
+  EFI_GUID             InverseSignatureGuid;
+  //
+  // The Rsdp10 and Rsdp20 fields may be read when the signature GUID matches.
+  // Rsdp10 is the guest-physical address of the ACPI 1.0 specification RSD PTR
+  // table, in 8-byte little endian representation. Rsdp20 is the same, for the
+  // ACPI 2.0 or later specification RSD PTR table. Each of these fields may be
+  // zero (independently of the other) if the UEFI System Table does not
+  // provide the corresponding UEFI Configuration Table.
+  //
+  EFI_PHYSICAL_ADDRESS Rsdp10;
+  EFI_PHYSICAL_ADDRESS Rsdp20;
+} BIOS_TABLES_TEST;
+#pragma pack ()
+
+#endif // __BIOS_TABLES_TEST_H__
diff --git a/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
new file mode 100644
index 000000000000..b208e17fb00f
--- /dev/null
+++ b/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c
@@ -0,0 +1,130 @@
+/** @file
+  Populate the BIOS_TABLES_TEST structure.
+
+  Copyright (C) 2019, Red Hat, Inc.
+
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License that accompanies this
+  distribution. The full text of the license may be found at
+  <http://opensource.org/licenses/bsd-license.php>.
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#include <Guid/Acpi.h>
+#include <Guid/BiosTablesTest.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+/**
+  Wait for a keypress with a message that the application is about to exit.
+**/
+STATIC
+VOID
+WaitForExitKeyPress (
+  VOID
+  )
+{
+  EFI_STATUS    Status;
+  UINTN         Idx;
+  EFI_INPUT_KEY Key;
+
+  if (gST->ConIn == NULL) {
+    return;
+  }
+  AsciiPrint ("%a: press any key to exit\n", gEfiCallerBaseName);
+  Status = gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Idx);
+  if (EFI_ERROR (Status)) {
+    return;
+  }
+  gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
+}
+
+EFI_STATUS
+EFIAPI
+BiosTablesTestMain (
+  IN EFI_HANDLE       ImageHandle,
+  IN EFI_SYSTEM_TABLE *SystemTable
+  )
+{
+  VOID                          *Pages;
+  volatile BIOS_TABLES_TEST     *BiosTablesTest;
+  CONST VOID                    *Rsdp10;
+  CONST VOID                    *Rsdp20;
+  CONST EFI_CONFIGURATION_TABLE *ConfigTable;
+  CONST EFI_CONFIGURATION_TABLE *ConfigTablesEnd;
+  volatile EFI_GUID             *InverseSignature;
+  UINTN                         Idx;
+
+  Pages = AllocateAlignedPages (EFI_SIZE_TO_PAGES (sizeof *BiosTablesTest),
+            SIZE_1MB);
+  if (Pages == NULL) {
+    AsciiErrorPrint ("%a: AllocateAlignedPages() failed\n",
+      gEfiCallerBaseName);
+    //
+    // Assuming the application was launched by the boot manager as a boot
+    // loader, exiting with error will cause the boot manager to proceed with
+    // the remaining boot options. If there are no other boot options, the boot
+    // manager menu will be pulled up. Give the user a chance to read the error
+    // message.
+    //
+    WaitForExitKeyPress ();
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  //
+  // Locate both gEfiAcpi10TableGuid and gEfiAcpi20TableGuid config tables in
+  // one go.
+  //
+  Rsdp10 = NULL;
+  Rsdp20 = NULL;
+  ConfigTable = gST->ConfigurationTable;
+  ConfigTablesEnd = gST->ConfigurationTable + gST->NumberOfTableEntries;
+  while ((Rsdp10 == NULL || Rsdp20 == NULL) && ConfigTable < ConfigTablesEnd) {
+    if (CompareGuid (&ConfigTable->VendorGuid, &gEfiAcpi10TableGuid)) {
+      Rsdp10 = ConfigTable->VendorTable;
+    } else if (CompareGuid (&ConfigTable->VendorGuid, &gEfiAcpi20TableGuid)) {
+      Rsdp20 = ConfigTable->VendorTable;
+    }
+    ++ConfigTable;
+  }
+
+  AsciiPrint ("%a: BiosTablesTest=%p Rsdp10=%p Rsdp20=%p\n",
+    gEfiCallerBaseName, Pages, Rsdp10, Rsdp20);
+
+  //
+  // Store the RSD PTR address(es) first, then the signature second.
+  //
+  BiosTablesTest = Pages;
+  BiosTablesTest->Rsdp10 = (UINTN)Rsdp10;
+  BiosTablesTest->Rsdp20 = (UINTN)Rsdp20;
+
+  MemoryFence();
+
+  InverseSignature = &BiosTablesTest->InverseSignatureGuid;
+  InverseSignature->Data1  = gBiosTablesTestGuid.Data1;
+  InverseSignature->Data1 ^= MAX_UINT32;
+  InverseSignature->Data2  = gBiosTablesTestGuid.Data2;
+  InverseSignature->Data2 ^= MAX_UINT16;
+  InverseSignature->Data3  = gBiosTablesTestGuid.Data3;
+  InverseSignature->Data3 ^= MAX_UINT16;
+  for (Idx = 0; Idx < sizeof InverseSignature->Data4; ++Idx) {
+    InverseSignature->Data4[Idx]  = gBiosTablesTestGuid.Data4[Idx];
+    InverseSignature->Data4[Idx] ^= MAX_UINT8;
+  }
+
+  //
+  // The wait below has dual purpose. First, it blocks the application without
+  // wasting VCPU cycles while the hypervisor is scanning guest RAM. Second,
+  // assuming the application was launched by the boot manager as a boot
+  // loader, exiting the app with success causes the boot manager to pull up
+  // the boot manager menu at once (regardless of other boot options); the wait
+  // gives the user a chance to read the info printed above.
+  //
+  WaitForExitKeyPress ();
+  return EFI_SUCCESS;
+}
diff --git a/tests/uefi-test-tools/LICENSE b/tests/uefi-test-tools/LICENSE
new file mode 100644
index 000000000000..38b78aecdb0e
--- /dev/null
+++ b/tests/uefi-test-tools/LICENSE
@@ -0,0 +1,25 @@
+All the files in this directory and subdirectories are released under the
+2-Clause BSD License (see header in each file).
+
+Copyright (C) 2019, Red Hat, Inc.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
                   ` (2 preceding siblings ...)
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 3/5] tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app Laszlo Ersek
@ 2019-01-18 22:33 ` Laszlo Ersek
  2019-01-21 12:17   ` Philippe Mathieu-Daudé
  2019-01-18 22:34 ` [Qemu-devel] [PATCH 5/5] tests/data: introduce "uefi-boot-images" with the "bios-tables-test" ISOs Laszlo Ersek
  4 siblings, 1 reply; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:33 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

Introduce the following build scripts under "tests/uefi-test-tools":

* "build.sh" builds a single module (a UEFI application) from
  UefiTestToolsPkg, for a single QEMU emulation target.

  "build.sh" relies on cross-compilers when the emulation target and the
  build host architecture don't match. The cross-compiler prefix is
  computed according to a fixed, Linux-specific pattern. No attempt is
  made to copy or reimplement the GNU Make magic from "qemu/roms/Makefile"
  for cross-compiler prefix determination. The reason is that the build
  host OSes that are officially supported by edk2, and those that are
  supported by QEMU, intersect only in Linux. (Note that the UNIXGCC
  toolchain is being removed from edk2,
  <https://bugzilla.tianocore.org/show_bug.cgi?id=1377>.)

* "Makefile" currently builds the "UefiTestToolsPkg/BiosTablesTest"
  application, for arm, aarch64, i386, and x86_64, with the help of
  "build.sh".

  "Makefile" turns each resultant UEFI executable into a UEFI-bootable,
  qcow2-compressed ISO image. The ISO images are output as
  "tests/data/uefi-boot-images/bios-tables-test.<TARGET>.iso.qcow2".

  Each ISO image should be passed to QEMU as follows:

    -drive id=boot-cd,if=none,readonly,format=qcow2,file=$ISO \
    -device virtio-scsi-pci,id=scsi0 \
    -device scsi-cd,drive=boot-cd,bus=scsi0.0,bootindex=0 \

  "Makefile" assumes that "mkdosfs", "mtools", and "genisoimage" are
  present.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 tests/uefi-test-tools/Makefile   |  92 +++++++++++++
 tests/uefi-test-tools/.gitignore |   3 +
 tests/uefi-test-tools/build.sh   | 145 ++++++++++++++++++++
 3 files changed, 240 insertions(+)

diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile
new file mode 100644
index 000000000000..7b6dd227e433
--- /dev/null
+++ b/tests/uefi-test-tools/Makefile
@@ -0,0 +1,92 @@
+# Makefile for the test helper UEFI applications that run in guests.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License that accompanies this
+# distribution. The full text of the license may be found at
+# <http://opensource.org/licenses/bsd-license.php>.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+edk2_dir              := ../../roms/edk2
+images_dir            := ../data/uefi-boot-images
+emulation_targets     := arm aarch64 i386 x86_64
+uefi_binaries         := bios-tables-test
+intermediate_suffixes := .efi .fat .iso.raw
+
+images: $(foreach binary,$(uefi_binaries), \
+		$(foreach target,$(emulation_targets), \
+			$(images_dir)/$(binary).$(target).iso.qcow2))
+
+# Preserve all intermediate targets if the build succeeds.
+# - Intermediate targets help with development & debugging.
+# - Preserving intermediate targets also keeps spurious changes out of the
+#   final build products, in case the user re-runs "make" without any changes
+#   to the UEFI source code. Normally, the intermediate files would have been
+#   removed by the last "make" invocation, hence the re-run would rebuild them
+#   from the unchanged UEFI sources. Unfortunately, the "mkdosfs" and
+#   "genisoimage" utilities embed timestamp-based information in their outputs,
+#   which causes git to report differences for the tracked qcow2 ISO images.
+.SECONDARY: $(foreach binary,$(uefi_binaries), \
+		$(foreach target,$(emulation_targets), \
+			$(foreach suffix,$(intermediate_suffixes), \
+				Build/$(binary).$(target)$(suffix))))
+
+# In the pattern rules below, the stem (%, $*) stands for
+# "$(binary).$(target)".
+
+# Convert the raw ISO image to a qcow2 one, enabling compression, and using a
+# small cluster size. This allows for small binary files under git control,
+# hence for small binary patches.
+$(images_dir)/%.iso.qcow2: Build/%.iso.raw
+	mkdir -p -- $(images_dir)
+	$${QTEST_QEMU_IMG:-qemu-img} convert -f raw -O qcow2 -c \
+		-o cluster_size=512 -- $< $@
+
+# Embed the "UEFI system partition" into an ISO9660 file system as an ElTorito
+# boot image.
+Build/%.iso.raw: Build/%.fat
+	genisoimage -input-charset ASCII -efi-boot $(notdir $<) -no-emul-boot \
+		-quiet -o $@ -- $<
+
+# Define chained macros in order to map QEMU system emulation targets to
+# *short* UEFI architecture identifiers. Periods are allowed in, and ultimately
+# stripped from, the argument.
+map_arm_to_uefi     = $(subst arm,ARM,$(1))
+map_aarch64_to_uefi = $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1)))
+map_i386_to_uefi    = $(subst i386,IA32,$(call map_aarch64_to_uefi,$(1)))
+map_x86_64_to_uefi  = $(subst x86_64,X64,$(call map_i386_to_uefi,$(1)))
+map_to_uefi         = $(subst .,,$(call map_x86_64_to_uefi,$(1)))
+
+# Format a "UEFI system partition", using the UEFI binary as the default boot
+# loader. Add 10% size for filesystem metadata, round up to the next KB, and
+# make sure the size is large enough for a FAT filesystem. Name the filesystem
+# after the UEFI binary. (Excess characters are automatically dropped from the
+# filesystem label.)
+Build/%.fat: Build/%.efi
+	rm -f -- $@
+	uefi_bin_b=$$(stat --format=%s -- $<) && \
+		uefi_fat_kb=$$(( (uefi_bin_b * 11 / 10 + 1023) / 1024 )) && \
+		uefi_fat_kb=$$(( uefi_fat_kb >= 64 ? uefi_fat_kb : 64 )) && \
+		mkdosfs -C $@ -n $(basename $(@F)) -- $$uefi_fat_kb
+	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI
+	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI/BOOT
+	MTOOLS_SKIP_CHECK=1 mcopy -i $@ -- $< \
+		::EFI/BOOT/BOOT$(call map_to_uefi,$(suffix $*)).EFI
+
+# In the pattern rules below, the stem (%, $*) stands for "$(target)" only. The
+# association between the UEFI binary (such as "bios-tables-test") and the
+# component name from the edk2 platform DSC file (such as "BiosTablesTest") is
+# explicit in each rule.
+
+Build/bios-tables-test.%.efi: build-edk2-tools
+	./build.sh $(edk2_dir) BiosTablesTest $* $@
+
+build-edk2-tools:
+	$(MAKE) -C $(edk2_dir)/BaseTools
+
+clean:
+	rm -rf Build Conf log
+	$(MAKE) -C $(edk2_dir)/BaseTools clean
diff --git a/tests/uefi-test-tools/.gitignore b/tests/uefi-test-tools/.gitignore
new file mode 100644
index 000000000000..9f246701dea1
--- /dev/null
+++ b/tests/uefi-test-tools/.gitignore
@@ -0,0 +1,3 @@
+Build
+Conf
+log
diff --git a/tests/uefi-test-tools/build.sh b/tests/uefi-test-tools/build.sh
new file mode 100755
index 000000000000..155cb75c4ddb
--- /dev/null
+++ b/tests/uefi-test-tools/build.sh
@@ -0,0 +1,145 @@
+#!/bin/bash
+
+# Build script that determines the edk2 toolchain to use, invokes the edk2
+# "build" utility, and copies the built UEFI binary to the requested location.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License that accompanies this
+# distribution. The full text of the license may be found at
+# <http://opensource.org/licenses/bsd-license.php>.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+set -e -u -C
+
+# Save the command line arguments. We need to reset $# to 0 before sourcing
+# "edksetup.sh", as it will inherit $@.
+program_name=$(basename -- "$0")
+edk2_dir=$1
+dsc_component=$2
+emulation_target=$3
+uefi_binary=$4
+shift 4
+
+# Set up the environment for edk2 building.
+export PACKAGES_PATH=$(realpath -- "$edk2_dir")
+export WORKSPACE=$PWD
+mkdir -p Conf
+
+# Source "edksetup.sh" carefully.
+set +e +u +C
+source "$PACKAGES_PATH/edksetup.sh"
+ret=$?
+set -e -u -C
+if [ $ret -ne 0 ]; then
+  exit $ret
+fi
+
+# Map the QEMU system emulation target to the following types of architecture
+# identifiers:
+# - edk2,
+# - gcc cross-compilation.
+# Cover only those targets that are supported by the UEFI spec and edk2.
+case "$emulation_target" in
+  (arm)
+    edk2_arch=ARM
+    gcc_arch=arm
+    ;;
+  (aarch64)
+    edk2_arch=AARCH64
+    gcc_arch=aarch64
+    ;;
+  (i386)
+    edk2_arch=IA32
+    gcc_arch=i686
+    ;;
+  (x86_64)
+    edk2_arch=X64
+    gcc_arch=x86_64
+    ;;
+  (*)
+    printf '%s: unknown/unsupported QEMU system emulation target "%s"\n' \
+      "$program_name" "$emulation_target" >&2
+    exit 1
+    ;;
+esac
+
+# Check if cross-compilation is needed.
+host_arch=$(uname -m)
+if [ "$gcc_arch" == "$host_arch" ] ||
+   ( [ "$gcc_arch" == i686 ] && [ "$host_arch" == x86_64 ] ); then
+  cross_prefix=
+else
+  cross_prefix=${gcc_arch}-linux-gnu-
+fi
+
+# Expose cross_prefix (which is possibly empty) to the edk2 tools. While at it,
+# determine the suitable edk2 toolchain as well.
+# - For ARM and AARCH64, edk2 only offers the GCC5 toolchain tag, which covers
+#   the gcc-5+ releases.
+# - For IA32 and X64, edk2 offers the GCC44 through GCC49 toolchain tags, in
+#   addition to GCC5. Unfortunately, the mapping between the toolchain tags and
+#   the actual gcc releases isn't entirely trivial. Run "git-blame" on
+#   "OvmfPkg/build.sh" in edk2 for more information.
+# And, because the above is too simple, we have to assign cross_prefix to an
+# edk2 build variable that is specific to both the toolchain tag and the target
+# architecture.
+case "$edk2_arch" in
+  (ARM)
+    edk2_toolchain=GCC5
+    export GCC5_ARM_PREFIX=$cross_prefix
+    ;;
+  (AARCH64)
+    edk2_toolchain=GCC5
+    export GCC5_AARCH64_PREFIX=$cross_prefix
+    ;;
+  (IA32|X64)
+    gcc_version=$("${cross_prefix}gcc" -v 2>&1 | tail -1 | awk '{print $3}')
+    case "$gcc_version" in
+      ([1-3].*|4.[0-3].*)
+        printf '%s: unsupported gcc version "%s"\n' \
+          "$program_name" "$gcc_version" >&2
+        exit 1
+        ;;
+      (4.4.*)
+        edk2_toolchain=GCC44
+        ;;
+      (4.5.*)
+        edk2_toolchain=GCC45
+        ;;
+      (4.6.*)
+        edk2_toolchain=GCC46
+        ;;
+      (4.7.*)
+        edk2_toolchain=GCC47
+        ;;
+      (4.8.*)
+        edk2_toolchain=GCC48
+        ;;
+      (4.9.*|6.[0-2].*)
+        edk2_toolchain=GCC49
+        ;;
+      (*)
+        edk2_toolchain=GCC5
+        ;;
+    esac
+    eval "export ${edk2_toolchain}_BIN=\$cross_prefix"
+    ;;
+esac
+
+# Build the UEFI binary
+mkdir -p log
+build \
+  --arch="$edk2_arch" \
+  --buildtarget=DEBUG \
+  --platform=UefiTestToolsPkg/UefiTestToolsPkg.dsc \
+  --tagname="$edk2_toolchain" \
+  --module="UefiTestToolsPkg/$dsc_component/$dsc_component.inf" \
+  --log="log/$dsc_component.$edk2_arch.log" \
+  --report-file="log/$dsc_component.$edk2_arch.report"
+cp -a -- \
+  "Build/UefiTestTools/DEBUG_${edk2_toolchain}/$edk2_arch/$dsc_component.efi" \
+  "$uefi_binary"
-- 
2.19.1.3.g30247aa5d201

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

* [Qemu-devel] [PATCH 5/5] tests/data: introduce "uefi-boot-images" with the "bios-tables-test" ISOs
  2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
                   ` (3 preceding siblings ...)
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts Laszlo Ersek
@ 2019-01-18 22:34 ` Laszlo Ersek
  4 siblings, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-18 22:34 UTC (permalink / raw)
  To: qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Philippe Mathieu-Daudé,
	Shannon Zhao

Add UEFI-bootable qcow2-compressed ISO images built from:

  tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    Again, if needed, I'd be happy to be designated as Maintainer for the
    files being added in this patch; please let me know the right spot in
    "MAINTAINERS".

 tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 | Bin 0 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2     | Bin 0 -> 11776 bytes
 tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2    | Bin 0 -> 12800 bytes
 tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2  | Bin 0 -> 13312 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.aarch64.iso.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..fa2cf9291215c2fce59e526e1147be950cdce818
GIT binary patch
literal 11776
zcmeHtbzECrmu_%(3s&4MSg~TI(BQ!xf?IJ4#oY=Ncc(xpQlPjMC|)GRT3m{|yA74^
zoBMlz^WAyxe{*MM?Q`<%XUR_1N^<tzIZ=_3y#@dP2oLA~DQLe4vj0DHSid{Se>nV4
zg!@DOGeCTBu(Cq9(0agF0Km-J+0}#E#M<>gi~DVdGj(uwe(C7?HzVKxFN{4ssGZF%
zOdVd@ySn_nC;6Z5_46(IU-=(d0l0_n@$ZHXKz-=J|7i#h`1AbT5Fh$K+yBac(+c?i
z$_o|n8?pbJX8FHq{j~xTzZB?zKPdMHr+=v*9{%vvfAGKJZ#xFgU-f^N|B0vkyZ(Rm
z`xDRhSN-4Rf8quImH!`m^uMx0e;F_ee*0l+{y~>N_^{sjuPvsoZrmV{nc2bN2}U%e
z9V^oy@W$t`k5{4ti4a`?ib#uVvA76b3`BK`pf2c^2*wXW3})(RhszfP&H^RVwNs&2
zhk{mwxJZE3HzL@dLAcL?x+Lp@;Vtd*5mS<@ohWW3>sXxcBPC+3!k<af8}g@nbOT;=
zKq`fFD=<5F{a@&n_0n`gDOZI^j&cd!;}cMv;58&#Qa|qX0<}7ya5g7Myf8KqP-W?b
zD6?;m2wMhu2o1CdQf`PD*abZO;?Q)50pIv+m@6<+hA;eDBY;Ys%~b35_DtZB8U%>s
zii{cbu#`1*{FS8ZsS4^L&JpIJ7Am&m%QM$wS2xVVlXFvQVlaNWGa)7`0C2s(V*-Wt
z^?}f37$4%yVxbRW21KGG_{jk9Xvi|5Dj-@ofSO4x6o7z+jE&pf0U2hdXQk=*+|}NW
z`YZ}lE?6Bz1_Dc}gC(B<p{zh^Z!sq2`^5{~=S-pky|}hg$dt&k;hwU51bJJHnK!p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ycFubQYuUnV!6tb7{SejqG}IzPq2)O&d*IvsV|Ih
z_f2&UB5FuVxHWxJv+#8So2V+;aD#za7?0r;AzTbhVH8F<4}WOh?a0HIfDlTL5OkAB
zs}TPC(ea7ybw2a2V;^M7AswIT8Utf~LLml6gU5}=LMnvBK*W#5K`Dwrz>C2~E`q{D
YB7nmK%e*8`^`$z5|HrM>|1a?00M!mU9smFU

literal 0
HcmV?d00001

diff --git a/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.arm.iso.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..c83358f2367630e6a6b499ac26c1628dab2b0aff
GIT binary patch
literal 11776
zcmeHtWmH_-mM&UY0R<EmT!Xs?65OqT;KAJ;f&?d6fI@;xfCw5A+@X-*nm};Z;83{K
z%Sld;e(&_S-KXELJNouqqw3q=oZsAguUWNbtuc0K$}8O<At9mueEr{s^@{*P{>_K`
z`vCAKNBIMh|0Mqvp#2os*`Z$Q{X{4dl9j!OmmjT#z1M%0_dAYk>FVL(?dJ72Gmw#-
z%>DgnJ*;gkUA<krJpbNB{?%1~d_@0i|B@9z{<)5S4{RjNpGPSF&p`dfP=EG^KgO?R
z|1Vjk|M8O!`87jKq~D15KYqUdJHg)-ko*PMNPnX8pE&!={qyZlzVUDTulPHTga23m
z-{pViQ~h22Uv+=xv;Woqcln?BBL7JLXFUEN#m#;NaNhpb0d@aG&p+|!e&?UtEWLbq
zd3da>j*j6t@sJMO9OJOt7sq}4k}z~Iwy+r*J;-Kx*=#us(>;dvZI5IGVK`dELs$oL
zp$OSLnN*g3hS~M8h#eS&j?|hUhS$jhLJ#kjs*6Ceb%ung49<w)-P6v28xeAfP`hYZ
zDaQAPt+^IRb!IHnlofg}&7MdK;ZDiq7t|-5q~iFE#XOC{!n?+NHoy<cUS-Ho7xhov
zSE3c-sS+zmwJcUhJ2T6zhPC8uw2E+Ub1gW9N)NayBhW*i(QoO&daM&*cMcu+rLRAi
z-RI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a)G2AlJc4LDR+R-Wf3Bm%#j=T?9
zmNugUv7n(uN(W08K=k!7(Xb<>3qY709B5hRuJFDjeoq$WEF#TNbmgbT1o3O`3>8o;
zH7kp+yeiFAj?JGF&-<Uu?XEL7svRWXFuD~qd+E6xIMjQK>1|7^82?bF@v5MxsF~`B
zdUB$je>FcExI)?nzkx%A?6axAer?c*NWnywmW>{lB7F?!?Eo<#0b;TE)`MqUbMgsV
zkJ#JYdjwtmdJk`5`L{hwEnBF<^CwA4C|FF%`i~}F=fSOMWyrC*`x=X%^~t_ZR^s9>
S2p;@zKYsqp)75`|`hNhrT|}P%

literal 0
HcmV?d00001

diff --git a/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.i386.iso.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..2d897a221010607a5e48de4f2d8cc84024c5eae3
GIT binary patch
literal 12800
zcmeHtWmH^Emu@#6++7-XXxxKaa7ltY1b5fQNr2$)?hsspHSQJ&1c#u(odmmi!#lI?
z`ex?N_wUY{nX1+G)bs4US9k3?r|NWdtI5dU0RRBl->?6>y!b;9ApfGFJ$DfP<}iOD
z@Ne>;0o-o~OH0_>x4$tK05G$1cJ%_8Sh@aZanE+3se`k#o1^PL836>?8hd+zoXssv
z9o+0)UH-W@`Je9f*A)G4`5&19;P3nRxgrA)fA?ViRM>xQ|LVd1YyHdmzvaJS1|WaN
zgamj-^#6t<{NEw{dl?Y>BO(L-##evi;ve~U^EcoA7ygg<Y)8TPNBy7Wf5(&kv;P0+
z_jf$=KkEN1|2v-lKl1<E9{nHLjs6%=3ZMN@-~5fXe`C-e^MB#S)YY8>3^p@6J-bAS
zR_#X1)DOD%I~(E>gTmt?^BKWWVOp%O8?6T+IlTuJ_KSsJ2g8NXL%V_b{DjMd;^|tc
zM!(MZEpaj70UaNO(0jm`Qo()VO(8Jvj&k8rlIxvF@5P%Kou4AbVl5-2#Ayt8(!Kft
zwouhi0y;IQP%enAZsj0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#=j_7IF5|5qsuFf
z$g`pYUvUj_fjRiWoM3+bv*5D;(3DCB7@7mkgE|<}axGoy?4s>Bc<ec_>!{yS6@34m
zFdF2ONJ#u~$(5UUZ^CaS&qv!anXnhm?Jl^}KMs$w<YZ9jN+3(?si30Z)oer{$OvXL
zTCBYvDd-^+6)krAitF4(<H`j);Ue-XGBW;30p)|j2X!2mD-;bEg)0S!0mD~zC8g0>
zcn&v(^9z>`S6Q#PT+}Zm1M@-bVUYfADCWuWp{+^Y$-bp+2oqUsR&@+9cu!9boR9pY
zXlo1e+z<(qndlpd7m+kk5{VMmqK#|cUP0Wa+GMAaGelE69K-~;1e1heIu|AM^m`6t
zt~p*M-f^CzI;Mt~_T%Q%#sv;sy#rs}TaOHu=$oS4#d_fg39A8Rtzn~R-=g56$ca0^
z&b-$=k0$p^TH}4)G$S<qh2v)B!@>zgbbuvW=b^2JVcG;)ItnHKG;n%)`eMd)#ss&%
z`L9{ciLt4%MV1xYz;71y9To&*Qscp6pT~F8YQUlv{&V-)KQ%78b`<e5@vHH%@Xzqg
z@vrdh@D*56S-n_!SfW{uST$HKSX6Wk8hz~<jcCn_Ot&rYjPY!e-n}-TvvXVc5i*Cv
zjBaCKBWWXa06H)^kpG%dm1L`EcWAe0Yq7}E<Yj&_AGY#!l6RVSDLF7uJTQ<FMov3*
zA(cP1CDk+aHWe;4BvmT4FO?>>Fx4z|D-}02F;z2lHkCWIA=NeYGF1_rX2RKP_Hh^{
uftHS0@oTCr_?t;xuUX76FoBwmUU4E-4-6!>1n{QkK_iT%{=faJ`u_l~a0>na

literal 0
HcmV?d00001

diff --git a/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2 b/tests/data/uefi-boot-images/bios-tables-test.x86_64.iso.qcow2
new file mode 100644
index 0000000000000000000000000000000000000000..e38ec57e7f391814ab924fdc27e6917d341f652d
GIT binary patch
literal 13312
zcmeHtcT^P5w(blALmF}#kT4=h&PfDh$V1LS;t&NSX9R&EN|F&#f`H^8AQ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9_ipBtW|
z*}@Ac3r3@aE?NaGrtAs&M*VY_gg3v^`<m00=4AVY4`tQD_Q~q}u$4k^*T5}fY8;#q
z?Wu|JU5->5HQbTLh=_@=iON+GU)XDKjFX8adYmWJUlKl99fd7gj58bNu=JO4)Nhpv
zu^TtHPkPeiygu6=b0_J3j(C{qU;J)+l}WW9qRhjK-#a|aG3o2>P2ip2>+2(0Ig-FH
zG)khbF4qILDcq2-{YewWa(6k8IxKv&9=Un?JfHRCcd`GIUP#dx#DU@mZ3>hgN(-e=
zKgJwOldkUd3mpsH6W;Fsz#kGa*Q{b!w^2KEYhdp8$eeji-nN2bcQ;!y&JnwSF#U%$
zd*P9cvj(}Ns(EgKNc{Cf+@}}JT(TN-3BK!|_bV@z43(%rbbdMD>^Zo@U2i-d{QQIL
z8r-Dkkz)>84Ol84;0~VbQaCEZVPhrP`!4KH!76i+W5e0|xa=1sDxUUmdja+`?0oO+
z8rmeE&@maU`vfY5vTIoEW+eHA@U>;FCwG#*<K_>;9RQ8_7yx)UYu}fh!MO`Aio{wZ
zf~Q*nF+m!U;GW%6+LQX?Q}O8Dlg`slh2GPAoK9AS;^_L*h~oPEQ`X{6*3Q%XVu#cQ
zSb>XjP>@Dtv#x`kMobX9mM}Iu6pPyPe{WrxS42G;Q@(uze8hkIDvbw>pX-U49>qS;
z@$k@+0(tpkp`TRz>Z~H^58}2q8mcr!)^~VBEYtN9y*A<YHTqpCiS+N-4PU11Cwy(l
z?P~PBGO%rzwx5REqB5|3m!Y48Te|YRZTD6`6L)asdHXI?KdpgVDXG!z%Fy$XeBS@y
LPjddh-u{09w(Wq>

literal 0
HcmV?d00001

-- 
2.19.1.3.g30247aa5d201

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

* Re: [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
@ 2019-01-21  7:35   ` Gerd Hoffmann
  2019-01-21 11:25   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 22+ messages in thread
From: Gerd Hoffmann @ 2019-01-21  7:35 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Igor Mammedov, Philippe Mathieu-Daudé,
	Shannon Zhao

On Fri, Jan 18, 2019 at 11:33:56PM +0100, Laszlo Ersek wrote:
> The roms/edk2 submodule can help with three goals:
> - build the OVMF and ArmVirtQemu virtual UEFI firmware platforms (to be
>   implemented later),
> - build the EfiRom tool on the fly, which is used in roms/Makefile, for
>   building the "efirom" target,
> - build UEFI test applications (to be run in guests), for qtest support.
> 
> Edk2 commit 85588389222a3636baf0f9ed8227f2434af4c3f9 stands for the latest
> "stable tag", namely "edk2-stable201811".
> 
> The edk2 repository tracks some binary files that should not be removed by
> QEMU's top-level "make clean"; exempt the full pathnames from the "find"
> command.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  Makefile    | 6 +++++-
>  .gitmodules | 3 +++
>  roms/edk2   | 1 +
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index dccba1dca27f..1f768e2bcf8f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -602,7 +602,11 @@ clean:
>  	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
>  	rm -f qemu-options.def
>  	rm -f *.msi
> -	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
> +	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
> +		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
> +		-exec rm {} +
>  	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
>  	rm -f fsdev/*.pod scsi/*.pod
>  	rm -f qemu-img-cmds.h
> diff --git a/.gitmodules b/.gitmodules
> index 6b91176098c8..ceafb0ee29a0 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -49,3 +49,6 @@
>  [submodule "tests/fp/berkeley-softfloat-3"]
>  	path = tests/fp/berkeley-softfloat-3
>  	url = https://github.com/cota/berkeley-softfloat-3
> +[submodule "roms/edk2"]
> +	path = roms/edk2
> +	url = https://github.com/tianocore/edk2.git
> diff --git a/roms/edk2 b/roms/edk2
> new file mode 160000
> index 000000000000..85588389222a
> --- /dev/null
> +++ b/roms/edk2
> @@ -0,0 +1 @@
> +Subproject commit 85588389222a3636baf0f9ed8227f2434af4c3f9
> -- 
> 2.19.1.3.g30247aa5d201
> 
> 

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

* Re: [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule Laszlo Ersek
@ 2019-01-21  7:35   ` Gerd Hoffmann
  2019-01-21 11:27   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 22+ messages in thread
From: Gerd Hoffmann @ 2019-01-21  7:35 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Igor Mammedov, Philippe Mathieu-Daudé,
	Shannon Zhao

On Fri, Jan 18, 2019 at 11:33:57PM +0100, Laszlo Ersek wrote:
> Building the EfiRom utility from "roms/edk2/BaseTools" should make
> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
> EfiRom for building the combined iPXE option ROMs, but call the sibling
> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

> ---
>  roms/Makefile | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index a6043eff37e9..78d5dd18c301 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>  # We need that to combine multiple images (legacy bios,
>  # efi ia32, efi x64) into a single rom binary.
>  #
> -# We try to find it in the path.  You can also pass the location on
> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
> -#
> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  
>  default:
>  	@echo "nothing is build by default"
> @@ -59,8 +56,7 @@ default:
>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>  	@echo "  sgabios        -- update sgabios binaries"
>  	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
> +	@echo "  efirom         -- update nic roms (bios+efi)"
>  	@echo "  slof           -- update slof.bin"
>  	@echo "  skiboot        -- update skiboot.lid"
>  	@echo "  u-boot.e500    -- update u-boot.e500"
> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>  
>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>  
> -efi-rom-%: build-pxe-roms build-efi-roms
> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>  
> +$(EFIROM):
> +	$(MAKE) -C edk2/BaseTools
>  
>  slof:
>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
> @@ -150,6 +148,7 @@ clean:
>  	$(MAKE) -C sgabios clean
>  	rm -f sgabios/.depend
>  	$(MAKE) -C ipxe/src veryclean
> +	$(MAKE) -C edk2/BaseTools clean
>  	$(MAKE) -C SLOF clean
>  	rm -rf u-boot/build.e500
>  	$(MAKE) -C u-boot-sam460ex distclean
> -- 
> 2.19.1.3.g30247aa5d201
> 
> 

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

* Re: [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
  2019-01-21  7:35   ` Gerd Hoffmann
@ 2019-01-21 11:25   ` Philippe Mathieu-Daudé
  2019-01-21 18:41     ` Laszlo Ersek
  1 sibling, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-21 11:25 UTC (permalink / raw)
  To: Laszlo Ersek, Daniel P. Berrange, Alex Bennée
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Gerd Hoffmann, Igor Mammedov, Shannon Zhao

Cc'ing Daniel & Alex.

On 1/18/19 11:33 PM, Laszlo Ersek wrote:
> The roms/edk2 submodule can help with three goals:
> - build the OVMF and ArmVirtQemu virtual UEFI firmware platforms (to be
>   implemented later),
> - build the EfiRom tool on the fly, which is used in roms/Makefile, for
>   building the "efirom" target,
> - build UEFI test applications (to be run in guests), for qtest support.
> 
> Edk2 commit 85588389222a3636baf0f9ed8227f2434af4c3f9 stands for the latest
> "stable tag", namely "edk2-stable201811".
> 
> The edk2 repository tracks some binary files that should not be removed by
> QEMU's top-level "make clean"; exempt the full pathnames from the "find"
> command.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  Makefile    | 6 +++++-
>  .gitmodules | 3 +++
>  roms/edk2   | 1 +
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index dccba1dca27f..1f768e2bcf8f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -602,7 +602,11 @@ clean:
>  	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
>  	rm -f qemu-options.def
>  	rm -f *.msi
> -	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
> +	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
> +		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \

Hmm I never try in-tree builds and thought this rule was for the
archived release out of git, so this wouldn't matter.

> +		-exec rm {} +
>  	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
>  	rm -f fsdev/*.pod scsi/*.pod
>  	rm -f qemu-img-cmds.h
> diff --git a/.gitmodules b/.gitmodules
> index 6b91176098c8..ceafb0ee29a0 100644
> --- a/.gitmodules
> +++ b/.gitmodules
> @@ -49,3 +49,6 @@
>  [submodule "tests/fp/berkeley-softfloat-3"]
>  	path = tests/fp/berkeley-softfloat-3
>  	url = https://github.com/cota/berkeley-softfloat-3
> +[submodule "roms/edk2"]
> +	path = roms/edk2
> +	url = https://github.com/tianocore/edk2.git

Indeed this is enough to build EfiRom.
However if you want to build firmwares (your patch 4/5), the submodule
is incomplete, until you manually run "submodule update --init --recursive".

I suggest the following change, Daniel/Alex what do you think?

-- >8 --
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 98ca0f2737..5441fe3385 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -71,7 +71,7 @@ update)
         exit 0
     fi

-    $GIT submodule update --init $modules 1>/dev/null
+    $GIT submodule update --init --recursive $modules 1>/dev/null
     test $? -ne 0 && error "failed to update modules"

     $GIT submodule status $modules > "${substat}"
---

> diff --git a/roms/edk2 b/roms/edk2
> new file mode 160000
> index 000000000000..85588389222a
> --- /dev/null
> +++ b/roms/edk2
> @@ -0,0 +1 @@
> +Subproject commit 85588389222a3636baf0f9ed8227f2434af4c3f9
> 

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

* Re: [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule Laszlo Ersek
  2019-01-21  7:35   ` Gerd Hoffmann
@ 2019-01-21 11:27   ` Philippe Mathieu-Daudé
  2019-01-21 11:37     ` Philippe Mathieu-Daudé
  2019-01-21 18:33     ` Laszlo Ersek
  1 sibling, 2 replies; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-21 11:27 UTC (permalink / raw)
  To: Laszlo Ersek, qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Shannon Zhao

Hi Laszlo,

On 1/18/19 11:33 PM, Laszlo Ersek wrote:
> Building the EfiRom utility from "roms/edk2/BaseTools" should make
> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
> EfiRom for building the combined iPXE option ROMs, but call the sibling
> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  roms/Makefile | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index a6043eff37e9..78d5dd18c301 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>  # We need that to combine multiple images (legacy bios,
>  # efi ia32, efi x64) into a single rom binary.
>  #
> -# We try to find it in the path.  You can also pass the location on
> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
> -#
> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  
>  default:
>  	@echo "nothing is build by default"
> @@ -59,8 +56,7 @@ default:
>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>  	@echo "  sgabios        -- update sgabios binaries"
>  	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
> +	@echo "  efirom         -- update nic roms (bios+efi)"
>  	@echo "  slof           -- update slof.bin"
>  	@echo "  skiboot        -- update skiboot.lid"
>  	@echo "  u-boot.e500    -- update u-boot.e500"
> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>  
>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>  
> -efi-rom-%: build-pxe-roms build-efi-roms
> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>  
> +$(EFIROM):
> +	$(MAKE) -C edk2/BaseTools

Since this is a single tool/file, can we simply use:

        $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

>  
>  slof:
>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
> @@ -150,6 +148,7 @@ clean:
>  	$(MAKE) -C sgabios clean
>  	rm -f sgabios/.depend
>  	$(MAKE) -C ipxe/src veryclean
> +	$(MAKE) -C edk2/BaseTools clean

Ditto.

>  	$(MAKE) -C SLOF clean
>  	rm -rf u-boot/build.e500
>  	$(MAKE) -C u-boot-sam460ex distclean
> 

Whichever path used:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

* Re: [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-21 11:27   ` Philippe Mathieu-Daudé
@ 2019-01-21 11:37     ` Philippe Mathieu-Daudé
  2019-01-21 18:34       ` Laszlo Ersek
  2019-01-21 18:33     ` Laszlo Ersek
  1 sibling, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-21 11:37 UTC (permalink / raw)
  To: Laszlo Ersek, Michael S. Tsirkin, Gerd Hoffmann
  Cc: qemu devel list, Ard Biesheuvel, Igor Mammedov, Shannon Zhao

On 1/21/19 12:27 PM, Philippe Mathieu-Daudé wrote:
> Hi Laszlo,
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  roms/Makefile | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/roms/Makefile b/roms/Makefile
>> index a6043eff37e9..78d5dd18c301 100644
>> --- a/roms/Makefile
>> +++ b/roms/Makefile
>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>  # We need that to combine multiple images (legacy bios,
>>  # efi ia32, efi x64) into a single rom binary.
>>  #
>> -# We try to find it in the path.  You can also pass the location on
>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>> -#
>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>  
>>  default:
>>  	@echo "nothing is build by default"
>> @@ -59,8 +56,7 @@ default:
>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>  	@echo "  sgabios        -- update sgabios binaries"
>>  	@echo "  pxerom         -- update nic roms (bios only)"
>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>  	@echo "  slof           -- update slof.bin"
>>  	@echo "  skiboot        -- update skiboot.lid"
>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>  
>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>  
>> -efi-rom-%: build-pxe-roms build-efi-roms
>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>  
>> +$(EFIROM):
>> +	$(MAKE) -C edk2/BaseTools
> 
> Since this is a single tool/file, can we simply use:
> 
>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

Also, note that this doesn't work for out-of-tree builds, but this
problem is pre-existent to your series.

> 
>>  
>>  slof:
>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>> @@ -150,6 +148,7 @@ clean:
>>  	$(MAKE) -C sgabios clean
>>  	rm -f sgabios/.depend
>>  	$(MAKE) -C ipxe/src veryclean
>> +	$(MAKE) -C edk2/BaseTools clean
> 
> Ditto.
> 
>>  	$(MAKE) -C SLOF clean
>>  	rm -rf u-boot/build.e500
>>  	$(MAKE) -C u-boot-sam460ex distclean
>>
> 
> Whichever path used:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-18 22:33 ` [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts Laszlo Ersek
@ 2019-01-21 12:17   ` Philippe Mathieu-Daudé
  2019-01-21 19:05     ` Laszlo Ersek
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-21 12:17 UTC (permalink / raw)
  To: Laszlo Ersek, Ard Biesheuvel
  Cc: qemu devel list, Michael S. Tsirkin, Gerd Hoffmann,
	Igor Mammedov, Shannon Zhao

Hi Laszlo,

On 1/18/19 11:33 PM, Laszlo Ersek wrote:
> Introduce the following build scripts under "tests/uefi-test-tools":
> 
> * "build.sh" builds a single module (a UEFI application) from
>   UefiTestToolsPkg, for a single QEMU emulation target.
> 
>   "build.sh" relies on cross-compilers when the emulation target and the
>   build host architecture don't match. The cross-compiler prefix is
>   computed according to a fixed, Linux-specific pattern. No attempt is
>   made to copy or reimplement the GNU Make magic from "qemu/roms/Makefile"
>   for cross-compiler prefix determination. The reason is that the build
>   host OSes that are officially supported by edk2, and those that are
>   supported by QEMU, intersect only in Linux. (Note that the UNIXGCC
>   toolchain is being removed from edk2,
>   <https://bugzilla.tianocore.org/show_bug.cgi?id=1377>.)
> 
> * "Makefile" currently builds the "UefiTestToolsPkg/BiosTablesTest"
>   application, for arm, aarch64, i386, and x86_64, with the help of
>   "build.sh".
> 
>   "Makefile" turns each resultant UEFI executable into a UEFI-bootable,
>   qcow2-compressed ISO image. The ISO images are output as
>   "tests/data/uefi-boot-images/bios-tables-test.<TARGET>.iso.qcow2".
> 
>   Each ISO image should be passed to QEMU as follows:
> 
>     -drive id=boot-cd,if=none,readonly,format=qcow2,file=$ISO \
>     -device virtio-scsi-pci,id=scsi0 \
>     -device scsi-cd,drive=boot-cd,bus=scsi0.0,bootindex=0 \
> 
>   "Makefile" assumes that "mkdosfs", "mtools", and "genisoimage" are
>   present.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  tests/uefi-test-tools/Makefile   |  92 +++++++++++++
>  tests/uefi-test-tools/.gitignore |   3 +
>  tests/uefi-test-tools/build.sh   | 145 ++++++++++++++++++++
>  3 files changed, 240 insertions(+)
> 
> diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile
> new file mode 100644
> index 000000000000..7b6dd227e433
> --- /dev/null
> +++ b/tests/uefi-test-tools/Makefile
> @@ -0,0 +1,92 @@
> +# Makefile for the test helper UEFI applications that run in guests.
> +#
> +# Copyright (C) 2019, Red Hat, Inc.
> +#
> +# This program and the accompanying materials are licensed and made available
> +# under the terms and conditions of the BSD License that accompanies this
> +# distribution. The full text of the license may be found at
> +# <http://opensource.org/licenses/bsd-license.php>.
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
> +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +edk2_dir              := ../../roms/edk2
> +images_dir            := ../data/uefi-boot-images
> +emulation_targets     := arm aarch64 i386 x86_64
> +uefi_binaries         := bios-tables-test
> +intermediate_suffixes := .efi .fat .iso.raw
> +
> +images: $(foreach binary,$(uefi_binaries), \
> +		$(foreach target,$(emulation_targets), \
> +			$(images_dir)/$(binary).$(target).iso.qcow2))
> +
> +# Preserve all intermediate targets if the build succeeds.
> +# - Intermediate targets help with development & debugging.
> +# - Preserving intermediate targets also keeps spurious changes out of the
> +#   final build products, in case the user re-runs "make" without any changes
> +#   to the UEFI source code. Normally, the intermediate files would have been
> +#   removed by the last "make" invocation, hence the re-run would rebuild them
> +#   from the unchanged UEFI sources. Unfortunately, the "mkdosfs" and
> +#   "genisoimage" utilities embed timestamp-based information in their outputs,
> +#   which causes git to report differences for the tracked qcow2 ISO images.
> +.SECONDARY: $(foreach binary,$(uefi_binaries), \
> +		$(foreach target,$(emulation_targets), \
> +			$(foreach suffix,$(intermediate_suffixes), \
> +				Build/$(binary).$(target)$(suffix))))
> +
> +# In the pattern rules below, the stem (%, $*) stands for
> +# "$(binary).$(target)".
> +
> +# Convert the raw ISO image to a qcow2 one, enabling compression, and using a
> +# small cluster size. This allows for small binary files under git control,
> +# hence for small binary patches.
> +$(images_dir)/%.iso.qcow2: Build/%.iso.raw
> +	mkdir -p -- $(images_dir)
> +	$${QTEST_QEMU_IMG:-qemu-img} convert -f raw -O qcow2 -c \
> +		-o cluster_size=512 -- $< $@
> +
> +# Embed the "UEFI system partition" into an ISO9660 file system as an ElTorito
> +# boot image.
> +Build/%.iso.raw: Build/%.fat
> +	genisoimage -input-charset ASCII -efi-boot $(notdir $<) -no-emul-boot \
> +		-quiet -o $@ -- $<
> +
> +# Define chained macros in order to map QEMU system emulation targets to
> +# *short* UEFI architecture identifiers. Periods are allowed in, and ultimately
> +# stripped from, the argument.
> +map_arm_to_uefi     = $(subst arm,ARM,$(1))
> +map_aarch64_to_uefi = $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1)))
> +map_i386_to_uefi    = $(subst i386,IA32,$(call map_aarch64_to_uefi,$(1)))
> +map_x86_64_to_uefi  = $(subst x86_64,X64,$(call map_i386_to_uefi,$(1)))
> +map_to_uefi         = $(subst .,,$(call map_x86_64_to_uefi,$(1)))
> +
> +# Format a "UEFI system partition", using the UEFI binary as the default boot
> +# loader. Add 10% size for filesystem metadata, round up to the next KB, and
> +# make sure the size is large enough for a FAT filesystem. Name the filesystem
> +# after the UEFI binary. (Excess characters are automatically dropped from the
> +# filesystem label.)
> +Build/%.fat: Build/%.efi
> +	rm -f -- $@
> +	uefi_bin_b=$$(stat --format=%s -- $<) && \
> +		uefi_fat_kb=$$(( (uefi_bin_b * 11 / 10 + 1023) / 1024 )) && \
> +		uefi_fat_kb=$$(( uefi_fat_kb >= 64 ? uefi_fat_kb : 64 )) && \
> +		mkdosfs -C $@ -n $(basename $(@F)) -- $$uefi_fat_kb
> +	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI
> +	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI/BOOT
> +	MTOOLS_SKIP_CHECK=1 mcopy -i $@ -- $< \
> +		::EFI/BOOT/BOOT$(call map_to_uefi,$(suffix $*)).EFI
> +
> +# In the pattern rules below, the stem (%, $*) stands for "$(target)" only. The
> +# association between the UEFI binary (such as "bios-tables-test") and the
> +# component name from the edk2 platform DSC file (such as "BiosTablesTest") is
> +# explicit in each rule.
> +
> +Build/bios-tables-test.%.efi: build-edk2-tools
> +	./build.sh $(edk2_dir) BiosTablesTest $* $@
> +
> +build-edk2-tools:
> +	$(MAKE) -C $(edk2_dir)/BaseTools
> +
[...]

I got errors [1] and [2] I couldn't figure out while running 'make -j4'.

The following patch didn't help, any idea?

-- >8 --
diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile
index 7b6dd227e4..798c55c823 100644
--- a/tests/uefi-test-tools/Makefile
+++ b/tests/uefi-test-tools/Makefile
@@ -81,6 +81,8 @@ Build/%.fat: Build/%.efi
 # component name from the edk2 platform DSC file (such as
"BiosTablesTest") is
 # explicit in each rule.

+.NOTPARALLEL: $(foreach
target,$(emulation_targets),Build/bios-tables-test.$(target).efi)
+
 Build/bios-tables-test.%.efi: build-edk2-tools
        ./build.sh $(edk2_dir) BiosTablesTest $* $@

diff --git a/tests/uefi-test-tools/build.sh b/tests/uefi-test-tools/build.sh
index 155cb75c4d..13891a7385 100755
--- a/tests/uefi-test-tools/build.sh
+++ b/tests/uefi-test-tools/build.sh
@@ -133,6 +133,7 @@ esac
 # Build the UEFI binary
 mkdir -p log
 build \
+  -n 1 \
   --arch="$edk2_arch" \
   --buildtarget=DEBUG \
   --platform=UefiTestToolsPkg/UefiTestToolsPkg.dsc \
---

Anyway building using "make -j1" works.

[1]:

    Building ...
qemu/roms/edk2/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
[ARM]
    make[1]: Entering directory
'qemu/tests/uefi-test-tools/Build/UefiTestTools/DEBUG_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib'
    "arm-linux-gnu-gcc" -mthumb -march=armv7-a -E -x assembler-with-cpp
-include
qemu/tests/uefi-test-tools/Build/UefiTestTools/DEBUG_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/DEBUG/AutoGen.h
-Iqemu/roms/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm
-Iqemu/roms/edk2/ArmPkg/Library/CompilerIntrinsicsLib
-Iqemu/tests/uefi-test-tools/Build/UefiTestTools/DEBUG_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/DEBUG
-Iqemu/roms/edk2/MdePkg -Iqemu/roms/edk2/MdePkg/Include
-Iqemu/roms/edk2/MdePkg/Include/Arm -Iqemu/roms/edk2/ArmPkg
-Iqemu/roms/edk2/ArmPkg/Include
qemu/roms/edk2/ArmPkg/Library/CompilerIntrinsicsLib/Arm/divsi3.S >
qemu/tests/uefi-test-tools/Build/UefiTestTools/DEBUG_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib/OUTPUT/Arm/divsi3.i
    make[1]: *** read jobs pipe: Bad file descriptor.  Stop.
    make[1]: *** Waiting for unfinished jobs....
    build.py...
     : error 7000: Failed to execute command
        make tbuild
[qemu/tests/uefi-test-tools/Build/UefiTestTools/DEBUG_GCC5/ARM/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib]


    build.py...
     : error F002: Failed to build module

qemu/roms/edk2/ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
[ARM, GCC5, DEBUG]

    - Failed -
    Build end time: 13:08:01, Jan.21 2019
    Build total time: 00:00:02

[2]:

    Active Platform          =
qemu/tests/uefi-test-tools/UefiTestToolsPkg/UefiTestToolsPkg.dsc
    Active Module            =
qemu/tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.inf

    Processing meta-data .

    build.py...
     : error C0DE: Unknown fatal error when processing
[qemu/roms/edk2/MdePkg/MdePkg.dec]

    (Please send email to edk2-devel@lists.01.org for help, attaching
following call stack trace!)

    (Python 2.7.15 on linux2) Traceback (most recent call last):
      File
"qemu/roms/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py",
line 2494, in Main
        MyBuild.Launch()
      File
"qemu/roms/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py",
line 2231, in Launch
        self._BuildModule()
      File
"qemu/roms/edk2/BaseTools/BinWrappers/PosixLike/../../Source/Python/build/build.py",
line 1837, in _BuildModule
        self.ModuleFile
      File "qemu/roms/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py",
line 241, in __init__
        self._InitWorker(Workspace, MetaFile, Target, Toolchain, Arch,
*args, **kwargs)
      File "qemu/roms/edk2/BaseTools/Source/Python/AutoGen/AutoGen.py",
line 405, in _InitWorker
        PlatformPcds = Platform.Pcds
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/DscBuildData.py", line
1176, in Pcds
        self._Pcds.update(self._GetPcd(MODEL_PCD_FIXED_AT_BUILD))
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/DscBuildData.py", line
1601, in _GetPcd
        PcdValue, DatumType, MaxDatumSize = self._ValidatePcd(PcdCName,
TokenSpaceGuid, Setting, Type, Dummy4)
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/DscBuildData.py", line
897, in _ValidatePcd
        self._DecPcds, self._GuidDict = GetDeclaredPcd(self, self._Bdb,
self._Arch, self._Target, self._Toolchain, PkgSet)
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/WorkspaceCommon.py",
line 68, in GetDeclaredPcd
        Guids = Pkg.Guids
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/DecBuildData.py", line
262, in Guids
        RecordList = self._RawData[MODEL_EFI_GUID, self._Arch]
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/MetaFileParser.py",
line 249, in __getitem__
        self.Start()
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/MetaFileParser.py",
line 1788, in Start
        0
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/MetaFileParser.py",
line 195, in _Store
        return self._Table.Insert(*Args)
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/MetaFileTable.py",
line 211, in Insert
        Enabled
      File
"qemu/roms/edk2/BaseTools/Source/Python/Workspace/MetaDataTable.py",
line 79, in Insert
        self.Cur.execute(SqlCommand)
    IntegrityError: UNIQUE constraint failed: _1012_3.ID

    - Failed -
    Build end time: 12:44:27, Jan.21 2019
    Build total time: 00:00:02

    make: *** [Makefile:85: Build/bios-tables-test.x86_64.efi] Error 1
    make: *** Waiting for unfinished jobs....

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

* Re: [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-21 11:27   ` Philippe Mathieu-Daudé
  2019-01-21 11:37     ` Philippe Mathieu-Daudé
@ 2019-01-21 18:33     ` Laszlo Ersek
  1 sibling, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-21 18:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu devel list
  Cc: Michael S. Tsirkin, Ard Biesheuvel, Gerd Hoffmann, Igor Mammedov,
	Shannon Zhao

On 01/21/19 12:27, Philippe Mathieu-Daudé wrote:
> Hi Laszlo,
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  roms/Makefile | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/roms/Makefile b/roms/Makefile
>> index a6043eff37e9..78d5dd18c301 100644
>> --- a/roms/Makefile
>> +++ b/roms/Makefile
>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>  # We need that to combine multiple images (legacy bios,
>>  # efi ia32, efi x64) into a single rom binary.
>>  #
>> -# We try to find it in the path.  You can also pass the location on
>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>> -#
>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>  
>>  default:
>>  	@echo "nothing is build by default"
>> @@ -59,8 +56,7 @@ default:
>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>  	@echo "  sgabios        -- update sgabios binaries"
>>  	@echo "  pxerom         -- update nic roms (bios only)"
>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>  	@echo "  slof           -- update slof.bin"
>>  	@echo "  skiboot        -- update skiboot.lid"
>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>  
>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>  
>> -efi-rom-%: build-pxe-roms build-efi-roms
>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>  
>> +$(EFIROM):
>> +	$(MAKE) -C edk2/BaseTools
> 
> Since this is a single tool/file, can we simply use:
> 
>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

Unfortunately, the BaseTools makefile(s) aren't granular enough for this. They don't track dependencies well enough, at the individual tool level. The above command would fail:

-------
make: Entering directory `/home/lacos/src/upstream/edk2/BaseTools/Source/C/EfiRom'
mkdir ../bin
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  EfiRom.c -o EfiRom.o
gcc -o ../bin/EfiRom   EfiRom.o -L../libs -lCommon
/usr/bin/ld: cannot find -lCommon
collect2: error: ld returned 1 exit status
-------

> 
>>  
>>  slof:
>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>> @@ -150,6 +148,7 @@ clean:
>>  	$(MAKE) -C sgabios clean
>>  	rm -f sgabios/.depend
>>  	$(MAKE) -C ipxe/src veryclean
>> +	$(MAKE) -C edk2/BaseTools clean
> 
> Ditto.
> 
>>  	$(MAKE) -C SLOF clean
>>  	rm -rf u-boot/build.e500
>>  	$(MAKE) -C u-boot-sam460ex distclean
>>
> 
> Whichever path used:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 

thanks!
Laszlo

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

* Re: [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule
  2019-01-21 11:37     ` Philippe Mathieu-Daudé
@ 2019-01-21 18:34       ` Laszlo Ersek
  0 siblings, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-21 18:34 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Michael S. Tsirkin, Gerd Hoffmann
  Cc: qemu devel list, Ard Biesheuvel, Igor Mammedov, Shannon Zhao

On 01/21/19 12:37, Philippe Mathieu-Daudé wrote:
> On 1/21/19 12:27 PM, Philippe Mathieu-Daudé wrote:
>> Hi Laszlo,
>>
>> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>>
>>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Igor Mammedov <imammedo@redhat.com>
>>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>>  roms/Makefile | 13 ++++++-------
>>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/roms/Makefile b/roms/Makefile
>>> index a6043eff37e9..78d5dd18c301 100644
>>> --- a/roms/Makefile
>>> +++ b/roms/Makefile
>>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>>  # We need that to combine multiple images (legacy bios,
>>>  # efi ia32, efi x64) into a single rom binary.
>>>  #
>>> -# We try to find it in the path.  You can also pass the location on
>>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>>> -#
>>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>>  
>>>  default:
>>>  	@echo "nothing is build by default"
>>> @@ -59,8 +56,7 @@ default:
>>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>>  	@echo "  sgabios        -- update sgabios binaries"
>>>  	@echo "  pxerom         -- update nic roms (bios only)"
>>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>>  	@echo "  slof           -- update slof.bin"
>>>  	@echo "  skiboot        -- update skiboot.lid"
>>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>>  
>>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>>  
>>> -efi-rom-%: build-pxe-roms build-efi-roms
>>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>>  
>>> +$(EFIROM):
>>> +	$(MAKE) -C edk2/BaseTools
>>
>> Since this is a single tool/file, can we simply use:
>>
>>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom
> 
> Also, note that this doesn't work for out-of-tree builds, but this
> problem is pre-existent to your series.

Right, "roms/Makefile" is unrelated to building QEMU itself (which is
supposed to work outside of the source tree); it is for maintainers when
they intend to refresh the bundled fw stuff.

Thanks
Laszlo

> 
>>
>>>  
>>>  slof:
>>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>>> @@ -150,6 +148,7 @@ clean:
>>>  	$(MAKE) -C sgabios clean
>>>  	rm -f sgabios/.depend
>>>  	$(MAKE) -C ipxe/src veryclean
>>> +	$(MAKE) -C edk2/BaseTools clean
>>
>> Ditto.
>>
>>>  	$(MAKE) -C SLOF clean
>>>  	rm -rf u-boot/build.e500
>>>  	$(MAKE) -C u-boot-sam460ex distclean
>>>
>>
>> Whichever path used:
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>

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

* Re: [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-21 11:25   ` Philippe Mathieu-Daudé
@ 2019-01-21 18:41     ` Laszlo Ersek
  2019-01-21 19:45       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-21 18:41 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Daniel P. Berrange, Alex Bennée
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Gerd Hoffmann, Igor Mammedov, Shannon Zhao

On 01/21/19 12:25, Philippe Mathieu-Daudé wrote:
> Cc'ing Daniel & Alex.
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> The roms/edk2 submodule can help with three goals:
>> - build the OVMF and ArmVirtQemu virtual UEFI firmware platforms (to be
>>   implemented later),
>> - build the EfiRom tool on the fly, which is used in roms/Makefile, for
>>   building the "efirom" target,
>> - build UEFI test applications (to be run in guests), for qtest support.
>>
>> Edk2 commit 85588389222a3636baf0f9ed8227f2434af4c3f9 stands for the latest
>> "stable tag", namely "edk2-stable201811".
>>
>> The edk2 repository tracks some binary files that should not be removed by
>> QEMU's top-level "make clean"; exempt the full pathnames from the "find"
>> command.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  Makefile    | 6 +++++-
>>  .gitmodules | 3 +++
>>  roms/edk2   | 1 +
>>  3 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index dccba1dca27f..1f768e2bcf8f 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -602,7 +602,11 @@ clean:
>>  	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
>>  	rm -f qemu-options.def
>>  	rm -f *.msi
>> -	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
>> +	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
>> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
>> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
>> +		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
> 
> Hmm I never try in-tree builds and thought this rule was for the
> archived release out of git, so this wouldn't matter.

That's not correct; before I posted the series, I downloaded the
then-latest tarball release, and I saw that the roms/ submoule trees
were flattened into it. Try:

wget -O - -q https://download.qemu.org/qemu-3.1.0.tar.xz \
| tar -t --xz \
| grep roms/

> 
>> +		-exec rm {} +
>>  	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
>>  	rm -f fsdev/*.pod scsi/*.pod
>>  	rm -f qemu-img-cmds.h
>> diff --git a/.gitmodules b/.gitmodules
>> index 6b91176098c8..ceafb0ee29a0 100644
>> --- a/.gitmodules
>> +++ b/.gitmodules
>> @@ -49,3 +49,6 @@
>>  [submodule "tests/fp/berkeley-softfloat-3"]
>>  	path = tests/fp/berkeley-softfloat-3
>>  	url = https://github.com/cota/berkeley-softfloat-3
>> +[submodule "roms/edk2"]
>> +	path = roms/edk2
>> +	url = https://github.com/tianocore/edk2.git
> 
> Indeed this is enough to build EfiRom.
> However if you want to build firmwares (your patch 4/5), the submodule
> is incomplete, until you manually run "submodule update --init --recursive".

That applies equally to the other submodules (firmware or otherwise)
that we have under roms/. Edk2 is not being added as a nested submodule,
it is a sibling; so whatever tooling covers e.g. roms/seabios and
roms/ipxe, the same tooling should cover roms/edk2 too.

> 
> I suggest the following change, Daniel/Alex what do you think?
> 
> -- >8 --
> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
> index 98ca0f2737..5441fe3385 100755
> --- a/scripts/git-submodule.sh
> +++ b/scripts/git-submodule.sh
> @@ -71,7 +71,7 @@ update)
>          exit 0
>      fi
> 
> -    $GIT submodule update --init $modules 1>/dev/null
> +    $GIT submodule update --init --recursive $modules 1>/dev/null
>      test $? -ne 0 && error "failed to update modules"
> 
>      $GIT submodule status $modules > "${substat}"
> ---

This shouldn't make a difference, as edk2 is not a nested submodule of
another submodule; it is a submodule directly under the main
superproject, i.e. QEMU.

Thanks,
Laszlo

> 
>> diff --git a/roms/edk2 b/roms/edk2
>> new file mode 160000
>> index 000000000000..85588389222a
>> --- /dev/null
>> +++ b/roms/edk2
>> @@ -0,0 +1 @@
>> +Subproject commit 85588389222a3636baf0f9ed8227f2434af4c3f9
>>

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-21 12:17   ` Philippe Mathieu-Daudé
@ 2019-01-21 19:05     ` Laszlo Ersek
  2019-01-21 19:30       ` Peter Maydell
  0 siblings, 1 reply; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-21 19:05 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Ard Biesheuvel
  Cc: qemu devel list, Michael S. Tsirkin, Gerd Hoffmann,
	Igor Mammedov, Shannon Zhao

On 01/21/19 13:17, Philippe Mathieu-Daudé wrote:
> Hi Laszlo,
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> Introduce the following build scripts under "tests/uefi-test-tools":
>>
>> * "build.sh" builds a single module (a UEFI application) from
>>   UefiTestToolsPkg, for a single QEMU emulation target.
>>
>>   "build.sh" relies on cross-compilers when the emulation target and the
>>   build host architecture don't match. The cross-compiler prefix is
>>   computed according to a fixed, Linux-specific pattern. No attempt is
>>   made to copy or reimplement the GNU Make magic from "qemu/roms/Makefile"
>>   for cross-compiler prefix determination. The reason is that the build
>>   host OSes that are officially supported by edk2, and those that are
>>   supported by QEMU, intersect only in Linux. (Note that the UNIXGCC
>>   toolchain is being removed from edk2,
>>   <https://bugzilla.tianocore.org/show_bug.cgi?id=1377>.)
>>
>> * "Makefile" currently builds the "UefiTestToolsPkg/BiosTablesTest"
>>   application, for arm, aarch64, i386, and x86_64, with the help of
>>   "build.sh".
>>
>>   "Makefile" turns each resultant UEFI executable into a UEFI-bootable,
>>   qcow2-compressed ISO image. The ISO images are output as
>>   "tests/data/uefi-boot-images/bios-tables-test.<TARGET>.iso.qcow2".
>>
>>   Each ISO image should be passed to QEMU as follows:
>>
>>     -drive id=boot-cd,if=none,readonly,format=qcow2,file=$ISO \
>>     -device virtio-scsi-pci,id=scsi0 \
>>     -device scsi-cd,drive=boot-cd,bus=scsi0.0,bootindex=0 \
>>
>>   "Makefile" assumes that "mkdosfs", "mtools", and "genisoimage" are
>>   present.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  tests/uefi-test-tools/Makefile   |  92 +++++++++++++
>>  tests/uefi-test-tools/.gitignore |   3 +
>>  tests/uefi-test-tools/build.sh   | 145 ++++++++++++++++++++
>>  3 files changed, 240 insertions(+)
>>
>> diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile
>> new file mode 100644
>> index 000000000000..7b6dd227e433
>> --- /dev/null
>> +++ b/tests/uefi-test-tools/Makefile
>> @@ -0,0 +1,92 @@
>> +# Makefile for the test helper UEFI applications that run in guests.
>> +#
>> +# Copyright (C) 2019, Red Hat, Inc.
>> +#
>> +# This program and the accompanying materials are licensed and made available
>> +# under the terms and conditions of the BSD License that accompanies this
>> +# distribution. The full text of the license may be found at
>> +# <http://opensource.org/licenses/bsd-license.php>.
>> +#
>> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
>> +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
>> +
>> +edk2_dir              := ../../roms/edk2
>> +images_dir            := ../data/uefi-boot-images
>> +emulation_targets     := arm aarch64 i386 x86_64
>> +uefi_binaries         := bios-tables-test
>> +intermediate_suffixes := .efi .fat .iso.raw
>> +
>> +images: $(foreach binary,$(uefi_binaries), \
>> +		$(foreach target,$(emulation_targets), \
>> +			$(images_dir)/$(binary).$(target).iso.qcow2))
>> +
>> +# Preserve all intermediate targets if the build succeeds.
>> +# - Intermediate targets help with development & debugging.
>> +# - Preserving intermediate targets also keeps spurious changes out of the
>> +#   final build products, in case the user re-runs "make" without any changes
>> +#   to the UEFI source code. Normally, the intermediate files would have been
>> +#   removed by the last "make" invocation, hence the re-run would rebuild them
>> +#   from the unchanged UEFI sources. Unfortunately, the "mkdosfs" and
>> +#   "genisoimage" utilities embed timestamp-based information in their outputs,
>> +#   which causes git to report differences for the tracked qcow2 ISO images.
>> +.SECONDARY: $(foreach binary,$(uefi_binaries), \
>> +		$(foreach target,$(emulation_targets), \
>> +			$(foreach suffix,$(intermediate_suffixes), \
>> +				Build/$(binary).$(target)$(suffix))))
>> +
>> +# In the pattern rules below, the stem (%, $*) stands for
>> +# "$(binary).$(target)".
>> +
>> +# Convert the raw ISO image to a qcow2 one, enabling compression, and using a
>> +# small cluster size. This allows for small binary files under git control,
>> +# hence for small binary patches.
>> +$(images_dir)/%.iso.qcow2: Build/%.iso.raw
>> +	mkdir -p -- $(images_dir)
>> +	$${QTEST_QEMU_IMG:-qemu-img} convert -f raw -O qcow2 -c \
>> +		-o cluster_size=512 -- $< $@
>> +
>> +# Embed the "UEFI system partition" into an ISO9660 file system as an ElTorito
>> +# boot image.
>> +Build/%.iso.raw: Build/%.fat
>> +	genisoimage -input-charset ASCII -efi-boot $(notdir $<) -no-emul-boot \
>> +		-quiet -o $@ -- $<
>> +
>> +# Define chained macros in order to map QEMU system emulation targets to
>> +# *short* UEFI architecture identifiers. Periods are allowed in, and ultimately
>> +# stripped from, the argument.
>> +map_arm_to_uefi     = $(subst arm,ARM,$(1))
>> +map_aarch64_to_uefi = $(subst aarch64,AA64,$(call map_arm_to_uefi,$(1)))
>> +map_i386_to_uefi    = $(subst i386,IA32,$(call map_aarch64_to_uefi,$(1)))
>> +map_x86_64_to_uefi  = $(subst x86_64,X64,$(call map_i386_to_uefi,$(1)))
>> +map_to_uefi         = $(subst .,,$(call map_x86_64_to_uefi,$(1)))
>> +
>> +# Format a "UEFI system partition", using the UEFI binary as the default boot
>> +# loader. Add 10% size for filesystem metadata, round up to the next KB, and
>> +# make sure the size is large enough for a FAT filesystem. Name the filesystem
>> +# after the UEFI binary. (Excess characters are automatically dropped from the
>> +# filesystem label.)
>> +Build/%.fat: Build/%.efi
>> +	rm -f -- $@
>> +	uefi_bin_b=$$(stat --format=%s -- $<) && \
>> +		uefi_fat_kb=$$(( (uefi_bin_b * 11 / 10 + 1023) / 1024 )) && \
>> +		uefi_fat_kb=$$(( uefi_fat_kb >= 64 ? uefi_fat_kb : 64 )) && \
>> +		mkdosfs -C $@ -n $(basename $(@F)) -- $$uefi_fat_kb
>> +	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI
>> +	MTOOLS_SKIP_CHECK=1 mmd -i $@ ::EFI/BOOT
>> +	MTOOLS_SKIP_CHECK=1 mcopy -i $@ -- $< \
>> +		::EFI/BOOT/BOOT$(call map_to_uefi,$(suffix $*)).EFI
>> +
>> +# In the pattern rules below, the stem (%, $*) stands for "$(target)" only. The
>> +# association between the UEFI binary (such as "bios-tables-test") and the
>> +# component name from the edk2 platform DSC file (such as "BiosTablesTest") is
>> +# explicit in each rule.
>> +
>> +Build/bios-tables-test.%.efi: build-edk2-tools
>> +	./build.sh $(edk2_dir) BiosTablesTest $* $@
>> +
>> +build-edk2-tools:
>> +	$(MAKE) -C $(edk2_dir)/BaseTools
>> +
> [...]
> 
> I got errors [1] and [2] I couldn't figure out while running 'make -j4'.
> 
> The following patch didn't help, any idea?
> 
> -- >8 --
> diff --git a/tests/uefi-test-tools/Makefile b/tests/uefi-test-tools/Makefile
> index 7b6dd227e4..798c55c823 100644
> --- a/tests/uefi-test-tools/Makefile
> +++ b/tests/uefi-test-tools/Makefile
> @@ -81,6 +81,8 @@ Build/%.fat: Build/%.efi
>  # component name from the edk2 platform DSC file (such as
> "BiosTablesTest") is
>  # explicit in each rule.
> 
> +.NOTPARALLEL: $(foreach
> target,$(emulation_targets),Build/bios-tables-test.$(target).efi)
> +
>  Build/bios-tables-test.%.efi: build-edk2-tools
>         ./build.sh $(edk2_dir) BiosTablesTest $* $@
> 
> diff --git a/tests/uefi-test-tools/build.sh b/tests/uefi-test-tools/build.sh
> index 155cb75c4d..13891a7385 100755
> --- a/tests/uefi-test-tools/build.sh
> +++ b/tests/uefi-test-tools/build.sh
> @@ -133,6 +133,7 @@ esac
>  # Build the UEFI binary
>  mkdir -p log
>  build \
> +  -n 1 \
>    --arch="$edk2_arch" \
>    --buildtarget=DEBUG \
>    --platform=UefiTestToolsPkg/UefiTestToolsPkg.dsc \
> ---

It wasn't clear to me whether and how multi-threaded builds were
supposed to be used by maintainers, whenever they'd update
"tests/data/uefi-boot-images/*".

I saw that "make" was invoked everywhere as $(MAKE), but that didn't
clarify any intent around "-j". So I didn't test "-j" at all, and in
fact I wouldn't have expected it to work:

- At any point in time, there shouldn't be more than one instance of the
"build" base tool working.

- the "build" base tool itself contains some level of support (although
not complete) for parallelizing edk2 module builds: it does not
parallelize the compilation of source files between each other *within*
a single edk2 module (= INF file). It parallelizes modules (INF files)
between each other.

- This means if you build only one module at a time, passing the "-m"
switch (plus an INF file) to the "build" base tool, then there's nothing
to parallelize.

- "build.sh" does pass the "-m" switch to the "build" tool, because I
wanted the build output to be granular. That is, it should be possible
for someone to build just a given uefi-test-tools image for just a given
architecture, if they specify the corresponding pathname (as target)
when they invoke "make". This usage requires the "-m" flag, which in
turn precludes the parallelism built into the "build" base tool itself.
And, invoking multiple "build" instances in parallel is not supposed to
work.


Regarding why ".NOTPARALLEL" doesn't work -- the GNU Make documentation
writes:

  [...]  Any recursively invoked make command will still run recipes in
  parallel (unless its makefile also contains this target). [...]

The "build" base tool in edk2 implements part of the job with generated
makefiles and invoking "make" itself, thus, despite .NOTPARALLEL, it
likely inherits the outermost -j<N> setting -- and it doesn't expect such.

So the best I can offer here is to check $MAKEFLAGS in "build.sh", and
exit with an early, explicit error if $MAKEFLAGS contains "-j", "-l", or
their long variants (--jobs, --load-average).

I realize this would not be acceptable for building QEMU itself, but
"tests/uefi-test-tools/Makefile" should be run by some subsystem
maintainers only, interactively (or in their on custom scripts).

Thanks
Laszlo

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-21 19:05     ` Laszlo Ersek
@ 2019-01-21 19:30       ` Peter Maydell
  2019-01-22 12:02         ` Laszlo Ersek
  0 siblings, 1 reply; 22+ messages in thread
From: Peter Maydell @ 2019-01-21 19:30 UTC (permalink / raw)
  To: Laszlo Ersek
  Cc: Philippe Mathieu-Daudé,
	Ard Biesheuvel, Igor Mammedov, Shannon Zhao, Gerd Hoffmann,
	qemu devel list, Michael S. Tsirkin

On Mon, 21 Jan 2019 at 19:09, Laszlo Ersek <lersek@redhat.com> wrote:
> It wasn't clear to me whether and how multi-threaded builds were
> supposed to be used by maintainers, whenever they'd update
> "tests/data/uefi-boot-images/*".
>
> I saw that "make" was invoked everywhere as $(MAKE), but that didn't
> clarify any intent around "-j". So I didn't test "-j" at all, and in
> fact I wouldn't have expected it to work:

The usual assumption with make is that "-jN" should work
and at least (if the thing being built can't actually
be parallelized usefully) be no worse than if you'd not
specified a -j option. We have occasionally had problems
with -jN in 'make check' (usually because several test cases
were trying to use the same temp filename or similar) but
we've treated them as bugs and squashed them.

> The "build" base tool in edk2 implements part of the job with generated
> makefiles and invoking "make" itself, thus, despite .NOTPARALLEL, it
> likely inherits the outermost -j<N> setting -- and it doesn't expect such.
>
> So the best I can offer here is to check $MAKEFLAGS in "build.sh", and
> exit with an early, explicit error if $MAKEFLAGS contains "-j", "-l", or
> their long variants (--jobs, --load-average).

Could you sanitize MAKEFLAGS in build.sh instead to remove the
parallelization options?

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-21 18:41     ` Laszlo Ersek
@ 2019-01-21 19:45       ` Philippe Mathieu-Daudé
  2019-01-22 10:51         ` Laszlo Ersek
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-01-21 19:45 UTC (permalink / raw)
  To: Laszlo Ersek, Daniel P. Berrange, Alex Bennée
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Gerd Hoffmann, Igor Mammedov, Shannon Zhao

On 1/21/19 7:41 PM, Laszlo Ersek wrote:
> On 01/21/19 12:25, Philippe Mathieu-Daudé wrote:
>> Cc'ing Daniel & Alex.
>>
>> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>>> The roms/edk2 submodule can help with three goals:
>>> - build the OVMF and ArmVirtQemu virtual UEFI firmware platforms (to be
>>>   implemented later),
>>> - build the EfiRom tool on the fly, which is used in roms/Makefile, for
>>>   building the "efirom" target,
>>> - build UEFI test applications (to be run in guests), for qtest support.
>>>
>>> Edk2 commit 85588389222a3636baf0f9ed8227f2434af4c3f9 stands for the latest
>>> "stable tag", namely "edk2-stable201811".
>>>
>>> The edk2 repository tracks some binary files that should not be removed by
>>> QEMU's top-level "make clean"; exempt the full pathnames from the "find"
>>> command.
>>>
>>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Igor Mammedov <imammedo@redhat.com>
>>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>>  Makefile    | 6 +++++-
>>>  .gitmodules | 3 +++
>>>  roms/edk2   | 1 +
>>>  3 files changed, 9 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index dccba1dca27f..1f768e2bcf8f 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -602,7 +602,11 @@ clean:
>>>  	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
>>>  	rm -f qemu-options.def
>>>  	rm -f *.msi
>>> -	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
>>> +	find . \( -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f \
>>> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-aarch64.a \
>>> +		! -path ./roms/edk2/ArmPkg/Library/GccLto/liblto-arm.a \
>>> +		! -path ./roms/edk2/BaseTools/Source/Python/UPT/Dll/sqlite3.dll \
>>
>> Hmm I never try in-tree builds and thought this rule was for the
>> archived release out of git, so this wouldn't matter.
> 
> That's not correct; before I posted the series, I downloaded the
> then-latest tarball release, and I saw that the roms/ submoule trees
> were flattened into it. Try:

My previous sentence is probably incorrect in english, let me reword as:
"I thought (incorrectly) this rule wouldn't matter for in-tree builds".
So I see it does matter, and your change do make sens.

> 
> wget -O - -q https://download.qemu.org/qemu-3.1.0.tar.xz \
> | tar -t --xz \
> | grep roms/
> 
>>
>>> +		-exec rm {} +
>>>  	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
>>>  	rm -f fsdev/*.pod scsi/*.pod
>>>  	rm -f qemu-img-cmds.h
>>> diff --git a/.gitmodules b/.gitmodules
>>> index 6b91176098c8..ceafb0ee29a0 100644
>>> --- a/.gitmodules
>>> +++ b/.gitmodules
>>> @@ -49,3 +49,6 @@
>>>  [submodule "tests/fp/berkeley-softfloat-3"]
>>>  	path = tests/fp/berkeley-softfloat-3
>>>  	url = https://github.com/cota/berkeley-softfloat-3
>>> +[submodule "roms/edk2"]
>>> +	path = roms/edk2
>>> +	url = https://github.com/tianocore/edk2.git
>>
>> Indeed this is enough to build EfiRom.
>> However if you want to build firmwares (your patch 4/5), the submodule
>> is incomplete, until you manually run "submodule update --init --recursive".
> 
> That applies equally to the other submodules (firmware or otherwise)
> that we have under roms/. Edk2 is not being added as a nested submodule,
> it is a sibling; so whatever tooling covers e.g. roms/seabios and
> roms/ipxe, the same tooling should cover roms/edk2 too.

OK.

>>
>> I suggest the following change, Daniel/Alex what do you think?
>>
>> -- >8 --
>> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
>> index 98ca0f2737..5441fe3385 100755
>> --- a/scripts/git-submodule.sh
>> +++ b/scripts/git-submodule.sh
>> @@ -71,7 +71,7 @@ update)
>>          exit 0
>>      fi
>>
>> -    $GIT submodule update --init $modules 1>/dev/null
>> +    $GIT submodule update --init --recursive $modules 1>/dev/null
>>      test $? -ne 0 && error "failed to update modules"
>>
>>      $GIT submodule status $modules > "${substat}"
>> ---
> 
> This shouldn't make a difference, as edk2 is not a nested submodule of
> another submodule; it is a submodule directly under the main
> superproject, i.e. QEMU.

OK (as long as we don't want to build OVMF within QEMU to run QEMU tests).

> 
> Thanks,
> Laszlo
> 
>>
>>> diff --git a/roms/edk2 b/roms/edk2
>>> new file mode 160000
>>> index 000000000000..85588389222a
>>> --- /dev/null
>>> +++ b/roms/edk2
>>> @@ -0,0 +1 @@
>>> +Subproject commit 85588389222a3636baf0f9ed8227f2434af4c3f9
>>>
> 

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

* Re: [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule
  2019-01-21 19:45       ` Philippe Mathieu-Daudé
@ 2019-01-22 10:51         ` Laszlo Ersek
  0 siblings, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-22 10:51 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Daniel P. Berrange, Alex Bennée
  Cc: qemu devel list, Michael S. Tsirkin, Ard Biesheuvel,
	Gerd Hoffmann, Igor Mammedov, Shannon Zhao

On 01/21/19 20:45, Philippe Mathieu-Daudé wrote:
> On 1/21/19 7:41 PM, Laszlo Ersek wrote:
>> On 01/21/19 12:25, Philippe Mathieu-Daudé wrote:

>>> I suggest the following change, Daniel/Alex what do you think?
>>>
>>> -- >8 --
>>> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
>>> index 98ca0f2737..5441fe3385 100755
>>> --- a/scripts/git-submodule.sh
>>> +++ b/scripts/git-submodule.sh
>>> @@ -71,7 +71,7 @@ update)
>>>          exit 0
>>>      fi
>>>
>>> -    $GIT submodule update --init $modules 1>/dev/null
>>> +    $GIT submodule update --init --recursive $modules 1>/dev/null
>>>      test $? -ne 0 && error "failed to update modules"
>>>
>>>      $GIT submodule status $modules > "${substat}"
>>> ---
>>
>> This shouldn't make a difference, as edk2 is not a nested submodule of
>> another submodule; it is a submodule directly under the main
>> superproject, i.e. QEMU.
> 
> OK (as long as we don't want to build OVMF within QEMU to run QEMU tests).

I think if / whenever we bundle OVMF binaries with QEMU, there'll be a
two step process (like with other roms); maintainers will (re)build the
binaries and commit/merge them, and tests will use the bundled binaries
as they are.

Thanks
Laszlo

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-21 19:30       ` Peter Maydell
@ 2019-01-22 12:02         ` Laszlo Ersek
  2019-01-23 16:13           ` Laszlo Ersek
  0 siblings, 1 reply; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-22 12:02 UTC (permalink / raw)
  To: Peter Maydell, Philippe Mathieu-Daudé
  Cc: Ard Biesheuvel, Igor Mammedov, Shannon Zhao, Gerd Hoffmann,
	qemu devel list, Michael S. Tsirkin

On 01/21/19 20:30, Peter Maydell wrote:
> On Mon, 21 Jan 2019 at 19:09, Laszlo Ersek <lersek@redhat.com> wrote:
>> It wasn't clear to me whether and how multi-threaded builds were
>> supposed to be used by maintainers, whenever they'd update
>> "tests/data/uefi-boot-images/*".
>>
>> I saw that "make" was invoked everywhere as $(MAKE), but that didn't
>> clarify any intent around "-j". So I didn't test "-j" at all, and in
>> fact I wouldn't have expected it to work:
> 
> The usual assumption with make is that "-jN" should work
> and at least (if the thing being built can't actually
> be parallelized usefully) be no worse than if you'd not
> specified a -j option. We have occasionally had problems
> with -jN in 'make check' (usually because several test cases
> were trying to use the same temp filename or similar) but
> we've treated them as bugs and squashed them.
> 
>> The "build" base tool in edk2 implements part of the job with generated
>> makefiles and invoking "make" itself, thus, despite .NOTPARALLEL, it
>> likely inherits the outermost -j<N> setting -- and it doesn't expect such.
>>
>> So the best I can offer here is to check $MAKEFLAGS in "build.sh", and
>> exit with an early, explicit error if $MAKEFLAGS contains "-j", "-l", or
>> their long variants (--jobs, --load-average).
> 
> Could you sanitize MAKEFLAGS in build.sh instead to remove the
> parallelization options?

I've looked into MAKEFLAGS in a bit more depth now; both the
documentation and some debug prints. Manipulating MAKEFLAGS looks
somewhat brittle.

So, I was about to suggest that I use the .NOTPARALLEL special target
recommended by Phil, for the .efi binaries (which would ensure that no
two instances of the "build" base tool run at the same time), *plus*
that I submit a patch to edk2 so that the makefiles generated by the
"build" tool also contain .NOTPARALLEL.

(Because, to quote the make docs again, "If .NOTPARALLEL is mentioned as
a target, then this invocation of make will be run serially, even if the
‘-j’ option is given. Any recursively invoked make command will still
run recipes in parallel (unless its makefile also contains this target).")

However: when I wanted to see the actual error from using .NOTPARALLEL
*only* in "tests/uefi-test-tools/Makefile", and not in the
build-generated makefiles, I failed to get any error. All the output
images were built just fine.

Phil: when you wrote that "The following patch didn't help" -- referring
to .NOTPARALLEL, added only to "tests/uefi-test-tools/Makefile"-- , did
you clean your tree first (with "make clean" or "git clean -ffdx")?

Because now I'm thinking that the *individual* makefiles generated by
edk2's "build" base tool might actually compatible with "-j", and your
testing of .NOTPARALLEL failed only because your build tree (for example
the Conf/ subdir -- list it with "-A") was in a messy state from your
previous -j4 attempt (where you didn't use .NOTPARALLEL at all).

Thanks
Laszlo

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-22 12:02         ` Laszlo Ersek
@ 2019-01-23 16:13           ` Laszlo Ersek
  2019-01-24 17:05             ` Laszlo Ersek
  0 siblings, 1 reply; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-23 16:13 UTC (permalink / raw)
  To: Peter Maydell, Philippe Mathieu-Daudé
  Cc: Michael S. Tsirkin, Ard Biesheuvel, qemu devel list,
	Shannon Zhao, Gerd Hoffmann, Igor Mammedov

On 01/22/19 13:02, Laszlo Ersek wrote:
> On 01/21/19 20:30, Peter Maydell wrote:
>> On Mon, 21 Jan 2019 at 19:09, Laszlo Ersek <lersek@redhat.com> wrote:
>>> It wasn't clear to me whether and how multi-threaded builds were
>>> supposed to be used by maintainers, whenever they'd update
>>> "tests/data/uefi-boot-images/*".
>>>
>>> I saw that "make" was invoked everywhere as $(MAKE), but that didn't
>>> clarify any intent around "-j". So I didn't test "-j" at all, and in
>>> fact I wouldn't have expected it to work:
>>
>> The usual assumption with make is that "-jN" should work
>> and at least (if the thing being built can't actually
>> be parallelized usefully) be no worse than if you'd not
>> specified a -j option. We have occasionally had problems
>> with -jN in 'make check' (usually because several test cases
>> were trying to use the same temp filename or similar) but
>> we've treated them as bugs and squashed them.
>>
>>> The "build" base tool in edk2 implements part of the job with generated
>>> makefiles and invoking "make" itself, thus, despite .NOTPARALLEL, it
>>> likely inherits the outermost -j<N> setting -- and it doesn't expect such.
>>>
>>> So the best I can offer here is to check $MAKEFLAGS in "build.sh", and
>>> exit with an early, explicit error if $MAKEFLAGS contains "-j", "-l", or
>>> their long variants (--jobs, --load-average).
>>
>> Could you sanitize MAKEFLAGS in build.sh instead to remove the
>> parallelization options?
> 
> I've looked into MAKEFLAGS in a bit more depth now; both the
> documentation and some debug prints. Manipulating MAKEFLAGS looks
> somewhat brittle.
> 
> So, I was about to suggest that I use the .NOTPARALLEL special target
> recommended by Phil, for the .efi binaries (which would ensure that no
> two instances of the "build" base tool run at the same time), *plus*
> that I submit a patch to edk2 so that the makefiles generated by the
> "build" tool also contain .NOTPARALLEL.
> 
> (Because, to quote the make docs again, "If .NOTPARALLEL is mentioned as
> a target, then this invocation of make will be run serially, even if the
> ‘-j’ option is given. Any recursively invoked make command will still
> run recipes in parallel (unless its makefile also contains this target).")
> 
> However: when I wanted to see the actual error from using .NOTPARALLEL
> *only* in "tests/uefi-test-tools/Makefile", and not in the
> build-generated makefiles, I failed to get any error. All the output
> images were built just fine.
> 
> Phil: when you wrote that "The following patch didn't help" -- referring
> to .NOTPARALLEL, added only to "tests/uefi-test-tools/Makefile"-- , did
> you clean your tree first (with "make clean" or "git clean -ffdx")?
> 
> Because now I'm thinking that the *individual* makefiles generated by
> edk2's "build" base tool might actually compatible with "-j", and your
> testing of .NOTPARALLEL failed only because your build tree (for example
> the Conf/ subdir -- list it with "-A") was in a messy state from your
> previous -j4 attempt (where you didn't use .NOTPARALLEL at all).

FWIW, I've asked

- both on edk2-devel, about adding .NOTPARALLEL to the generated inner
makefiles:

  "parallelism in the module-level, generated GNUmakefile's"
  https://lists.01.org/pipermail/edk2-devel/2019-January/035463.html

- and on help-make, about safely filtering the job-related options from
MAKEFLAGS, between the outer and inner "make" processes:

  "filtering job options from MAKEFLAGS, manually"
  http://lists.gnu.org/archive/html/help-make/2019-01/msg00003.html

Thanks
Laszlo

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

* Re: [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts
  2019-01-23 16:13           ` Laszlo Ersek
@ 2019-01-24 17:05             ` Laszlo Ersek
  0 siblings, 0 replies; 22+ messages in thread
From: Laszlo Ersek @ 2019-01-24 17:05 UTC (permalink / raw)
  To: Peter Maydell, Philippe Mathieu-Daudé
  Cc: Ard Biesheuvel, Michael S. Tsirkin, qemu devel list,
	Shannon Zhao, Gerd Hoffmann, Igor Mammedov

On 01/23/19 17:13, Laszlo Ersek wrote:

> FWIW, I've asked
> 
> - both on edk2-devel, about adding .NOTPARALLEL to the generated inner
> makefiles:
> 
>   "parallelism in the module-level, generated GNUmakefile's"
>   https://lists.01.org/pipermail/edk2-devel/2019-January/035463.html
> 
> - and on help-make, about safely filtering the job-related options from
> MAKEFLAGS, between the outer and inner "make" processes:
> 
>   "filtering job options from MAKEFLAGS, manually"
>   http://lists.gnu.org/archive/html/help-make/2019-01/msg00003.html

Results:

- The "build" utility in BaseTools generates such GNUMakefiles that
dependencies between targets are fully described. This is an explicit
goal and if we notice any missing deps, that's a bug to be reported and
fixed. As a consequence, we can expect the recipes in those GNUMakefiles
to be fully parallelizable. Therefore we need not add .NOTPARALLEL to
them (in the edk2 project), or filter MAKEFLAGS, or append "-j1" to
MAKEFLAGS.

- The .NOTPARALLEL target ignores any pre-requisites it gets;
.NOTPARALLEL applies to the entire current invocation of make. Therefore
we just need to stick a bare .NOTPARALLEL into
"tests/uefi-test-tools/Makefile", to keep "build" itself isolated.

I'm going to post v2 with this one addition (i.e., .NOTPARALLEL).

Thanks,
Laszlo

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

end of thread, other threads:[~2019-01-24 17:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-18 22:33 [Qemu-devel] [PATCH 0/5] add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule Laszlo Ersek
2019-01-18 22:33 ` [Qemu-devel] [PATCH 1/5] roms: add the edk2 project as a git submodule Laszlo Ersek
2019-01-21  7:35   ` Gerd Hoffmann
2019-01-21 11:25   ` Philippe Mathieu-Daudé
2019-01-21 18:41     ` Laszlo Ersek
2019-01-21 19:45       ` Philippe Mathieu-Daudé
2019-01-22 10:51         ` Laszlo Ersek
2019-01-18 22:33 ` [Qemu-devel] [PATCH 2/5] roms: build the EfiRom utility from the roms/edk2 submodule Laszlo Ersek
2019-01-21  7:35   ` Gerd Hoffmann
2019-01-21 11:27   ` Philippe Mathieu-Daudé
2019-01-21 11:37     ` Philippe Mathieu-Daudé
2019-01-21 18:34       ` Laszlo Ersek
2019-01-21 18:33     ` Laszlo Ersek
2019-01-18 22:33 ` [Qemu-devel] [PATCH 3/5] tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app Laszlo Ersek
2019-01-18 22:33 ` [Qemu-devel] [PATCH 4/5] tests/uefi-test-tools: add build scripts Laszlo Ersek
2019-01-21 12:17   ` Philippe Mathieu-Daudé
2019-01-21 19:05     ` Laszlo Ersek
2019-01-21 19:30       ` Peter Maydell
2019-01-22 12:02         ` Laszlo Ersek
2019-01-23 16:13           ` Laszlo Ersek
2019-01-24 17:05             ` Laszlo Ersek
2019-01-18 22:34 ` [Qemu-devel] [PATCH 5/5] tests/data: introduce "uefi-boot-images" with the "bios-tables-test" ISOs Laszlo Ersek

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.