From nobody Mon Nov 23 22:39:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1792070517; cv=none; d=zohomail.com; s=zohoarc; b=bQ6JXG6dYcdc65wHXnythEaBwefk7ITO0R5jD2SrsxeVn1Mpdetda/kCvrvPHWbms1CXhLbINXIK6iYCkFHZaku6S5ajPEUZvUTfAx3z2G7v0WVb6FJ0oav9/NWJ4cIMfO7i5b4GQ4jDb2aiZZMGPHcW38YHV7MD8MJryOeurhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792070517; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=96wIn1uekCRs9P1gGem/hdVbYyuKamo638+EoyoEx0Y=; b=QuKe3QLhwwniplncQ/8tLO6gNRkw8sstPM4bkXm9Zdmu+9cZaebne71q6M/uqx47P+hK2kV64ea5R4yfQ+g7yBYGY0pBF6zO2uxn9jrUbt+aB7Z5TCtzY/tKS6awjL578Tn+7akPzcLySO6kkgY+es0x6b8mRGyD+kWUxOmcbrw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792070517031827.9995460399443; Thu, 15 Oct 2026 06:21:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1450536.1665994 (Exim 4.92) (envelope-from ) id 1xHLOt-0001Yo-Hq; Thu, 15 Oct 2026 13:21:39 +0000 Received: by outflank-mailman (output) from mailman id 1450536.1665994; Thu, 15 Oct 2026 13:21:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLOt-0001Yh-DJ; Thu, 15 Oct 2026 13:21:39 +0000 Received: by outflank-mailman (input) for mailman id 1450536; Thu, 15 Oct 2026 13:21:38 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLOs-0001Yb-Cw for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 13:21:38 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xHLOr-002bdR-Lm for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 15:21:37 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad0d361-e002-0a2a0a5209dd-0a2a4504d01a-2 for ; Thu, 15 Oct 2026 15:21:37 +0200 Received: from [185.255.28.34] (helo=prod-mta-13-01.swg-srv.net) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad0d361-b57f-0a2a45040019-b9ff1c22b6af-3 for ; Thu, 15 Oct 2026 15:21:37 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13-01.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 1a13fb9a01f0008425.005 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 15 Oct 2026 13:21:32 +0000 Received: from julian.home (82-67-211-29.subs.proxad.net [82.67.211.29]) (Authenticated sender: julian.vetter@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id 3147382B1B; Thu, 15 Oct 2026 15:21:31 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=96wIn1uekCRs9P1gGem/hdVbYyuKamo638+EoyoEx0Y=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=Sskf1gc4jRQcimJHUYWYuhK6yxZ4wofbQq1DsvsXdk2P1QPvLdxF/DjobP+MvWNqwJvL7NosC OMJScnnNFnRv20oSpUV3juqIhS2yBaB6roBLR8pXISH0+i5zHl47c9LiyGbjxIzqXRP2BEvOuGN CXnzscEECAw0KeGXg3r5zsRVT47qhv0MPjku+wSlB+33ReWaNa5vV+MINIwgONCfe/6Xpx1IYTc aMyd7mxjbSXDp734NZxBR9ZBOymXfmyIN7/DPir1U/lmY5RCuF2PF4c0ty8KqhjXqgeRfIunhyF 8xECk84OdfhoFmfRQhVaIbyN4/m6VcZOctqM+BTxce0A== X-Zone-Loop: 09c97141a24b1fbaf35086021fae41559d27390f4c0c x-campaign-type: default x-transaction-id: b9a5f416-93d6-407c-b2e1-a7364fa15895 x-swg-uid: 01-7d625f9f-cafd-4b03-b761-476a36b1c966 X-Mailer: Sweego Message-ID: <1792070492.8631fc262581453bbf619ec5b2062170.1a13fb9a01f0008425@vates.tech> x-swg-bid: 1792070492.8631fc262581453bbf619ec5b2062170.1a13fb9a01f0008425 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Julian Vetter To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Stefano Stabellini , Doug Goldstein , Julian Vetter Subject: [PATCH 1/3] tools/tests: fix domain creation on ARM Date: Thu, 15 Oct 2026 15:21:21 +0200 In-Reply-To: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> References: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.242.9bbe1338220ab1a0.1a13fb99ddf.96ee2834d2b33a54=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1792070491615 X-purgate-ID: tlsNG-ebf023/1792070497-C12DCB50-08341C57/0/0 X-purgate-type: clean X-purgate-size: 7856 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1792070518902158500 ---=Part.242.9bbe1338220ab1a0.1a13fb99ddf.96ee2834d2b33a54=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The tests test-mem-claim, test-paging-mempool and test-resource create ARM domains with xen_arch_domainconfig set to zero, i.e., gic_version XEN_DOMCTL_CONFIG_GIC_NATIVE, which has been removed. Domain creation in test-mem-claim and test-paging-mempool fails, and test-resource skips its ARM configuration. So, pick the GIC version from the XEN_SYSCTL_PHYSCAP_ARM_GIC_V2/V3 capability bits reported by XEN_SYSCTL_physinfo instead, the same way libxl does. Use GICv3 if available, else GICv2, else fail the test. But, even with a valid GIC version, the tests don't properly run, because ARM domains start with an empty P2M pool. The toolstack calls libxl__domain_set_paging_mempool_size() in libxl__arch_domain_create() to provision the page pool. But these tests don't go through the toolstack and call domain_create() directly. To fix this, call xc_set_paging_mempool_size() just like the toolstack does. Signed-off-by: Julian Vetter --- tools/tests/mem-claim/test-mem-claim.c | 15 ++++++++ .../paging-mempool/test-paging-mempool.c | 34 ++++++++++++++++++- tools/tests/resource/test-resource.c | 21 ++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/tools/tests/mem-claim/test-mem-claim.c b/tools/tests/mem-claim= /test-mem-claim.c index 69dc99cfdd..c21d791f0f 100644 --- a/tools/tests/mem-claim/test-mem-claim.c +++ b/tools/tests/mem-claim/test-mem-claim.c @@ -9,6 +9,7 @@ #include #include #include +#include #include =20 static unsigned int nr_failures; @@ -72,6 +73,13 @@ static void run_tests(void) create.flags &=3D ~XEN_DOMCTL_CDF_hvm; create.arch.emulation_flags =3D 0; } +#elif defined(__arm__) || defined(__aarch64__) + if ( arch_capabilities_arm_gic_v3(physinfo.arch_capabilities) ) + create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V3; + else if ( arch_capabilities_arm_gic_v2(physinfo.arch_capabilities) ) + create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V2; + else + return fail(" No supported GIC version\n"); #endif =20 rc =3D xc_domain_create(xch, &domid, &create); @@ -84,6 +92,13 @@ static void run_tests(void) return fail(" Failed to set maxmem: %d - %s\n", errno, strerror(errno)); =20 +#if defined(__arm__) || defined(__aarch64__) + rc =3D xc_set_paging_mempool_size(xch, domid, MB(1)); + if ( rc ) + return fail(" Failed to set paging mempool size: %d - %s\n", + errno, strerror(errno)); +#endif + printf(" Created d%u\n", domid); =20 /* diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests= /paging-mempool/test-paging-mempool.c index 0e03e2e4a0..020ebd5f8f 100644 --- a/tools/tests/paging-mempool/test-paging-mempool.c +++ b/tools/tests/paging-mempool/test-paging-mempool.c @@ -9,6 +9,7 @@ #include #include #include +#include #include =20 static unsigned int nr_failures; @@ -24,6 +25,8 @@ static xendevicemodel_handle *dh; static xenforeignmemory_handle *fh; static uint32_t domid =3D DOMID_ANY; =20 +static xc_physinfo_t physinfo; + static struct xen_domctl_createdomain create =3D { .flags =3D (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap | @@ -44,7 +47,7 @@ static uint64_t default_mempool_size_bytes =3D #if defined(__x86_64__) || defined(__i386__) 256 << 12; /* Only x86 HAP for now. x86 Shadow needs more work. */ #elif defined (__arm__) || defined(__aarch64__) - 16 << 12; + 0; #endif =20 static int test_paging_mempool_size(void) @@ -80,6 +83,14 @@ static int test_paging_mempool_size(void) * Populate the domain with some RAM. This will cause more of the mem= pool * to be used. */ +#if defined(__arm__) || defined(__aarch64__) + size_bytes =3D 16 << 12; + rc =3D xc_set_paging_mempool_size(xch, domid, size_bytes); + if ( rc ) + return fail(" Fail: set mempool size: %d - %s\n", + errno, strerror(errno)); +#endif + old_size_bytes =3D size_bytes; =20 rc =3D xc_domain_setmaxmem(xch, domid, -1); @@ -274,6 +285,11 @@ static int test_p2m_relocate_memory(void) GFN_PAIR(GFN_4M - 32, 32), GFN_PAIR(GFN_4M, 32)); =20 rc =3D xendevicemodel_relocate_memory(dh, domid, 32, GFN_4M - 32, GFN_= 4M); + if ( rc && (errno =3D=3D EOPNOTSUPP || errno =3D=3D ENOSYS) ) + { + printf(" Skip: %d - %s\n", errno, strerror(errno)); + return 0; + } if ( rc ) return fail(" Fail: relocate memory: %d - %s\n", errno, strerror(errno)); @@ -370,6 +386,22 @@ int main(int argc, char **argv) if ( !fh ) err(1, "xenforeignmemory_open"); =20 + rc =3D xc_physinfo(xch, &physinfo); + if ( rc ) + err(1, "Failed to obtain physinfo"); + +#if defined(__arm__) || defined(__aarch64__) + if ( arch_capabilities_arm_gic_v3(physinfo.arch_capabilities) ) + create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V3; + else if ( arch_capabilities_arm_gic_v2(physinfo.arch_capabilities) ) + create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V2; + else + { + fail(" No supported GIC version\n"); + goto out; + } +#endif + rc =3D xc_domain_create(xch, &domid, &create); if ( rc ) { diff --git a/tools/tests/resource/test-resource.c b/tools/tests/resource/te= st-resource.c index 236da0dcd4..2392281f76 100644 --- a/tools/tests/resource/test-resource.c +++ b/tools/tests/resource/test-resource.c @@ -7,6 +7,7 @@ #include #include #include +#include #include =20 static unsigned int nr_failures; @@ -213,6 +214,16 @@ static void test_domain_configurations(void) continue; } } +#elif defined(__aarch64__) || defined(__arm__) + if ( arch_capabilities_arm_gic_v3(physinfo.arch_capabilities) ) + t->create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V3; + else if ( arch_capabilities_arm_gic_v2(physinfo.arch_capabilities)= ) + t->create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V2; + else + { + fail(" No supported GIC version\n"); + continue; + } #endif =20 rc =3D xc_domain_create(xch, &domid, &t->create); @@ -236,6 +247,16 @@ static void test_domain_configurations(void) goto test_done; } =20 +#if defined(__aarch64__) || defined(__arm__) + rc =3D xc_set_paging_mempool_size(xch, domid, MB(1)); + if ( rc ) + { + fail(" Failed to set paging mempool size: %d - %s\n", + errno, strerror(errno)); + goto test_done; + } +#endif + rc =3D xc_domain_populate_physmap_exact( xch, domid, ARRAY_SIZE(ram), 0, 0, ram); if ( rc ) --=20 2.53.0 --=20 Julian Vetter | Vates Hypervisor & Kernel Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.242.9bbe1338220ab1a0.1a13fb99ddf.96ee2834d2b33a54=--- From nobody Mon Nov 23 22:39:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1792070517; cv=none; d=zohomail.com; s=zohoarc; b=MzsezScdXzwwWf8MUOgmfaV0eF/9WMbp0gm/6Ils3mqLmNnWx0LD6x8fS7jVM5jhZToTBFBjidNGxXZvtqCGS00g26JJauLTwbFrOwUxzBycelzM2ApGHu/gatCS/RzhAcvd8JTVjfXdKQIzElyGw7xSFWE+zASnVQV+T4I5WNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792070517; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=994Z2AwKWVseJVTVA5qO9/fH1rz5FCL4yb2kHAul2yk=; b=Ltwmq16Gm2eiQZx6NU7VDSezgxr7GRwRl0waET9J/ilUl9xSpQ+7TOEyd60Kv1iPq2kFm230T88O/IIglPR/Rc3VCfE/ImD9vGBDPdcheyjkGWSBDOKBz1Hr2wFBrcxEIjlOrjxZHTXNP7Fa5EEmuih75fimX5PxY/x/0kaf5Fg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792070517767278.0922304077276; Thu, 15 Oct 2026 06:21:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1450537.1666002 (Exim 4.92) (envelope-from ) id 1xHLP1-0001p1-NI; Thu, 15 Oct 2026 13:21:47 +0000 Received: by outflank-mailman (output) from mailman id 1450537.1666002; Thu, 15 Oct 2026 13:21:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLP1-0001or-Jr; Thu, 15 Oct 2026 13:21:47 +0000 Received: by outflank-mailman (input) for mailman id 1450537; Thu, 15 Oct 2026 13:21:46 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLP0-0001oB-9g for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 13:21:46 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xHLOz-00H2Lo-MV for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 15:21:45 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad0d369-2eae-0a2a0a5409dd-0a2a4506862c-2 for ; Thu, 15 Oct 2026 15:21:45 +0200 Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad0d364-195a-0a2a45060019-b9ff1c12a6c9-3 for ; Thu, 15 Oct 2026 15:21:41 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 1a13fb9a2d20008425.005 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 15 Oct 2026 13:21:32 +0000 Received: from julian.home (82-67-211-29.subs.proxad.net [82.67.211.29]) (Authenticated sender: julian.vetter@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id E48B380120; Thu, 15 Oct 2026 15:21:31 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=994Z2AwKWVseJVTVA5qO9/fH1rz5FCL4yb2kHAul2yk=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=b1N/fFfo6b6cDynfyBg8hW8DCVgEWd09ehjvzySyMD7E2wqE1wKTsSUypTdXFYJO3BjI6L8Ok 0YSEFTTpg4OZU8QsBa8zmqgsOUbEH96UeX6JPscjelOAJNnWOsazwqAHR7IjZa6QRm5P+sGJvBS breP2zv5jM+eiXAYCpMhxpwGVTPYggGEsg+P9aXGFa4qk86HeMws0FOD4v3PegTvOX29lEHl0nm Mb0MaQH7AfbCt5bp6AoYUG8Zw4HMm/5z1Ee0R6bXZv6zBYfOicVKSY+HTGO5PUtYMPWWKOavaRs dA+nLfaz7iCA1fV8kIKrx+08ut1NMwGyMpc3Fvs1sECQ== X-Zone-Loop: 34655567a8ecf9afa5472571a0597ec249929519557c x-campaign-type: default x-transaction-id: ac05a02e-0c3d-4c24-8924-2d725a96c0a7 x-swg-uid: 01-c861ec83-9fc3-4f5d-8c3b-4555e70dc5ad X-Mailer: Sweego Message-ID: <1792070492.8631fc262581453bbf619ec5b2062170.1a13fb9a2d20008425@vates.tech> x-swg-bid: 1792070492.8631fc262581453bbf619ec5b2062170.1a13fb9a2d20008425 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Julian Vetter To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Stefano Stabellini , Doug Goldstein , Julian Vetter Subject: [PATCH 2/3] tools/tests: don't skip all of test-paging-mempool without an IOMMU Date: Thu, 15 Oct 2026 15:21:22 +0200 In-Reply-To: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> References: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.243.1e85d09599fae89b.1a13fb9a138.997487b0e243cbb3=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1792070492472 X-purgate-ID: tlsNG-16d1c6/1792070501-F6A7477B-2F7F85ED/0/0 X-purgate-type: clean X-purgate-size: 2391 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1792070521022158500 ---=Part.243.1e85d09599fae89b.1a13fb9a138.997487b0e243cbb3=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 --- 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"); =20 + if ( !(create.flags & XEN_DOMCTL_CDF_iommu) ) + { + printf(" Skip: No IOMMU, can't force continuations\n"); + return 0; + } + rc =3D 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"); =20 + /* + * 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 &=3D ~XEN_DOMCTL_CDF_iommu; + #if defined(__arm__) || defined(__aarch64__) if ( arch_capabilities_arm_gic_v3(physinfo.arch_capabilities) ) create.arch.gic_version =3D XEN_DOMCTL_CONFIG_GIC_V3; --=20 2.53.0 --=20 Julian Vetter | Vates Hypervisor & Kernel Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.243.1e85d09599fae89b.1a13fb9a138.997487b0e243cbb3=--- From nobody Mon Nov 23 22:39:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1792070527; cv=none; d=zohomail.com; s=zohoarc; b=g1SRGn9JveKgdxNdkPOLUDpWAt9vs3nHPwbcBZ+DoflzzQT6Z0m2FVYZ0tdGF2Y41JCayxo3pLxw6S/pN45PDV4vKvmH6D+9w0aAb9BjxqR6EFvso7qP/Um97uXitXXa1Gl0awTPnbCE8DkgnthM9ak7ILbiMeypacEWuDabPAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1792070527; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Tn8t9m1cvZ8eErG1VUqIp9xR9MpDpiXQ5lbx+uFtkS4=; b=UAT9Vbi5NcMUiSrUKvtiVroBvOUmCpCnzjmlzoMlVWqP57y9aIjjOfPz2R/8/ofUH0zDeYD64MQAla8mRZJoCnevGEm821iAGoRDnLgCLdSf5EyWDBcZ9b7DzppG7c/ZPe6HdI8dMzqhe0E/kEeF1JmjtrKo1QSbtq5aw4JlzOk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1792070527262970.3528970208399; Thu, 15 Oct 2026 06:22:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1450538.1666011 (Exim 4.92) (envelope-from ) id 1xHLP4-00023E-2L; Thu, 15 Oct 2026 13:21:50 +0000 Received: by outflank-mailman (output) from mailman id 1450538.1666011; Thu, 15 Oct 2026 13:21:50 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLP3-000236-Ur; Thu, 15 Oct 2026 13:21:49 +0000 Received: by outflank-mailman (input) for mailman id 1450538; Thu, 15 Oct 2026 13:21:48 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1xHLP2-0001yX-IS for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 13:21:48 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1xHLP1-00H2NG-VP for xen-devel@lists.xenproject.org; Thu, 15 Oct 2026 15:21:47 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6ad0d369-bab6-0a2a0a5309dd-0a2a4506863a-8 for ; Thu, 15 Oct 2026 15:21:47 +0200 Received: from [185.255.28.18] (helo=prod-mta-13.swg-srv.net) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6ad0d364-195a-0a2a45060019-b9ff1c12a6c9-4 for ; Thu, 15 Oct 2026 15:21:47 +0200 Received: from mail2.vates.fr ([37.26.189.201] mail2.vates.fr) (Authenticated sender: 8631fc262581453bbf619ec5b2062170/smtp/7773de5a-2839-4720-82ee-e06722ae1d3e) by prod-mta-13.swg-srv.net (ZoneMTA - prod-mta-13) with ESMTPSA id 1a13fb9a6560008425.005 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 15 Oct 2026 13:21:33 +0000 Received: from julian.home (82-67-211-29.subs.proxad.net [82.67.211.29]) (Authenticated sender: julian.vetter@vates.tech) by mail2.vates.fr (Postfix) with ESMTPSA id 9D40A82B1B; Thu, 15 Oct 2026 15:21:32 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:In-Reply-To:References:Feedback-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; q=dns/txt; s=selector1; bh=Tn8t9m1cvZ8eErG1VUqIp9xR9MpDpiXQ5lbx+uFtkS4=; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to:references:feedback-id; b=mqWoI4ovIH+FA6P6x+uxVWeOrSpTArftGa6cfl1ChNQKmbubUMPo5jagpHKlao5WP/O5/rqkO c6CclcuDKj+9LGU09PEP/Q+/QH30Y6zJxHJD2xXPc6eFuNB8HcEpfGA4FUHelAQt0CLliWvzLqY OYeUWmcNM3vBrdC4/LeIQ+VdIhZpRqpPjtM8VEsmAhNwCmTnkfkIAci+rGCilvHC4sOKgA4XC9A Q4whSLVhTJ/zqU64deKNG/4hFSWrLeLflWfomeax50HXUBu3NHJ1Do8tfJYRAgLCATjGd8UqdWW pjD6Hppjf0ei3OUDh/eXqH3HxgGw/ZZdEfvW7VQYEESg== X-Zone-Loop: f25508eb7cb5979d8723953df0cf7c19a9382d65a856 x-campaign-type: default x-transaction-id: 1f2eb63c-f1ff-4eec-b7a2-39b2945b2cab x-swg-uid: 01-8ecdd480-5c83-415f-b315-504d28ebe569 X-Mailer: Sweego Message-ID: <1792070493.8631fc262581453bbf619ec5b2062170.1a13fb9a6560008425@vates.tech> x-swg-bid: 1792070493.8631fc262581453bbf619ec5b2062170.1a13fb9a6560008425 Feedback-ID: default:8631fc262581453bbf619ec5b2062170:Sweego x-campaign-id: default x-client-id: 8631fc262581453bbf619ec5b2062170 X-Originating-IP: [37.26.189.201] From: Julian Vetter To: xen-devel@lists.xenproject.org Cc: Andrew Cooper , Anthony PERARD , Michal Orzel , Stefano Stabellini , Doug Goldstein , Julian Vetter Subject: [PATCH 3/3] automation: run tools/tests on arm64 under QEMU Date: Thu, 15 Oct 2026 15:21:23 +0200 In-Reply-To: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> References: <1792070250.8631fc262581453bbf619ec5b2062170.1a13fb5eee80008425@vates.tech> MIME-Version: 1.0 X-BM-Disclaimer: Yes Content-Type: multipart/alternative; boundary="-=Part.244.cdffe731ec7b89e7.1a13fb9a3f1.14a6e143a9d8b062=-" X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1792070493169 X-purgate-ID: tlsNG-16d1c6/1792070507-F5A0C77B-5CEB33D9/0/0 X-purgate-type: clean X-purgate-size: 5590 X-ZohoMail-DKIM: pass (identity @vates.tech) X-ZM-MESSAGEID: 1792070529162158501 ---=Part.244.cdffe731ec7b89e7.1a13fb9a3f1.14a6e143a9d8b062=- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently the tests from tools/tests/* are only run on x86 hardware. So, add jobs running them in dom0 under QEMU on arm64, for both GICv2 and GICv3. Like qemu-smoke-dom0-arm64.sh, boot Xen and dom0 via U-Boot and ImageBuilder, and run them with automation/scripts/run-tools-tests. The JUnit output is printed on the console and extracted from the log afterwards, as there is no network access to the guest to get it. Signed-off-by: Julian Vetter --- automation/gitlab-ci/test.yaml | 23 ++++ automation/scripts/qemu-tools-tests-arm64.sh | 105 +++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100755 automation/scripts/qemu-tools-tests-arm64.sh diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 96127995d7..f6110f764e 100644 --- a/automation/gitlab-ci/test.yaml +++ b/automation/gitlab-ci/test.yaml @@ -581,6 +581,29 @@ qemu-smoke-dom0-arm64-gcc-debug: - *arm64-test-needs - alpine-3.24-arm64-gcc-debug =20 +.qemu-tools-tests-arm64: + extends: .qemu-arm64 + artifacts: + paths: + - tools-tests.serial + - '*.log' + - tests-junit.xml + reports: + junit: tests-junit.xml + needs: + - *arm64-test-needs + - alpine-3.24-arm64-gcc-debug + +qemu-tools-tests-arm64-gcc-debug-gicv2: + extends: .qemu-tools-tests-arm64 + script: + - ./automation/scripts/qemu-tools-tests-arm64.sh gicv2 2>&1 | tee ${LO= GFILE} + +qemu-tools-tests-arm64-gcc-debug-gicv3: + extends: .qemu-tools-tests-arm64 + script: + - ./automation/scripts/qemu-tools-tests-arm64.sh gicv3 2>&1 | tee ${LO= GFILE} + qemu-smoke-dom0less-arm64-gcc: extends: .qemu-arm64 script: diff --git a/automation/scripts/qemu-tools-tests-arm64.sh b/automation/scri= pts/qemu-tools-tests-arm64.sh new file mode 100755 index 0000000000..0d82c0055a --- /dev/null +++ b/automation/scripts/qemu-tools-tests-arm64.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +# Run the tests from tools/tests/* in dom0, under QEMU. +# +# Usage: qemu-tools-tests-arm64.sh gicv2|gicv3 + +set -ex -o pipefail + +test_variant=3D$1 + +case "${test_variant}" in + gicv2) gic_version=3D2 ;; + gicv3) gic_version=3D3 ;; + *) + echo "Unrecognised test_variant '${test_variant}'" >&2 + exit 1 + ;; +esac + +passed=3D"tools tests passed" +failed=3D"tools tests failed" + +# Dom0 rootfs +cd binaries +cp rootfs.cpio.gz dom0-rootfs.cpio.gz +cat xen-tools.cpio.gz >> dom0-rootfs.cpio.gz + +# test-local configuration +mkdir -p rootfs +cd rootfs +mkdir -p etc/local.d root +cp -a ../../automation/scripts/run-tools-tests root/ +echo "#!/bin/bash + +bash /etc/init.d/xencommons start + +if /root/run-tools-tests /usr/lib/xen/tests /tmp/tests-junit.xml; then + result=3D\"${passed}\" +else + result=3D\"${failed}\" +fi + +echo '@@@ JUNIT BEGIN' +cat /tmp/tests-junit.xml +echo '@@@ JUNIT END' +echo \"\${result}\" +" > etc/local.d/xen.start +chmod +x etc/local.d/xen.start +find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz +cd ../.. + +qemu-system-aarch64 \ + -machine virtualization=3Dtrue \ + -cpu cortex-a57 -machine type=3Dvirt,gic-version=3D${gic_version} \ + -m 2048 -smp 2 -display none \ + -machine dumpdtb=3Dbinaries/virt.dtb + +# XXX disable pl061 to avoid Linux crash +fdtput binaries/virt.dtb -p -t s /pl061@9030000 status disabled + +# ImageBuilder +echo 'MEMORY_START=3D"0x40000000" +MEMORY_END=3D"0xC0000000" + +DEVICE_TREE=3D"virt.dtb" +XEN=3D"xen" +DOM0_KERNEL=3D"Image" +DOM0_RAMDISK=3D"dom0-rootfs.cpio.gz" +XEN_CMD=3D"console=3Ddtuart dom0_mem=3D1024M console_timestamps=3Dboot" + +NUM_DOMUS=3D0 + +LOAD_CMD=3D"tftpb" +UBOOT_SOURCE=3D"boot.source" +UBOOT_SCRIPT=3D"boot.scr"' > binaries/config +rm -rf imagebuilder +git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git +bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binarie= s/config + + +# Run the test +rm -f tools-tests.serial +export TEST_CMD=3D"qemu-system-aarch64 \ + -machine virtualization=3Dtrue \ + -cpu cortex-a57 -machine type=3Dvirt,gic-version=3D${gic_version} \ + -m 2048 -monitor none -serial stdio \ + -smp 2 \ + -no-reboot \ + -device virtio-net-pci,netdev=3Dn0 \ + -netdev user,id=3Dn0,tftp=3Dbinaries \ + -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin" + +export UBOOT_CMD=3D"virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0= x40000000" +export BOOT_MSG=3D"Latest ChangeSet: " +export TEST_LOG=3D"tools-tests.serial" +export PASSED=3D"${passed}|${failed}" + +./automation/scripts/console.exp |& sed 's/\r\+$//' + +# Extract the JUnit report from the console, dropping any interleaved Xen +# messages. +sed -e 's/\r\+$//' -e '1,/^@@@ JUNIT BEGIN$/d' -e '/^@@@ JUNIT END$/,$d' \ + tools-tests.serial | grep -v '^(XEN)' > tests-junit.xml + +grep -q "^${passed}$" <(sed 's/\r\+$//' tools-tests.serial) --=20 2.53.0 --=20 Julian Vetter | Vates Hypervisor & Kernel Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech ---=Part.244.cdffe731ec7b89e7.1a13fb9a3f1.14a6e143a9d8b062=---