Skip to contentSkip to conversation

lib/xz: Add ARM64 BCJ filter

PATCH In review Lasse Collin 2 participants 3 messages Nov 8, 2023 Xz embedded

lore
Share & tools
lore
#1 lore raw
In reply to Lasse Collin
Quoted 4 lines · On Wed, 8 Nov 2023 19:44:48 +0200 Lasse Collin <[email protected]> wrote:

ARM64 kernel decompression is done by bootloaders but the filter can still be useful, for example, for Squashfs.

A duplicated check for XZ_DEC_ARM in xz_private.h was omitted too.

There's nothing here that uses the new functionality?

Is a squashfs patch expected?

Lasse Collin

author maintainer
#0 lore raw

PATCH 1/1 lib/xz: Add ARM64 BCJ filter

From: Lasse Collin <[email protected]>

ARM64 kernel decompression is done by bootloaders but the filter can still be useful, for example, for Squashfs.

A duplicated check for XZ_DEC_ARM in xz_private.h was omitted too.

---

 lib/xz/Kconfig      |    5 +++++
 lib/xz/xz_dec_bcj.c |   50 +++++++++++++++++++++++++++++++++++++++++++++++++-
 lib/xz/xz_private.h |    7 +++++--
 3 files changed, 59 insertions(+), 3 deletions(-)
lib/xz/Kconfig +5 -0
diff -rup linux-6.6.orig/lib/xz/Kconfig linux-6.6/lib/xz/Kconfig
@@ -34,6 +34,11 @@ config XZ_DEC_ARMTHUMB
 	default y
 	select XZ_DEC_BCJ
 
+config XZ_DEC_ARM64
+	bool "ARM64 BCJ filter decoder" if EXPERT
+	default y
+	select XZ_DEC_BCJ
+
 config XZ_DEC_SPARC
 	bool "SPARC BCJ filter decoder" if EXPERT
 	default y
lib/xz/xz_dec_bcj.c +49 -1

74 lines not on this page · raw message

lib/xz/xz_private.h +5 -2
diff -rup linux-6.6.orig/lib/xz/xz_private.h linux-6.6/lib/xz/xz_private.h
@@ -37,6 +37,9 @@
 #		ifdef CONFIG_XZ_DEC_SPARC
 #			define XZ_DEC_SPARC
 #		endif
+#		ifdef CONFIG_XZ_DEC_ARM64
+#			define XZ_DEC_ARM64
+#		endif
 #		ifdef CONFIG_XZ_DEC_MICROLZMA
 #			define XZ_DEC_MICROLZMA
 #		endif
@@ -98,9 +101,9 @@
  */
 #ifndef XZ_DEC_BCJ
 #	if defined(XZ_DEC_X86) || defined(XZ_DEC_POWERPC) \
-			|| defined(XZ_DEC_IA64) || defined(XZ_DEC_ARM) \
+			|| defined(XZ_DEC_IA64) \
 			|| defined(XZ_DEC_ARM) || defined(XZ_DEC_ARMTHUMB) \
-			|| defined(XZ_DEC_SPARC)
+			|| defined(XZ_DEC_SPARC) || defined(XZ_DEC_ARM64)
 #		define XZ_DEC_BCJ
 #	endif
 #endif
author maintainer
#2 lore raw
In reply to Andrew Morton
Quoted 11 lines · On 2023-11-08 Andrew Morton wrote:
Quoted 4 lines · On Wed, 8 Nov 2023 19:44:48 +0200 Lasse Collin <[email protected]> wrote:

ARM64 kernel decompression is done by bootloaders but the filter can still be useful, for example, for Squashfs.

A duplicated check for XZ_DEC_ARM in xz_private.h was omitted too.

There's nothing here that uses the new functionality?

Is a squashfs patch expected?

I need to send a patch to mksquashfs. In the kernel the XZ filters are handled by the XZ code, so Squashfs in the kernel needs no changes.

Initramfs can use the filters if initramfs contains a significant amount of executable code. There are practical reasons why it's not commonly done on other archs though. The main one is that kernel modules shouldn't be filtered (worse compression). There are plans to improve the compression tools to make this easier (it would help in other contexts too) but it will take time.

Signature · 1 line
Lasse Collin