Bug 2229357 - [intel iommu][vfio-vf/vfio-pf] qemu-kvm: Fail to lookup the translated address
Summary: [intel iommu][vfio-vf/vfio-pf] qemu-kvm: Fail to lookup the translated address
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.3
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: Yanghang Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-05 09:24 UTC by Yanghang Liu
Modified: 2023-08-11 01:40 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-164660 0 None None None 2023-08-05 09:26:07 UTC

Description Yanghang Liu 2023-08-05 09:24:57 UTC
Description of problem:
When reboot or shutdown the VM with an Intel iommu device and PF/VF, the qemu-kvm throws the error info like : Fail to lookup the translated address fff22000

Version-Release number of selected component (if applicable):
5.14.0-348.el9.x86_64
qemu-kvm-8.0.0-9.el9.x86_64
libvirt-9.5.0-5.el9.x86_64
edk2-ovmf-20230524-2.el9.noarch


How reproducible:
100%

Steps to Reproduce:
1. import a VM which has two VFs

# virt-install --machine=q35 --noreboot --name=rhel93 --memory=4096 --vcpus=4 --graphics type=vnc,port=5993,listen=0.0.0.0 --osinfo detect=on,require=off --check all=off --memtune hard_limit=12582912 --memballoon virtio,driver.iommu=on,driver.ats=on --import --noautoconsole --check all=off --network bridge=switch,model=virtio,mac=52:54:00:03:93:93,driver.iommu=on,driver.ats=on --disk path=/home/images/RHEL93.qcow2,bus=virtio,cache=none,format=qcow2,io=threads,size=20,driver.iommu=on,driver.ats=on --features ioapic.driver=qemu --iommu model=intel,driver.intremap=on,driver.caching_mode=on,driver.iotlb=on --boot=uefi --hostdev pci_0000_3b_0e_0  --hostdev pci_0000_3b_0e_1 



2. make sure the VM kernel has enabled intel_iommu=on option


3. start a VM which has two VFs

# virsh start rhel93

4. reboot or shutdown the VM
(1) 
run "virsh reboot rhel93" or  "virsh shutdown rhel93" on the host 
(2)
run "reboot" or "shutdown -h now" in the VM

5. repeated the step 2 for 5 times

Actual results:
The qemu-kvm throws the error info like : Fail to lookup the translated address fff22000

Expected results:
The qemu-kvm does not throw any error

Additional info:
(1) The cmd I used to reproduce this issue via auto tests: 
# python3 /home/private_autocase/vfio/vfio_sriov_test.py --feature=vf --domain=rhel93 --device_name=MT2892  --machine_type=q35 --bios=ovmf  --test_list="intel_iommu_test"
or
python3 /home/private_autocase/vfio/vfio_sriov_test.py --feature=pf --domain=rhel93 --device_name=82599ES --machine_type=q35 --bios=ovmf  --test_list="intel_iommu_test"

Comment 1 Alex Williamson 2023-08-09 19:30:23 UTC
The only such message I see in QEMU is from vhost:

hw/virtio/vhost.c:
            error_report("Fail to lookup the translated address "
                         "%"PRIx64, iotlb.translated_addr);

Suspect this might have more to do with the virtio network device than the vfio devices.


Note You need to log in before you can comment on or make changes to this bug.