On Wed, Oct 19, 2016 at 10:21:11PM +0200, Radim Krčmář wrote: > 2016-10-14 20:40+0800, Peter Xu: > > This series is adding simplest test cases for VT-d. > > > > The series contains some conflict with Alex's PCI framework > > enhancement, so I am marking it as RFC, I can rebase to Alex's work > > after it's merged. Besides the conflict, the codes is workable, and > > passed smoke test. > > > > Currently only a very small test scope is covered: > > > > * VT-d init > > * DMAR: 4 bytes copy > > * IR: MSI > > > > However this series could be a base point to add more test cases for > > VT-d. > > The size already scared away reviewers, so slowly extending it is a good > idea. :) Noted. Thanks for the hint. :) > > > The problem is, there are many IOMMU error conditions which are > > very hard to be triggered in a real guest (IOMMU has merely no > > interface for guest user, and it's totally running in the background). > > I gracefully skipped most of VT-d error handling ... how many of those > errors are not a result of a misconfiguration? Do you mean the error handling codes in hw/i386/intel_iommu.c? IMHO most of those errors will be triggered only if there is bug in guest OS IOMMU driver. Here when I talked about error conditions, I mostly meant potential QEMU IOMMU bugs, not guest OS bugs (of course, AFAICT kvm-unit-tests are not for guest OS bugs). For example, there are still bugs in IOMMU IR, and some of the bugs can hardly be triggered by guest OS. In that case, we need this unit test to reproduce the bug, and re-run it to verify when I have a fix. Otherwise even if I fixed the bug one day, I can never reproduce it, nor can I know whether the fix works. > > > This piece of work can be a start point if we want to do more > > complicated things and play around with Intel IOMMU devices (also for > > IOMMU regression tests). > > > > Please review. Thanks, > > > > ================= > > > > To run the test: > > > > ./x86/run ./x86/intel-iommu.flat \ > > -M q35,kernel-irqchip=split -global ioapic.version=0x20 \ > > -device intel-iommu,intremap=on -device edu > > This command line deserved an entry in x86/unittests.cfg, it will run > the test automatically with ./run_tests.sh and serve as a refererence > for manual execution. I will add one more patch for it. Thanks! -- peterx -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html