Merge ~mfo/ubuntu/+source/xen:lp1956166v2 into ubuntu/+source/xen:ubuntu/focal-devel

Proposed by Mauricio Faria de Oliveira
Status: Merged
Merged at revision: 3dc1816e8b4773401502e20c76d88c16d24ca72a
Proposed branch: ~mfo/ubuntu/+source/xen:lp1956166v2
Merge into: ubuntu/+source/xen:ubuntu/focal-devel
Diff against target: 80 lines (+58/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch (+50/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
Review via email: mp+426503@code.launchpad.net

Description of the change

This is an incremental fix for LP#1956166, which addresses
a FTBFS on arm64/armhf introduced with the previous MR [1].

[1] https://code.launchpad.net/~mfo/ubuntu/+source/xen/+git/xen/+merge/426221

To post a comment you must log in.
Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :
Download full text (3.4 KiB)

The fixup patch does NOT change the generated assembly code
for the 3 functions in xen/common/lzo.c on both amd64/arm64:
- amd64: between the first patch (*ubuntu2.1) and this fixup (*ubuntu2.2), and
- arm64: between the original package (*ubuntu2) and this fixup (*ubuntu2.2).

Details:

$ wget https://launchpad.net/~mfo/+archive/ubuntu/lp1956166/+files/xen-hypervisor-4.11-amd64_4.11.3+24-g14b62ab3e5-1ubuntu2.1_amd64.deb
$ wget https://launchpad.net/~mfo/+archive/ubuntu/lp1956166/+files/xen-hypervisor-4.11-amd64_4.11.3+24-g14b62ab3e5-1ubuntu2.2_amd64.deb

$ https://launchpad.net/ubuntu/+archive/primary/+files/xen-hypervisor-4.11-arm64_4.11.3+24-g14b62ab3e5-1ubuntu2_arm64.deb
$ wget https://launchpad.net/~mfo/+archive/ubuntu/lp1956166/+files/xen-hypervisor-4.11-arm64_4.11.3+24-g14b62ab3e5-1ubuntu2.2_arm64.deb

$ ls -1
xen-hypervisor-4.11-amd64_4.11.3+24-g14b62ab3e5-1ubuntu2.1_amd64.deb
xen-hypervisor-4.11-amd64_4.11.3+24-g14b62ab3e5-1ubuntu2.2_amd64.deb
xen-hypervisor-4.11-arm64_4.11.3+24-g14b62ab3e5-1ubuntu2.2_arm64.deb
xen-hypervisor-4.11-arm64_4.11.3+24-g14b62ab3e5-1ubuntu2_arm64.deb

$ for ARCH in amd64 arm64; do
  for VERSION in 4.11.3+24-g14b62ab3e5-1ubuntu2{,.1,.2}; do

    DEB="xen-hypervisor-4.11-${ARCH}_${VERSION}_${ARCH}.deb"
    [ -f "$DEB" ] || continue

    DIR="xen-4.11-${ARCH}-${VERSION}"
    DIS="xen-4.11-${ARCH}-${VERSION}.disass"
    OBJDUMP='objdump'
    [ "$ARCH" != 'arm64' ] || OBJDUMP='aarch64-linux-gnu-objdump'

    dpkg-deb -x $DEB $DIR
    gunzip $DIR/usr/lib/debug/xen-syms-4.11.4-pre.gz
    $OBJDUMP -d $DIR/usr/lib/debug/xen-syms-4.11.4-pre > $DIS

    for FUNC in lzo1x_1_do_compress lzo1x_1_compress lzo1x_decompress_safe; do
      sed -n "/<${FUNC}>:/,/^\$/p" $DIS | cut -d: -f2- > $DIS.func-$FUNC
    done

  done
done

$ md5sum xen-4.11-amd64-*.func-* | sort
163d549302aad6dfd82f7669e2f2aa65 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.1.disass.func-lzo1x_1_compress
163d549302aad6dfd82f7669e2f2aa65 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_1_compress
de4dc27fc2584edc6a33183abe34cc24 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.1.disass.func-lzo1x_1_do_compress
de4dc27fc2584edc6a33183abe34cc24 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_1_do_compress
e68052e9060777fd445056132b4de031 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.1.disass.func-lzo1x_decompress_safe
e68052e9060777fd445056132b4de031 xen-4.11-amd64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_decompress_safe

$ md5sum xen-4.11-arm64-*.func-* | sort
4cd4f9d881190842449f23f8e2ac0dd1 xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_decompress_safe
4cd4f9d881190842449f23f8e2ac0dd1 xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.disass.func-lzo1x_decompress_safe
c100e134e2086017d15021b8ef38be7e xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_1_do_compress
c100e134e2086017d15021b8ef38be7e xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.disass.func-lzo1x_1_do_compress
e3e70b078204d5171b4d45d1f8fc1845 xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.2.disass.func-lzo1x_1_compress
e3e70b078204d5171b4d45d1f8fc1845 xen-4.11-arm64-4.11.3+24-g14b62ab3e5-1ubuntu2.disass....

Read more...

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

FTBFS offending commit:

 /git/xen$ gl1 -1 --format=quote 7c9f81687ad6
 commit 7c9f81687ad6 ("introduce unaligned.h")

 /git/xen$ git describe --contains 7c9f81687ad6
 4.15.0-rc1~280

In upstream/4.15, lzo.c was no longer built on arm, just on x86,
but downstream/4.11, it still is.

 ~/git/xen$ gl1 -1 --format=quote c492e19fdd05
 commit c492e19fdd05 ("xen: remove tmem from hypervisor")

 ~/git/xen$ git show c492e19fdd05
 diff --git a/xen/common/Makefile b/xen/common/Makefile
 ...
 -obj-$(CONFIG_TMEM) += lzo.o
 ...
 -lzo-y := lzo
 -lzo-$(CONFIG_TMEM) :=
 -obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma $(lzo-y) unlzo unlz4 earlycpio,$(n).init.o)
 +obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz unlzma lzo unlzo unlz4 earlycpio,$(n).init.o)

 /git/xen$ git describe --contains c492e19fdd05
 4.13.0-rc1~972

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Sorry you had to hit this bump, but I'm sure you will from now on always test build all arches :-)

