From nobody Sun Dec 22 11:11:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1728423190164381.1521874570219; Tue, 8 Oct 2024 14:33:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.813637.1226633 (Exim 4.92) (envelope-from ) id 1syHot-0008LN-QO; Tue, 08 Oct 2024 21:32:39 +0000 Received: by outflank-mailman (output) from mailman id 813637.1226633; Tue, 08 Oct 2024 21:32:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1syHot-0008LG-NL; Tue, 08 Oct 2024 21:32:39 +0000 Received: by outflank-mailman (input) for mailman id 813637; Tue, 08 Oct 2024 21:32:38 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1syHos-0008LA-CT for xen-devel@lists.xenproject.org; Tue, 08 Oct 2024 21:32:38 +0000 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d569bb92-85bc-11ef-a0bd-8be0dac302b0; Tue, 08 Oct 2024 23:32:36 +0200 (CEST) Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfout.phl.internal (Postfix) with ESMTP id B3FF813802A5; Tue, 8 Oct 2024 17:32:34 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Tue, 08 Oct 2024 17:32:34 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Oct 2024 17:32:33 -0400 (EDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d569bb92-85bc-11ef-a0bd-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1728423154; x=1728509554; bh=cExzukkzxkZ0MlC75VQr8KanQPwdweR+ oZAZw8RFEas=; b=UlR4tLt8z/VkxnD3i4vM5BIhs5S8n9bHRTt8aEogc07yTxa5 zp0nOXajBVbd4IHbqprXgoeX1F91QoQ2ATqftfxTJtDmI0bxW5nvrKTfEviaoLY5 QgqYtBnBS98z23/2yhtbx1xkytFqQL6pqhVnzBri/Gg/+XbRjkKjP6PljvxDwIDU J5zbw6HbLKFr9Ur5s4TkjUTKF/30g+x3Xoa4+sZHI5P6gjholW+FE6fxrJJUJ85h lLfCnnaLs7G4K4OfU41w2wIr0qhT6tRnXKPHgOgMyP6ry7u9z7LQDt35bqa6jlGN gNZ4GifScRIEbeRZTmvezuJCpjlV1ph0jgUu9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1728423154; x=1728509554; bh=cExzukkzxkZ0M lC75VQr8KanQPwdweR+oZAZw8RFEas=; b=G1LV/Xd/BYKtXpOA9i5p78ODU0Uvp xQMQR0H9+5bkr4Tb8vr6PGBaDKmPjgd+F/vUSI82ILoHPlz2vzzvxqrzZCWosaMD 2Ke3y50YB8V+Ejuts3P6iGgqw94r+gr1/fY+CU0PI/XtIJfUdYpCBQ6LhOg3FOT4 1DNQjTgy8D3ysBibE2JlPWiLkmgxTDFN+nVtgDBjGOaYuMO+FtNZiYbMd0yyzoIV HpwvuVCJApFAj3gSCQoXovxGzTpS5P6fgEk2XW2C1PmtMzyyEBluxq5Vng1pGwL6 BIAROWy2v3KvocNUxllltqjFGipqVouW+uJHDl3Dmafe8y/0kDpCTK9VA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdefuddgudeifecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeen ucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomh grrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggft rfgrthhtvghrnhepleekhfduleetleelleetteevfeefteffkeetteejheelgfegkeelge ehhfdthedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhdpnh gspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgigvnhdq uggvvhgvlheslhhishhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthhtohepmh grrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhdprhgtphht thhopegrnhhthhhonhihrdhpvghrrghrugesvhgrthgvshdrthgvtghhpdhrtghpthhtoh epjhhgrhhoshhssehsuhhsvgdrtghomh X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Anthony PERARD , Juergen Gross Subject: [PATCH] tools/xg: increase LZMA_BLOCK_SIZE for uncompressing the kernel Date: Tue, 8 Oct 2024 23:32:23 +0200 Message-ID: <20241008213225.728922-1-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1728423190948116600 Linux 6.12-rc2 fails to decompress with the current 128MiB, contrary to the code comment. It results in a failure like this: domainbuilder: detail: xc_dom_kernel_file: filename=3D"/var/lib/qubes/v= m-kernels/6.12-rc2-1.1.fc37/vmlinuz" domainbuilder: detail: xc_dom_malloc_filemap : 12104 kB domainbuilder: detail: xc_dom_module_file: filename=3D"/var/lib/qubes/v= m-kernels/6.12-rc2-1.1.fc37/initramfs" domainbuilder: detail: xc_dom_malloc_filemap : 7711 kB domainbuilder: detail: xc_dom_boot_xen_init: ver 4.19, caps xen-3.0-x86= _64 hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 domainbuilder: detail: xc_dom_parse_image: called domainbuilder: detail: xc_dom_find_loader: trying multiboot-binary load= er ... domainbuilder: detail: loader probe failed domainbuilder: detail: xc_dom_find_loader: trying HVM-generic loader ... domainbuilder: detail: loader probe failed domainbuilder: detail: xc_dom_find_loader: trying Linux bzImage loader = ... domainbuilder: detail: _xc_try_lzma_decode: XZ decompression error: Mem= ory usage limit reached xc: error: panic: xg_dom_bzimageloader.c:761: xc_dom_probe_bzimage_kern= el unable to XZ decompress kernel: Invalid kernel domainbuilder: detail: loader probe failed domainbuilder: detail: xc_dom_find_loader: trying ELF-generic loader ... domainbuilder: detail: loader probe failed xc: error: panic: xg_dom_core.c:689: xc_dom_find_loader: no loader foun= d: Invalid kernel libxl: error: libxl_dom.c:566:libxl__build_dom: xc_dom_parse_image fail= ed The important part: XZ decompression error: Memory usage limit reached This looks to be related to the following change in Linux: 8653c909922743bceb4800e5cc26087208c9e0e6 ("xz: use 128 MiB dictionary and f= orce single-threaded mode") Fix this by increasing the block size to 256MiB. And remove the misleading comment (from lack of better ideas). Signed-off-by: Marek Marczykowski-G=C3=B3recki Acked-by: Andrew Cooper Acked-by: Anthony PERARD Reviewed-by: Roger Pau Monn=C3=A9 --- tools/libs/guest/xg_dom_bzimageloader.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/libs/guest/xg_dom_bzimageloader.c b/tools/libs/guest/xg_= dom_bzimageloader.c index c6ee6d83e7c6..1fb4e5a1f728 100644 --- a/tools/libs/guest/xg_dom_bzimageloader.c +++ b/tools/libs/guest/xg_dom_bzimageloader.c @@ -272,8 +272,7 @@ static int _xc_try_lzma_decode( return retval; } =20 -/* 128 Mb is the minimum size (half-way) documented to work for all inputs= . */ -#define LZMA_BLOCK_SIZE (128*1024*1024) +#define LZMA_BLOCK_SIZE (256*1024*1024) =20 static int xc_try_xz_decode( struct xc_dom_image *dom, void **blob, size_t *size) --=20 2.46.0