[PATCH 1/1] tests/cryptodev_common.py Supporting vfio denylist for QAT

Patrick Robb probb at iol.unh.edu
Mon Sep 16 06:14:09 CEST 2024


DH895XCC, C3XXX, and C62X QuickAssist cards are not designed to run
in an untrusted environment. Consequently, this patch adds commands
to the cryptodev_perf testsuite for loading the vfio driver
with disable_denylist enabled and enabling unsame iommu mode.

Signed-off-by: Patrick Robb <probb at iol.unh.edu>
---
 tests/cryptodev_common.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/cryptodev_common.py b/tests/cryptodev_common.py
index b550b46869df..37483c51e3e7 100644
--- a/tests/cryptodev_common.py
+++ b/tests/cryptodev_common.py
@@ -15,6 +15,10 @@ def bind_qat_device(test_case, driver="igb_uio"):
 
     if "crypto_dev_id" in conf.suite_cfg:
         dev_id = conf.suite_cfg["crypto_dev_id"]
+        if dev_id in ["37c8", "435", "19e2"]:
+            test_case.dut.send_expect('modprobe -r vfio_iommu_type1; modprobe -r vfio_pci; modprobe -r vfio_virqfd; modprobe -r vfio', '# ', 5)
+            test_case.dut.send_expect('modprobe vfio-pci disable_denylist=1 enable_sriov=1', '# ', 5)
+            test_case.dut.send_expect('echo "1" | tee /sys/module/vfio/parameters/enable_unsafe_noiommu_mode', '# ', 5)
         test_case.logger.info(
             "specified the qat hardware device id in cfg: {}".format(dev_id)
         )
-- 
2.25.1



More information about the dts mailing list