This patchset is another attempt at fixing a regression that's been
around since v9.0.0, where
 qemu-system-x86_64 -machine q35,accel=kvm,smm=off
stopped showing graphics output from the BIOS since commit b07bf7b7
("q35: Introduce smm_ranges property for q35-pci-host"). This is
most obvious and bad for accelerators which have no SMM support
(e.g. NVMM, HVF, WHPX) because there smm=off is the default and
so you always see the bug.

The rough outline of the fix has been known for ages (the
MCHPCIState::smram_region needs to be set up even if smm=off), and
various downstreams have carried versions of that patch.  However the
early-return is also somewhat bug-prone because mch_realize() in
particular is a very long function and it would be easy to add
non-SMM-specific code to the bottom of it without realizing that the
smm=off case never executed it.

This series starts with the simple fix, as most convenient for
backporting, and then on top of that has some refactoring patches
which avoid the "return from the middle of the function if
has_smm_ranges is set" pattern.

A different variant of the fix was sent by Mohamed Mediouni
a couple of months ago:
https://patchew.org/QEMU/[email protected]/
I believe that the changes that patch makes to other places
than mch_realize() are unnecessary (see patch 1 commit message
for more details).

thanks
-- PMM

Peter Maydell (3):
  hw/pci-host/q35.c: Always initialize smram-region even if SMM disabled
  hw/pci-host/q35.c: Factor out creation of SMRAM MRs
  hw/pci-host/q35.c: Avoid early return in mch_write_config()

 hw/pci-host/q35.c | 110 +++++++++++++++++++++++++---------------------
 1 file changed, 59 insertions(+), 51 deletions(-)

-- 
2.43.0


Reply via email to