Skip to contentSkip to conversation

tools: Use the system liblz4 package

PATCH In review Andrew Cooper 4 participants 13 messages Jun 3 – Jun 8

lore
Share & tools
lore
#0 lore raw

cover tools: Use the system liblz4 package

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

Andrew Cooper (2):
tools/configure: Detect the presence of liblz4 tools/libs/guest: Use the system liblz4 in the bzimage loader

 automation/build/debian/13-arm64v8.dockerfile |   1 +
 automation/build/debian/13-x86_64.dockerfile  |   1 +
 tools/configure                               |  79 ++++++++++
 tools/configure.ac                            |   4 +
 tools/libs/guest/Makefile.common              |   2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       | 128 +++++++++++++++-
 tools/libs/guest/xg_dom_decompress.h          |   6 -
 tools/libs/guest/xg_dom_decompress_lz4.c      | 143 ------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   2 +
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |  39 +++++
 10 files changed, 254 insertions(+), 151 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_lz4.c
 create mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c

base-commit: c069c014f21fd1f5925d8c30c18adb4f26381475

Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/2 tools/configure: Detect the presence of liblz4

As with other compression libraries, group liblz4 into ZLIB_{CFLAGS,LIBS}.

Add the packages to the Debian Trixie build containers for coverage.

---
CC: Anthony PERARD <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Oleksii Kurochko <[email protected]>

Rebuild the containers when pushed.

---
 automation/build/debian/13-arm64v8.dockerfile |  1 +
 automation/build/debian/13-x86_64.dockerfile  |  1 +
 tools/configure                               | 79 +++++++++++++++++++
 tools/configure.ac                            |  4 +
 4 files changed, 85 insertions(+)
automation/build/debian/13-arm64v8.dockerfile +1 -0
index b9062ee8b443..ee9bb841eb92 100644
@@ -28,6 +28,7 @@ RUN <<EOF
         wget
         # libxenguest dombuilder
         libbz2-dev
+        liblz4-dev
         liblzma-dev
         liblzo2-dev
         libzstd-dev
automation/build/debian/13-x86_64.dockerfile +1 -0
index 2c6c9d4a5098..e0a722595233 100644
@@ -29,6 +29,7 @@ RUN <<EOF
         wget
         # libxenguest dombuilder
         libbz2-dev
+        liblz4-dev
         liblzma-dev
         liblzo2-dev
         libzstd-dev
tools/configure +79 -0

103 lines not on this page · raw message

tools/configure.ac +4 -0
index ecd45e782eb8..74b9f56025cb 100644
@@ -403,6 +403,10 @@ PKG_CHECK_MODULES([libzstd], [libzstd],
     [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_ZSTD $libzstd_CFLAGS"
      ZLIB_LIBS="$ZLIB_LIBS $libzstd_LIBS"],
     [true])
+PKG_CHECK_MODULES([liblz4], [liblz4],
+    [ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_LZ4 $liblz4_CFLAGS"
+     ZLIB_LIBS="$ZLIB_LIBS $liblz4_LIBS"],
+    [true])
 AC_SUBST([ZLIB_CFLAGS])
 AC_SUBST([ZLIB_LIBS])
 AX_CHECK_EXTFS
Signature · 1 line
2.39.5
#3 lore raw

PATCH 2/2 tools/libs/guest: Use the system liblz4 in the bzimage loader

In reply to Andrew Cooper

Right now lz4, unlike every other compression scheme, unconditionally uses Xen's unsafe decompressor. Make it consistent with all other compression schemes by using liblz4.

The unsafe decompression is still required for the MiniOS build, so rename xg_dom_decompress_lz4.c to xg_dom_decompress_unsafe_lz4.c and drop the non-MiniOS content.

---
CC: Anthony PERARD <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Oleksii Kurochko <[email protected]>

---
 tools/libs/guest/Makefile.common              |   2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       | 128 +++++++++++++++-
 tools/libs/guest/xg_dom_decompress.h          |   6 -
 tools/libs/guest/xg_dom_decompress_lz4.c      | 143 ------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   2 +
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |  39 +++++
 6 files changed, 169 insertions(+), 151 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_lz4.c
 create mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
