Ok, I have had some more time to test and play and while there has been some feedback on just some coding style issues so far, I am happy with the results. The change introduces some new configuration values as RedHat wish to retain backwards compatibility by default for now, and perhaps change things in a later revision of the Q35 platform version.
Huge thanks to Alex Williamson of RedHat for his time and effort on this!
The patch is a total of seven parts and is available at https://patchwork.kernel.org/cover/10683043/
Usage is simple, the speed and width of the bus needs to be set on the root port, not the PCIe device. Patch 6 of 7 has an example libvirt configuration, but if you’re not using libvirt here is how to do it directly.
-device pcie-root-port,id=root_port1,chassis=0,slot=0,bus=pcie.0 \
-set device.root_port1.speed=8 \
-set device.root_port1.width=16
You may be able to put those extra lines on the root-port device itself as parameters but I have not bothered to test this. Note that the device is no longer ioh3420
but has been changed to pcie-root-port
.
This patch set applies against the latest version of Qemu in git, please note that several things have changed, namely:
-
Ryzen users now need to explicitly set the host CPU option
topoext
to enable hyperthreading. -
The PulseAudio patches no longer applies clean, seems more work was done to the PA code without any regard for these audio problems or the fix that we have been using for some time.
It would be great if @spheenik would be so kind as to update his patch. If not when I can find some time I will look into it, however I will need to get up to speed with how PA works in Qemu. If I can help it i’d rather not as this is taking time away from Looking Glass.
Edit: After a bit of messing around I managed to get an acceptable sound solution by using ALSA in Qemu, allowing it to use the Pulse ALSA shim. I found that the following extra environment variables have resolved all sound issues, however I am using AC97 which may also have helped here.
export QEMU_AUDIO_DRV=alsa export QEMU_ALSA_DAC_BUFFER_SIZE=512 export QEMU_ALSA_DAC_PERIOD_SIZE=128