diff --git a/KVM/qemu/tests/vfio_net_boot.py b/KVM/qemu/tests/vfio_net_boot.py index 0439af5..f0b5f5b 100644 --- a/KVM/qemu/tests/vfio_net_boot.py +++ b/KVM/qemu/tests/vfio_net_boot.py @@ -13,6 +13,8 @@ from virttest import error_context, utils_net +from avocado.utils import process +from avocado.core import exceptions from provider import hostdev from provider.hostdev import utils as hostdev_utils from provider.hostdev.dev_setup import hostdev_setup @@ -31,6 +33,12 @@ def run(test, params, env): :type env: virttest.utils_env.Env """ ip_version = params["ip_version"] + vm_type = params.get("vm_secure_guest_type") + if not params.get("vm_hostdev_iommufd") and vm_type == "tdx": + dma_entry_limit_cmd = params.get("dma_cmd") + status = process.system(dma_entry_limit_cmd, shell=True) + if status: + raise exceptions.TestError("Failed to increase dma_entry_limit.") with hostdev_setup(params) as params: hostdev_driver = params.get("vm_hostdev_driver", "vfio-pci") assignment_type = params.get("hostdev_assignment_type") diff --git a/KVM/qemu/vfio_net_boot.cfg b/KVM/qemu/vfio_net_boot.cfg index 3d7417e..44c8443 100644 --- a/KVM/qemu/vfio_net_boot.cfg +++ b/KVM/qemu/vfio_net_boot.cfg @@ -15,6 +15,7 @@ - ipv4: variants: - @default: + dma_cmd = "echo 0x200000 > /sys/module/vfio_iommu_type1/parameters/dma_entry_limit" - iommufd: vm_hostdev_iommufd = iommufd0 variants: