qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qxl: introduce hardware revision 5

The only difference to hardware revision 4 is that the device doesn't
switch to VGA mode in case someone happens to touch a VGA register,
which should make things more robust in configurations with multiple
vga devices.

Swtiching back to VGA mode happens on reset, either full machine
reset or qxl device reset (QXL_IO_RESET ioport command).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-id: 20200206074358.4274-1-kraxel@redhat.com

+9 -2
+2
hw/core/machine.c
··· 34 34 { "vhost-blk-device", "seg_max_adjust", "off"}, 35 35 { "usb-host", "suppress-remote-wake", "off" }, 36 36 { "usb-redir", "suppress-remote-wake", "off" }, 37 + { "qxl", "revision", "4" }, 38 + { "qxl-vga", "revision", "4" }, 37 39 }; 38 40 const size_t hw_compat_4_2_len = G_N_ELEMENTS(hw_compat_4_2); 39 41
+6 -1
hw/display/qxl.c
··· 1309 1309 PCIQXLDevice *qxl = container_of(vga, PCIQXLDevice, vga); 1310 1310 1311 1311 trace_qxl_io_write_vga(qxl->id, qxl_mode_to_string(qxl->mode), addr, val); 1312 - if (qxl->mode != QXL_MODE_VGA) { 1312 + if (qxl->mode != QXL_MODE_VGA && 1313 + qxl->revision <= QXL_REVISION_STABLE_V12) { 1313 1314 qxl_destroy_primary(qxl, QXL_SYNC); 1314 1315 qxl_soft_reset(qxl); 1315 1316 } ··· 2119 2120 break; 2120 2121 case 4: /* qxl-4 */ 2121 2122 pci_device_rev = QXL_REVISION_STABLE_V12; 2123 + io_size = pow2ceil(QXL_IO_RANGE_SIZE); 2124 + break; 2125 + case 5: /* qxl-5 */ 2126 + pci_device_rev = QXL_REVISION_STABLE_V12 + 1; 2122 2127 io_size = pow2ceil(QXL_IO_RANGE_SIZE); 2123 2128 break; 2124 2129 default:
+1 -1
hw/display/qxl.h
··· 144 144 } \ 145 145 } while (0) 146 146 147 - #define QXL_DEFAULT_REVISION QXL_REVISION_STABLE_V12 147 + #define QXL_DEFAULT_REVISION (QXL_REVISION_STABLE_V12 + 1) 148 148 149 149 /* qxl.c */ 150 150 void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);