[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.5 43/43] qxl: don't assert() if device isn't yet initialized
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.5 43/43] qxl: don't assert() if device isn't yet initialized |
Date: |
Sat, 9 Sep 2023 16:00:09 +0300 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
If the PCI BAR isn't yet mapped or was unmapped, QXL_IO_SET_MODE will
assert(). Instead, report a guest bug and keep going.
This can be reproduced with:
cat << EOF | ./qemu-system-x86_64 -vga qxl -m 2048 -nodefaults -qtest stdio
outl 0xcf8 0x8000101c
outl 0xcfc 0xc000
outl 0xcf8 0x80001001
outl 0xcfc 0x01000000
outl 0xc006 0x00
EOF
Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1829
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 95bef686e490bc3afc3f51f5fc6e20bf260b938c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 80ce1e9a93..4b26aab235 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -1591,7 +1591,10 @@ static void qxl_set_mode(PCIQXLDevice *d, unsigned int
modenr, int loadvm)
}
d->guest_slots[0].slot = slot;
- assert(qxl_add_memslot(d, 0, devmem, QXL_SYNC) == 0);
+ if (qxl_add_memslot(d, 0, devmem, QXL_SYNC) != 0) {
+ qxl_set_guest_bug(d, "device isn't initialized yet");
+ return;
+ }
d->guest_primary.surface = surface;
qxl_create_guest_primary(d, 0, QXL_SYNC);
--
2.39.2
- [Stable-8.0.5 32/43] hw/ide/ahci: write D2H FIS when processing NCQ command, (continued)
- [Stable-8.0.5 32/43] hw/ide/ahci: write D2H FIS when processing NCQ command, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 33/43] hw/ide/ahci: simplify and document PxCI handling, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 34/43] hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 36/43] hw/ide/ahci: fix ahci_write_fis_sdb(), Michael Tokarev, 2023/09/09
- [Stable-8.0.5 37/43] hw/ide/ahci: fix broken SError handling, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 35/43] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 38/43] hw/i2c/aspeed: Fix Tx count and Rx size error in buffer pool mode, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 39/43] hw/i2c/aspeed: Fix TXBUF transmission start position error, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 40/43] qemu-options.hx: Rephrase the descriptions of the -hd* and -cdrom options, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 41/43] docs tests: Fix use of migrate_set_parameter, Michael Tokarev, 2023/09/09
- [Stable-8.0.5 43/43] qxl: don't assert() if device isn't yet initialized,
Michael Tokarev <=
- [Stable-8.0.5 42/43] hw/net/vmxnet3: Fix guest-triggerable assert(), Michael Tokarev, 2023/09/09