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 <peterx@xxxxxxxxxx> > --- [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 > -- 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