I checked your change and it indeed just makes the backported version match the upstream patch in the sense of being x86 only. Approved and sponsored.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index ddb115c..a9a4cd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1xen (4.11.3+24-g14b62ab3e5-1ubuntu2.2) focal; urgency=medium
2
3 * Fix FTBFS on armhf/arm64 due to missing <asm/unaligned.h>:
4 - d/p/lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch
5
6 -- Mauricio Faria de Oliveira <mfo@canonical.com> Thu, 07 Jul 2022 13:53:37 -0300
7
1xen (4.11.3+24-g14b62ab3e5-1ubuntu2.1) focal; urgency=medium8xen (4.11.3+24-g14b62ab3e5-1ubuntu2.1) focal; urgency=medium
29
3 * Add support for zstd compressed kernels for Dom0/DomU on x86 (LP: #1956166)10 * Add support for zstd compressed kernels for Dom0/DomU on x86 (LP: #1956166)
diff --git a/debian/patches/lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch b/debian/patches/lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch
4new file mode 10064411new file mode 100644
index 0000000..d8ac52e
--- /dev/null
+++ b/debian/patches/lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch
@@ -0,0 +1,50 @@
1Bug-Ubuntu: https://bugs.launchpad.net/bugs/1956166
2Description: Fix FTBFS on armhf/arm64 due to <asm/unaligned.h>
3 Patch lp1956166-0001-introduce-unaligned.h.patch builds fine
4 on x86, but it fails to build from source on armhf and arm64:
5 .
6 lzo.c:100:10: fatal error: asm/unaligned.h: No such file or directory
7 .
8 The <asm/unaligned.h> header is only available on x86, but arm
9 also builds lzo.c in Xen 4.11 ('obj-y' in xen/common/Makefile).
10 This isn't the case in Xen 4.15 (original release of the patch),
11 where lzo.c is obj-$(CONFIG_X86)-based.
12 .
13 So, make the lzo.c changes in the patch more conditional to x86,
14 keeping the (local) previous unaligned macro definitions on arm.
15 .
16 This keeps the spirit of the upstream patch (which is x86-only),
17 and is backwards compatible with 4.11 code.
18Author: Mauricio Faria de Oliveira <mfo@canonical.com>
19Forwarded: not-needed
20Last-Update: 2022-07-07
21---
22This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
23Index: xen/xen/common/lzo.c
24===================================================================
25--- xen.orig/xen/common/lzo.c
26+++ xen/xen/common/lzo.c
27@@ -97,12 +97,23 @@
28 #ifdef __XEN__
29 #include <xen/lib.h>
30 #include <asm/byteorder.h>
31+#endif
32+
33+#ifdef CONFIG_X86
34+#ifdef __XEN__
35 #include <asm/unaligned.h>
36 #else
37 #define get_unaligned_le16(_p) (*(u16 *)(_p))
38 #endif
39+#endif
40
41 #include <xen/lzo.h>
42+#ifndef CONFIG_X86
43+#define get_unaligned(_p) (*(_p))
44+#define put_unaligned(_val,_p) (*(_p)=_val)
45+#define get_unaligned_le16(_p) (*(u16 *)(_p))
46+#define get_unaligned_le32(_p) (*(u32 *)(_p))
47+#endif
48
49 static noinline size_t
50 lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
diff --git a/debian/patches/series b/debian/patches/series
index 29c8653..d942e5b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -57,3 +57,4 @@ lp1956166-0002-lib-introduce-xxhash.patch
57lp1956166-0003-x86-Dom0-support-zstd-compressed-kernels.patch57lp1956166-0003-x86-Dom0-support-zstd-compressed-kernels.patch
58lp1956166-0004-libxenguest-add-get_unaligned_le32.patch58lp1956166-0004-libxenguest-add-get_unaligned_le32.patch
59lp1956166-0005-libxenguest-support-zstd-compressed-kernels.patch59lp1956166-0005-libxenguest-support-zstd-compressed-kernels.patch
60lp1956166-0006-fix-ftbfs-arm-lzo-unaligned.h.patch

Subscribers

People subscribed via source and target branches