From c1a37784f95ec8615b2c4915fba08aa52aaff9b0 Mon Sep 17 00:00:00 2001 From: Richard W.M. Jones Date: Aug 31 2021 17:59:35 +0000 Subject: Fix -cpu max (RHBZ#1999700) --- diff --git a/0001-target-i386-add-missing-bits-to-CR4_RESERVED_MASK.patch b/0001-target-i386-add-missing-bits-to-CR4_RESERVED_MASK.patch new file mode 100644 index 0000000..8ff4e30 --- /dev/null +++ b/0001-target-i386-add-missing-bits-to-CR4_RESERVED_MASK.patch @@ -0,0 +1,48 @@ +From f6ea43966cc3b739ba8cd9be20b141a1bad32a8e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Tue, 31 Aug 2021 18:50:33 +0100 +Subject: [PATCH] target/i386: add missing bits to CR4_RESERVED_MASK +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Booting Fedora kernels with -cpu max hangs very early in boot. Disabling +the la57 CPUID bit fixes the problem. git bisect traced the regression to + + commit 213ff024a2f92020290296cb9dc29c2af3d4a221 (HEAD, refs/bisect/bad) + Author: Lara Lazier + Date: Wed Jul 21 17:26:50 2021 +0200 + + target/i386: Added consistency checks for CR4 + + All MBZ bits in CR4 must be zero. (APM2 15.5) + Added reserved bitmask and added checks in both + helper_vmrun and helper_write_crN. + + Signed-off-by: Lara Lazier + Message-Id: <20210721152651.14683-2-laramglazier@gmail.com> + Signed-off-by: Paolo Bonzini + +In this commit CR4_RESERVED_MASK is missing CR4_LA57_MASK and +two others. Adding this lets Fedora kernels boot once again. + +Signed-off-by: Daniel P. Berrangé +--- + target/i386/cpu.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index 6c50d3ab4f..ce85f1a29d 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -257,6 +257,7 @@ typedef enum X86Seg { + | CR4_DE_MASK | CR4_PSE_MASK | CR4_PAE_MASK \ + | CR4_MCE_MASK | CR4_PGE_MASK | CR4_PCE_MASK \ + | CR4_OSFXSR_MASK | CR4_OSXMMEXCPT_MASK |CR4_UMIP_MASK \ ++ | CR4_LA57_MASK | CR4_VMXE_MASK | CR4_SMXE_MASK \ + | CR4_FSGSBASE_MASK | CR4_PCIDE_MASK | CR4_OSXSAVE_MASK \ + | CR4_SMEP_MASK | CR4_SMAP_MASK | CR4_PKE_MASK | CR4_PKS_MASK)) + +-- +2.32.0 + diff --git a/qemu.spec b/qemu.spec index af0626e..9689b84 100644 --- a/qemu.spec +++ b/qemu.spec @@ -282,7 +282,7 @@ Obsoletes: %{name}-system-unicore32-core <= %{epoch}:%{version}-%{release} Summary: QEMU is a FAST! processor emulator Name: qemu Version: 6.1.0 -Release: 4%{?rcrel}%{?dist} +Release: 5%{?rcrel}%{?dist} Epoch: 2 License: GPLv2 and BSD and MIT and CC-BY URL: http://www.qemu.org/ @@ -300,6 +300,10 @@ Source30: kvm-s390x.conf Source31: kvm-x86.conf Source36: README.tests +# Fix -cpu max +# https://bugzilla.redhat.com/show_bug.cgi?id=1999700 +Patch1: 0001-target-i386-add-missing-bits-to-CR4_RESERVED_MASK.patch + BuildRequires: meson >= %{meson_version} BuildRequires: zlib-devel BuildRequires: glib2-devel @@ -2228,6 +2232,9 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog +* Tue Aug 31 2021 Richard W.M. Jones - 6.1.0-5 +- Fix -cpu max (RHBZ#1999700) + * Fri Aug 27 2021 Richard W.M. Jones - 6.1.0-4 - Disable gcrypt (for real this time).