[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH 0/2] Use streaming decompression for ZSTD kernels


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Rafaël Kooi <rafael_andreas@xxxxxxxxxxx>
  • Date: Wed, 10 May 2023 02:18:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0HVxw76X4sNRQ9I6fgOOtesQKW3CkebbZBE9wbgYkqE=; b=oJg1Kn+8Rd1cLUYZQZJ+2xmot3wGRrKFPcCbsVZubCR+uKfFAg6E9SQAAXmFb0GedBelIAm4IH1W/PJr2eNzavj0xNWt7mR6cKkuDLXyPUUeMPgB6Hq0O3oybrq8L3uULH+eN/bZraKHEiUO+rV2B8QEpOSI4A/CzaN9+Am9i1hncTKRF0IiFqnG5uxzmdySvOfXESI7XLMBLQKeHkqtLrBPoH6qieUtVhen4Uk8I1o1B9TzzAd80sAXbPL348i558qYtw9yWctdfbkyPH0iB7cnf/gwkTRbk6otmcV0VYtr0DSD0sG5FirzVgaai9CGMZuI2okPOQGGYEt87sJ/HQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e6ggHOMYqA+VDkqkLM68zo3xoa3Im/SBUvsAq441pKH/4JAmGm6lBaPQSyIhOVrb7TQrnLvqtXP5f7ZcAv0Xh5k4OA2qVebfapADHlVxPgr+MFHNkNsK/JZN9huKiLMSFFAFF85a/X6CDsPTE289L3oXx+iJYGSEyQxnSNQdvPAVTy3zvyEIdt7OBg/yB4sap+vMuJOC18XB5R3k9HGZZ37VNUfl5ZELpCXoscROY6AsrENtwk4hjb2iBl8Eq66nHXlbk4VewO8S/0J6l0aKW9rgxN2bl5Ug0scGB4+y5jh8A7eHcSdssx2frZH8b1AFK1KZtVO+6A1J8+pxqYPq8g==
  • Cc: Rafaël Kooi <rafael_andreas@xxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 10 May 2023 05:14:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

I've attempted to get Xen to boot Arch Linux as a unified EFI binary.
Using https://xenbits.xen.org/docs/unstable/misc/efi.html as my source
of information, I've been able to build a unified binary. When trying to
boot the kernel Xen complains that the stream is corrupt
("ZSTD-compressed data is corrupt"). I've been able to reproduce the
issue locally in user-mode, and confirmed that the issue is also present
in the latest ZSTD version.

Using streaming decompression the kernel gets unpacked properly and the
output is the same as if doing `cat kernel.zst | unzstd > bzImage`.

A problem I ran into was that adding book keeping to decompress.c would
result in either a .data section being added or a .bss.* section. The
linker would complain about this. And since I am not familiar with this
code, and why it is this way, I opted to add a user-pointer to the
internal decompression API.

Rafaël Kooi (2):
  xen/decompress: Add a user pointer for book keeping in the callbacks
  x86/Dom0: Use streaming decompression for ZSTD compressed kernels

 xen/common/bunzip2.c         | 23 ++++++++++++----------
 xen/common/decompress.c      | 37 ++++++++++++++++++++++++++++++------
 xen/common/unlz4.c           | 15 ++++++++-------
 xen/common/unlzma.c          | 30 +++++++++++++++++------------
 xen/common/unlzo.c           | 13 +++++++------
 xen/common/unxz.c            | 11 ++++++-----
 xen/common/unzstd.c          | 13 +++++++------
 xen/include/xen/decompress.h | 10 +++++++---
 8 files changed, 97 insertions(+), 55 deletions(-)

--
2.40.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.