Package: qemu-efi
Version: 0~20150106.5c2d456b-2
Tags: patch

GICv3 support has been added upstream, which is needed to support EFI
KVM guests on systems like Cavium's ThunderX. Attached are patches to
update the packaging after an upstream merge (I prepared/tested them
on top of upstream commit c2a892d).

>From fee3c101820b71fe912a7c875473b61545233333 Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Tue, 5 Jan 2016 16:04:19 -0700
Subject: [PATCH 1/6] New upstream release, for GICv3 support.

---
 debian/changelog

diff --git a/debian/changelog b/debian/changelog
index 2736c37..5cd97a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+edk2 (0~20160105.c2a892d-1) UNRELEASED; urgency=medium
+
+  * New upstream release, for GICv3 support.
+
+ -- dann frazier <da...@debian.org>  Tue, 05 Jan 2016 16:03:34 -0700
+
 edk2 (0~20150106.5c2d456b-2) unstable; urgency=medium
 
   [ Steve Langasek ]
-- 
2.7.0.rc3

>From b4b1778517c5172f63149e6cf938ff262940023c Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Tue, 5 Jan 2016 16:12:25 -0700
Subject: [PATCH 2/6] Drop patches that no longer apply

---
 .../patches/arm64-no-expensive-optimizations.patch | 23 --------------
 debian/patches/no-missing-braces.diff              | 15 ---------
 debian/patches/no-stack-protector-all-archs.diff   | 37 ----------------------
 debian/patches/series                              |  3 --
 4 files changed, 78 deletions(-)
 delete mode 100644 debian/patches/arm64-no-expensive-optimizations.patch
 delete mode 100644 debian/patches/no-missing-braces.diff
 delete mode 100644 debian/patches/no-stack-protector-all-archs.diff

diff --git a/debian/patches/arm64-no-expensive-optimizations.patch b/debian/patches/arm64-no-expensive-optimizations.patch
deleted file mode 100644
index b1fe9ac..0000000
--- a/debian/patches/arm64-no-expensive-optimizations.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Description: Workaround ARM64 compiler issue by disabling certain optimizations
- GCC5 introduced a regression when building edk2. The symptom is that KVM
- VMs hang before displaying any EFI messages. This was bisected down to the
- introduction of some bswap optimizations that can be disabled with
- -fno-expensive-optimizations.
-Author: dann frazier <da...@ubuntu.com>
-Last-Update: 2015-09-03
-Bug-Ubuntu: http://bugs.launchpad.net/bugs/1489560
-Forwarded: no
-
-diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
-index c3166e5..3848dc2 100644
---- a/BaseTools/Conf/tools_def.template
-+++ b/BaseTools/Conf/tools_def.template
-@@ -6732,7 +6732,7 @@ RELEASE_ARMGCC_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_F
- #
- # Use default values, or override in DSC file
- #
--*_ARMGCC_AARCH64_ARCHCC_FLAGS    = -fno-stack-protector
-+*_ARMGCC_AARCH64_ARCHCC_FLAGS    = -fno-stack-protector -fno-expensive-optimizations
- *_ARMGCC_AARCH64_ARCHASM_FLAGS   =
- *_ARMGCC_AARCH64_ARCHDLINK_FLAGS =
- *_ARMGCC_AARCH64_PLATFORM_FLAGS  =
diff --git a/debian/patches/no-missing-braces.diff b/debian/patches/no-missing-braces.diff
deleted file mode 100644
index 3001ecb..0000000
--- a/debian/patches/no-missing-braces.diff
+++ /dev/null
@@ -1,15 +0,0 @@
-Description: Add -Wno-missing-braces to CFLAGS to avoid build failures
-Author: dann frazier <da...@debian.org>
-Forwarded: no
-
---- a/BaseTools/Conf/tools_def.template	2015-01-06 19:00:37.684069275 -0700
-+++ b/BaseTools/Conf/tools_def.template	2015-01-06 19:01:24.320317934 -0700
-@@ -3839,7 +3839,7 @@
- DEFINE GCC_ARM_RC_FLAGS            = -I binary -O elf32-littlearm     -B arm     --rename-section .data=.hii
- DEFINE GCC_AARCH64_RC_FLAGS        = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
- 
--DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-+DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-missing-braces -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
- DEFINE GCC44_IA32_CC_FLAGS           = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32
- DEFINE GCC44_X64_CC_FLAGS            = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large
- DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script
diff --git a/debian/patches/no-stack-protector-all-archs.diff b/debian/patches/no-stack-protector-all-archs.diff
deleted file mode 100644
index 66384c9..0000000
--- a/debian/patches/no-stack-protector-all-archs.diff
+++ /dev/null
@@ -1,37 +0,0 @@
-Author: Steve Langasek <steve.langa...@ubuntu.com>
-Description: pass -fno-stack-protector to all ARM GCC toolchains
- The upstream build rules inexplicably pass -fno-stack-protector only
- when building for i386 and amd64.  Add this essential argument to both the
- generic rules for gcc 4.4 and later, as well as to the ARMGCC toolchain
- target (since we want the latter for cross-building).
-Index: edk2/BaseTools/Conf/tools_def.template
-===================================================================
---- edk2.orig/BaseTools/Conf/tools_def.template
-+++ edk2/BaseTools/Conf/tools_def.template
-@@ -3839,7 +3839,7 @@
- DEFINE GCC_ARM_RC_FLAGS            = -I binary -O elf32-littlearm     -B arm     --rename-section .data=.hii
- DEFINE GCC_AARCH64_RC_FLAGS        = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
- 
--DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-missing-braces -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
-+DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-missing-braces -ffunction-sections -fdata-sections -fno-stack-protector -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
- DEFINE GCC44_IA32_CC_FLAGS           = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32
- DEFINE GCC44_X64_CC_FLAGS            = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large
- DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.4-ld-script
-@@ -6696,7 +6696,7 @@
- #
- # Use default values, or override in DSC file
- #
--*_ARMGCC_ARM_ARCHCC_FLAGS    =
-+*_ARMGCC_ARM_ARCHCC_FLAGS    = -fno-stack-protector
- *_ARMGCC_ARM_ARCHASM_FLAGS   =
- *_ARMGCC_ARM_ARCHDLINK_FLAGS =
- *_ARMGCC_ARM_PLATFORM_FLAGS  = -march=armv7-a
-@@ -6732,7 +6732,7 @@
- #
- # Use default values, or override in DSC file
- #
--*_ARMGCC_AARCH64_ARCHCC_FLAGS    =
-+*_ARMGCC_AARCH64_ARCHCC_FLAGS    = -fno-stack-protector
- *_ARMGCC_AARCH64_ARCHASM_FLAGS   =
- *_ARMGCC_AARCH64_ARCHDLINK_FLAGS =
- *_ARMGCC_AARCH64_PLATFORM_FLAGS  =
diff --git a/debian/patches/series b/debian/patches/series
index 8498739..47223ec 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,6 +1,3 @@
 shell-efiapi.patch
 enable-nvme
