[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/3] tools/tests: don't skip all of test-paging-mempool without an IOMMU



Commit 66c982a5d3 ("tests/paging-mempool: Extend to test P2M
relocation") added XEN_DOMCTL_CDF_iommu to the test domain. On hosts
without an IOMMU, Xen rejects the flag with -EINVAL and the whole test
is skipped, including the paging mempool tests that do not depend on it.
This is the case e.g. for QEMU-based CI.

Only set XEN_DOMCTL_CDF_iommu if XEN_SYSCTL_PHYSCAP_directio is
reported, and skip just the relocation test otherwise.

Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
---
 tools/tests/paging-mempool/test-paging-mempool.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/tests/paging-mempool/test-paging-mempool.c 
b/tools/tests/paging-mempool/test-paging-mempool.c
index 020ebd5f8f..b65a800d00 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -258,6 +258,12 @@ static int test_p2m_relocate_memory(void)
      */
     printf("Test p2m memory relocation\n");
 
+    if ( !(create.flags & XEN_DOMCTL_CDF_iommu) )
+    {
+        printf("  Skip: No IOMMU, can't force continuations\n");
+        return 0;
+    }
+
     rc = xc_domain_populate_physmap_exact(
         xch, domid, ARRAY_SIZE(physmap),
         9 /* order 2M */, 0 /* flags */, physmap);
@@ -390,6 +396,14 @@ int main(int argc, char **argv)
     if ( rc )
         err(1, "Failed to obtain physinfo");
 
+    /*
+     * XEN_DOMCTL_CDF_iommu is only needed to force continuations in the
+     * relocation test. Without an IOMMU, Xen rejects the flag, so drop it
+     * and skip only the relocation test rather than all tests.
+     */
+    if ( !(physinfo.capabilities & XEN_SYSCTL_PHYSCAP_directio) )
+        create.flags &= ~XEN_DOMCTL_CDF_iommu;
+
 #if defined(__arm__) || defined(__aarch64__)
     if ( arch_capabilities_arm_gic_v3(physinfo.arch_capabilities) )
         create.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_V3;
-- 
2.53.0



--
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.