linux/debian/patches/features/x86/x86-boot-Clear-RSDP-address...

44 lines
1.7 KiB
Diff
Raw Normal View History

[x86] Support booting a Xen PVH guest via Grub2 tl;dr: Xen PVH is the perfect upgrade path from PV and in combination with grub2 support, it's the Xen "killer feature" we really should have in Buster. Background info about Xen PVH: https://wiki.xen.org/wiki/Virtualization_Spectrum#Almost_fully_PV:_PVH_mode PVH mode in Xen, a.k.a. "HVM without having to run qemu" is a Xen guest type best supported since Xen 4.11 and Linux kernel 4.17. Just like when using PV mode, the guest does not have an emulated BIOS and the guest kernel is directly started by the dom0. Buster will ship with Xen 4.11. Why is PVH interesting? 1. When the whole Meltdown/Spectre story started, it quickly became apparent that 64-bit PV is the most problematic virtualization mode to protect and to protect from, since address space from the hypervisor and other guests (including dom0) is reachable from a 64-bit PV domU. To mitigate this, XPTI (the Xen variant of PTI) has been implemented in the hypervisor, but with a performance hit. HVM (so, also PVH) guests are better isolated from the hypervisor and other guests. Inside the guest a choice can be made about which mitigations to enable or not. Also see https://xenbits.xen.org/xsa/advisory-254.html 2. Unlike HVM, it's not needed to have a boot loader/sector, partitions, and a qemu process in the dom0 (using cpu and memory and having an attack surface). Also, when running a largeish amount of domUs on a physical server, not having all the qemu processes is an advantage. 3. Unlike PV, PVH makes use of all hardware features that accelerate virtualization. The upgrade path from PV to PVH is super optimal. It's just setting type='pvh' in the guest file and doing a full restart of the domU! Unless... (insert Monty Python's Dramatic Chord!) Unless... grub2 was used to boot the PV guests. Why is it interesting to be able to use grub? Without using grub in between, the guest kernel and initrd have to be copied out of the guest onto the dom0 filesystem, because the guest has to be booted with them directly. Currently, we already have the grub-xen packages in Debian, which provide grub images which can be used as kernel for a PV guest, after which it can load the actual linux kernel that is symlinked from /vmlinuz on the guest filesystem at that moment. The final changes to the Linux kernel for grub+PVH are in Linux 4.20. This request, to carry a few patches from Linux 4.20, provides one half of the dots that need to be connected to make the full thing happen for Buster. Since we'll have Xen 4.11 in Buster, PVH is supported. The related grub2 patchset was committed to the grub master branch on Dec 12 2018 (yup, today). So, I'll also start contacting the debian grub team soon to ask (and help) to get the current grub-xen functionality in Debian to be extended with PVH capabilities as well. Test reports: https://lists.xenproject.org/archives/html/xen-devel/2018-10/msg01913.html https://lists.xenproject.org/archives/html/xen-devel/2018-11/msg03312.html
2018-12-12 21:12:47 +00:00
From: Juergen Gross <jgross@suse.com>
Date: Mon, 3 Dec 2018 11:38:11 +0100
Subject: x86/boot: Clear RSDP address in boot_params for broken loaders
Origin: https://git.kernel.org/linus/182ddd16194cd082f25fa1b063dae3c7c5cce384
Gunnar Krueger reported a systemd-boot failure and bisected it down to:
e6e094e053af75 ("x86/acpi, x86/boot: Take RSDP address from boot params if available")
In case a broken boot loader doesn't clear its 'struct boot_params', clear
rsdp_addr in sanitize_boot_params().
Reported-by: Gunnar Krueger <taijian@posteo.de>
Tested-by: Gunnar Krueger <taijian@posteo.de>
Signed-off-by: Juergen Gross <jgross@suse.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: sstabellini@kernel.org
Fixes: e6e094e053af75 ("x86/acpi, x86/boot: Take RSDP address from boot params if available")
Link: http://lkml.kernel.org/r/20181203103811.17056-1-jgross@suse.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/include/asm/bootparam_utils.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h
index a07ffd23e4dd..f6f6ef436599 100644
--- a/arch/x86/include/asm/bootparam_utils.h
+++ b/arch/x86/include/asm/bootparam_utils.h
@@ -36,6 +36,7 @@ static void sanitize_boot_params(struct boot_params *boot_params)
*/
if (boot_params->sentinel) {
/* fields in boot_params are left uninitialized, clear them */
+ boot_params->acpi_rsdp_addr = 0;
memset(&boot_params->ext_ramdisk_image, 0,
(char *)&boot_params->efi_info -
(char *)&boot_params->ext_ramdisk_image);
--
2.19.2