-no-missing-braces.diff
 FatPkg-AARCH64.diff
-no-stack-protector-all-archs.diff
-arm64-no-expensive-optimizations.patch
-- 
2.7.0.rc3

>From dbe76470557baaf9530b3f7a5a93414b0d238b00 Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Tue, 5 Jan 2016 16:25:32 -0700
Subject: [PATCH 3/6] Use GCC49 toolchain for all architectures

ARMGCC was dropped upstream in commit 64ffb95441efad61aac023942f26b5c7f0868396.
---
 debian/rules | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/debian/rules b/debian/rules
index cd946d1..90e6068 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,6 +16,8 @@ DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
+EDK2_TOOLCHAIN = GCC49
+
 ifeq ($(DEB_BUILD_ARCH),amd64)
 	EDK2_BUILD_ARCH=X64
 endif
@@ -49,7 +51,6 @@ setup-build:
 	QUILT_PC=.pc-post QUILT_PATCHES=debian/post-patches quilt push -a || [ $$? = 2 ]
 
 build-ovmf: EDK2_ARCH_DIR=X64
-build-ovmf: EDK2_TOOLCHAIN=GCC49
 build-ovmf:
 ifneq (,$(findstring ovmf, $(shell dh_listpackages)))
 	cd CryptoPkg/Library/OpensslLib/ && ./Install.sh
@@ -67,23 +68,22 @@ ifneq (,$(findstring ovmf, $(shell dh_listpackages)))
 		build -DSECURE_BOOT_ENABLE=TRUE -DFD_SIZE_2MB -b RELEASE
 endif
 
-build-qemu-efi: EDK2_TOOLCHAIN=ARMGCC
 build-qemu-efi: EDK2_ARCH_DIR=AArch64
 build-qemu-efi: EDK2_HOST_ARCH=AARCH64
-build-qemu-efi: CROSS_COMPILE=aarch64-linux-gnu-
+build-qemu-efi: GCC49_AARCH64_PREFIX=aarch64-linux-gnu-
 build-qemu-efi:
 	mkdir -p ShellBinPkg/UefiShell/$(EDK2_ARCH_DIR) FatBinPkg/EnhancedFatDxe/$(EDK2_ARCH_DIR)
 	set -e; . ./edksetup.sh; \
-		CROSS_COMPILE=$(CROSS_COMPILE) build -a $(EDK2_HOST_ARCH) \
+		GCC49_AARCH64_PREFIX=$(GCC49_AARCH64_PREFIX) build -a $(EDK2_HOST_ARCH) \
 			-p ShellPkg/ShellPkg.dsc -b RELEASE -t $(EDK2_TOOLCHAIN); \
 		cp -a Build/Shell/RELEASE_$(EDK2_TOOLCHAIN)/AARCH64/Shell.efi \
 			ShellBinPkg/UefiShell/$(EDK2_ARCH_DIR)/Shell.efi; \
-		CROSS_COMPILE=$(CROSS_COMPILE) build -a $(EDK2_HOST_ARCH) \
+		GCC49_AARCH64_PREFIX=$(GCC49_AARCH64_PREFIX) build -a $(EDK2_HOST_ARCH) \
 			-p FatPkg/FatPkg.dsc -m FatPkg/EnhancedFatDxe/Fat.inf \
 			-t $(EDK2_TOOLCHAIN) -b RELEASE; \
 		cp -a Build/Fat/RELEASE_$(EDK2_TOOLCHAIN)/$(EDK2_HOST_ARCH)/Fat.efi \
 			FatBinPkg/EnhancedFatDxe/$(EDK2_ARCH_DIR)/Fat.efi; \
-		CROSS_COMPILE=$(CROSS_COMPILE) build -a $(EDK2_HOST_ARCH) \
+		GCC49_AARCH64_PREFIX=$(GCC49_AARCH64_PREFIX) build -a $(EDK2_HOST_ARCH) \
 			-t $(EDK2_TOOLCHAIN) \
 			-p ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc \
 			-DINTEL_BDS \
-- 
2.7.0.rc3

>From 33d15781fa800bc55839682d92bbc438156ad50e Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Tue, 5 Jan 2016 16:32:12 -0700
Subject: [PATCH 4/6] Handle upstream rename of
 ArmPlatformPkg/ArmVirtualizationPkg -> ArmVirtPkg

This rename occurred upstream in commit 7fbd1eb2312d3dfab2ac8cdfcefc234c73d8aeeb.
---
 debian/qemu-efi.install | 2 +-
 debian/rules            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/qemu-efi.install b/debian/qemu-efi.install
index ab02cb0..bde62e9 100644
--- a/debian/qemu-efi.install
+++ b/debian/qemu-efi.install
@@ -1 +1 @@
-Build/ArmVirtualizationQemu-AARCH64/RELEASE_*GCC*/FV/QEMU_EFI.fd /usr/share/qemu-efi
+Build/ArmVirtQemu-AARCH64/RELEASE_*GCC*/FV/QEMU_EFI.fd /usr/share/qemu-efi
diff --git a/debian/rules b/debian/rules
index 90e6068..ae9cfb3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,7 +85,7 @@ build-qemu-efi:
 			FatBinPkg/EnhancedFatDxe/$(EDK2_ARCH_DIR)/Fat.efi; \
 		GCC49_AARCH64_PREFIX=$(GCC49_AARCH64_PREFIX) build -a $(EDK2_HOST_ARCH) \
 			-t $(EDK2_TOOLCHAIN) \
-			-p ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc \
+			-p ArmVirtPkg/ArmVirtQemu.dsc \
 			-DINTEL_BDS \
 			-b RELEASE
 
-- 
2.7.0.rc3

>From 79bed7c3c5aea180cfa1531c3fbaa6b7fe776ddb Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Tue, 5 Jan 2016 16:45:55 -0700
Subject: [PATCH 5/6] no-missing-braces.diff: Refresh and re-add

Confirmed still needed.
---
 debian/changelog                      |  1 +
 debian/patches/no-missing-braces.diff | 18 ++++++++++++++++++
 debian/patches/series                 |  1 +
 3 files changed, 20 insertions(+)
 create mode 100644 debian/patches/no-missing-braces.diff

diff --git a/debian/changelog b/debian/changelog
index 5cd97a6..2d6c8ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 edk2 (0~20160105.c2a892d-1) UNRELEASED; urgency=medium
 
   * New upstream release, for GICv3 support.
+  * debian/patches/no-missing-braces.diff: refreshed.
 
  -- dann frazier <da...@debian.org>  Tue, 05 Jan 2016 16:03:34 -0700
 
