Bug 2084567

Summary: Disable 5-level page tables when using -cpu max
Product: Red Hat Enterprise Linux 9 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED DUPLICATE QA Contact: YongkuiGuo <yoguo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: kchamart, lersek, rjones, virt-maint, ymankad, yoguo
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-13 14:22:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard W.M. Jones 2022-05-12 12:43:05 UTC
Description of problem:

In https://bugzilla.redhat.com/show_bug.cgi?id=2082806 we are
tracking an insidious qemu bug which intermittently prevents the
libguestfs appliance from starting.  The symptoms are that SeaBIOS
starts and displays its messages, but the kernel isn't reached.  We
found that the kernel does in fact start, but when it tries to set up
page tables and jump to protected mode it gets a triple fault which
causes the emulated CPU in qemu to reset (qemu exits).

This seems to only affect TCG (not KVM).

This is caused by using -cpu max which enables the "la57" feature
(5-level page tables[0]), and that we can make the problem go away
using -cpu max,la57=off.

Note this is only a workaround for bug 2082806.  We may in future
fix that bug properly (in qemu).  However the proposed workaround
for libguestfs should not have any negative effects.

This bug affects all versions of libguestfs that run qemu with
-cpu max or the libvirt equivalent <cpu mode="maximum"/>, which
includes RHEL 8.7 (not 8.6), and RHEL 9.0 and 9.1.

Version-Release number of selected component (if applicable):

libguestfs-1.44.0-6.el8

How reproducible:

100%

Steps to Reproduce:

These two commands test the libvirt and direct paths (which are
fixed separately):

while LIBGUESTFS_BACKEND_SETTINGS=force_tcg ./run libguestfs-test-tool  >&/tmp/log ; do echo -n . ; done

while LIBGUESTFS_BACKEND=direct LIBGUESTFS_BACKEND_SETTINGS=force_tcg ./run libguestfs-test-tool  >&/tmp/log ; do echo -n . ; done

Upstream bug fix:
https://listman.redhat.com/archives/libguestfs/2022-May/028853.html

Comment 2 Richard W.M. Jones 2022-05-12 12:47:05 UTC
This bug needs to be a z-stream, but maybe we should ask for
z-stream on bug 2084568 instead?

Comment 6 Richard W.M. Jones 2022-05-13 14:22:44 UTC

*** This bug has been marked as a duplicate of bug 2084568 ***