tools/libs/guest/Makefile.common +1 -1
index b928a4a246a9..86b1f160e536 100644
@@ -46,7 +46,6 @@ OBJS-y                 += xg_dom_core.o
 OBJS-y                 += xg_dom_boot.o
 OBJS-y                 += xg_dom_elfloader.o
 OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
-OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
 OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
 OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
 OBJS-y                 += xg_dom_binloader.o
@@ -59,6 +58,7 @@ OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 OBJS-y                 += xg_dom_decompress_unsafe.o
 OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y                 += xg_dom_decompress_unsafe_lz4.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
 OBJS-y                 += xg_dom_decompress_unsafe_xz.o
tools/libs/guest/xg_dom_bzimageloader.c +127 -1

140 lines not on this page · raw message

tools/libs/guest/xg_dom_decompress.h deleted +0 -6
deleted file mode 100644
index d7a45f730d67..000000000000
@@ -1,6 +0,0 @@
-#ifdef __MINIOS__
-# include "xg_dom_decompress_unsafe.h"
-#endif
-
-int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size);
-
tools/libs/guest/xg_dom_decompress_lz4.c deleted +0 -143

143 lines not on this page · raw message

tools/libs/guest/xg_dom_decompress_unsafe.h +2 -0
index ac6b94288d5e..5bc222207653 100644
@@ -16,6 +16,8 @@ int xc_dom_decompress_unsafe(
 
 int xc_try_bzip2_decode(struct xc_dom_image *dom, void **blob, size_t *size)
     __attribute__((visibility("internal")));
+int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+    __attribute__((visibility("internal")));
 int xc_try_lzma_decode(struct xc_dom_image *dom, void **blob, size_t *size)
     __attribute__((visibility("internal")));
 int xc_try_lzo1x_decode(struct xc_dom_image *dom, void **blob, size_t *size)
tools/libs/guest/xg_dom_decompress_unsafe_lz4.c new file +39 -0
new file mode 100644
index 000000000000..405143aa6182
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <stdint.h>
+
+#include INCLUDE_ENDIAN_H
+
+#define XG_NEED_UNALIGNED
+#include "xg_private.h"
+#include "xg_dom_decompress.h"
+
+#define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef uint64_t u64;
+
+#define likely(a) a
+#define unlikely(a) a
+
+static inline uint16_t le16_to_cpu(uint16_t v)
+{
+#if BYTE_ORDER == BIG_ENDIAN
+    return __builtin_bswap16(v);
+#else
+    return v;
+#endif
+}
+
+#include "../../xen/include/xen/lz4.h"
+#include "../../xen/common/decompress.h"
+#include "../../xen/common/unlz4.c"
+
+int xc_try_lz4_decode(
+    struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    return xc_dom_decompress_unsafe(unlz4, dom, blob, size);
+}
Signature · 1 line
2.39.5
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] tools/libs/guest: Use the system liblz4 in the bzimage loader

Quoted 9 lines · Andrew Cooper

Right now lz4, unlike every other compression scheme, unconditionally uses Xen's unsafe decompressor. Make it consistent with all other compression schemes by using liblz4.

The unsafe decompression is still required for the MiniOS build, so rename xg_dom_decompress_lz4.c to xg_dom_decompress_unsafe_lz4.c and drop the non-MiniOS content.

Quoted 71 lines

---
CC: Anthony PERARD <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Oleksii Kurochko <[email protected]>

---
 tools/libs/guest/Makefile.common              |   2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       | 128 +++++++++++++++-
 tools/libs/guest/xg_dom_decompress.h          |   6 -
 tools/libs/guest/xg_dom_decompress_lz4.c      | 143 ------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   2 +
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |  39 +++++
 6 files changed, 169 insertions(+), 151 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_lz4.c
 create mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
tools/libs/guest/Makefile.common +1 -1
index b928a4a246a9..86b1f160e536 100644
@@ -46,7 +46,6 @@ OBJS-y                 += xg_dom_core.o
 OBJS-y                 += xg_dom_boot.o
 OBJS-y                 += xg_dom_elfloader.o
 OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
-OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
 OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
 OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
 OBJS-y                 += xg_dom_binloader.o
@@ -59,6 +58,7 @@ OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 OBJS-y                 += xg_dom_decompress_unsafe.o
 OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y                 += xg_dom_decompress_unsafe_lz4.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
 OBJS-y                 += xg_dom_decompress_unsafe_xz.o
