From 01265fb2172352c93c0054fc8b97c07c9d9bb30d Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 24 Aug 2023 13:23:05 +0200 Subject: [PATCH] tests/vfio: Gather debug info and disable tdp_mmu tdp_mmu had some issues up until around Linux v6.3 that make it work particularly bad when running nested on Hyper-V. Reload the module at the start of the test and disable the tdp_mmu param. Gather debug info at the end of the test to make it easier to figure out what went wrong. This uses github actions group syntax so that each section can be collapsed. Signed-off-by: Jeremi Piotrowski (cherry picked from commit 5f6475a28a6329eaca693cc00fc4034f79e68b24) --- .../functional/vfio/vfio_fedora_vm_wrapper.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/functional/vfio/vfio_fedora_vm_wrapper.sh b/tests/functional/vfio/vfio_fedora_vm_wrapper.sh index 07ef83874b..2928455324 100755 --- a/tests/functional/vfio/vfio_fedora_vm_wrapper.sh +++ b/tests/functional/vfio/vfio_fedora_vm_wrapper.sh @@ -43,6 +43,14 @@ cleanup() { sudo chown -R ${USER} ${artifacts_dir} scp_vm ${artifacts_dir}/* ${artifacts_dir} || true kill_vms + + echo "::group::L2 journal" + cat "${artifacts_dir}/journal.log" + echo "::endgroup::" + + echo "::group::L1 dmesg" + sudo dmesg + echo "::endgroup::" } create_ssh_key() { @@ -238,6 +246,14 @@ pull_fedora_cloud_image() { qemu-img resize -f raw "${fedora_img}" +20G } +reload_kvm() { + # TDP_MMU is buggy on Hyper-V until v6.3/v6.4 + sudo rmmod kvm-intel kvm-amd kvm || true + sudo modprobe kvm tdp_mmu=0 + sudo modprobe kvm-intel || true + sudo modprobe kvm-amd || true +} + run_vm() { image="$1" config_iso="$2" @@ -247,6 +263,8 @@ run_vm() { cpus=2 machine_type="q35" + reload_kvm + sudo /usr/bin/qemu-system-${arch} -m "${memory}" -smp cpus="${cpus}" \ -cpu host,host-phys-bits \ -machine ${machine_type},accel=kvm,kernel_irqchip=split \