From 76465d1b29cefc9cacc38394087a0644f9895fa8 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 17 Aug 2020 16:04:37 +0200 Subject: tests: iommu support --- tests/drminfo/__init__.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/drminfo/__init__.py b/tests/drminfo/__init__.py index c37ade6..769f00f 100644 --- a/tests/drminfo/__init__.py +++ b/tests/drminfo/__init__.py @@ -130,14 +130,19 @@ class TestDRM(avocado.Test): cmdline += " \"%s\" \"%s\"" % (self.initrd, kversion) run(cmdline) - def boot_gfx_vm(self, vga, display = None, vm = None, incoming = None, append = ""): + def boot_gfx_vm(self, vga, display = None, vm = None, incoming = None, iommu = False, append = ""): append += " console=ttyS0" append += " rd.shell" self.log.info("### boot kernel with display device \"%s\"" % vga) if vm is None: vm = self.vm - vm.set_machine('pc') + + if iommu: + vm.set_machine('q35,kernel-irqchip=split') + else: + vm.set_machine('pc') + vm.set_console() vm.add_args('-enable-kvm') vm.add_args('-m', '1G') @@ -145,10 +150,16 @@ class TestDRM(avocado.Test): vm.add_args('-initrd', self.initrd) vm.add_args('-append', append) vm.add_args('-device', vga) + + if iommu: + vm.add_args('-device', 'intel-iommu,intremap=on,device-iotlb=on') + vm.add_args('-global', 'virtio-pci.iommu_platform=on') + if not display is None: vm.add_args('-display', display) if not incoming is None: vm.add_args('-incoming', incoming) + vm.launch() if self.rconsole is None: -- cgit