From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI9by-0008Sz-Ru for qemu-devel@nongnu.org; Wed, 29 Jun 2016 03:08:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bI9bs-000268-NX for qemu-devel@nongnu.org; Wed, 29 Jun 2016 03:08:37 -0400 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:36915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bI9bs-00025y-GC for qemu-devel@nongnu.org; Wed, 29 Jun 2016 03:08:32 -0400 Received: by mail-wm0-x22d.google.com with SMTP id a66so58594048wme.0 for ; Wed, 29 Jun 2016 00:08:32 -0700 (PDT) Sender: Paolo Bonzini References: <20160629063221.GF16629@pxdev.xzpeter.org> <57736C59.8010503@web.de> From: Paolo Bonzini Message-ID: Date: Wed, 29 Jun 2016 09:08:29 +0200 MIME-Version: 1.0 In-Reply-To: <57736C59.8010503@web.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] Question about qtest and IOMMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka , Peter Xu , QEMU Devel Mailing List Cc: Peter Maydell , "Michael S. Tsirkin" , Valentine Sinitsyn , David kiarie , John Snow On 29/06/2016 08:36, Jan Kiszka wrote: > On 2016-06-29 08:32, Peter Xu wrote: >> Hi, all, >> >> I am thinking about whether it's possible to write up a unit test >> program for emulated IOMMUs (of course, Intel IOMMU would be the first >> one). This can provide us the chance to do quick functional regression >> tests for IOMMU just like other devices, as well as customized test >> sequences which is hard to do in real guests (e.g., specific cache >> invalidations, error injections), etc.. >> >> I see that current qtest framework cannot support well on testing >> IOMMUs. For DMA remapping, things would be quite smooth. The problem >> is that, we still do not have a complete test framework on the >> interrupts. E.g., currently qtest is still an acceleration type, in >> which we have no vCPUs, as well as interrupt chips like APICs (please >> correct me if I am wrong). qtest does have VCPUs, they just run a dummy loop. You do have an APIC too, but reading it doesn't work because cpu_get_current_apic() returns NULL. You can use kvm-unit-tests if qtest is not flexible enough. It's probably the simplest thing to do if you also want to test kernel LAPIC and split irqchip operation. Paolo >> It's even further if we want to test >> something like kernel irqchips with QEMU. Not sure whether it's >> possible to do test based on a much realistic VM (e.g., with KVM >> enabled, but just keep the CPUs stall?). > > Adding David and Valentine as we were discussing this need in the > context of the AMD IOMMU as well: You cannot test errors with workload > (like Linux) that do not trigger them in normal conditions. Paolo