diff --git a/debian/patches/no-missing-braces.diff b/debian/patches/no-missing-braces.diff
new file mode 100644
index 0000000..5b14c67
--- /dev/null
+++ b/debian/patches/no-missing-braces.diff
@@ -0,0 +1,18 @@
+Description: Add -Wno-missing-braces to CFLAGS to avoid build failures
+Author: dann frazier <da...@debian.org>
+Forwarded: no
+Last-Updated: 2016-01-05
+
+Index: edk2-0~20160105.c2a892d/BaseTools/Conf/tools_def.template
+===================================================================
+--- edk2-0~20160105.c2a892d.orig/BaseTools/Conf/tools_def.template
++++ edk2-0~20160105.c2a892d/BaseTools/Conf/tools_def.template
+@@ -4349,7 +4349,7 @@ DEFINE GCC_IPF_RC_FLAGS            = -I
+ DEFINE GCC_ARM_RC_FLAGS            = -I binary -O elf32-littlearm     -B arm     --rename-section .data=.hii
+ DEFINE GCC_AARCH64_RC_FLAGS        = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii
+ 
+-DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
++DEFINE GCC44_ALL_CC_FLAGS            = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -Wno-missing-braces -ffunction-sections -fdata-sections -c -include AutoGen.h -fno-common -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ DEFINE GCC44_IA32_CC_FLAGS           = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables
+ DEFINE GCC44_X64_CC_FLAGS            = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables
+ DEFINE GCC44_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections -z common-page-size=0x20
diff --git a/debian/patches/series b/debian/patches/series
index 47223ec..1eec171 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 shell-efiapi.patch
 enable-nvme
 FatPkg-AARCH64.diff
+no-missing-braces.diff
-- 
2.7.0.rc3

>From 911d2e175e02caf27975e45e052316d32f11294f Mon Sep 17 00:00:00 2001
From: dann frazier <dann.fraz...@canonical.com>
Date: Fri, 8 Jan 2016 17:31:57 -0700
Subject: [PATCH 6/6] Add arm64-mstrict-align.patch

This replaces arm64-fno-expensive-optimizations.patch, a better fix for
LP: #1489560.
---
 debian/changelog                         |  2 ++
 debian/patches/arm64-mstrict-align.patch | 19 +++++++++++++++++++
 debian/patches/series                    |  1 +
 3 files changed, 22 insertions(+)
 create mode 100644 debian/patches/arm64-mstrict-align.patch

diff --git a/debian/changelog b/debian/changelog
index 2d6c8ee..b8e4bac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ edk2 (0~20160105.c2a892d-1) UNRELEASED; urgency=medium
 
   * New upstream release, for GICv3 support.
   * debian/patches/no-missing-braces.diff: refreshed.
+  * Supersede debian/patches/arm64-no-expensive-optimizations.patch
+    with debian/patches/arm64-mstrict-align.patch.
 
  -- dann frazier <da...@debian.org>  Tue, 05 Jan 2016 16:03:34 -0700
 
diff --git a/debian/patches/arm64-mstrict-align.patch b/debian/patches/arm64-mstrict-align.patch
new file mode 100644
index 0000000..49ab0a2
--- /dev/null
+++ b/debian/patches/arm64-mstrict-align.patch
@@ -0,0 +1,19 @@
+Description: Use -mstrict-align for AARCH64
+Author: dann frazier <da...@ubuntu.com>
+Last-Update: 2016-01-08
+Bug-Ubuntu: http://bugs.launchpad.net/bugs/1489560
+Forwarded: no
+
+Index: edk2-0~20160105.c2a892d/BaseTools/Conf/tools_def.template
+===================================================================
+--- edk2-0~20160105.c2a892d.orig/BaseTools/Conf/tools_def.template
++++ edk2-0~20160105.c2a892d/BaseTools/Conf/tools_def.template
+@@ -4323,7 +4323,7 @@ DEFINE GCC_IA32_CC_FLAGS           = DEF
+ DEFINE GCC_X64_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
+ DEFINE GCC_IPF_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
+ DEFINE GCC_ARM_CC_FLAGS            = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft
+-DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char  -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address -fno-asynchronous-unwind-tables
++DEFINE GCC_AARCH64_CC_FLAGS        = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mstrict-align -fno-short-enums -save-temps -fverbose-asm -fsigned-char  -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address -fno-asynchronous-unwind-tables
+ DEFINE GCC_DLINK_FLAGS_COMMON      = -nostdlib --pie
+ DEFINE GCC_DLINK2_FLAGS_COMMON     = --script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
+ DEFINE GCC_IA32_X64_DLINK_COMMON   = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
diff --git a/debian/patches/series b/debian/patches/series
index 1eec171..b05a0d5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+arm64-mstrict-align.patch
 shell-efiapi.patch
 enable-nvme
 FatPkg-AARCH64.diff
-- 
2.7.0.rc3

Reply via email to