tools/libs/guest/xg_dom_bzimageloader.c +19 -1
index 1fb4e5a1f728..32b3c682a447 100644
@@ -32,7 +32,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xg_dom_decompress.h"
 
 #include <xen-tools/common-macros.h>
 
@@ -623,6 +622,133 @@ static int xc_try_zstd_decode(
 
 #endif
 
+#if defined(HAVE_LZ4)
+
+#include <lz4.h>
+
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+static int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    size_t outsize, insize;
+    unsigned char *outbuf = NULL, *inp = *blob, *outp;
+    uint32_t chunksize;
+
+    /* Magic, descriptor byte, and trailing size field. */
+    if ( *size <= 8 )
+    {
+        DOMPRINTF("LZ4: insufficient input data");
+        goto err;
+    }
+

tools/libs/guest/xg_dom_bzimageloader.c static int xc_try_zstd_decode( · line 653

Quoted 10 lines
tools/libs/guest/xg_dom_bzimageloader.c +10 -0
+    insize = *size - 4;
+    outsize = get_unaligned_le32(*blob + insize);
+
+    if ( xc_dom_kernel_check_size(dom, outsize) )
+    {
+        DOMPRINTF("LZ4: output too large");
+        goto err;
+    }
+
+    outbuf = malloc(outsize);

I would use calloc() or memset() the buffer, just in case part of it is (wrongly) left uninitialized, as this is copied into guest memory.

I see this is code moment, so possibly better to adjust afterwards if anything.

Thanks, Roger.

#5 lore raw

Re: [PATCH 2/2] tools/libs/guest: Use the system liblz4 in the bzimage loader

Quoted 96 lines · Roger Pau Monné
Quoted 9 lines · Andrew Cooper

Right now lz4, unlike every other compression scheme, unconditionally uses Xen's unsafe decompressor. Make it consistent with all other compression schemes by using liblz4.

The unsafe decompression is still required for the MiniOS build, so rename xg_dom_decompress_lz4.c to xg_dom_decompress_unsafe_lz4.c and drop the non-MiniOS content.

Quoted 71 lines

---
CC: Anthony PERARD <[email protected]>
CC: Juergen Gross <[email protected]>
CC: Oleksii Kurochko <[email protected]>

---
 tools/libs/guest/Makefile.common              |   2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       | 128 +++++++++++++++-
 tools/libs/guest/xg_dom_decompress.h          |   6 -
 tools/libs/guest/xg_dom_decompress_lz4.c      | 143 ------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   2 +
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |  39 +++++
 6 files changed, 169 insertions(+), 151 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_lz4.c
 create mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c
tools/libs/guest/Makefile.common +1 -1
index b928a4a246a9..86b1f160e536 100644
@@ -46,7 +46,6 @@ OBJS-y                 += xg_dom_core.o
 OBJS-y                 += xg_dom_boot.o
 OBJS-y                 += xg_dom_elfloader.o
 OBJS-$(CONFIG_X86)     += xg_dom_bzimageloader.o
-OBJS-$(CONFIG_X86)     += xg_dom_decompress_lz4.o
 OBJS-$(CONFIG_X86)     += xg_dom_hvmloader.o
 OBJS-$(CONFIG_ARM)     += xg_dom_armzimageloader.o
 OBJS-y                 += xg_dom_binloader.o
@@ -59,6 +58,7 @@ OBJS-$(CONFIG_ARM)     += xg_dom_arm.o
 ifeq ($(CONFIG_LIBXC_MINIOS),y)
 OBJS-y                 += xg_dom_decompress_unsafe.o
 OBJS-y                 += xg_dom_decompress_unsafe_bzip2.o
+OBJS-y                 += xg_dom_decompress_unsafe_lz4.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzma.o
 OBJS-y                 += xg_dom_decompress_unsafe_lzo1x.o
 OBJS-y                 += xg_dom_decompress_unsafe_xz.o
tools/libs/guest/xg_dom_bzimageloader.c +19 -1
index 1fb4e5a1f728..32b3c682a447 100644
@@ -32,7 +32,6 @@
 #include <inttypes.h>
 
 #include "xg_private.h"
-#include "xg_dom_decompress.h"
 
 #include <xen-tools/common-macros.h>
 
@@ -623,6 +622,133 @@ static int xc_try_zstd_decode(
 
 #endif
 
+#if defined(HAVE_LZ4)
+
+#include <lz4.h>
+
+#define ARCHIVE_MAGICNUMBER 0x184C2102
+
+static int xc_try_lz4_decode(struct xc_dom_image *dom, void **blob, size_t *size)
+{
+    size_t outsize, insize;
+    unsigned char *outbuf = NULL, *inp = *blob, *outp;
+    uint32_t chunksize;
+
+    /* Magic, descriptor byte, and trailing size field. */
+    if ( *size <= 8 )
+    {
+        DOMPRINTF("LZ4: insufficient input data");
+        goto err;
+    }
+

tools/libs/guest/xg_dom_bzimageloader.c static int xc_try_zstd_decode( · line 653

Quoted 10 lines
tools/libs/guest/xg_dom_bzimageloader.c +10 -0
+    insize = *size - 4;
+    outsize = get_unaligned_le32(*blob + insize);
+
+    if ( xc_dom_kernel_check_size(dom, outsize) )
+    {
+        DOMPRINTF("LZ4: output too large");
+        goto err;
+    }
+
+    outbuf = malloc(outsize);

I would use calloc() or memset() the buffer, just in case part of it is (wrongly) left uninitialized, as this is copied into guest memory.

Quoted 2 lines

I see this is code moment, so possibly better to adjust afterwards if anything.

There's a later check:

    if ( (outp - outbuf) != outsize )

which will fail and free the buffer if the output length isn't exactly as expected.

This code is all manner of horrible, including the fact that liblz4 doesn't actually have a function to decompress a full stream; only chunk-by-chunk with the caller providing the framing.

~Andrew

#6 lore raw
In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was no shared library available at the time (and on the SLES versions I worked with). Later a shared library appeared, but the -devel package still wasn't there. On my main dev system (intentionally a relatively old SLES version) I therefore wouldn't be able to build/test LZ4 anymore if we went this route. (FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

Jan

Quoted 21 lines

Andrew Cooper (2):
tools/configure: Detect the presence of liblz4 tools/libs/guest: Use the system liblz4 in the bzimage loader

 automation/build/debian/13-arm64v8.dockerfile |   1 +
 automation/build/debian/13-x86_64.dockerfile  |   1 +
 tools/configure                               |  79 ++++++++++
 tools/configure.ac                            |   4 +
 tools/libs/guest/Makefile.common              |   2 +-
 tools/libs/guest/xg_dom_bzimageloader.c       | 128 +++++++++++++++-
 tools/libs/guest/xg_dom_decompress.h          |   6 -
 tools/libs/guest/xg_dom_decompress_lz4.c      | 143 ------------------
 tools/libs/guest/xg_dom_decompress_unsafe.h   |   2 +
 .../libs/guest/xg_dom_decompress_unsafe_lz4.c |  39 +++++
 10 files changed, 254 insertions(+), 151 deletions(-)
 delete mode 100644 tools/libs/guest/xg_dom_decompress.h
 delete mode 100644 tools/libs/guest/xg_dom_decompress_lz4.c
 create mode 100644 tools/libs/guest/xg_dom_decompress_unsafe_lz4.c

base-commit: c069c014f21fd1f5925d8c30c18adb4f26381475

#7 lore raw
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

Quoted 7 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was no shared library available at the time (and on the SLES versions I worked with). Later a shared library appeared, but the -devel package still wasn't there. On my main dev system (intentionally a relatively old SLES version) I therefore wouldn't be able to build/test LZ4 anymore if we went this route. (FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

That was 13 years ago.  Are you saying that there's still an in-support version of SLES which doesn't have liblz4 ?

~Andrew

#8 lore raw
Quoted 15 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

Quoted 7 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was no shared library available at the time (and on the SLES versions I worked with). Later a shared library appeared, but the -devel package still wasn't there. On my main dev system (intentionally a relatively old SLES version) I therefore wouldn't be able to build/test LZ4 anymore if we went this route. (FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

Quoted 2 lines

That was 13 years ago.  Are you saying that there's still an in-support version of SLES which doesn't have liblz4 ?

If "in-support" includes LTSS, then yes as far as liblz4-devel goes. If you mean only ordinary support, then (afaict) no.

Jan

#9 lore raw
In reply to Jan Beulich
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

Generally, the patch series looks straightforward and low risk, so I am comfortable taking it for this release. Considering that...

Quoted 8 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was no shared library available at the time (and on the SLES versions I worked with). Later a shared library appeared, but the -devel package still wasn't there. On my main dev system (intentionally a relatively old SLES version) I therefore wouldn't be able to build/test LZ4 anymore if we went this route. (FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

...does not consider this an outright objection. While this may become an issue sooner or later on older dev systems, if the change is accepted into staging, we could switch to the shared library approach in 4.22.

We should also consider adding a note to CHANGELOG.md.

Thanks.

~ Oleksii

#10 lore raw
Quoted 21 lines · Oleksii Kurochko
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather than using the unsafe decompressor from Xen (itself a port of Linux's unsafe decompressor).

Generally, the patch series looks straightforward and low risk, so I am comfortable taking it for this release. Considering that...

Quoted 8 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was no shared library available at the time (and on the SLES versions I worked with). Later a shared library appeared, but the -devel package still wasn't there. On my main dev system (intentionally a relatively old SLES version) I therefore wouldn't be able to build/test LZ4 anymore if we went this route. (FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

Quoted 1 line

...does not consider this an outright objection. While this may become an issue sooner or later on older dev systems, if the change is accepted into staging, we could switch to the shared library approach in 4.22.

~ Oleksii

#11 lore raw
Quoted 32 lines · Oleksii Kurochko
Quoted 29 lines · Oleksii Kurochko
Quoted 8 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather
than using the unsafe decompressor from Xen (itself a port of Linux's unsafe
decompressor).

Generally, the patch series looks straightforward and low risk, so I am comfortable taking it for this release. Considering that...

Quoted 13 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was
no shared library available at the time (and on the SLES versions I worked
with). Later a shared library appeared, but the -devel package still wasn't
there. On my main dev system (intentionally a relatively old SLES version) I
therefore wouldn't be able to build/test LZ4 anymore if we went this route.
(FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

Quoted 6 lines
Quoted 4 lines

...does not consider this an outright objection. While this may become an issue sooner or later on older dev systems, if the change is accepted into staging, we could switch to the shared library approach in 4.22.

I've included this incremental diff for CHANGELOG.

CHANGELOG.md +0 -0
index 1db3efc4864c..5cf19372a361 100644
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

    represent a wildcard input.
  - On x86:
    - Enable pf-fixup option by default for PVH dom0.
+   - The libxenguest bzImage loader now uses the system liblz4 library.
 ### Added
  - Support for per-domain Xenstore quota in C xenstored (includes

~Andrew

#12 lore raw
Quoted 47 lines · Andrew Cooper
Quoted 32 lines · Oleksii Kurochko
Quoted 29 lines · Oleksii Kurochko
Quoted 8 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper

Switch to using the system liblz4.

This brings libxenguest's lz4 decompression in line all the others, rather
than using the unsafe decompressor from Xen (itself a port of Linux's unsafe
decompressor).

Generally, the patch series looks straightforward and low risk, so I am comfortable taking it for this release. Considering that...

Quoted 13 lines

As stated in 84f04d8f0dbf ("libxc: add LZ4 decompression support"), there was
no shared library available at the time (and on the SLES versions I worked
with). Later a shared library appeared, but the -devel package still wasn't
there. On my main dev system (intentionally a relatively old SLES version) I
therefore wouldn't be able to build/test LZ4 anymore if we went this route.
(FTAOD this isn't an outright objection, as the goal of the series is certainly good. It is mainly a data point to consider.)

Quoted 6 lines
Quoted 4 lines

...does not consider this an outright objection. While this may become an issue sooner or later on older dev systems, if the change is accepted into staging, we could switch to the shared library approach in 4.22.

I've included this incremental diff for CHANGELOG.

CHANGELOG.md +0 -0
index 1db3efc4864c..5cf19372a361 100644

CHANGELOG.md The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · line 16

Quoted 4 lines
CHANGELOG.md +1 -0
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
     represent a wildcard input.
   - On x86:
     - Enable pf-fixup option by default for PVH dom0.
+   - The libxenguest bzImage loader now uses the system liblz4 library.

Looks good to me.

Thanks.

~ Oleksii