From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kZTFH-0002k6-Ot for mharc-grub-devel@gnu.org; Mon, 02 Nov 2020 01:23:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZTFG-0002ju-0j for grub-devel@gnu.org; Mon, 02 Nov 2020 01:23:10 -0500 Received: from mail.bitfolk.com ([2001:ba8:1f1:f019::25]:46539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kZTFD-0006dk-R6 for grub-devel@gnu.org; Mon, 02 Nov 2020 01:23:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bitfolk.com; s=alpha; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=Vn+4N1weYpD9DjA9J0tYdlt2jqBNJkVW2hK2yzWfPlo=; b=zqAB2uw5SKPWf2MCjV9xjXwJGKF5rd7wMJaJpkXL1ZI1C1xD8kd7efcWpy6/mWg7ERBa+NpdRzUo/z2lbHxZZ8d4rhauKSoF96gIkd3A+fHneApKvvpEhAWzKhd9WDyzqakNoONi+viKaY324LT0fLLA5jlY4OUlcVFJ7NLkayFGIFu3RJgBxscMlHoeaMRLtkejks/vaZ5ywu7+XXDT6sREzSK81iW/sbCSaFZh8/gaCHGsMWqeAkz7bdpMGuJ9iFg2MWgu6RICCRz5RjjXvhfPzj8nrDFZv1SPu90maEbNfQXvpCGck8fbw04oNkrUeR5+9QqLxqEHAHxRIlzm9w==; Received: from andy by mail.bitfolk.com with local (Exim 4.84_2) (envelope-from ) id 1kZTF4-00025H-FF; Mon, 02 Nov 2020 06:22:58 +0000 Date: Mon, 2 Nov 2020 06:22:58 +0000 From: Andy Smith To: grub-devel@gnu.org Cc: xen-users Subject: Grub xen_pvh platform does not seem to support uncompressed kernels Message-ID: <20201102062258.GN16003@bitfolk.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit OpenPGP: id=BF15490B; url=http://strugglers.net/~andy/pubkey.asc X-URL: http://strugglers.net/wiki/User:Andy User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: andy@strugglers.net X-SA-Exim-Scanned: No (on mail.bitfolk.com); SAEximRunCond expanded to false Received-SPF: none client-ip=2001:ba8:1f1:f019::25; envelope-from=andy@strugglers.net; helo=mail.bitfolk.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Nov 2020 06:23:10 -0000 Hi, [ xen-users in CC as I know a few there are using a decompressed kernel workaround for LZ4 and might be hit by this too ] I'm currently evaluating switching from booting Xen guests with grub Xen PV (grub-mkimage -O x86_64-xen) to Xen PVH (grub-mkimage -O i386-xen_pvh). I've noticed that a decompressed guest kernel refuses to boot under PVH with the following error: Loading Linux 5.4.0-52-generic ... error: invalid magic number. That same kernel boots with PV. If I use the LZ4-compressed version of that kernel as supplied by the distribution (Ubuntu 20.04), it works PVH. I therefore can only conclude that PVH grub doesn't like kernels with no compression. Is that expected? I suppose it is possible that the method I use to decompress the kernel could be wrong, though as I say, it does work with PV grub. I basically use the extract-vmlinux script from the upstream kernel source¹. When decompressed: $ sudo file /boot/vmlinuz-5.4.0-52-generic /boot/vmlinuz-5.4.0-52-generic: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=d435b2b7b13b7e1904dddeee22bff30225d2bd04, stripped $ ls -lah /boot/vmlinuz-5.4.0-52-generic -rw------- 1 root root 43M Nov 1 20:00 /boot/vmlinuz-5.4.0-52-generic When leaving it LZ4 compressed as it comes from the distributor: $ sudo file /boot/vmlinuz-5.4.0-52-generic /boot/vmlinuz-5.4.0-52-generic: Linux kernel x86 boot executable bzImage, version 5.4.0-52-generic (buildd@lgw01-amd64-060) #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020, RO-rootFS, swap_dev 0xB, Normal VGA $ ls -lah /boot/vmlinuz-5.4.0-52-generic -rw------- 1 root root 12M Oct 15 11:33 /boot/vmlinuz-5.4.0-52-generic The reason why I am decompressing these guest kernels is because PV grub does not understand LZ4 compression and as I currently do boot guests this way, they would be unbootable otherwise. For new installs I can skip installing my hack that decompresses the kernel image, but if PVH grub won't support uncompressed kernel images then this is inconvenient for the installed base who will need to make extra changes. Is not supporting decompressed kernel images a bug in PVH grub? This was tested with a git clone just now, following these instructions: https://wiki.xenproject.org/wiki/Xen_4.12_RC_test_instructions#PVH_domU_boot_via_grub2 Thanks, Andy ¹ https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux