From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH 12/14] x86: intel-iommu: add dmar test Date: Wed, 19 Oct 2016 22:33:53 +0200 Message-ID: <20161019203353.GD8573@potion> References: <1476448852-30062-1-git-send-email-peterx@redhat.com> <1476448852-30062-13-git-send-email-peterx@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, jan.kiszka@web.de, agordeev@redhat.com, drjones@redhat.com, pbonzini@redhat.com To: Peter Xu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:43520 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941378AbcJSUd5 (ORCPT ); Wed, 19 Oct 2016 16:33:57 -0400 Content-Disposition: inline In-Reply-To: <1476448852-30062-13-git-send-email-peterx@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-10-14 20:40+0800, Peter Xu: > DMAR test is based on QEMU edu device. A 4B DMA memory copy is carried > out as the simplest DMAR test. > > Signed-off-by: Peter Xu > --- [The code made me realize that I won't be able to do a proper review right now ...] > int main(int argc, char *argv[]) > { > + int ret; > + pci_edu_dev_t dev; > + > setup_vm(); > smp_init(); > setup_idt(); > @@ -37,5 +76,18 @@ int main(int argc, char *argv[]) > vtd_enable_ir(); > report("IR enablement", vtd_status() & VTD_GCMD_IR); > > + report("DMAR support 39 bits address width", > + vtd_cap() & VTD_CAP_SAGAW); > + > + report("DMAR support huge pages", vtd_cap() & VTD_CAP_SLLPS); > + > + ret = edu_init(&dev); > + if (ret) { > + printf("Please specify \"-device edu\" to test IOMMU.\n"); > + return -1; The test did something before this point, so we should print a summary before exiting. Probably the best thing would be to report_skip() the following tests, because the device needed for them couldn't be found. > + } > + > + vtd_test_dmar(&dev); > + > return report_summary(); > } > -- > 2.7.4 >