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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Rafaël Kooi <rafael_andreas@xxxxxxxxxxx>
  • Date: Thu, 11 May 2023 03:06:26 +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=a8efdFnv7QyOwR7v+2Lo1+b/mnbyjE1GIiKJ+okTHsg=; b=C9dFN37JEl0pvmtHsfcuup/fhUH8IVVTV4dAhbrwJkfKcDCw7W67WasYhgiT0+A2v9eYy5OuommszxxG6rNT6iH6b9mvfEjwQCJfEQmbRlbRPBsp+zYkPpTOZNna6dTGIUvPTIYZzN0xG/d0auiElZYpf9r8+BB/lTN8o7QFBVd+ufnSakTcEnLntgCxc5qDfAoj7n+miSTb5vgAz7hhGWoy7JZyFl8uIK8US7ZgIBFS477WhG+KQQk/p15ljDMsvt3ysa9N/qW0ltCXX9eiS09eSRqSobMUfipEwkUFtPGKm4QH2q5vrxMEWoqITioOmtCauCerY37No9IVOabf+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5+T3q3BLC986g/fpHXkHPntRmNZp/j3tKwmcTu3FXaNVr/Ne/xp0rvkK6FnzTmVXhkoG16ZCAmjuwbsP8TCm7CxMZc3Ysm4hzLf/5rEJq4BvHQI6zLPXdhqO2/2Ns2hjPU0T7fZXAcHazQ87//tTPm2jH5sP9W4yy9+gFjQRxu25rEexu1arNSZn3sSVABQUaXQI5oHMZ5RuWMH0Y+sdQMe0cq8hN8wmlPQwdxBjzldF2x5gIuUhYjXvEuwFF2zWOS/Zkm7jV+xpDvoq90W/rBsE+4zh1MCCa+EP8FOH5C7V6WZGykKwbp7MOfpqRrhWvC/1BuiCetiWDVrkRKPog==
  • Cc: 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>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 11 May 2023 01:07:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10/05/2023 02:18, Rafaël Kooi wrote:> 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


This patch can be dropped in its entirety. The issue that this code
fixes is a symptom of another issue entirely. What ended up being the
issue was that the SSD of my laptop is dead, and that I messed up the
alignment of the sections inserted into xen.efi.

I plan to add some sanity checks to the EFI boot loader code to inform
the user if the sections are misaligned. That's a much more user friendly
error than whatever the decompressor will report.

To Jan, sorry for wasting your time, and thanks again for being patient
with me.

Rafaël



 


Rackspace

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