From xen-changelog-bounces@lists.xenproject.org Fri May 01 12:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 May 2026 12:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1298666.1573794 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImhz-0008FB-KT; Fri, 01 May 2026 12:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1298666.1573794; Fri, 01 May 2026 12:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImhz-0008F3-HU; Fri, 01 May 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1298666;
 Fri, 01 May 2026 12:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wImhy-0008Ex-8W
 for xen-changelog@lists.xenproject.org; Fri, 01 May 2026 12:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImhy-00BpLF-0Y
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImhy-00AUln-0C
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZHl6/8jnhZvt0ajJEQyRUHl9YPraMMfS1/GynucPCNI=; b=MblhoVahmu/MfyED718zx4noWZ
	NHXNcZ3zLMsBsFvC4ZaU31mCoKRfDRh5k46soiEwxn7mLnDFqmsnoHH2AlApkyc3kjKQh6jnMIGF4
	pb/BRFeVaXc2KueoShUTe5bFjxtQvg/Sqy+ORBTs9WXOk3Y4GkJ9gEApB3sW5a+nD+k4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pdx: Undef the correct macro
Message-Id: <E1wImhy-00AUln-0C@xenbits.xenproject.org>
Date: Fri, 01 May 2026 12:11:02 +0000

commit 9e13c0ca186c073f17f0f055658c7d33b3ea6877
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 09:37:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    x86/pdx: Undef the correct macro
    
    This was caused by a rename during review.
    
    No functional change.
    
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Fixes: bd0b3a876d80 ("pdx: allow per-arch optimization of PDX conversion helpers")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/x86/include/asm/pdx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/pdx.h b/xen/arch/x86/include/asm/pdx.h
index 6be7e1185e..6c10234ecf 100644
--- a/xen/arch/x86/include/asm/pdx.h
+++ b/xen/arch/x86/include/asm/pdx.h
@@ -57,7 +57,7 @@ static inline paddr_t directmapoff_to_maddr(unsigned long offset)
     return offset;
 }
 
-#undef PDX_ASM_GOTO_SKIP
+#undef PDX_ASM_GOTO
 
 #endif /* X86_PDX_H */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 01 12:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 May 2026 12:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1298667.1573798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImi9-0008GR-LN; Fri, 01 May 2026 12:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1298667.1573798; Fri, 01 May 2026 12:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImi9-0008GJ-Iq; Fri, 01 May 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1298667;
 Fri, 01 May 2026 12:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wImi8-0008G9-9s
 for xen-changelog@lists.xenproject.org; Fri, 01 May 2026 12:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImi8-00BpLL-0t
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImi8-00AUmo-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jUmR630d8WwdgpzKDxYJp5rWr4MrPflnScEBsvxMnfU=; b=6qZSpjceSTPe0t+u9/8t3+XFqs
	uBj2IiyiqkcmcUgNdWw/rnvWUOPk2FI9lOs0VABgrID3a2wdh73shR7ploQa3qQT1ZvXktC1WqQiZ
	Ny0HQY8z+aRDbEWgJ9pCDta4QgE+tI0UuDpoyiJ5Q/uplRj2iLs8JjU0QDXfibQeaI1o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu: identify uninitialized CPU data using BAD_APICID
Message-Id: <E1wImi8-00AUmo-0j@xenbits.xenproject.org>
Date: Fri, 01 May 2026 12:11:12 +0000

commit cd0413bfacf262b258029cbccbeadf99a7fef2b4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 30 13:46:47 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    x86/cpu: identify uninitialized CPU data using BAD_APICID
    
    Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
    not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
    correct condition.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 491cbbba33..ff05955bae 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -961,8 +961,7 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
      * In that case the socket number cannot be relied upon, but the respective
      * socket_cpumask[] slot also wouldn't have been set.
      */
-    if ( c[cpu].apicid != boot_cpu_data.apicid &&
-         cpumask_empty(socket_cpumask[socket]) )
+    if ( c[cpu].apicid != BAD_APICID && cpumask_empty(socket_cpumask[socket]) )
     {
         xfree(socket_cpumask[socket]);
         socket_cpumask[socket] = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 01 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 01 May 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1298669.1573802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImiJ-0008JB-Mj; Fri, 01 May 2026 12:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1298669.1573802; Fri, 01 May 2026 12:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wImiJ-0008J4-KD; Fri, 01 May 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1298669;
 Fri, 01 May 2026 12:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wImiI-0008Iq-Cb
 for xen-changelog@lists.xenproject.org; Fri, 01 May 2026 12:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImiI-00BpLQ-1A
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wImiI-00AUoW-13
 for xen-changelog@lists.xenproject.org;
 Fri, 01 May 2026 12:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eRX/h7bwJZnByPfyUJk+e8QNO0RBAmNBPEyXtCAp2EQ=; b=jL5BC9e7bvjUZvX3eXzDJhMbu6
	3GjGvro6UStkVAVLjfaZJHH3QOfaXXP7bNdmcVihjBbfuOiPIQmbwoOFqY7jGTndXmH6R5o6SXDVR
	Hd8OF3dc7GO5scI69oAC3zNaByF04ch0/7V3QfmAr1hambRIN4cDMe/aIncnCWvGitao=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: use --platform on `docker build` and `push`
Message-Id: <E1wImiI-00AUoW-13@xenbits.xenproject.org>
Date: Fri, 01 May 2026 12:11:22 +0000

commit 61f957d48c78df6c5254b6f54d6170d3bd3d717e
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Apr 29 14:48:01 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    CI: use --platform on `docker build` and `push`
    
    Without --platform, it seems recent versions of docker ignores the
    platform of the image when pushing, and it's pushed as the platform of
    the runner.
    
    If we happen to build an arm64 image on x86, with recent version of
    docker, the image will be push as if it was an x86 image, then
    `docker run --platform=linux/arm64 ...` fails. Even if it would
    work without --platform, gitlab-runner will not be able to use the
    image.
    
    To go back to the previous behavior, we will extract --platform from
    the dockerfiles, and use it on the command line.
    
    --platform= is needed on both docker-build and docker-push. The first
    one so that the image is tagged with the right platform, and the
    second one so that we can push a "generic" image without been tagged
    to a particular platform. --platform on docker-push allow to easly use
    the container on any arch, without having to use --platform on
    docker-pull or docker-run.
    
    `docker push --platform` seem to have been added to 1.46, according to
    the [doc], and doesn't exist on Podman. So we need to check that we
    are using `docker` and that the API version is new enough.
    
    [doc] https://docs.docker.com/reference/cli/docker/image/push/
    
    Also, introduce the $img variable, to make the lines a bit shorter.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/Makefile | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index fedf7524da..d578cd3476 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -15,10 +15,28 @@ help:
 
 include yocto/yocto.inc
 
+# Find out if we are running Podman, if not is likely docker.
+is-docker = $(if $(filter Podman,$(shell $(DOCKER_CMD) version)),,1)
+
+# Find out the docker API version is at least 1.46. We exploit `sort -V` to
+# compare the versions at it can sort by version.
+docker-api-version = $(shell $(DOCKER_CMD) version -f '{{.Client.APIVersion}}')
+docker-min-version = $(firstword $(shell printf "1.46\n$(docker-api-version)" | sort -V))
+docker-have-push-platform = $(if $(filter 1.46,$(docker-min-version)),1)
+
+# check if we can use `X push --platform`.
+# `podman push` doesn't support --platform.
+# `docker` only have it on recent version.
+builder-have-push-platform = $(and $(is-docker),$(docker-have-push-platform))
+
 %: %.dockerfile ## Builds containers
-	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
-	@if [ ! -z $${PUSH+x} ]; then \
-		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
+	set -xe; \
+	$(if $(builder-have-push-platform), \
+	    platform=$$(sed -n '/^FROM/{s/.*\(--platform=[^ ]*\) .*/\1/p;q}' $<); ) \
+	img="$(REGISTRY)/$(@D):$(@F)"; \
+	$(DOCKER_CMD) build --pull $$platform -t $$img -f $< $(<D); \
+	if [ ! -z $${PUSH+x} ]; then \
+		$(DOCKER_CMD) push $$platform $$img; \
 	fi
 
 .PHONY: all clean
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sun May 03 04:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 03 May 2026 04:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299259.1573901 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLN-0006FU-A4; Sun, 03 May 2026 04:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299259.1573901; Sun, 03 May 2026 04:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLN-0006FM-7Q; Sun, 03 May 2026 04:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1299259;
 Sun, 03 May 2026 04:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJOLM-0006FE-EV
 for xen-changelog@lists.xenproject.org; Sun, 03 May 2026 04:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLM-00F0r5-1L
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLM-00CsSk-0u
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XTSUTgRStvXr6ftsp9eOJgaOcAiaPYcNq13DD4RvmR8=; b=QeAgMJNcCxpKYpLWFsJfCxAg6q
	93T4inDWTr4wWvR7T6OmJZhA//UxvOLcVXB971pozXPaMxrKbAbAdD2tu3Gf/A66F53VmBJkt3Vfa
	sT79bXzjgdC3cIaHvgj2RTdUAOD9AAhVJt/T3JdzP75q6tXQnwHFKX2rjQFLlZ3TVM08=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu: identify uninitialized CPU data using BAD_APICID
Message-Id: <E1wJOLM-00CsSk-0u@xenbits.xenproject.org>
Date: Sun, 03 May 2026 04:22:12 +0000

commit cd0413bfacf262b258029cbccbeadf99a7fef2b4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 30 13:46:47 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    x86/cpu: identify uninitialized CPU data using BAD_APICID
    
    Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
    not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
    correct condition.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 491cbbba33..ff05955bae 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -961,8 +961,7 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
      * In that case the socket number cannot be relied upon, but the respective
      * socket_cpumask[] slot also wouldn't have been set.
      */
-    if ( c[cpu].apicid != boot_cpu_data.apicid &&
-         cpumask_empty(socket_cpumask[socket]) )
+    if ( c[cpu].apicid != BAD_APICID && cpumask_empty(socket_cpumask[socket]) )
     {
         xfree(socket_cpumask[socket]);
         socket_cpumask[socket] = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun May 03 04:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 03 May 2026 04:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299258.1573897 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLE-0006EF-9M; Sun, 03 May 2026 04:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299258.1573897; Sun, 03 May 2026 04:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLE-0006E6-65; Sun, 03 May 2026 04:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1299258;
 Sun, 03 May 2026 04:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJOLC-0006E0-9G
 for xen-changelog@lists.xenproject.org; Sun, 03 May 2026 04:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLC-00F0qz-0j
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLC-00CsR1-0L
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=s+b2k1fCO7AH26xtlMYog5n/JT7nBba1X2LueTRPDz8=; b=budzE4cAkZfRNveBHHkRXHeWFV
	KjtAbHWQEnt2/FZm97P/WpmRhbzDsDWO7CHFGx3ISx+VuxVuX/PZan7v8Rg8AZWqjGxWqdOoGI+nG
	mA9DDEjgsLyT18sAvgdVWZeQKu1/YMUZqPlphcCg/E8GWYv+iX+8EFjK5abAHsgqhZUg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pdx: Undef the correct macro
Message-Id: <E1wJOLC-00CsR1-0L@xenbits.xenproject.org>
Date: Sun, 03 May 2026 04:22:02 +0000

commit 9e13c0ca186c073f17f0f055658c7d33b3ea6877
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 09:37:30 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    x86/pdx: Undef the correct macro
    
    This was caused by a rename during review.
    
    No functional change.
    
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Fixes: bd0b3a876d80 ("pdx: allow per-arch optimization of PDX conversion helpers")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
---
 xen/arch/x86/include/asm/pdx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/pdx.h b/xen/arch/x86/include/asm/pdx.h
index 6be7e1185e..6c10234ecf 100644
--- a/xen/arch/x86/include/asm/pdx.h
+++ b/xen/arch/x86/include/asm/pdx.h
@@ -57,7 +57,7 @@ static inline paddr_t directmapoff_to_maddr(unsigned long offset)
     return offset;
 }
 
-#undef PDX_ASM_GOTO_SKIP
+#undef PDX_ASM_GOTO
 
 #endif /* X86_PDX_H */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sun May 03 04:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 03 May 2026 04:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299260.1573905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLX-0006Jh-Bd; Sun, 03 May 2026 04:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299260.1573905; Sun, 03 May 2026 04:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJOLX-0006JX-8t; Sun, 03 May 2026 04:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1299260;
 Sun, 03 May 2026 04:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJOLW-0006JM-Gv
 for xen-changelog@lists.xenproject.org; Sun, 03 May 2026 04:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLW-00F0rF-1c
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJOLW-00CsVM-1V
 for xen-changelog@lists.xenproject.org;
 Sun, 03 May 2026 04:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yIGFrva0Hn7gllzQr8fLc+blrCbazYGZ2JAP4EPXDaA=; b=MsMw5WvgjRfWC3adlcaYx085jZ
	jP5Qdqk4zdAXlBH0KGeGyKOxTr5fiedecXwd2hSRm21nQCxZo7PFs64As8mjbsYfTEbBiQWj4ABOb
	D7hwSaP3cmlAQx/vwJyQ+YT7GsNkocHe4l56UdF8dBd/nvzb2UZII4m1xfUj9w0ec3BE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: use --platform on `docker build` and `push`
Message-Id: <E1wJOLW-00CsVM-1V@xenbits.xenproject.org>
Date: Sun, 03 May 2026 04:22:22 +0000

commit 61f957d48c78df6c5254b6f54d6170d3bd3d717e
Author:     Anthony PERARD <anthony.perard@vates.tech>
AuthorDate: Wed Apr 29 14:48:01 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 1 10:51:19 2026 +0100

    CI: use --platform on `docker build` and `push`
    
    Without --platform, it seems recent versions of docker ignores the
    platform of the image when pushing, and it's pushed as the platform of
    the runner.
    
    If we happen to build an arm64 image on x86, with recent version of
    docker, the image will be push as if it was an x86 image, then
    `docker run --platform=linux/arm64 ...` fails. Even if it would
    work without --platform, gitlab-runner will not be able to use the
    image.
    
    To go back to the previous behavior, we will extract --platform from
    the dockerfiles, and use it on the command line.
    
    --platform= is needed on both docker-build and docker-push. The first
    one so that the image is tagged with the right platform, and the
    second one so that we can push a "generic" image without been tagged
    to a particular platform. --platform on docker-push allow to easly use
    the container on any arch, without having to use --platform on
    docker-pull or docker-run.
    
    `docker push --platform` seem to have been added to 1.46, according to
    the [doc], and doesn't exist on Podman. So we need to check that we
    are using `docker` and that the API version is new enough.
    
    [doc] https://docs.docker.com/reference/cli/docker/image/push/
    
    Also, introduce the $img variable, to make the lines a bit shorter.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/build/Makefile | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/automation/build/Makefile b/automation/build/Makefile
index fedf7524da..d578cd3476 100644
--- a/automation/build/Makefile
+++ b/automation/build/Makefile
@@ -15,10 +15,28 @@ help:
 
 include yocto/yocto.inc
 
+# Find out if we are running Podman, if not is likely docker.
+is-docker = $(if $(filter Podman,$(shell $(DOCKER_CMD) version)),,1)
+
+# Find out the docker API version is at least 1.46. We exploit `sort -V` to
+# compare the versions at it can sort by version.
+docker-api-version = $(shell $(DOCKER_CMD) version -f '{{.Client.APIVersion}}')
+docker-min-version = $(firstword $(shell printf "1.46\n$(docker-api-version)" | sort -V))
+docker-have-push-platform = $(if $(filter 1.46,$(docker-min-version)),1)
+
+# check if we can use `X push --platform`.
+# `podman push` doesn't support --platform.
+# `docker` only have it on recent version.
+builder-have-push-platform = $(and $(is-docker),$(docker-have-push-platform))
+
 %: %.dockerfile ## Builds containers
-	$(DOCKER_CMD) build --pull -t $(REGISTRY)/$(@D):$(@F) -f $< $(<D)
-	@if [ ! -z $${PUSH+x} ]; then \
-		$(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
+	set -xe; \
+	$(if $(builder-have-push-platform), \
+	    platform=$$(sed -n '/^FROM/{s/.*\(--platform=[^ ]*\) .*/\1/p;q}' $<); ) \
+	img="$(REGISTRY)/$(@D):$(@F)"; \
+	$(DOCKER_CMD) build --pull $$platform -t $$img -f $< $(<D); \
+	if [ ! -z $${PUSH+x} ]; then \
+		$(DOCKER_CMD) push $$platform $$img; \
 	fi
 
 .PHONY: all clean
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 04 08:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 May 2026 08:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299580.1574116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJojf-0003Ic-3C; Mon, 04 May 2026 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299580.1574116; Mon, 04 May 2026 08:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJojf-0003IU-0f; Mon, 04 May 2026 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1299580;
 Mon, 04 May 2026 08:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJoje-0003IO-1v
 for xen-changelog@lists.xenproject.org; Mon, 04 May 2026 08:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJojd-00Gmkk-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 08:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJojd-00ELWb-30
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 08:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/NH6qokUBowxXQcD93mb2leMjftiJD6y03H0poghi5k=; b=hMyiWTOa0EXneWxrWDtKqh5Bzg
	0xNrxa0EMLa3emlvBnCp2K1msoT5OeLTRohi7GlG/yUVG3d0ynpMH4y6DUS/YSAq/Dw+aN6T9f1LI
	1r0m3A0jXb7RKQdIv+NxdYZlYLbowUTynJirK2mFyqM4YSFIbyCfeauC1saoyqtGNy4M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v2: disable interrupt bypass on CPU shutdown
Message-Id: <E1wJojd-00ELWb-30@xenbits.xenproject.org>
Date: Mon, 04 May 2026 08:33:01 +0000

commit 6f00fd9d6c1d6f08ab21f16c0406b3bb2c1e3b01
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue Apr 28 14:57:55 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 4 10:20:00 2026 +0200

    xen/arm: gic-v2: disable interrupt bypass on CPU shutdown
    
    The GICv2 CPU shutdown path currently writes 0 to GICC_CTLR.
    
    Per IHI0048B.b section 2.3.1, clearing the architected bypass-disable
    bits selects bypass rather than deasserted interrupt outputs when the
    CPU interface stops driving them. Tables 2-2 and 2-3 show that a zeroed
    GICC_CTLR can fall back to the legacy IRQ/FIQ inputs instead of fully
    disabling the interface.
    
    Fix this by reading GICC_CTLR, then setting the bypass-disable bits and
    clearing the group-enable bits that are architecturally defined for the
    current GICC_CTLR view before writing the value back. When Security
    Extensions are implemented Xen accesses the Non-secure copy of
    GICC_CTLR, where IRQBypDisGrp1 and FIQBypDisGrp1 are at bits [6:5] and
    bits [8:7] are reserved.
    
    Without Security Extensions (GICD_CTLR.DS=1), GICD_IGROUPR is RAZ/WI
    and all interrupts are Group 0, so clearing EnableGrp0 alone is
    sufficient to stop interrupt delivery through the CPU interface.
    
    Section 2.3.2 also states that wakeup event signals remain available
    even when both GIC interrupt signaling and interrupt bypass are
    disabled, so disabling bypass does not break the power-management use
    case, i.e. suspend modes.
    
    Fixes: 5e40a1b4351e ("arm: SMP CPU shutdown")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v2.c          | 12 +++++++++++-
 xen/arch/arm/include/asm/gic.h | 25 +++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 014f955967..43a379fdda 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -408,7 +408,17 @@ static void gicv2_cpu_init(void)
 
 static void gicv2_cpu_disable(void)
 {
-    writel_gicc(0x0, GICC_CTLR);
+    uint32_t ctlr = readl_gicc(GICC_CTLR);
+
+    if ( readl_gicd(GICD_TYPER) & GICD_TYPE_SEC )
+        ctlr |= GICC_NS_CTLR_BYPASS_DISABLE_GRP1_MASK;
+    else
+        ctlr |= GICC_CTLR_BYPASS_DISABLE_GRP0_MASK |
+                GICC_CTLR_BYPASS_DISABLE_GRP1_MASK;
+
+    ctlr &= ~GICC_CTL_ENABLE;
+
+    writel_gicc(ctlr, GICC_CTLR);
 }
 
 static void gicv2_hyp_init(void)
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index 8e713aa477..ff22dea40d 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -102,8 +102,29 @@
 #define GICD_TYPE_SEC   0x400
 #define GICD_TYPER_DVIS (1U << 18)
 
-#define GICC_CTL_ENABLE 0x1
-#define GICC_CTL_EOI    (0x1 << 9)
+/*
+ * Xen runs in the Non-secure world. When Security Extensions are present,
+ * Xen accesses the Non-secure GICC_CTLR view, where bit[0] is EnableGrp1
+ * and bits[6:5] are the Group 1 bypass-disable bits. Otherwise Xen sees the
+ * common GICC_CTLR layout, where bit[0] is EnableGrp0, bit[1] is EnableGrp1,
+ * bits[6:5] are the Group 0 bypass-disable bits, and bits[8:7] are the
+ * Group 1 bypass-disable bits.
+ */
+#define GICC_CTL_ENABLE        (0x1 << 0)
+#define GICC_CTL_ENABLE_GRP1   (0x1 << 1)
+#define GICC_CTL_FIQBypDisGrp0 (0x1 << 5)
+#define GICC_CTL_IRQBypDisGrp0 (0x1 << 6)
+#define GICC_CTL_FIQBypDisGrp1 (0x1 << 7)
+#define GICC_CTL_IRQBypDisGrp1 (0x1 << 8)
+
+#define GICC_CTLR_BYPASS_DISABLE_GRP0_MASK              \
+    (GICC_CTL_FIQBypDisGrp0 | GICC_CTL_IRQBypDisGrp0)
+#define GICC_CTLR_BYPASS_DISABLE_GRP1_MASK              \
+    (GICC_CTL_FIQBypDisGrp1 | GICC_CTL_IRQBypDisGrp1)
+#define GICC_NS_CTLR_BYPASS_DISABLE_GRP1_MASK           \
+    GICC_CTLR_BYPASS_DISABLE_GRP0_MASK
+
+#define GICC_CTL_EOI           (0x1 << 9)
 
 #define GICC_IA_IRQ       0x03ff
 #define GICC_IA_CPU_MASK  0x1c00
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 04 08:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 May 2026 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299581.1574120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJojp-0003KB-4f; Mon, 04 May 2026 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299581.1574120; Mon, 04 May 2026 08:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJojp-0003K3-1y; Mon, 04 May 2026 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1299581;
 Mon, 04 May 2026 08:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJojo-0003Jr-4S
 for xen-changelog@lists.xenproject.org; Mon, 04 May 2026 08:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJojo-00Gmko-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJojo-00ELXC-09
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 08:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+cMgQ0VD+S3IHebz5eAM7qaMJWJJjjnn+UDmxSNGroE=; b=HQCULl0r1ikI4Kn8AtpC3cmDJs
	pNtGvnjn4FJ4p05ntEto7LYQH8/+IFZZn4N3zToDsXocaDxVzeLpXEjh3KnHaAFQUzWCHB06HGrsN
	/MO7QzothtXAC8un17fD6RofuR+ETHhR/l0P9Sjgu7QvXv/aAoHWgoh3/x/+Dku0wl4Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: vpsci: ignore upper 32 bits for SMC32 PSCI arguments
Message-Id: <E1wJojo-00ELXC-09@xenbits.xenproject.org>
Date: Mon, 04 May 2026 08:33:12 +0000

commit f4af571dd70bea97d8de82d7aa39c62c530db897
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue Mar 31 21:31:29 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 4 10:20:00 2026 +0200

    xen/arm: vpsci: ignore upper 32 bits for SMC32 PSCI arguments
    
    SMCCC DEN0028G, section 3.1, states that for AArch64 SMC/HVC calls
    using Wn, only the least significant 32 bits are significant and the
    upper 32 bits must be ignored by the implementation.
    
    So for SMC32 PSCI calls, Xen must not treat non-zero upper bits in the
    argument registers as an error. Instead, they should be discarded when
    decoding the arguments.
    
    Arm ARM DDI 0487J.a (D1-5406) also notes that the upper 32 bits may be
    implementation defined when entering from AArch32. Xen zeros them on
    entry, but that guarantee is only relevant for 32-bit domains.
    
    Update PSCI v0.2+ CPU_ON, CPU_SUSPEND, AFFINITY_INFO and SYSTEM_SUSPEND
    to read SMC32 arguments via PSCI_ARG32(), while keeping the SMC64
    handling unchanged.
    
    No functional change is intended for PSCI 0.1.
    
    Suggested-by: Julien Grall <julien@xen.org>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/vpsci.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index bd87ec430d..ac6af6118f 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -305,13 +305,16 @@ static int32_t do_psci_1_0_features(uint32_t psci_func_id)
 #define PSCI_ARG32(reg, n) PSCI_ARG(reg, n)
 #endif
 
+#define PSCI_ARG_CONV(reg, n, conv_64) \
+    ((conv_64) ? PSCI_ARG(reg, n) : PSCI_ARG32(reg, n))
+
 /*
  * PSCI 0.1 calls. It will return false if the function ID is not
  * handled.
  */
 bool do_vpsci_0_1_call(struct cpu_user_regs *regs, uint32_t fid)
 {
-    switch ( (uint32_t)get_user_reg(regs, 0) )
+    switch ( fid )
     {
     case PSCI_cpu_off:
     {
@@ -346,6 +349,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
      * adding/removing a function. SSSC_SMCCC_*_REVISION should be
      * updated once per release.
      */
+    bool is_conv_64 = smccc_is_conv_64(fid);
+
     switch ( fid )
     {
     case PSCI_0_2_FN32_PSCI_VERSION:
@@ -378,9 +383,9 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN32_CPU_ON:
     case PSCI_0_2_FN64_CPU_ON:
     {
-        register_t vcpuid = PSCI_ARG(regs, 1);
-        register_t epoint = PSCI_ARG(regs, 2);
-        register_t cid = PSCI_ARG(regs, 3);
+        register_t vcpuid = PSCI_ARG_CONV(regs, 1, is_conv_64);
+        register_t epoint = PSCI_ARG_CONV(regs, 2, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 3, is_conv_64);
 
         perfc_incr(vpsci_cpu_on);
         PSCI_SET_RESULT(regs, do_psci_0_2_cpu_on(vcpuid, epoint, cid));
@@ -391,8 +396,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN64_CPU_SUSPEND:
     {
         uint32_t pstate = PSCI_ARG32(regs, 1);
-        register_t epoint = PSCI_ARG(regs, 2);
-        register_t cid = PSCI_ARG(regs, 3);
+        register_t epoint = PSCI_ARG_CONV(regs, 2, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 3, is_conv_64);
 
         perfc_incr(vpsci_cpu_suspend);
         PSCI_SET_RESULT(regs, do_psci_0_2_cpu_suspend(pstate, epoint, cid));
@@ -402,7 +407,7 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN32_AFFINITY_INFO:
     case PSCI_0_2_FN64_AFFINITY_INFO:
     {
-        register_t taff = PSCI_ARG(regs, 1);
+        register_t taff = PSCI_ARG_CONV(regs, 1, is_conv_64);
         uint32_t laff = PSCI_ARG32(regs, 2);
 
         perfc_incr(vpsci_cpu_affinity_info);
@@ -422,14 +427,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_1_0_FN32_SYSTEM_SUSPEND:
     case PSCI_1_0_FN64_SYSTEM_SUSPEND:
     {
-        register_t epoint = PSCI_ARG(regs, 1);
-        register_t cid = PSCI_ARG(regs, 2);
-
-        if ( fid == PSCI_1_0_FN32_SYSTEM_SUSPEND )
-        {
-            epoint &= GENMASK(31, 0);
-            cid &= GENMASK(31, 0);
-        }
+        register_t epoint = PSCI_ARG_CONV(regs, 1, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 2, is_conv_64);
 
         perfc_incr(vpsci_system_suspend);
         PSCI_SET_RESULT(regs, do_psci_1_0_system_suspend(epoint, cid));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 04 09:33:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 May 2026 09:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299641.1574187 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJpfi-0005nY-M1; Mon, 04 May 2026 09:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299641.1574187; Mon, 04 May 2026 09:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJpfi-0005nQ-JD; Mon, 04 May 2026 09:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1299641;
 Mon, 04 May 2026 09:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJpfh-0005nK-NL
 for xen-changelog@lists.xenproject.org; Mon, 04 May 2026 09:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJpfh-00Gnu2-21
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJpfh-00EOd6-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 09:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=YkmuHswXYzV5SMiKQjupUrR3xW7yT1IWbGjGzmiJSMY=; b=nS9Y6i+FPPV6TE75p82sCPKIjh
	WN1stbUFsY9hzdnLU0Sgvr8QcsVWjsOJSwgEOQR4bOKl8rBD7vSyQdc/w51/DXI2Qa/fANUMAzUS/
	3Mbdsj1nK76ItmVtNIY5wdUzmYC8gEk7fgipFVMqhTQvRTc/Dv9bnUD5VXIzVwdJkrOE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v2: disable interrupt bypass on CPU shutdown
Message-Id: <E1wJpfh-00EOd6-1s@xenbits.xenproject.org>
Date: Mon, 04 May 2026 09:33:01 +0000

commit 6f00fd9d6c1d6f08ab21f16c0406b3bb2c1e3b01
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue Apr 28 14:57:55 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 4 10:20:00 2026 +0200

    xen/arm: gic-v2: disable interrupt bypass on CPU shutdown
    
    The GICv2 CPU shutdown path currently writes 0 to GICC_CTLR.
    
    Per IHI0048B.b section 2.3.1, clearing the architected bypass-disable
    bits selects bypass rather than deasserted interrupt outputs when the
    CPU interface stops driving them. Tables 2-2 and 2-3 show that a zeroed
    GICC_CTLR can fall back to the legacy IRQ/FIQ inputs instead of fully
    disabling the interface.
    
    Fix this by reading GICC_CTLR, then setting the bypass-disable bits and
    clearing the group-enable bits that are architecturally defined for the
    current GICC_CTLR view before writing the value back. When Security
    Extensions are implemented Xen accesses the Non-secure copy of
    GICC_CTLR, where IRQBypDisGrp1 and FIQBypDisGrp1 are at bits [6:5] and
    bits [8:7] are reserved.
    
    Without Security Extensions (GICD_CTLR.DS=1), GICD_IGROUPR is RAZ/WI
    and all interrupts are Group 0, so clearing EnableGrp0 alone is
    sufficient to stop interrupt delivery through the CPU interface.
    
    Section 2.3.2 also states that wakeup event signals remain available
    even when both GIC interrupt signaling and interrupt bypass are
    disabled, so disabling bypass does not break the power-management use
    case, i.e. suspend modes.
    
    Fixes: 5e40a1b4351e ("arm: SMP CPU shutdown")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v2.c          | 12 +++++++++++-
 xen/arch/arm/include/asm/gic.h | 25 +++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index 014f955967..43a379fdda 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -408,7 +408,17 @@ static void gicv2_cpu_init(void)
 
 static void gicv2_cpu_disable(void)
 {
-    writel_gicc(0x0, GICC_CTLR);
+    uint32_t ctlr = readl_gicc(GICC_CTLR);
+
+    if ( readl_gicd(GICD_TYPER) & GICD_TYPE_SEC )
+        ctlr |= GICC_NS_CTLR_BYPASS_DISABLE_GRP1_MASK;
+    else
+        ctlr |= GICC_CTLR_BYPASS_DISABLE_GRP0_MASK |
+                GICC_CTLR_BYPASS_DISABLE_GRP1_MASK;
+
+    ctlr &= ~GICC_CTL_ENABLE;
+
+    writel_gicc(ctlr, GICC_CTLR);
 }
 
 static void gicv2_hyp_init(void)
diff --git a/xen/arch/arm/include/asm/gic.h b/xen/arch/arm/include/asm/gic.h
index 8e713aa477..ff22dea40d 100644
--- a/xen/arch/arm/include/asm/gic.h
+++ b/xen/arch/arm/include/asm/gic.h
@@ -102,8 +102,29 @@
 #define GICD_TYPE_SEC   0x400
 #define GICD_TYPER_DVIS (1U << 18)
 
-#define GICC_CTL_ENABLE 0x1
-#define GICC_CTL_EOI    (0x1 << 9)
+/*
+ * Xen runs in the Non-secure world. When Security Extensions are present,
+ * Xen accesses the Non-secure GICC_CTLR view, where bit[0] is EnableGrp1
+ * and bits[6:5] are the Group 1 bypass-disable bits. Otherwise Xen sees the
+ * common GICC_CTLR layout, where bit[0] is EnableGrp0, bit[1] is EnableGrp1,
+ * bits[6:5] are the Group 0 bypass-disable bits, and bits[8:7] are the
+ * Group 1 bypass-disable bits.
+ */
+#define GICC_CTL_ENABLE        (0x1 << 0)
+#define GICC_CTL_ENABLE_GRP1   (0x1 << 1)
+#define GICC_CTL_FIQBypDisGrp0 (0x1 << 5)
+#define GICC_CTL_IRQBypDisGrp0 (0x1 << 6)
+#define GICC_CTL_FIQBypDisGrp1 (0x1 << 7)
+#define GICC_CTL_IRQBypDisGrp1 (0x1 << 8)
+
+#define GICC_CTLR_BYPASS_DISABLE_GRP0_MASK              \
+    (GICC_CTL_FIQBypDisGrp0 | GICC_CTL_IRQBypDisGrp0)
+#define GICC_CTLR_BYPASS_DISABLE_GRP1_MASK              \
+    (GICC_CTL_FIQBypDisGrp1 | GICC_CTL_IRQBypDisGrp1)
+#define GICC_NS_CTLR_BYPASS_DISABLE_GRP1_MASK           \
+    GICC_CTLR_BYPASS_DISABLE_GRP0_MASK
+
+#define GICC_CTL_EOI           (0x1 << 9)
 
 #define GICC_IA_IRQ       0x03ff
 #define GICC_IA_CPU_MASK  0x1c00
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 04 09:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 04 May 2026 09:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1299642.1574191 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJpfs-0005pe-N9; Mon, 04 May 2026 09:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1299642.1574191; Mon, 04 May 2026 09:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wJpfs-0005pW-KX; Mon, 04 May 2026 09:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1299642;
 Mon, 04 May 2026 09:33:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wJpfr-0005pM-Oh
 for xen-changelog@lists.xenproject.org; Mon, 04 May 2026 09:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJpfr-00GnuJ-2N
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 09:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wJpfr-00EOds-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 04 May 2026 09:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WSXMezb1jMUGnOogFCGxUFHUOP1MxG4ERFQDcoB0uKA=; b=TkvtvMaSQEVyFaMjczD8+gBZmV
	mXiAMijEo5AObgSTNLXYqkrr6SUYF2G9dE8FfRszxLbQqzg7gyOIGvbkMeaArYzLA6ny3cwoLW/2g
	T1kWlR5AD051tzLqy++l13xZqteJQQdQVFhWEinZHdhSMnxRvcnYy6rMX239lsS6PonY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: vpsci: ignore upper 32 bits for SMC32 PSCI arguments
Message-Id: <E1wJpfr-00EOds-2C@xenbits.xenproject.org>
Date: Mon, 04 May 2026 09:33:11 +0000

commit f4af571dd70bea97d8de82d7aa39c62c530db897
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue Mar 31 21:31:29 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 4 10:20:00 2026 +0200

    xen/arm: vpsci: ignore upper 32 bits for SMC32 PSCI arguments
    
    SMCCC DEN0028G, section 3.1, states that for AArch64 SMC/HVC calls
    using Wn, only the least significant 32 bits are significant and the
    upper 32 bits must be ignored by the implementation.
    
    So for SMC32 PSCI calls, Xen must not treat non-zero upper bits in the
    argument registers as an error. Instead, they should be discarded when
    decoding the arguments.
    
    Arm ARM DDI 0487J.a (D1-5406) also notes that the upper 32 bits may be
    implementation defined when entering from AArch32. Xen zeros them on
    entry, but that guarantee is only relevant for 32-bit domains.
    
    Update PSCI v0.2+ CPU_ON, CPU_SUSPEND, AFFINITY_INFO and SYSTEM_SUSPEND
    to read SMC32 arguments via PSCI_ARG32(), while keeping the SMC64
    handling unchanged.
    
    No functional change is intended for PSCI 0.1.
    
    Suggested-by: Julien Grall <julien@xen.org>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/vpsci.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/vpsci.c b/xen/arch/arm/vpsci.c
index bd87ec430d..ac6af6118f 100644
--- a/xen/arch/arm/vpsci.c
+++ b/xen/arch/arm/vpsci.c
@@ -305,13 +305,16 @@ static int32_t do_psci_1_0_features(uint32_t psci_func_id)
 #define PSCI_ARG32(reg, n) PSCI_ARG(reg, n)
 #endif
 
+#define PSCI_ARG_CONV(reg, n, conv_64) \
+    ((conv_64) ? PSCI_ARG(reg, n) : PSCI_ARG32(reg, n))
+
 /*
  * PSCI 0.1 calls. It will return false if the function ID is not
  * handled.
  */
 bool do_vpsci_0_1_call(struct cpu_user_regs *regs, uint32_t fid)
 {
-    switch ( (uint32_t)get_user_reg(regs, 0) )
+    switch ( fid )
     {
     case PSCI_cpu_off:
     {
@@ -346,6 +349,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
      * adding/removing a function. SSSC_SMCCC_*_REVISION should be
      * updated once per release.
      */
+    bool is_conv_64 = smccc_is_conv_64(fid);
+
     switch ( fid )
     {
     case PSCI_0_2_FN32_PSCI_VERSION:
@@ -378,9 +383,9 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN32_CPU_ON:
     case PSCI_0_2_FN64_CPU_ON:
     {
-        register_t vcpuid = PSCI_ARG(regs, 1);
-        register_t epoint = PSCI_ARG(regs, 2);
-        register_t cid = PSCI_ARG(regs, 3);
+        register_t vcpuid = PSCI_ARG_CONV(regs, 1, is_conv_64);
+        register_t epoint = PSCI_ARG_CONV(regs, 2, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 3, is_conv_64);
 
         perfc_incr(vpsci_cpu_on);
         PSCI_SET_RESULT(regs, do_psci_0_2_cpu_on(vcpuid, epoint, cid));
@@ -391,8 +396,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN64_CPU_SUSPEND:
     {
         uint32_t pstate = PSCI_ARG32(regs, 1);
-        register_t epoint = PSCI_ARG(regs, 2);
-        register_t cid = PSCI_ARG(regs, 3);
+        register_t epoint = PSCI_ARG_CONV(regs, 2, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 3, is_conv_64);
 
         perfc_incr(vpsci_cpu_suspend);
         PSCI_SET_RESULT(regs, do_psci_0_2_cpu_suspend(pstate, epoint, cid));
@@ -402,7 +407,7 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_0_2_FN32_AFFINITY_INFO:
     case PSCI_0_2_FN64_AFFINITY_INFO:
     {
-        register_t taff = PSCI_ARG(regs, 1);
+        register_t taff = PSCI_ARG_CONV(regs, 1, is_conv_64);
         uint32_t laff = PSCI_ARG32(regs, 2);
 
         perfc_incr(vpsci_cpu_affinity_info);
@@ -422,14 +427,8 @@ bool do_vpsci_0_2_call(struct cpu_user_regs *regs, uint32_t fid)
     case PSCI_1_0_FN32_SYSTEM_SUSPEND:
     case PSCI_1_0_FN64_SYSTEM_SUSPEND:
     {
-        register_t epoint = PSCI_ARG(regs, 1);
-        register_t cid = PSCI_ARG(regs, 2);
-
-        if ( fid == PSCI_1_0_FN32_SYSTEM_SUSPEND )
-        {
-            epoint &= GENMASK(31, 0);
-            cid &= GENMASK(31, 0);
-        }
+        register_t epoint = PSCI_ARG_CONV(regs, 1, is_conv_64);
+        register_t cid = PSCI_ARG_CONV(regs, 2, is_conv_64);
 
         perfc_incr(vpsci_system_suspend);
         PSCI_SET_RESULT(regs, do_psci_1_0_system_suspend(epoint, cid));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300261.1574782 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKARo-00018p-5t; Tue, 05 May 2026 07:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300261.1574782; Tue, 05 May 2026 07:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKARo-00018h-2w; Tue, 05 May 2026 07:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1300261;
 Tue, 05 May 2026 07:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKARm-00018a-EI
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKARm-000q5f-15
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKARm-00FYt1-0r
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2JAoGMkRaafi0RNxl8wJCJaPvkiJGt6W5uAD80taKes=; b=Kc1/cOrrUuU3jteLr49C+BhNlu
	Qwf43gdEVbQ8QW6GoR+ZVAbuhXHZfIEee4QWGNmrxQJuqiB8w+R2ch6D1bLBWHpYSyMuDDb3st01a
	J4wKwBtaFbrjbC+x//W7uMT2ICXd7ZTpoYgfDfty8UoaZ44G1cfwMlNNGtN3TBILJzcI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram()
Message-Id: <E1wKARm-00FYt1-0r@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:02 +0000

commit d367f87cfd7429aa3646e58e764563ce6f361842
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:20:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:20:55 2026 +0200

    x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram()
    
    There's no need to call vfree() with the lock still held.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 3565c7940d..cf4862cbc9 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1200,8 +1200,8 @@ int shadow_track_dirty_vram(struct domain *d,
         paging_unlock(d);
         rc = -EFAULT;
     }
-    vfree(dirty_bitmap);
     p2m_unlock(p2m_get_hostp2m(d));
+    vfree(dirty_bitmap);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300262.1574786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKARy-0001Ak-6y; Tue, 05 May 2026 07:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300262.1574786; Tue, 05 May 2026 07:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKARy-0001Ab-4I; Tue, 05 May 2026 07:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1300262;
 Tue, 05 May 2026 07:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKARw-0001AM-FR
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKARw-000q5o-1N
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKARw-00FYuh-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=d/zltZHGuhe3fsaWI1+K6cSnVrX1OtMBJt38wNmK/bA=; b=SwTF4PHEDRXvjD8XJSKG3ig+4t
	Ohj9aPXMoWcCMZzydg3BSjpw787oMDmX8Wxio4Tj/98AesUvCLSQv/3bQDWz/skV2G8k5mqtrmQRK
	yJk8FhTWiof5dpmJcQgMRUBFSV+F1T6fz/w2IVKELy0ZSn6hIqYi9ZS/MW0VEtZwAhek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: device.c is init-only when OVERLAY_DTB=n
Message-Id: <E1wKARw-00FYuh-1G@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:12 +0000

commit 227a9aae44a31c440f05e66ed0841b21fb99837d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:21:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:21:45 2026 +0200

    Arm: device.c is init-only when OVERLAY_DTB=n
    
    Introduce an annotation similar to __hwdom_init and use it througout the
    file. All external callers are either themselves __init or are limited to
    OVERLAY_DTB=y. Adjust the Makefile accordingly to also have string
    literals moved into .init.rodata.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile        |  2 +-
 xen/arch/arm/device.c        | 33 ++++++++++++++++++---------------
 xen/include/xen/dt-overlay.h |  8 ++++++++
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 69200b2728..982c6c396a 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
 obj-y += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
-obj-y += device.o
+obj-y += $(if $(CONFIG_OVERLAY_DTB),device.o,device.init.o)
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-y += domain.o
diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
index 74b54cad34..7d9644fd8b 100644
--- a/xen/arch/arm/device.c
+++ b/xen/arch/arm/device.c
@@ -9,6 +9,7 @@
  */
 
 #include <xen/device_tree.h>
+#include <xen/dt-overlay.h>
 #include <xen/errno.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
@@ -16,8 +17,8 @@
 #include <asm/firmware/sci.h>
 #include <asm/setup.h>
 
-int map_irq_to_domain(struct domain *d, unsigned int irq,
-                      bool need_mapping, const char *devname)
+int __overlay_init map_irq_to_domain(struct domain *d, unsigned int irq,
+                                     bool need_mapping, const char *devname)
 {
     int res;
 
@@ -49,8 +50,8 @@ int map_irq_to_domain(struct domain *d, unsigned int irq,
     return 0;
 }
 
-int map_range_to_domain(const struct dt_device_node *dev,
-                        uint64_t addr, uint64_t len, void *data)
+int __overlay_init map_range_to_domain(const struct dt_device_node *dev,
+                                       uint64_t addr, uint64_t len, void *data)
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
@@ -124,10 +125,10 @@ int map_range_to_domain(const struct dt_device_node *dev,
  *   < 0 error
  *   0   success
  */
-int map_device_irqs_to_domain(struct domain *d,
-                              struct dt_device_node *dev,
-                              bool need_mapping,
-                              struct rangeset *irq_ranges)
+int __overlay_init map_device_irqs_to_domain(struct domain *d,
+                                             struct dt_device_node *dev,
+                                             bool need_mapping,
+                                             struct rangeset *irq_ranges)
 {
     unsigned int i, nirq;
     int res, irq;
@@ -180,9 +181,9 @@ int map_device_irqs_to_domain(struct domain *d,
     return 0;
 }
 
-static int map_dt_irq_to_domain(const struct dt_device_node *dev,
-                                const struct dt_irq *dt_irq,
-                                void *data)
+static int __overlay_init map_dt_irq_to_domain(const struct dt_device_node *dev,
+                                               const struct dt_irq *dt_irq,
+                                               void *data)
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
@@ -219,8 +220,8 @@ static int map_dt_irq_to_domain(const struct dt_device_node *dev,
  * then we may need to perform additional mappings in order to make
  * the child resources available to domain 0.
  */
-static int map_device_children(const struct dt_device_node *dev,
-                               struct map_range_data *mr_data)
+static int __overlay_init map_device_children(const struct dt_device_node *dev,
+                                              struct map_range_data *mr_data)
 {
     if ( dt_device_type_is_equal(dev, "pci") )
     {
@@ -250,8 +251,10 @@ static int map_device_children(const struct dt_device_node *dev,
  *  - Assign the device to the guest if it's protected by an IOMMU
  *  - Map the IRQs and iomem regions to DOM0
  */
-int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt,
-                  struct rangeset *iomem_ranges, struct rangeset *irq_ranges)
+int __overlay_init handle_device(struct domain *d, struct dt_device_node *dev,
+                                 p2m_type_t p2mt,
+                                 struct rangeset *iomem_ranges,
+                                 struct rangeset *irq_ranges)
 {
     unsigned int naddr;
     unsigned int i;
diff --git a/xen/include/xen/dt-overlay.h b/xen/include/xen/dt-overlay.h
index b2cedf3f2a..7400382842 100644
--- a/xen/include/xen/dt-overlay.h
+++ b/xen/include/xen/dt-overlay.h
@@ -42,10 +42,18 @@ struct xen_sysctl_dt_overlay;
 struct xen_domctl_dt_overlay;
 
 #ifdef CONFIG_OVERLAY_DTB
+
+#define __overlay_init
+
 long dt_overlay_sysctl(struct xen_sysctl_dt_overlay *op);
 long dt_overlay_domctl(struct domain *d, struct xen_domctl_dt_overlay *op);
+
 #else
+
 #include <xen/errno.h>
+
+#define __overlay_init __init
+
 static inline long dt_overlay_sysctl(struct xen_sysctl_dt_overlay *op)
 {
     return -EOPNOTSUPP;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300263.1574790 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKAS8-0001Cm-8I; Tue, 05 May 2026 07:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300263.1574790; Tue, 05 May 2026 07:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKAS8-0001Ce-5Z; Tue, 05 May 2026 07:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1300263;
 Tue, 05 May 2026 07:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKAS6-0001CX-Hd
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKAS6-000q6A-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKAS6-00FYw0-1Y
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yiBpfbanle6KBrW+v6qE1AFi0W4ucpSrQJ/u7RW/k9Q=; b=YXVAHj6GWlJWZpLogZSm/XILn6
	zmbm+oMtBPFV6u3R7R/DwPiHRESYFYXMXU2OOvVLgf5Xfeg8kJI0b/OG915u35n9s3RZw2kj+Y48I
	a6A5/gQ0TDifj+rUqXP9bUZAtc0q96bLnHy1JT7y5LKToxFLA4+xkk3kmzEHudbhCm2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: Remove unused driver version constant
Message-Id: <E1wKAS6-00FYw0-1Y@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:22 +0000

commit 6c9344ee3d48b8bb7758c72d9e4eeb8841b8f7ec
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Tue May 5 08:25:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:25:56 2026 +0200

    x86/mwait-idle: Remove unused driver version constant
    
    The MWAIT_IDLE_VERSION constant has not been updated since 2016 and serves
    no useful purpose. The driver version is implicitly defined by the
    hypervisor version, making this constant redundant.
    
    Remove the constant to eliminate potential confusion about version
    tracking.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Link: https://patch.msgid.link/20251215111229.132705-1-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 25ff69011ddf
    
    Adjust description to fit our code base.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 6776eeb9ac..48b7a1e721 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -58,7 +58,6 @@
 
 #include <acpi/cpufreq/cpufreq.h>
 
-#define MWAIT_IDLE_VERSION "0.4.1"
 #undef PREFIX
 #define PREFIX "mwait-idle: "
 
@@ -1636,9 +1635,6 @@ static int __init mwait_idle_probe(void)
 	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
 
-	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
-		 boot_cpu_data.model);
-
 	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
 		 lapic_timer_reliable_states);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300264.1574794 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASI-0001Eu-9i; Tue, 05 May 2026 07:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300264.1574794; Tue, 05 May 2026 07:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASI-0001Em-6s; Tue, 05 May 2026 07:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1300264;
 Tue, 05 May 2026 07:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKASG-0001Eg-KP
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASG-000q6G-1v
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASG-00FYxJ-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=X0EsFGZkdnlg5sxGDPGWLwjB8SW9esIRhIUQRK/l1+M=; b=FhDLkB8Fmxp4i5J2IBAih5snk3
	mdNY3Su7dJdDcb4OCnCuBnnm/60q8DeYsEzGgU2U5mVO9t6o2syTKFAcHbblLeat0Gt8QGYdGIzb9
	uywss+cRfwCqxu/GUxYnXxy62n8ZLS4FRRHaAcoDVN4wZfhUAZL1MKOZKHq3cZudXjp4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: remove setup_physical_bridge_port() function
Message-Id: <E1wKASG-00FYxJ-1p@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:32 +0000

commit 280e4ca4dffd1558d237804a8bf349b9c3874660
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Tue May 5 08:26:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:26:41 2026 +0200

    tools: remove setup_physical_bridge_port() function
    
    Only the setup_virtual_bridge_port() function was used.  As such merge
    that with _setup_bridge_port() and leave that as the remaining function.
    The last user of setup_physical_bridge_port() was removed in 9fabe55939a8
    ("tools/hotplug: Remove network-*").
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/hotplug/Linux/vif-bridge            |  2 +-
 tools/hotplug/Linux/vif-openvswitch       |  2 +-
 tools/hotplug/Linux/xen-network-common.sh | 22 ++++++----------------
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 906047e82f..6164c7a52f 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -78,7 +78,7 @@ fi
 
 case "$command" in
     add|online)
-        setup_virtual_bridge_port "$dev"
+        setup_bridge_port "$dev"
         set_mtu "$bridge" "$dev" "$type_if"
         add_to_bridge "$bridge" "$dev"
         ;;
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
index 18bfb6cefb..a8aea2acb5 100644
--- a/tools/hotplug/Linux/vif-openvswitch
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -88,7 +88,7 @@ add_to_openvswitch () {
 case "$command" in
     add|online)
         check_tools
-        setup_virtual_bridge_port $dev
+        setup_bridge_port $dev
         add_to_openvswitch $dev
         ;;
 
diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh
index 42fa704e8d..0150a4840e 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -79,32 +79,22 @@ find_dhcpd_arg_file()
 }
 
 # configure interfaces which act as pure bridge ports:
-_setup_bridge_port() {
+setup_bridge_port() {
     local dev="$1"
-    local virtual="$2"
 
     # take interface down ...
     ip link set dev ${dev} down
 
-    if [ $virtual -ne 0 ] ; then
-        # Initialise a dummy MAC address. We choose the numerically
-        # largest non-broadcast address to prevent the address getting
-        # stolen by an Ethernet bridge for STP purposes.
-        # (FE:FF:FF:FF:FF:FF)
-        ip link set dev ${dev} address fe:ff:ff:ff:ff:ff || true
-    fi
+    # Initialise a dummy MAC address. We choose the numerically
+    # largest non-broadcast address to prevent the address getting
+    # stolen by an Ethernet bridge for STP purposes.
+    # (FE:FF:FF:FF:FF:FF)
+    ip link set dev ${dev} address fe:ff:ff:ff:ff:ff || true
 
     # ... and configure it
     ip address flush dev ${dev}
 }
 
-setup_physical_bridge_port() {
-    _setup_bridge_port $1 0
-}
-setup_virtual_bridge_port() {
-    _setup_bridge_port $1 1
-}
-
 # Usage: create_bridge bridge
 create_bridge () {
     local bridge=$1
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300266.1574798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASS-0001H3-B0; Tue, 05 May 2026 07:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300266.1574798; Tue, 05 May 2026 07:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASS-0001Gw-8L; Tue, 05 May 2026 07:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1300266;
 Tue, 05 May 2026 07:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKASQ-0001Go-O9
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASQ-000q6M-2K
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASQ-00FYyV-28
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=O9DC0aA5gL/cclVPq9T4FDWqtyPYPi8wy7vC7wYrie8=; b=nAEp5PFeZadUanX4zbAV8AkFe4
	V6hTFY2k/IU9hBFHY7qb+OsHc5o30K5MTmN0MrLkbSmfgubdp/4yPCGBGwWuZVkf9GUbwojOEs8uL
	L1Hu2k8wy9qrQ1YcjkkQL3p8nJmOqs4ldTzX3qnT2eRmjEWS3tGewIiOQ1EMqcZ3lFu8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wKASQ-00FYyV-28@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:42 +0000

commit 93acfeb78b508984aa815d00629cc8b6b90dc047
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:27:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:27:29 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 3001e98a6e..1a749fabd2 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -119,7 +119,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -131,12 +131,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -413,10 +416,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -690,18 +694,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1448,7 +1452,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1611,21 +1615,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 18b3c79dc9..90c9d36186 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -384,12 +384,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 48b7a1e721..c0d5767f87 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1044,15 +1044,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1457,7 +1458,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1622,7 +1623,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1710,8 +1711,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 29e1888ffb..44f995ff05 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 008d9e97d9..8209d37d32 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -517,7 +517,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2663,7 +2663,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2715,11 +2715,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3007,7 +3002,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index ca87cd15a8..2fdf38cf74 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300267.1574802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASc-0001Jc-Dp; Tue, 05 May 2026 07:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300267.1574802; Tue, 05 May 2026 07:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASc-0001JU-B8; Tue, 05 May 2026 07:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1300267;
 Tue, 05 May 2026 07:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKASa-0001JJ-RK
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASa-000q6Q-2c
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASa-00FYzG-2W
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fy3toIEyMddZ51x6DSgbFNBzsHeM47yhhyxqZzUdObQ=; b=YhQjpSeTFZR75i6CoVOUEFfi7h
	CTBairNHDwAjD4VvRc5ZYlQAnR3oHeLI8y90e3nErVeYWuYK08hp9NDQuLSDuFONpaBKYgJXbWF6J
	o5P0xxpkpEVm6LHU9PFu7ZMJupUFWGOnXydvlha3kiPpnBc0oPpkTKJkwFAqsfDUdWAc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/HVM: drop dead code from HVM_PARAM_IDENT_PT setting
Message-Id: <E1wKASa-00FYzG-2W@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:44:52 +0000

commit 76a79d86662053f1144133ecc7b6030c5577bee9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:28:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:28:56 2026 +0200

    x86/HVM: drop dead code from HVM_PARAM_IDENT_PT setting
    
    The setting of d->arch.hvm.params[] will uniformly happen at the bottom of
    hvm_set_param(), hence as per Misra's classification redundantly doing so
    earlier is "dead code".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/hvm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4a81afce02..f759a397c5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4242,10 +4242,7 @@ static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value)
          * capabilities.  Short circuit the pause if possible.
          */
         if ( paging_mode_shadow(d) || !using_vmx() )
-        {
-            d->arch.hvm.params[index] = value;
             break;
-        }
 
         /*
          * Update GUEST_CR3 in each VMCS to point at identity map.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300269.1574805 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASm-0001M2-F8; Tue, 05 May 2026 07:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300269.1574805; Tue, 05 May 2026 07:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASm-0001Lv-Cb; Tue, 05 May 2026 07:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1300269;
 Tue, 05 May 2026 07:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKASk-0001Ln-Ug
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASk-000q6s-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASk-00FYzs-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2+GeLl9o1buhLfkwbdqelbgP29iXSe+RgCXbPT5PgpA=; b=paX8tnRMza2guzr9gDap/kZlgo
	jD/ExsAVj9hlTpMnNoghsaUKYBmEHKF7AfYVd9tU4upIDr3M21khS8+vcdwqPxg9o/ob+vLZHl5dH
	SQc98lVVcOo981fI7IDPZ6kAzz1l+EvwuT1+B9ef00BLj/04iCSMMNoAWG0xLxfEaC5M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: normalize page count types to unsigned long
Message-Id: <E1wKASk-00FYzs-2n@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:45:02 +0000

commit 48054287a840011bce4c07f3db47ea1a4c669155
Author:     Bernhard Kaindl <bernhard.kaindl@citrix.com>
AuthorDate: Tue May 5 08:29:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:29:45 2026 +0200

    xen/mm: normalize page count types to unsigned long
    
    The current use of long for total_avail_pages and outstanding_claims
    creates an unnecessary mix of signed and unsigned types during page
    allocation calculations. This necessitates awkward constructs
    like '+ 0UL' to satisfy type matching in macros such as min().
    
    Address this by normalizing `total_avail_pages` and `outstanding_claims`
    from `long` to `unsigned long`.
    
    As a direct consequence of making `total_avail_pages` unsigned, the
    post-decrement assertions checking for `>= 0` are no longer logically
    sound. Adjust those assertions to pre-decrement checks.
    
    No functional change intended.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index b1edef8712..2c4ff2c34c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -484,10 +484,11 @@ static heap_by_zone_and_order_t *_heap[MAX_NUMNODES];
 static unsigned long node_need_scrub[MAX_NUMNODES];
 
 static unsigned long *avail[MAX_NUMNODES];
-static long total_avail_pages;
+static unsigned long total_avail_pages;
 
 static DEFINE_SPINLOCK(heap_lock);
-static long outstanding_claims; /* total outstanding claims by all domains */
+/* Total outstanding claims by all domains */
+static unsigned long outstanding_claims;
 
 static unsigned long avail_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi, unsigned int node)
@@ -1047,8 +1048,8 @@ static struct page_info *alloc_heap_pages(
 
     ASSERT(avail[node][zone] >= request);
     avail[node][zone] -= request;
+    ASSERT(total_avail_pages >= request);
     total_avail_pages -= request;
-    ASSERT(total_avail_pages >= 0);
 
     if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
     {
@@ -1240,8 +1241,8 @@ static int reserve_offlined_page(struct page_info *head)
             continue;
 
         avail[node][zone]--;
+        ASSERT(total_avail_pages > 0);
         total_avail_pages--;
-        ASSERT(total_avail_pages >= 0);
 
         page_list_add_tail(cur_head,
                            test_bit(_PGC_broken, &cur_head->count_info) ?
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 07:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 07:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300270.1574810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASw-0001O4-Gq; Tue, 05 May 2026 07:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300270.1574810; Tue, 05 May 2026 07:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKASw-0001Nx-E6; Tue, 05 May 2026 07:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1300270;
 Tue, 05 May 2026 07:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKASv-0001Np-0u
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 07:45:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASu-000q6w-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKASu-00FZ0e-38
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 07:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mzFHyFgl7qN+nEIpzj0dcAPM88kEcIiBhmRys3/bWks=; b=BAOMJLyvytxGcT4/et3LAF2Hsl
	8pJQamFCzh9hiovodHfcf+fkh3Njm3Zg7m1Sl6bxjdqFcXUtFxAMOy2DSgqs3YpAXjPsNkFhIgN18
	/FypKbCwiB6UroL4XOcI1gDMHXwp9huh5c/M+jTBgmmXXT8shC3DkNasx7qxCNnU4Mig=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CHANGELOG: add xenstored watch depth feature
Message-Id: <E1wKASu-00FZ0e-38@xenbits.xenproject.org>
Date: Tue, 05 May 2026 07:45:12 +0000

commit 07bff81a219a756309e1c75e967b9c432e59c6e4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue May 5 08:30:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:30:20 2026 +0200

    CHANGELOG: add xenstored watch depth feature
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb41d89997..ce46020dbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Added
  - Support for per-domain Xenstore quota in C xenstored (includes
    xenstore-stubdom), libxl and xl.
+ - Support for Xenstore watch depth feature in C xenstored (includes
+   xenstore-stubdom).
  - On x86:
    - Support for Bus Lock Threshold on AMD Zen5 and later CPUs, used by Xen to
      mitigate (by rate-limiting) the system wide impact of an HVM guest
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300351.1574877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBNq-0004ih-GO; Tue, 05 May 2026 08:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300351.1574877; Tue, 05 May 2026 08:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBNq-0004iZ-DQ; Tue, 05 May 2026 08:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1300351;
 Tue, 05 May 2026 08:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBNp-0004iO-Ki
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBNp-000rmh-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBNp-00FbaB-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jOqKq1XfV5V9GrIwOz7MFqf7syYBcfsl8PZS3apOpnU=; b=B0GzLwQOr+IA5+4sjm/lWCrc5Z
	VgO3fwNx/KNdZl3UnR+IpjbuSGEkxPjLJYi3xET9WrVpl5bilOijYgFSMEzy6nGu2sze+T3o8DMUJ
	ExfBfqthYXC46f0PomlrcbpWKtGZ+WrPufD1N1Rjs5tYZzgqR3FFHM1b0lz4/Osh+6k0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram()
Message-Id: <E1wKBNp-00FbaB-1g@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:01 +0000

commit d367f87cfd7429aa3646e58e764563ce6f361842
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:20:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:20:55 2026 +0200

    x86/shadow: unlock P2M slightly earlier in shadow_track_dirty_vram()
    
    There's no need to call vfree() with the lock still held.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 3565c7940d..cf4862cbc9 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1200,8 +1200,8 @@ int shadow_track_dirty_vram(struct domain *d,
         paging_unlock(d);
         rc = -EFAULT;
     }
-    vfree(dirty_bitmap);
     p2m_unlock(p2m_get_hostp2m(d));
+    vfree(dirty_bitmap);
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300354.1574880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBO0-0004oF-Hg; Tue, 05 May 2026 08:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300354.1574880; Tue, 05 May 2026 08:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBO0-0004o9-Ek; Tue, 05 May 2026 08:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1300354;
 Tue, 05 May 2026 08:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBNz-0004nz-Md
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBNz-000rmx-28
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBNz-00FbbM-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hBMASSHTLhPYF/lcctEavXnESGbDwpJ/T3Cbvd2l05Y=; b=Yy5Fn27V0IGQfifxgl11pgHeZc
	TJ6v6mcf3Qy/g213fRCuaGY+/oBqVNc9wvPr0lFjdYsRtxk55MpMppzpAm094o1rmGNtRt2e+s4Jc
	lGb8JX7H4GP2S9zprElMCsiR/nGIy2CJSm8iPqKFDVjwMvcg5Eak1XLkUVFUrYur6kXA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: device.c is init-only when OVERLAY_DTB=n
Message-Id: <E1wKBNz-00FbbM-1z@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:11 +0000

commit 227a9aae44a31c440f05e66ed0841b21fb99837d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:21:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:21:45 2026 +0200

    Arm: device.c is init-only when OVERLAY_DTB=n
    
    Introduce an annotation similar to __hwdom_init and use it througout the
    file. All external callers are either themselves __init or are limited to
    OVERLAY_DTB=y. Adjust the Makefile accordingly to also have string
    literals moved into .init.rodata.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/Makefile        |  2 +-
 xen/arch/arm/device.c        | 33 ++++++++++++++++++---------------
 xen/include/xen/dt-overlay.h |  8 ++++++++
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 69200b2728..982c6c396a 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -15,7 +15,7 @@ obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
 obj-y += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
-obj-y += device.o
+obj-y += $(if $(CONFIG_OVERLAY_DTB),device.o,device.init.o)
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-y += domain.o
diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
index 74b54cad34..7d9644fd8b 100644
--- a/xen/arch/arm/device.c
+++ b/xen/arch/arm/device.c
@@ -9,6 +9,7 @@
  */
 
 #include <xen/device_tree.h>
+#include <xen/dt-overlay.h>
 #include <xen/errno.h>
 #include <xen/iocap.h>
 #include <xen/lib.h>
@@ -16,8 +17,8 @@
 #include <asm/firmware/sci.h>
 #include <asm/setup.h>
 
-int map_irq_to_domain(struct domain *d, unsigned int irq,
-                      bool need_mapping, const char *devname)
+int __overlay_init map_irq_to_domain(struct domain *d, unsigned int irq,
+                                     bool need_mapping, const char *devname)
 {
     int res;
 
@@ -49,8 +50,8 @@ int map_irq_to_domain(struct domain *d, unsigned int irq,
     return 0;
 }
 
-int map_range_to_domain(const struct dt_device_node *dev,
-                        uint64_t addr, uint64_t len, void *data)
+int __overlay_init map_range_to_domain(const struct dt_device_node *dev,
+                                       uint64_t addr, uint64_t len, void *data)
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
@@ -124,10 +125,10 @@ int map_range_to_domain(const struct dt_device_node *dev,
  *   < 0 error
  *   0   success
  */
-int map_device_irqs_to_domain(struct domain *d,
-                              struct dt_device_node *dev,
-                              bool need_mapping,
-                              struct rangeset *irq_ranges)
+int __overlay_init map_device_irqs_to_domain(struct domain *d,
+                                             struct dt_device_node *dev,
+                                             bool need_mapping,
+                                             struct rangeset *irq_ranges)
 {
     unsigned int i, nirq;
     int res, irq;
@@ -180,9 +181,9 @@ int map_device_irqs_to_domain(struct domain *d,
     return 0;
 }
 
-static int map_dt_irq_to_domain(const struct dt_device_node *dev,
-                                const struct dt_irq *dt_irq,
-                                void *data)
+static int __overlay_init map_dt_irq_to_domain(const struct dt_device_node *dev,
+                                               const struct dt_irq *dt_irq,
+                                               void *data)
 {
     struct map_range_data *mr_data = data;
     struct domain *d = mr_data->d;
@@ -219,8 +220,8 @@ static int map_dt_irq_to_domain(const struct dt_device_node *dev,
  * then we may need to perform additional mappings in order to make
  * the child resources available to domain 0.
  */
-static int map_device_children(const struct dt_device_node *dev,
-                               struct map_range_data *mr_data)
+static int __overlay_init map_device_children(const struct dt_device_node *dev,
+                                              struct map_range_data *mr_data)
 {
     if ( dt_device_type_is_equal(dev, "pci") )
     {
@@ -250,8 +251,10 @@ static int map_device_children(const struct dt_device_node *dev,
  *  - Assign the device to the guest if it's protected by an IOMMU
  *  - Map the IRQs and iomem regions to DOM0
  */
-int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt,
-                  struct rangeset *iomem_ranges, struct rangeset *irq_ranges)
+int __overlay_init handle_device(struct domain *d, struct dt_device_node *dev,
+                                 p2m_type_t p2mt,
+                                 struct rangeset *iomem_ranges,
+                                 struct rangeset *irq_ranges)
 {
     unsigned int naddr;
     unsigned int i;
diff --git a/xen/include/xen/dt-overlay.h b/xen/include/xen/dt-overlay.h
index b2cedf3f2a..7400382842 100644
--- a/xen/include/xen/dt-overlay.h
+++ b/xen/include/xen/dt-overlay.h
@@ -42,10 +42,18 @@ struct xen_sysctl_dt_overlay;
 struct xen_domctl_dt_overlay;
 
 #ifdef CONFIG_OVERLAY_DTB
+
+#define __overlay_init
+
 long dt_overlay_sysctl(struct xen_sysctl_dt_overlay *op);
 long dt_overlay_domctl(struct domain *d, struct xen_domctl_dt_overlay *op);
+
 #else
+
 #include <xen/errno.h>
+
+#define __overlay_init __init
+
 static inline long dt_overlay_sysctl(struct xen_sysctl_dt_overlay *op)
 {
     return -EOPNOTSUPP;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300355.1574885 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOB-0004sj-J4; Tue, 05 May 2026 08:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300355.1574885; Tue, 05 May 2026 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOB-0004sb-GC; Tue, 05 May 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1300355;
 Tue, 05 May 2026 08:44:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBO9-0004sH-Ox
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBO9-000rnJ-2O
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBO9-00FbcO-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QaPdDTceEYVHglb2/O8Z9slK/HESr16viKaMT9HZXrU=; b=D+K8tlOfeTbEYDtR0M32jPazA+
	kf8oLJo56gimPNhvEN7c/gnkAXtiemY/85ggkgxXjl1Mtq+6sH3kyXSgMEgTrq1dBoPOTMgu8jcH9
	5NQxzs1JtckwTUJmur2SELYRkVxbTx5QVFtylOGDCR0PcRK8h36+FBQVWogkoix8P6LU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: Remove unused driver version constant
Message-Id: <E1wKBO9-00FbcO-2J@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:21 +0000

commit 6c9344ee3d48b8bb7758c72d9e4eeb8841b8f7ec
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Tue May 5 08:25:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:25:56 2026 +0200

    x86/mwait-idle: Remove unused driver version constant
    
    The MWAIT_IDLE_VERSION constant has not been updated since 2016 and serves
    no useful purpose. The driver version is implicitly defined by the
    hypervisor version, making this constant redundant.
    
    Remove the constant to eliminate potential confusion about version
    tracking.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Link: https://patch.msgid.link/20251215111229.132705-1-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 25ff69011ddf
    
    Adjust description to fit our code base.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 6776eeb9ac..48b7a1e721 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -58,7 +58,6 @@
 
 #include <acpi/cpufreq/cpufreq.h>
 
-#define MWAIT_IDLE_VERSION "0.4.1"
 #undef PREFIX
 #define PREFIX "mwait-idle: "
 
@@ -1636,9 +1635,6 @@ static int __init mwait_idle_probe(void)
 	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
 
-	pr_debug(PREFIX "v" MWAIT_IDLE_VERSION " model %#x\n",
-		 boot_cpu_data.model);
-
 	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
 		 lapic_timer_reliable_states);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300356.1574888 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOL-0004vq-Ke; Tue, 05 May 2026 08:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300356.1574888; Tue, 05 May 2026 08:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOL-0004vj-HX; Tue, 05 May 2026 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1300356;
 Tue, 05 May 2026 08:44:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBOJ-0004vU-SI
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOJ-000rnZ-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOJ-00FbdZ-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=itPRqomsy6oQ2FTNB8NwkNVGl4jUwSOYMDpjRFK3Ixk=; b=C7kblBqBlkuLBSIMchb4Lrpc4M
	TU2dbsBst2pRn0RjcdCecRBNxx7KipXbAWcLa0QfeROqpYFTK4MG5bvDHbjYxVcmnHdp9FvrfPsut
	CT3YCrD5VnahONrGaEXBhh6t/c3+Q66k+3SJVjyC8Ea2cIAH95UUwD2HbUcYYf/QM7CI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: remove setup_physical_bridge_port() function
Message-Id: <E1wKBOJ-00FbdZ-2Z@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:31 +0000

commit 280e4ca4dffd1558d237804a8bf349b9c3874660
Author:     Elliott Mitchell <ehem+xen@m5p.com>
AuthorDate: Tue May 5 08:26:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:26:41 2026 +0200

    tools: remove setup_physical_bridge_port() function
    
    Only the setup_virtual_bridge_port() function was used.  As such merge
    that with _setup_bridge_port() and leave that as the remaining function.
    The last user of setup_physical_bridge_port() was removed in 9fabe55939a8
    ("tools/hotplug: Remove network-*").
    
    Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/hotplug/Linux/vif-bridge            |  2 +-
 tools/hotplug/Linux/vif-openvswitch       |  2 +-
 tools/hotplug/Linux/xen-network-common.sh | 22 ++++++----------------
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index 906047e82f..6164c7a52f 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -78,7 +78,7 @@ fi
 
 case "$command" in
     add|online)
-        setup_virtual_bridge_port "$dev"
+        setup_bridge_port "$dev"
         set_mtu "$bridge" "$dev" "$type_if"
         add_to_bridge "$bridge" "$dev"
         ;;
diff --git a/tools/hotplug/Linux/vif-openvswitch b/tools/hotplug/Linux/vif-openvswitch
index 18bfb6cefb..a8aea2acb5 100644
--- a/tools/hotplug/Linux/vif-openvswitch
+++ b/tools/hotplug/Linux/vif-openvswitch
@@ -88,7 +88,7 @@ add_to_openvswitch () {
 case "$command" in
     add|online)
         check_tools
-        setup_virtual_bridge_port $dev
+        setup_bridge_port $dev
         add_to_openvswitch $dev
         ;;
 
diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh
index 42fa704e8d..0150a4840e 100644
--- a/tools/hotplug/Linux/xen-network-common.sh
+++ b/tools/hotplug/Linux/xen-network-common.sh
@@ -79,32 +79,22 @@ find_dhcpd_arg_file()
 }
 
 # configure interfaces which act as pure bridge ports:
-_setup_bridge_port() {
+setup_bridge_port() {
     local dev="$1"
-    local virtual="$2"
 
     # take interface down ...
     ip link set dev ${dev} down
 
-    if [ $virtual -ne 0 ] ; then
-        # Initialise a dummy MAC address. We choose the numerically
-        # largest non-broadcast address to prevent the address getting
-        # stolen by an Ethernet bridge for STP purposes.
-        # (FE:FF:FF:FF:FF:FF)
-        ip link set dev ${dev} address fe:ff:ff:ff:ff:ff || true
-    fi
+    # Initialise a dummy MAC address. We choose the numerically
+    # largest non-broadcast address to prevent the address getting
+    # stolen by an Ethernet bridge for STP purposes.
+    # (FE:FF:FF:FF:FF:FF)
+    ip link set dev ${dev} address fe:ff:ff:ff:ff:ff || true
 
     # ... and configure it
     ip address flush dev ${dev}
 }
 
-setup_physical_bridge_port() {
-    _setup_bridge_port $1 0
-}
-setup_virtual_bridge_port() {
-    _setup_bridge_port $1 1
-}
-
 # Usage: create_bridge bridge
 create_bridge () {
     local bridge=$1
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300357.1574893 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOV-0004z4-Nj; Tue, 05 May 2026 08:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300357.1574893; Tue, 05 May 2026 08:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOV-0004yx-L4; Tue, 05 May 2026 08:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1300357;
 Tue, 05 May 2026 08:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBOT-0004yj-VM
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOT-000rnh-32
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:41 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOT-00Fbeb-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zHsC5fHmo0fptwjqMxM/dirclgZYmaUfUtMMDT4pjFA=; b=PZ/c9aGImjXzppLRevBbLCqV4U
	/V+XenlysM4wpY2zDOQU0YrIpUm7+Jy4RBMiKAGE6wRUD1cFKS1Dn01Zw8KK237s9eVUHkQPHzGbj
	UX2jK5hS9QhoAMttdlVySXiH7j3JXhTV82tBLQ9u1x/HXi97qdeuCeGs4tsqrgHnnZqs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wKBOT-00Fbeb-2v@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:41 +0000

commit 93acfeb78b508984aa815d00629cc8b6b90dc047
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:27:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:27:29 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 3001e98a6e..1a749fabd2 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -119,7 +119,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -131,12 +131,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -413,10 +416,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -690,18 +694,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1448,7 +1452,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1611,21 +1615,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 18b3c79dc9..90c9d36186 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -384,12 +384,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 48b7a1e721..c0d5767f87 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1044,15 +1044,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1457,7 +1458,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1622,7 +1623,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1710,8 +1711,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 29e1888ffb..44f995ff05 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 008d9e97d9..8209d37d32 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -517,7 +517,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2663,7 +2663,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_XEN_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2715,11 +2715,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3007,7 +3002,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index ca87cd15a8..2fdf38cf74 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300359.1574897 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOf-00051a-PJ; Tue, 05 May 2026 08:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300359.1574897; Tue, 05 May 2026 08:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOf-00051S-Mc; Tue, 05 May 2026 08:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1300359;
 Tue, 05 May 2026 08:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBOe-00051L-2l
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOe-000rnl-08
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOe-00Fbfs-01
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=u0VnquyuuGXC7DgE3cCU0uwJFrKOCTaUpt5gipEEIbE=; b=KzO/17PqSm6wVCGO02MqMm/B2a
	9Jc1MA+jPJgfkmYs2ZSCqrz/4vVcz+2WxP3ADZGEZyM5AmwJayrwlkq3egXVvCowVElpu+81jFg2F
	v+pkI8VKtIaNJ3G2UPv2eeauwPs2MrN97ySymqLo1m+QxRn5YlmkZUPXJrrgHLf1FCdw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/HVM: drop dead code from HVM_PARAM_IDENT_PT setting
Message-Id: <E1wKBOe-00Fbfs-01@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:44:52 +0000

commit 76a79d86662053f1144133ecc7b6030c5577bee9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 5 08:28:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:28:56 2026 +0200

    x86/HVM: drop dead code from HVM_PARAM_IDENT_PT setting
    
    The setting of d->arch.hvm.params[] will uniformly happen at the bottom of
    hvm_set_param(), hence as per Misra's classification redundantly doing so
    earlier is "dead code".
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/hvm/hvm.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4a81afce02..f759a397c5 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -4242,10 +4242,7 @@ static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value)
          * capabilities.  Short circuit the pause if possible.
          */
         if ( paging_mode_shadow(d) || !using_vmx() )
-        {
-            d->arch.hvm.params[index] = value;
             break;
-        }
 
         /*
          * Update GUEST_CR3 in each VMCS to point at identity map.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:45:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:45:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300360.1574901 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOp-000547-QW; Tue, 05 May 2026 08:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300360.1574901; Tue, 05 May 2026 08:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOp-00053z-Ny; Tue, 05 May 2026 08:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1300360;
 Tue, 05 May 2026 08:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBOo-00053S-5Z
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOo-000roD-0T
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOo-00Fbgc-0J
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uqqYy2R9cteLIxAOKwqndLXAOwfzMcWcc+v/YhZAoGo=; b=r5m603TuFN0pSjGQsnw+IRz4kL
	x0Ffv5bU+SJN5YjxMuPAsS/WsQqlFihVinR5g/UetmC6MDVn+4/hf0ai3+sA7/WDd2IsvC6XlJX0y
	N/LI+jwwECAYwp8+hntCFXI2HvbgKV/NLFGirCkOz9c8o0LMXAWXmVVzx6yh2sdAtXPs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: normalize page count types to unsigned long
Message-Id: <E1wKBOo-00Fbgc-0J@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:45:02 +0000

commit 48054287a840011bce4c07f3db47ea1a4c669155
Author:     Bernhard Kaindl <bernhard.kaindl@citrix.com>
AuthorDate: Tue May 5 08:29:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:29:45 2026 +0200

    xen/mm: normalize page count types to unsigned long
    
    The current use of long for total_avail_pages and outstanding_claims
    creates an unnecessary mix of signed and unsigned types during page
    allocation calculations. This necessitates awkward constructs
    like '+ 0UL' to satisfy type matching in macros such as min().
    
    Address this by normalizing `total_avail_pages` and `outstanding_claims`
    from `long` to `unsigned long`.
    
    As a direct consequence of making `total_avail_pages` unsigned, the
    post-decrement assertions checking for `>= 0` are no longer logically
    sound. Adjust those assertions to pre-decrement checks.
    
    No functional change intended.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/page_alloc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index b1edef8712..2c4ff2c34c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -484,10 +484,11 @@ static heap_by_zone_and_order_t *_heap[MAX_NUMNODES];
 static unsigned long node_need_scrub[MAX_NUMNODES];
 
 static unsigned long *avail[MAX_NUMNODES];
-static long total_avail_pages;
+static unsigned long total_avail_pages;
 
 static DEFINE_SPINLOCK(heap_lock);
-static long outstanding_claims; /* total outstanding claims by all domains */
+/* Total outstanding claims by all domains */
+static unsigned long outstanding_claims;
 
 static unsigned long avail_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi, unsigned int node)
@@ -1047,8 +1048,8 @@ static struct page_info *alloc_heap_pages(
 
     ASSERT(avail[node][zone] >= request);
     avail[node][zone] -= request;
+    ASSERT(total_avail_pages >= request);
     total_avail_pages -= request;
-    ASSERT(total_avail_pages >= 0);
 
     if ( d && d->outstanding_pages && !(memflags & MEMF_no_refcount) )
     {
@@ -1240,8 +1241,8 @@ static int reserve_offlined_page(struct page_info *head)
             continue;
 
         avail[node][zone]--;
+        ASSERT(total_avail_pages > 0);
         total_avail_pages--;
-        ASSERT(total_avail_pages >= 0);
 
         page_list_add_tail(cur_head,
                            test_bit(_PGC_broken, &cur_head->count_info) ?
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 08:45:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 08:45:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300361.1574905 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOz-00056e-Rw; Tue, 05 May 2026 08:45:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300361.1574905; Tue, 05 May 2026 08:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKBOz-00056W-PM; Tue, 05 May 2026 08:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1300361;
 Tue, 05 May 2026 08:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKBOy-00056I-8R
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 08:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOy-000roL-0i
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKBOy-00Fbh4-0d
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 08:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=G9SmQmuJXWbflg4R0QKzTFkPNlljM/2Zuk++/e6Hk2c=; b=6RGrC5YFpTt6XYDZ8PqwXuhA2R
	4OHU5Ki35xKm2MC2f9PhGK8Hn1EVG4g7q7gGXpnIiK+esD9XTuD3vBuU4iTzgZPADgXIKRQbESIWP
	YorYwtJAeqGLfaoVsqecw/VWeu/Fysfi7uyAdfjPLDYaP/C7KIEZQoQTrWSO7sZpjeK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CHANGELOG: add xenstored watch depth feature
Message-Id: <E1wKBOy-00Fbh4-0d@xenbits.xenproject.org>
Date: Tue, 05 May 2026 08:45:12 +0000

commit 07bff81a219a756309e1c75e967b9c432e59c6e4
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue May 5 08:30:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 5 08:30:20 2026 +0200

    CHANGELOG: add xenstored watch depth feature
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb41d89997..ce46020dbd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Added
  - Support for per-domain Xenstore quota in C xenstored (includes
    xenstore-stubdom), libxl and xl.
+ - Support for Xenstore watch depth feature in C xenstored (includes
+   xenstore-stubdom).
  - On x86:
    - Support for Bus Lock Threshold on AMD Zen5 and later CPUs, used by Xen to
      mitigate (by rate-limiting) the system wide impact of an HVM guest
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 10:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 10:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300560.1575089 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQd-0008Je-JT; Tue, 05 May 2026 10:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300560.1575089; Tue, 05 May 2026 10:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQd-0008JW-Gr; Tue, 05 May 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1300560;
 Tue, 05 May 2026 10:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKDQc-0008JM-HM
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 10:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQc-000uNR-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQc-00FiXu-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Prd6xVTW9Wp6qlolDqyf5TQFKIbg2uIkzvz/UBTHgNM=; b=W6z3whz4Q5k2qhv6wz2+9x7Yjf
	p4uSBWleietolsVMnGod9ywjmLMFARl7pJEqLJStKibILpP2YGQQqv/xRu5fvqK2SF42b6j2lYDZA
	o9/PPZdEHJk/vDSUDAUMTFqwJj9AcpI2GnPQaTEH0p+6WvfRFhzFgY5tHbheVgNejcUM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] ARM/vgic: Use for_each_set_bit() in vgic_sync_from_lrs()
Message-Id: <E1wKDQc-00FiXu-1M@xenbits.xenproject.org>
Date: Tue, 05 May 2026 10:55:02 +0000

commit b4fd29dfe1f8114f5b978a5f8307ba37f1d9595d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 25 13:20:12 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    ARM/vgic: Use for_each_set_bit() in vgic_sync_from_lrs()
    
    lr_mask doesn't have bits set beyond the hardware limit, with the upper bits
    remaining zero.  Therefore, for_each_set_bit() is a better option.
    
    For ARM64, bloat-o-meter reports:
    
      Function                                     old     new   delta
      vgic_sync_from_lrs                           208     168     -40
    
    but this doesn't highlight that it also removes a call to find_next_bit() from
    each loop iteration.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/gic-vgic.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
index ea48c5375a..fae80e6cd2 100644
--- a/xen/arch/arm/gic-vgic.c
+++ b/xen/arch/arm/gic-vgic.c
@@ -241,9 +241,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
 
 void vgic_sync_from_lrs(struct vcpu *v)
 {
-    int i = 0;
     unsigned long flags;
-    unsigned int nr_lrs = gic_get_nr_lrs();
 
     /* The idle domain has no LRs to be cleared. Since gic_restore_state
      * doesn't write any LR registers for the idle domain they could be
@@ -255,11 +253,8 @@ void vgic_sync_from_lrs(struct vcpu *v)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask),
-                              nr_lrs, i)) < nr_lrs ) {
+    for_each_set_bit ( i, this_cpu(lr_mask) )
         gic_update_one_lr(v, i);
-        i++;
-    }
 
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 10:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 10:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300561.1575092 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQn-0008Lh-Kk; Tue, 05 May 2026 10:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300561.1575092; Tue, 05 May 2026 10:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQn-0008LZ-IC; Tue, 05 May 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1300561;
 Tue, 05 May 2026 10:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKDQm-0008LR-Jc
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 10:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQm-000uNV-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQm-00FiYZ-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KV0ykAXnZyqkZ6/FV5y3vDM1PfE6P92HeNMAO6uUhow=; b=Ql/1N6JsQH8RC3MqDtMuNKduwi
	ha95rjdMArb/+oX93EYBJrto+QzgnCqqEAYjRw75WMSS3NtSj2+IARSzCxEUaHZqARVuErneZrHyw
	LETs1UOCyYNsvBohY5/iNn5Ey7fQi0KCPZ+BViXqmyEoFfI0HqWAaxHWfu3t9q34t8s8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wKDQm-00FiYZ-1g@xenbits.xenproject.org>
Date: Tue, 05 May 2026 10:55:12 +0000

commit acfd2631b95e29fd68b98d902a1663e07474ed5f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 17:50:44 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d041cbd5f6..19ee857abf 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -908,6 +908,13 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
 
         /*
@@ -932,6 +939,8 @@ static void __init noreturn reinit_bsp_stack(void)
         }
         else
             asm volatile ( "setssbsy" ::: "memory" );
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 10:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300563.1575096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQx-0008OQ-NP; Tue, 05 May 2026 10:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300563.1575096; Tue, 05 May 2026 10:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKDQx-0008OJ-L0; Tue, 05 May 2026 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1300563;
 Tue, 05 May 2026 10:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKDQw-0008O7-M4
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 10:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQw-000uPg-26
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKDQw-00FiZ1-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 10:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jig7kDNiN8KsnuSkp5T7J3lzCcfhOdqHwrbWAeIMuLA=; b=tfPI74LslagVe/HGo5PtKhudwb
	LaA0fVGCCuJwR9/etJHcQpzralLJEa5/IW+BmGy0KIcDQbhwbVANx5W6Zz37SFFmKAdF2MxTFFNg6
	hySsMB9m5NprMvTTS/xrHw9hfIu2InTohnMyLSD8hwm4VJ0HIODj47I5QgTvSBwWYRaw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wKDQw-00FiZ1-1z@xenbits.xenproject.org>
Date: Tue, 05 May 2026 10:55:22 +0000

commit 3e6bca616b344aaa62602fcef0021255d467c2fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 20:17:29 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index ced6166847..f49d2ebbfd 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2505,6 +2505,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 11:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 11:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300608.1575137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEMg-0001jl-Q2; Tue, 05 May 2026 11:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300608.1575137; Tue, 05 May 2026 11:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEMg-0001jd-NQ; Tue, 05 May 2026 11:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1300608;
 Tue, 05 May 2026 11:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKEMg-0001jX-Co
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 11:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEMg-000vVe-13
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEMg-00FlDq-0w
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JOgamnaJeqqAU33tFC84vGoT2BfinZQujHliqQ8bsis=; b=kxWbCEa4aNULy+6drLpCRILJcA
	2h6Jym8HKQmHptxNHUXwkKyA1q421g4Kc9XyLMks8dbm95gx1/+SDdPZgrONP5eCpLQez870u/5ZL
	ND+N1GGM/wS0QpSbHcnKdjRQiPHRlBR+MpVgX4jiS+FUhkeqMmRM2cRZYeh9PIcFXFFM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] ARM/vgic: Use for_each_set_bit() in vgic_sync_from_lrs()
Message-Id: <E1wKEMg-00FlDq-0w@xenbits.xenproject.org>
Date: Tue, 05 May 2026 11:55:02 +0000

commit b4fd29dfe1f8114f5b978a5f8307ba37f1d9595d
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Feb 25 13:20:12 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    ARM/vgic: Use for_each_set_bit() in vgic_sync_from_lrs()
    
    lr_mask doesn't have bits set beyond the hardware limit, with the upper bits
    remaining zero.  Therefore, for_each_set_bit() is a better option.
    
    For ARM64, bloat-o-meter reports:
    
      Function                                     old     new   delta
      vgic_sync_from_lrs                           208     168     -40
    
    but this doesn't highlight that it also removes a call to find_next_bit() from
    each loop iteration.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/gic-vgic.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
index ea48c5375a..fae80e6cd2 100644
--- a/xen/arch/arm/gic-vgic.c
+++ b/xen/arch/arm/gic-vgic.c
@@ -241,9 +241,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
 
 void vgic_sync_from_lrs(struct vcpu *v)
 {
-    int i = 0;
     unsigned long flags;
-    unsigned int nr_lrs = gic_get_nr_lrs();
 
     /* The idle domain has no LRs to be cleared. Since gic_restore_state
      * doesn't write any LR registers for the idle domain they could be
@@ -255,11 +253,8 @@ void vgic_sync_from_lrs(struct vcpu *v)
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
 
-    while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask),
-                              nr_lrs, i)) < nr_lrs ) {
+    for_each_set_bit ( i, this_cpu(lr_mask) )
         gic_update_one_lr(v, i);
-        i++;
-    }
 
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 11:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300609.1575140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEMq-0001lx-RY; Tue, 05 May 2026 11:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300609.1575140; Tue, 05 May 2026 11:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEMq-0001lp-Op; Tue, 05 May 2026 11:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1300609;
 Tue, 05 May 2026 11:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKEMq-0001lh-FK
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 11:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEMq-000vVi-1Q
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEMq-00FlEI-1E
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=e2pDavQhJBEe5zg+OJ72gBBbHTgNgmZg/zJrBG57Uec=; b=r0Zt2Y1/Xo33LbUvvOCWjVWs0j
	9tOjpUkkk8fUgmQdWjaIoluC3RadczLYWLFEmek7Hpg7Aq5RLKbBXfswxpkn/gbB5HbqzwYa6Tk7g
	5O0Vaz0SKpA/Pcix1jighyNcQsfbOT1x+CRmXbr71RZyZV9bjZ1iquCYD7rmS0xmwlBA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wKEMq-00FlEI-1E@xenbits.xenproject.org>
Date: Tue, 05 May 2026 11:55:12 +0000

commit acfd2631b95e29fd68b98d902a1663e07474ed5f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 17:50:44 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d041cbd5f6..19ee857abf 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -908,6 +908,13 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
 
         /*
@@ -932,6 +939,8 @@ static void __init noreturn reinit_bsp_stack(void)
         }
         else
             asm volatile ( "setssbsy" ::: "memory" );
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 11:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 11:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1300610.1575145 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEN1-0001oa-Sy; Tue, 05 May 2026 11:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1300610.1575145; Tue, 05 May 2026 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKEN1-0001oS-QF; Tue, 05 May 2026 11:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1300610;
 Tue, 05 May 2026 11:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKEN0-0001oK-Ij
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 11:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEN0-000vXt-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKEN0-00FlF0-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 11:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BxFPG9jw7qiw46nOLq3HhX1cqiHaMFcC8D8+2KAvp2g=; b=EIjEE6heH0qW+h5tDZoSG9ymH4
	deKXb3+gwvPAj7bjnnqhftgYIXcBPVSefIXUHlQKVDwIOEukoUOVuM2P8X0O+POea6e5dsmjKsdAz
	WQYCzeDA1Ef49N2ip5mj1gJf7X/YUkP9th9ivz6wx+7aRIfCHp0YzaUKblfYhZD5WtXk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wKEN0-00FlF0-1b@xenbits.xenproject.org>
Date: Tue, 05 May 2026 11:55:22 +0000

commit 3e6bca616b344aaa62602fcef0021255d467c2fd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 1 20:17:29 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 5 11:45:00 2026 +0100

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index ced6166847..f49d2ebbfd 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2505,6 +2505,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 05 19:00:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 19:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301048.1575392 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKKzz-0006Rc-44; Tue, 05 May 2026 19:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301048.1575392; Tue, 05 May 2026 19:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKKzz-0006R7-16; Tue, 05 May 2026 19:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1301048;
 Tue, 05 May 2026 19:00:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKKzx-0006Aj-T6
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 19:00:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKKzx-0014Y6-2d
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 19:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKKzx-00GAlf-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 19:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QYxjgxEVYlzJVO6I8XJo5b7rlhyI8JD31IVsJp4lryI=; b=kjtt/7m5O9mZ1565D4gQLxMc39
	CBvAHxnk3hTZvcuwowRVsQe1rzP7JK6C9vNThkFWliEEdjuHXT1QKXMNndyBG3cwLR5qk06TPDaaS
	7a0hNRQN1x2Z6Z8bCcvY/7Qv5s0NMOGIC8cjF3+5/fNBgOXCibTVNGkBdXyGI1HDwT/8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation/gitlab: introduce macOS build jobs
Message-Id: <E1wKKzx-00GAlf-2S@xenbits.xenproject.org>
Date: Tue, 05 May 2026 19:00:01 +0000

commit 278953f6c1551e392585b7f2229aa28086bb1f39
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 23 18:19:38 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue May 5 20:52:48 2026 +0200

    automation/gitlab: introduce macOS build jobs
    
    With the imminent decommission of CirrusCI we will lose the limited macOS
    build testing done there.  Introduce two Gitlab macOS build jobs that
    reproduce the ones present on CirrusCI.
    
    According to the "Community programs" Gitlab documentation [0] we get
    50,000 compute minutes per month.  The arm64 job takes ~1m 15s, and the
    x86_64 one ~2m.  I think it's likely enough given the amount of minutes we
    have available.  We might need to reconsider if we add more tasks that
    consume compute minutes.
    
    [0] https://docs.gitlab.com/subscriptions/community_programs/#gitlab-for-open-source
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index eff96beaa5..463ed2f96d 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -815,3 +815,33 @@ debian-13-riscv64-gcc-randconfig:
     KBUILD_DEFCONFIG: tiny64_defconfig
     RANDCONFIG: y
     <<: *riscv-fixed-randconfig
+
+# macOS build jobs
+.macos-26:
+  <<: *build
+  tags:
+    - saas-macos-medium-m1
+  image: macos-26-xcode-26
+  variables:
+    HOMEBREW_NO_AUTO_UPDATE: 1
+    HOSTCC: clang
+    HYPERVISOR_ONLY: y
+    <<: *gcc
+  script:
+    - brew install ${CROSS_COMPILE}gcc ${CROSS_COMPILE}binutils
+    - alias nproc="sysctl -n hw.ncpu"
+    - ./automation/scripts/build 2>&1 | tee build.log
+
+macos-26-x86_64:
+  extends:
+    - .macos-26
+  variables:
+    XEN_TARGET_ARCH: x86_64
+    CROSS_COMPILE: x86_64-elf-
+
+macos-26-arm64:
+  extends:
+    - .macos-26
+  variables:
+    XEN_TARGET_ARCH: arm64
+    CROSS_COMPILE: aarch64-elf-
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 05 20:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 05 May 2026 20:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301079.1575415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKM6g-0001m6-Fd; Tue, 05 May 2026 20:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301079.1575415; Tue, 05 May 2026 20:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKM6g-0001ly-CR; Tue, 05 May 2026 20:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1301079;
 Tue, 05 May 2026 20:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKM6f-0001ls-LH
 for xen-changelog@lists.xenproject.org; Tue, 05 May 2026 20:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKM6f-00161l-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 20:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKM6f-00GE1X-1o
 for xen-changelog@lists.xenproject.org;
 Tue, 05 May 2026 20:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=41Qd6y2/EuWw6C2iOrWyGLu3Uzh/E3J+nro+EmjtC9o=; b=08e9ENduDe6LZaYtj4rHAuDdPI
	L5Atnzt3fcICVVA2ILjhd7CQT3IL6QQdAYDMcc38aXRdGJWXsWnuI0YvdsSizrF+H0xpUT/9rt4Fe
	CrzOdXppC4QssOAbHAxYAxM2hKjdrlsZzI77tBspcQEE2mWJVdwdgsZkt2AvKh+Ymqls=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation/gitlab: introduce macOS build jobs
Message-Id: <E1wKM6f-00GE1X-1o@xenbits.xenproject.org>
Date: Tue, 05 May 2026 20:11:01 +0000

commit 278953f6c1551e392585b7f2229aa28086bb1f39
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Apr 23 18:19:38 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue May 5 20:52:48 2026 +0200

    automation/gitlab: introduce macOS build jobs
    
    With the imminent decommission of CirrusCI we will lose the limited macOS
    build testing done there.  Introduce two Gitlab macOS build jobs that
    reproduce the ones present on CirrusCI.
    
    According to the "Community programs" Gitlab documentation [0] we get
    50,000 compute minutes per month.  The arm64 job takes ~1m 15s, and the
    x86_64 one ~2m.  I think it's likely enough given the amount of minutes we
    have available.  We might need to reconsider if we add more tasks that
    consume compute minutes.
    
    [0] https://docs.gitlab.com/subscriptions/community_programs/#gitlab-for-open-source
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/gitlab-ci/build.yaml | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index eff96beaa5..463ed2f96d 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -815,3 +815,33 @@ debian-13-riscv64-gcc-randconfig:
     KBUILD_DEFCONFIG: tiny64_defconfig
     RANDCONFIG: y
     <<: *riscv-fixed-randconfig
+
+# macOS build jobs
+.macos-26:
+  <<: *build
+  tags:
+    - saas-macos-medium-m1
+  image: macos-26-xcode-26
+  variables:
+    HOMEBREW_NO_AUTO_UPDATE: 1
+    HOSTCC: clang
+    HYPERVISOR_ONLY: y
+    <<: *gcc
+  script:
+    - brew install ${CROSS_COMPILE}gcc ${CROSS_COMPILE}binutils
+    - alias nproc="sysctl -n hw.ncpu"
+    - ./automation/scripts/build 2>&1 | tee build.log
+
+macos-26-x86_64:
+  extends:
+    - .macos-26
+  variables:
+    XEN_TARGET_ARCH: x86_64
+    CROSS_COMPILE: x86_64-elf-
+
+macos-26-arm64:
+  extends:
+    - .macos-26
+  variables:
+    XEN_TARGET_ARCH: arm64
+    CROSS_COMPILE: aarch64-elf-
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 06 12:22:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 12:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301682.1575904 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKbGO-00082o-Ez; Wed, 06 May 2026 12:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301682.1575904; Wed, 06 May 2026 12:22:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKbGO-00082f-Bw; Wed, 06 May 2026 12:22:04 +0000
Received: by outflank-mailman (input) for mailman id 1301682;
 Wed, 06 May 2026 12:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKbGM-00082Y-GT
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 12:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKbGM-002bQf-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 12:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKbGM-00Gxxw-0z
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 12:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9AWMGvFIPY6FmsvKO48rz9oWBQcbnFJ4040pOQdjeus=; b=hVYxkhLGyAgjEGEgUDUfUY+SBy
	Ig3sbPc1gCa7LYa+3uRa/I9Dbg1MXy6WGLcwk8nI8HhfqkEr82dFqpjsDicaY+TYpDLMwNM6olAcb
	XmvWuzi1O4Sdv7r2YFU8rU6ae9Wm4cgXfp+l+dNLmD6d43dELFHGybnoOf0R7j9Y8QuM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Refresh the Debian 12 cppcheck container
Message-Id: <E1wKbGM-00Gxxw-0z@xenbits.xenproject.org>
Date: Wed, 06 May 2026 12:22:02 +0000

commit e8c1feab33cb28ea066506fea998fc6733b3e9a2
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Mon Oct 21 11:07:54 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 13:14:36 2026 +0100

    CI: Refresh the Debian 12 cppcheck container
    
    Rework the container to derive from bookworm-slim, and to build and run
    cppcheck as a normal user.  User heredocs for readability and use apt-get
    --no-install-recommends to keep the size down.
    
    Changed the libpcre3-dev dependency to libpcre3, as the -dev package
    is only needed for building, not for running.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .../build/debian/12-arm64v8-cppcheck.dockerfile    | 86 ++++++++++++++++++++++
 .../build/debian/bookworm-cppcheck.dockerfile      | 54 --------------
 automation/gitlab-ci/build.yaml                    | 12 +--
 automation/scripts/containerize                    |  2 +-
 4 files changed, 93 insertions(+), 61 deletions(-)

diff --git a/automation/build/debian/12-arm64v8-cppcheck.dockerfile b/automation/build/debian/12-arm64v8-cppcheck.dockerfile
new file mode 100644
index 0000000000..50d2614453
--- /dev/null
+++ b/automation/build/debian/12-arm64v8-cppcheck.dockerfile
@@ -0,0 +1,86 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CPPCHECK_VERSION=2.7
+
+# dependencies for cppcheck build
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --home /build --create-home user
+
+    apt-get update
+
+    DEPS=(
+        build-essential
+        ca-certificates
+        curl
+        libpcre3-dev
+        python-is-python3
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+WORKDIR /build
+USER user
+
+# cppcheck release build (see cppcheck readme.md)
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".tar.gz
+    echo "5fd20549bb2fabf9a8026f772779d8cc6a5782c8f17500408529f7747afbc526  ${CPPCHECK_VERSION}.tar.gz" | sha256sum -c -
+
+    tar oxf "$CPPCHECK_VERSION".tar.gz
+    cd cppcheck-"$CPPCHECK_VERSION"
+
+    MAKE_OPTS=(
+        MATCHCOMPILER=yes
+        DESTDIR=/build/out
+        FILESDIR="/usr/share/cppcheck"
+        HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
+    )
+    make install -j$(nproc) "${MAKE_OPTS[@]}"
+EOF
+
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+COPY --from=builder /build/out/usr/bin/cppcheck /usr/bin/cppcheck
+COPY --from=builder /build/out/usr/share/cppcheck /usr/share/cppcheck
+
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# dependencies for cppcheck analysis including Xen-only build/cross-build
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        bison
+        build-essential
+        python-is-python3
+        libpcre3
+        flex
+        gcc-arm-linux-gnueabihf
+        gcc-x86-64-linux-gnu
+    )
+
+    apt-get --yes --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-cppcheck.dockerfile b/automation/build/debian/bookworm-cppcheck.dockerfile
deleted file mode 100644
index fe4cd4a1aa..0000000000
--- a/automation/build/debian/bookworm-cppcheck.dockerfile
+++ /dev/null
@@ -1,54 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm AS builder
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV CPPCHECK_VERSION=2.7
-ENV USER root
-
-# dependencies for cppcheck build
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        curl \
-        build-essential \
-        python-is-python3 \
-        libpcre3-dev
-
-RUN mkdir /build
-WORKDIR /build
-
-# cppcheck release build (see cppcheck readme.md)
-RUN curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".tar.gz && \
-    tar xvzf "$CPPCHECK_VERSION".tar.gz && \
-    cd cppcheck-"$CPPCHECK_VERSION" && \
-    make install -j$(nproc) \
-        MATCHCOMPILER=yes \
-        FILESDIR=/usr/share/cppcheck \
-        HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
-
-FROM --platform=linux/arm64/v8 debian:bookworm
-COPY --from=builder /usr/bin/cppcheck /usr/bin/cppcheck
-COPY --from=builder /usr/share/cppcheck /usr/share/cppcheck
-
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# dependencies for cppcheck analysis including Xen-only build/cross-build
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        python-is-python3 \
-        libpcre3-dev \
-        flex \
-        bison \
-        gcc-arm-linux-gnueabihf \
-        gcc-x86-64-linux-gnu \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 463ed2f96d..f058957291 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -510,26 +510,26 @@ yocto-qemux86-64:
 
 # Cppcheck analysis jobs
 
-debian-bookworm-gcc-cppcheck:
+debian-12-x86_64-gcc-cppcheck:
   extends: .gcc-x86-64-cross-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CROSS_COMPILE: /usr/bin/x86_64-linux-gnu-
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-cppcheck:
+debian-12-arm32-gcc-cppcheck:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CROSS_COMPILE: /usr/bin/arm-linux-gnueabihf-
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm64-cppcheck:
+debian-12-arm64-gcc-cppcheck:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 743567cb77..ad3e237270 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -40,7 +40,7 @@ case "_${CONTAINER}" in
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
     _bookworm-arm64v8-arm32-gcc) CONTAINER="${BASE}/debian:bookworm-arm64v8-arm32-gcc" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
-    _bookworm-cppcheck) CONTAINER="${BASE}/debian:bookworm-cppcheck" ;;
+    _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
     _xenial) CONTAINER="${BASE}/ubuntu:16.04-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 06 13:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 13:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301730.1575926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCS-0008S6-0z; Wed, 06 May 2026 13:22:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301730.1575926; Wed, 06 May 2026 13:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCR-0008Ry-UW; Wed, 06 May 2026 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1301730;
 Wed, 06 May 2026 13:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKcCQ-0008Rs-I8
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 13:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCQ-002cYK-1a
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCQ-00H1Fy-1O
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0u1EliWCUUudRgIBr6Htg0NjNHIij1dj0RFWqkhEQNA=; b=4dVrFejsSuFadnz5Xxb2KgJ9Ch
	f6IDNBiQaJ6+5d2DbRxUX99tLc2jKnaUoa92kTZNvw5gf9physjI7xGTIEfQ0ztMa70SRmHl4ZqHu
	owxFxcpFbXRAZTL7DaXclKs8eQ2Oh67rwkw8omQmKcN96e7toqkiTwnMFywpHHozFeSU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wKcCQ-00H1Fy-1O@xenbits.xenproject.org>
Date: Wed, 06 May 2026 13:22:02 +0000

commit 96ffccef5a5f598ffbd263971b92132391f1606a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 6 13:59:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:11 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 110b10e88c..83c9d4dea2 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 06 13:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 13:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301732.1575930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCc-0008U6-2C; Wed, 06 May 2026 13:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301732.1575930; Wed, 06 May 2026 13:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCb-0008Ty-Vu; Wed, 06 May 2026 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1301732;
 Wed, 06 May 2026 13:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKcCa-0008Tg-Me
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 13:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCa-002cYT-24
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCa-00H1Gg-1m
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WHs2crix/i1/jyiTu73gnswroLKI9tXC36TJlhqLNT8=; b=ADGAOpeG0RASQKOw84kO2AEZl3
	xcZK4vamu1t/gJhO35I/jM/g7XyUn+ObZvYCFX8iK8LlK+drnrIuZBdD7C643Wn8iKHQBI2HDj4Z0
	5ajmyNeE6ZVzxDWSk4GniPmyYSYSCMoVzTqhWXcrCGYc+t1UKwCsjWOWh+hrTm8zMyLY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: adjust cfg file buffer freeing
Message-Id: <E1wKcCa-00H1Gg-1m@xenbits.xenproject.org>
Date: Wed, 06 May 2026 13:22:12 +0000

commit 4ff927133ebc32498fd4af49a8025a846cfe1dc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 6 14:00:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:11 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index b44762878b..9ea2183c0b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -778,6 +778,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -787,8 +797,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1557,11 +1566,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1631,11 +1636,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         if ( dir_handle )
             dir_handle->Close(dir_handle);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 06 13:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 13:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301735.1575934 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCm-00006f-3b; Wed, 06 May 2026 13:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301735.1575934; Wed, 06 May 2026 13:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKcCm-00006X-15; Wed, 06 May 2026 13:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1301735;
 Wed, 06 May 2026 13:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKcCk-00006P-Ov
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 13:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCk-002cYd-2O
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKcCk-00H1H2-2E
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 13:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MKJaYFPpQuSEVUnxh8ZbEO3cUvr2mOPtQuNeA02WQc4=; b=jMoEIV06rk1YZtpfTiZGUDvAte
	Nr6UH0H7dKaxBIueOYaNZzLxLOc4JW1ciPzAINKChkoDRv09kcmve0qlP1K0/bMFsJEiIqQx6tJ6c
	vDNA6RlhAL02ID4lXE96xBI+Fpb8NmONfva44ywYa3UXYVXBE9d/v90M0XY7z8pfvc1A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wKcCk-00H1H2-2E@xenbits.xenproject.org>
Date: Wed, 06 May 2026 13:22:22 +0000

commit 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Wed May 6 14:00:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:18 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 06 15:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 15:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301870.1576018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKe4Z-00047P-74; Wed, 06 May 2026 15:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301870.1576018; Wed, 06 May 2026 15:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKe4Z-00047H-48; Wed, 06 May 2026 15:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1301870;
 Wed, 06 May 2026 15:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKe4X-00047B-Qj
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 15:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKe4X-002f59-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKe4X-00H8oB-29
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 15:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ie5wES9PyXByqqfQOu+/+QYp7PniK1zhYN3PUMkM3gw=; b=yWI69Hwd6/pppe7MK0A2IOQpy7
	VrtwYOhMCL6+ue3+1TpNfSE3plHDZCDboK7yWoRz75+E0vHjfNmlBIqzE0Nnsgxe2+46tpQUmCO+r
	tRztsHUZmSP/iIY1m1vWkOEitzOWmKioTD/IEHmLNYLnqeDuRrw1wPc7+MeU6Niw9O/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Refresh the Debian 12 cppcheck container
Message-Id: <E1wKe4X-00H8oB-29@xenbits.xenproject.org>
Date: Wed, 06 May 2026 15:22:01 +0000

commit e8c1feab33cb28ea066506fea998fc6733b3e9a2
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Mon Oct 21 11:07:54 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 13:14:36 2026 +0100

    CI: Refresh the Debian 12 cppcheck container
    
    Rework the container to derive from bookworm-slim, and to build and run
    cppcheck as a normal user.  User heredocs for readability and use apt-get
    --no-install-recommends to keep the size down.
    
    Changed the libpcre3-dev dependency to libpcre3, as the -dev package
    is only needed for building, not for running.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 .../build/debian/12-arm64v8-cppcheck.dockerfile    | 86 ++++++++++++++++++++++
 .../build/debian/bookworm-cppcheck.dockerfile      | 54 --------------
 automation/gitlab-ci/build.yaml                    | 12 +--
 automation/scripts/containerize                    |  2 +-
 4 files changed, 93 insertions(+), 61 deletions(-)

diff --git a/automation/build/debian/12-arm64v8-cppcheck.dockerfile b/automation/build/debian/12-arm64v8-cppcheck.dockerfile
new file mode 100644
index 0000000000..50d2614453
--- /dev/null
+++ b/automation/build/debian/12-arm64v8-cppcheck.dockerfile
@@ -0,0 +1,86 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CPPCHECK_VERSION=2.7
+
+# dependencies for cppcheck build
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --home /build --create-home user
+
+    apt-get update
+
+    DEPS=(
+        build-essential
+        ca-certificates
+        curl
+        libpcre3-dev
+        python-is-python3
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+WORKDIR /build
+USER user
+
+# cppcheck release build (see cppcheck readme.md)
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".tar.gz
+    echo "5fd20549bb2fabf9a8026f772779d8cc6a5782c8f17500408529f7747afbc526  ${CPPCHECK_VERSION}.tar.gz" | sha256sum -c -
+
+    tar oxf "$CPPCHECK_VERSION".tar.gz
+    cd cppcheck-"$CPPCHECK_VERSION"
+
+    MAKE_OPTS=(
+        MATCHCOMPILER=yes
+        DESTDIR=/build/out
+        FILESDIR="/usr/share/cppcheck"
+        HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
+    )
+    make install -j$(nproc) "${MAKE_OPTS[@]}"
+EOF
+
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+COPY --from=builder /build/out/usr/bin/cppcheck /usr/bin/cppcheck
+COPY --from=builder /build/out/usr/share/cppcheck /usr/share/cppcheck
+
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# dependencies for cppcheck analysis including Xen-only build/cross-build
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        bison
+        build-essential
+        python-is-python3
+        libpcre3
+        flex
+        gcc-arm-linux-gnueabihf
+        gcc-x86-64-linux-gnu
+    )
+
+    apt-get --yes --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-cppcheck.dockerfile b/automation/build/debian/bookworm-cppcheck.dockerfile
deleted file mode 100644
index fe4cd4a1aa..0000000000
--- a/automation/build/debian/bookworm-cppcheck.dockerfile
+++ /dev/null
@@ -1,54 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm AS builder
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV CPPCHECK_VERSION=2.7
-ENV USER root
-
-# dependencies for cppcheck build
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        curl \
-        build-essential \
-        python-is-python3 \
-        libpcre3-dev
-
-RUN mkdir /build
-WORKDIR /build
-
-# cppcheck release build (see cppcheck readme.md)
-RUN curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".tar.gz && \
-    tar xvzf "$CPPCHECK_VERSION".tar.gz && \
-    cd cppcheck-"$CPPCHECK_VERSION" && \
-    make install -j$(nproc) \
-        MATCHCOMPILER=yes \
-        FILESDIR=/usr/share/cppcheck \
-        HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
-
-FROM --platform=linux/arm64/v8 debian:bookworm
-COPY --from=builder /usr/bin/cppcheck /usr/bin/cppcheck
-COPY --from=builder /usr/share/cppcheck /usr/share/cppcheck
-
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# dependencies for cppcheck analysis including Xen-only build/cross-build
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        python-is-python3 \
-        libpcre3-dev \
-        flex \
-        bison \
-        gcc-arm-linux-gnueabihf \
-        gcc-x86-64-linux-gnu \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 463ed2f96d..f058957291 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -510,26 +510,26 @@ yocto-qemux86-64:
 
 # Cppcheck analysis jobs
 
-debian-bookworm-gcc-cppcheck:
+debian-12-x86_64-gcc-cppcheck:
   extends: .gcc-x86-64-cross-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CROSS_COMPILE: /usr/bin/x86_64-linux-gnu-
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-cppcheck:
+debian-12-arm32-gcc-cppcheck:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CROSS_COMPILE: /usr/bin/arm-linux-gnueabihf-
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm64-cppcheck:
+debian-12-arm64-gcc-cppcheck:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: debian:bookworm-cppcheck
+    CONTAINER: debian:12-arm64v8-cppcheck
     CPPCHECK: y
     HYPERVISOR_ONLY: y
 
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index 743567cb77..ad3e237270 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -40,7 +40,7 @@ case "_${CONTAINER}" in
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
     _bookworm-arm64v8-arm32-gcc) CONTAINER="${BASE}/debian:bookworm-arm64v8-arm32-gcc" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
-    _bookworm-cppcheck) CONTAINER="${BASE}/debian:bookworm-cppcheck" ;;
+    _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
     _xenial) CONTAINER="${BASE}/ubuntu:16.04-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 06 16:22:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 16:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301920.1576041 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0d-00053g-Mg; Wed, 06 May 2026 16:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301920.1576041; Wed, 06 May 2026 16:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0d-00053Y-K1; Wed, 06 May 2026 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1301920;
 Wed, 06 May 2026 16:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKf0c-00053Q-1a
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 16:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0c-002giG-00
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0b-00HCOr-36
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pNyQxDbjhv9pmYHKhs2hWMWndwH+UXJM/Cl4uqBfz6E=; b=OjA/l5HjBNIFP1N9eIzytnUrHi
	GPY3elfXPaKPrLkSKsXZ/hb1OgbYWjvgzArDJq/J6Uq0sGdIHX1uViD9rHXKgnNw3UH8/pDTXM3tQ
	Sx7qUGuGKAfGulZnXwlFyNQk8aw4seXm0ZD+RieSXfPWTxax0GUBNp8S8URDB0cbCQIM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wKf0b-00HCOr-36@xenbits.xenproject.org>
Date: Wed, 06 May 2026 16:22:01 +0000

commit 96ffccef5a5f598ffbd263971b92132391f1606a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 6 13:59:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:11 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 110b10e88c..83c9d4dea2 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 06 16:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301921.1576045 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0n-00055S-OI; Wed, 06 May 2026 16:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301921.1576045; Wed, 06 May 2026 16:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0n-00055K-LM; Wed, 06 May 2026 16:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1301921;
 Wed, 06 May 2026 16:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKf0m-000554-4U
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 16:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0m-002giM-0M
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0m-00HCPZ-0B
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2jNh3BG1q/Otama/wZPkwqNsnRScjypNX6y49G742mw=; b=tmOLm0dTvjo9qDqEAaHtxC0rQV
	ezXJgjIQKnHZs+VLdQPzyL81CnTi+hHH3X/hh9XLq/AAna21B0gZYOKHcC+2G/i0qAHbykXdtMLm/
	BnzpZaOcjzgs07nmYU+C5Uv7K0dwpQJw0/EtJ/+bnaKFj2xR3ym3R8bYIAQ0QOLdCQ6c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: adjust cfg file buffer freeing
Message-Id: <E1wKf0m-00HCPZ-0B@xenbits.xenproject.org>
Date: Wed, 06 May 2026 16:22:12 +0000

commit 4ff927133ebc32498fd4af49a8025a846cfe1dc6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 6 14:00:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:11 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index b44762878b..9ea2183c0b 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -778,6 +778,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -787,8 +797,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1557,11 +1566,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1631,11 +1636,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         if ( dir_handle )
             dir_handle->Close(dir_handle);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 06 16:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 16:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1301923.1576049 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0x-00059J-PW; Wed, 06 May 2026 16:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1301923.1576049; Wed, 06 May 2026 16:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKf0x-00059B-Mu; Wed, 06 May 2026 16:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1301923;
 Wed, 06 May 2026 16:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKf0w-00058z-7p
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 16:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0w-002giY-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKf0w-00HCSh-0X
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 16:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GVWahtYsDFOVQdHF+KzcBFHi4EIExvpCuOmewbMptIw=; b=e4UgOqijvOExKRYo/0X/XOmJaI
	FrXu0ro35e3ASNAPouGO3ZCOJyuTQxJY0AYEqytciPE4iWC9k2BUyXemj7QS0ltgV2OOnwCYHXt7E
	PIbXxFKQBW1KVg4nATI8oZqdluCMwVb7pSQuOAL6Cj66cJaNRmiT5ynKjy3EdDQiB1Tc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wKf0w-00HCSh-0X@xenbits.xenproject.org>
Date: Wed, 06 May 2026 16:22:22 +0000

commit 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Wed May 6 14:00:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 6 15:11:18 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 06 17:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 17:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302020.1576106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKgSd-000499-AJ; Wed, 06 May 2026 17:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302020.1576106; Wed, 06 May 2026 17:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKgSd-000492-7T; Wed, 06 May 2026 17:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1302020;
 Wed, 06 May 2026 17:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKgSc-00048s-EZ
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 17:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKgSb-002iRV-2h
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 17:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKgSb-00HOGa-2X
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 17:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=pxnARs1DGvpb6KdIZqpGNzbeYczPdrfbTxXbGNVqWQ4=; b=u9QwsZWSXFg9HqFcOz46RbZiDe
	wgm4E5yVyHnKk5alRtXhPegyl/sUVH2g+624L/64SQo3m0XLV050T9dO9n6qCkKcEcwb5cfvFzAmF
	vKXeX7KGX/0ci3/DAnF6PjimhLIlNQPqSuKfna6DQVYzFlc5r1MbQy+SdlgqJRrgyl0U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] iommu/amd-vi: do not zero IOMMU MMIO region
Message-Id: <E1wKgSb-00HOGa-2X@xenbits.xenproject.org>
Date: Wed, 06 May 2026 17:55:01 +0000

commit bdb30883f3528676f8b736e4ec0e475914289993
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue May 5 15:13:28 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed May 6 18:56:59 2026 +0200

    iommu/amd-vi: do not zero IOMMU MMIO region
    
    Attempting to memset the whole IOMMU MMIO region to zero is dangerous to
    say the least.  We don't know which registers might be there, nor which
    values might be safe for those registers.  On a forthcoming platform doing
    the zeroing of the MMIO region does put the IOMMU in a broken state, which
    is not recoverable by the IOMMU initialization procedure in Xen.
    
    Instead just zero the control register, which mimics the current behavior
    with regards to how the control register is handled, and ensures the IOMU
    setup is done with the unit disabled.  This approach will need revisiting
    in order to support Preboot DMA Protection.
    
    Fold map_iommu_mmio_region() into its only caller, as the function body is
    just an ioremap() call after the removal of the memset().
    
    Fixes: 0700c962ac2d ("Add AMD IOMMU support into hypervisor")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 33 ++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index d77dd85112..e0c8925c33 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -42,18 +42,6 @@ static bool iommu_has_ht_flag(struct amd_iommu *iommu, u8 mask)
     return iommu->ht_flags & mask;
 }
 
-static int __init map_iommu_mmio_region(struct amd_iommu *iommu)
-{
-    iommu->mmio_base = ioremap(iommu->mmio_base_phys,
-                               IOMMU_MMIO_REGION_LENGTH);
-    if ( !iommu->mmio_base )
-        return -ENOMEM;
-
-    memset(iommu->mmio_base, 0, IOMMU_MMIO_REGION_LENGTH);
-
-    return 0;
-}
-
 static void __init unmap_iommu_mmio_region(struct amd_iommu *iommu)
 {
     if ( iommu->mmio_base )
@@ -1367,11 +1355,14 @@ static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
 {
     int rc = alloc_ivrs_mappings(iommu->sbdf.seg);
 
-    if ( !rc )
-        rc = map_iommu_mmio_region(iommu);
     if ( rc )
         return rc;
 
+    iommu->mmio_base = ioremap(iommu->mmio_base_phys,
+                               IOMMU_MMIO_REGION_LENGTH);
+    if ( !iommu->mmio_base )
+        return -ENOMEM;
+
     get_iommu_features(iommu);
 
     /*
@@ -1381,6 +1372,20 @@ static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
     if ( amd_iommu_max_paging_mode < amd_iommu_min_paging_mode )
         return -ERANGE;
 
+    /*
+     * Check whether the IOMMU is already enabled and unconditionally disable
+     * it (zero the control register) ahead of Xen setup.  Needs to be
+     * revisited to support Preboot DMA Protection.
+     */
+    iommu->ctrl.raw = readq(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+    if ( iommu->ctrl.iommu_en )
+        printk(XENLOG_WARNING
+               "AMD-Vi: IOMMU %pp enabled by firmware (ctrl %016lx)\n",
+               &iommu->sbdf, iommu->ctrl.raw);
+
+    iommu->ctrl.raw = 0;
+    writeq(0, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 06 19:22:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 06 May 2026 19:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302045.1576111 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKhop-00074R-49; Wed, 06 May 2026 19:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302045.1576111; Wed, 06 May 2026 19:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKhop-00074J-1X; Wed, 06 May 2026 19:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1302045;
 Wed, 06 May 2026 19:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKhon-00074D-RT
 for xen-changelog@lists.xenproject.org; Wed, 06 May 2026 19:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKhon-002k9u-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 19:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKhon-00HS8w-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 06 May 2026 19:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BOlJrbA/ol3Id8X2RqYze5quHSCqmO806vGNEJEi4jk=; b=NETlYzyj04kYN56rDFcQ4N4OTW
	NRrYVaHGdk+XWOMJCWeM2dj+1AP4by9VHDZGhspHHyQ8kQgPKqmKl889BgI9TZDjn4c0S9t15zAvz
	6dzPSmKMd+BiTfUQ1YqCrg+m+ESHfEeZsOpla0bvJAs/TGC1dmBMnXs/f2ww4aaK8PeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] iommu/amd-vi: do not zero IOMMU MMIO region
Message-Id: <E1wKhon-00HS8w-2K@xenbits.xenproject.org>
Date: Wed, 06 May 2026 19:22:01 +0000

commit bdb30883f3528676f8b736e4ec0e475914289993
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue May 5 15:13:28 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Wed May 6 18:56:59 2026 +0200

    iommu/amd-vi: do not zero IOMMU MMIO region
    
    Attempting to memset the whole IOMMU MMIO region to zero is dangerous to
    say the least.  We don't know which registers might be there, nor which
    values might be safe for those registers.  On a forthcoming platform doing
    the zeroing of the MMIO region does put the IOMMU in a broken state, which
    is not recoverable by the IOMMU initialization procedure in Xen.
    
    Instead just zero the control register, which mimics the current behavior
    with regards to how the control register is handled, and ensures the IOMU
    setup is done with the unit disabled.  This approach will need revisiting
    in order to support Preboot DMA Protection.
    
    Fold map_iommu_mmio_region() into its only caller, as the function body is
    just an ioremap() call after the removal of the memset().
    
    Fixes: 0700c962ac2d ("Add AMD IOMMU support into hypervisor")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
---
 xen/drivers/passthrough/amd/iommu_init.c | 33 ++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index d77dd85112..e0c8925c33 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -42,18 +42,6 @@ static bool iommu_has_ht_flag(struct amd_iommu *iommu, u8 mask)
     return iommu->ht_flags & mask;
 }
 
-static int __init map_iommu_mmio_region(struct amd_iommu *iommu)
-{
-    iommu->mmio_base = ioremap(iommu->mmio_base_phys,
-                               IOMMU_MMIO_REGION_LENGTH);
-    if ( !iommu->mmio_base )
-        return -ENOMEM;
-
-    memset(iommu->mmio_base, 0, IOMMU_MMIO_REGION_LENGTH);
-
-    return 0;
-}
-
 static void __init unmap_iommu_mmio_region(struct amd_iommu *iommu)
 {
     if ( iommu->mmio_base )
@@ -1367,11 +1355,14 @@ static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
 {
     int rc = alloc_ivrs_mappings(iommu->sbdf.seg);
 
-    if ( !rc )
-        rc = map_iommu_mmio_region(iommu);
     if ( rc )
         return rc;
 
+    iommu->mmio_base = ioremap(iommu->mmio_base_phys,
+                               IOMMU_MMIO_REGION_LENGTH);
+    if ( !iommu->mmio_base )
+        return -ENOMEM;
+
     get_iommu_features(iommu);
 
     /*
@@ -1381,6 +1372,20 @@ static int __init amd_iommu_prepare_one(struct amd_iommu *iommu)
     if ( amd_iommu_max_paging_mode < amd_iommu_min_paging_mode )
         return -ERANGE;
 
+    /*
+     * Check whether the IOMMU is already enabled and unconditionally disable
+     * it (zero the control register) ahead of Xen setup.  Needs to be
+     * revisited to support Preboot DMA Protection.
+     */
+    iommu->ctrl.raw = readq(iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+    if ( iommu->ctrl.iommu_en )
+        printk(XENLOG_WARNING
+               "AMD-Vi: IOMMU %pp enabled by firmware (ctrl %016lx)\n",
+               &iommu->sbdf, iommu->ctrl.raw);
+
+    iommu->ctrl.raw = 0;
+    writeq(0, iommu->mmio_base + IOMMU_CONTROL_MMIO_OFFSET);
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 07 13:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 13:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302740.1576529 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKyfy-0002T7-DK; Thu, 07 May 2026 13:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302740.1576529; Thu, 07 May 2026 13:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKyfy-0002Sz-Ah; Thu, 07 May 2026 13:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1302740;
 Thu, 07 May 2026 13:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKyfx-0002St-JO
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 13:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKyfx-004IU5-1h
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 13:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKyfx-000l8j-1X
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 13:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7vt4mVxkab3oxv4bFdUEIjRa2f4KZZQV+PX20ZzgYvw=; b=m1FyzyAHoPneIBjImTEu/3Uw64
	LSAeDyHzW6KUor+Fp8RJ42aQqZKEA6zIwlns4RJhvri+HB9tXLjrhQ9GRzO9kCx4WtUVoiOmmQQnU
	/gB3wuk3fVGamcl1ke4yDNYstVtXEE+HxJ993vhTZIgLso/bgWmnMB95laoTzMTo2jzs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: introduce CONFIG_HAS_DOMAIN_TYPE
Message-Id: <E1wKyfx-000l8j-1X@xenbits.xenproject.org>
Date: Thu, 07 May 2026 13:22:01 +0000

commit 9f976dec039c2a5ddeb389efbaae8d726e17e84a
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:23 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 7 13:26:52 2026 +0200

    xen: introduce CONFIG_HAS_DOMAIN_TYPE
    
    As domain type is part of common code now there is no any reason
    to have architecture-specific set_domain_type() functions so
    it is dropped.
    
    Change the guard around access of kinfo->type to CONFIG_HAS_DOMAIN_TYPE
    for consistency. Also, drop and add some parentheses to be aligned
    with the similar if() below.
    
    x86 with CONFIG_64BIT=y shouldn't use is_{32,64}bit_domain() as
    x86 doesn't have support of CONFIG_HAS_DOMAIN_TYPE. Since x86_32 Xen no
    longer builds, the fallback is currently only relevant for arm32.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/Kconfig               |  1 +
 xen/arch/arm/arm64/domctl.c        |  4 ++--
 xen/arch/arm/dom0less-build.c      | 14 --------------
 xen/arch/arm/domain_build.c        | 12 +++++-------
 xen/arch/arm/include/asm/domain.h  | 16 ----------------
 xen/arch/arm/include/asm/kernel.h  |  4 ----
 xen/arch/arm/kernel.c              | 16 ++++++++--------
 xen/common/Kconfig                 |  3 +++
 xen/include/xen/dom0less-build.h   |  2 --
 xen/include/xen/domain.h           | 13 +++++++++++++
 xen/include/xen/fdt-domain-build.h | 10 ++++++++++
 xen/include/xen/fdt-kernel.h       |  5 +++++
 xen/include/xen/sched.h            |  4 ++++
 13 files changed, 51 insertions(+), 53 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2f2b501fda..79622b46a1 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -7,6 +7,7 @@ config ARM_64
 	def_bool y
 	depends on !ARM_32
 	select 64BIT
+	select HAS_DOMAIN_TYPE
 	select HAS_FAST_MULTIPLY
 	select HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH
 
diff --git a/xen/arch/arm/arm64/domctl.c b/xen/arch/arm/arm64/domctl.c
index 8720d126c9..9e9a29eb1e 100644
--- a/xen/arch/arm/arm64/domctl.c
+++ b/xen/arch/arm/arm64/domctl.c
@@ -21,10 +21,10 @@ static long switch_mode(struct domain *d, enum domain_type type)
         return -EINVAL;
     if ( domain_tot_pages(d) != 0 )
         return -EBUSY;
-    if ( d->arch.type == type )
+    if ( d->type == type )
         return 0;
 
-    d->arch.type = type;
+    d->type = type;
 
     if ( is_64bit_domain(d) )
         for_each_vcpu(d, v)
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 4181c10538..6f73c65e51 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -237,20 +237,6 @@ int __init make_arch_nodes(struct kernel_info *kinfo)
     return 0;
 }
 
-/* TODO: make arch.type generic ? */
-#ifdef CONFIG_ARM_64
-void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
-{
-    /* type must be set before allocate memory */
-    d->arch.type = kinfo->arch.type;
-}
-#else
-void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
-{
-    /* Nothing to do */
-}
-#endif
-
 int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
                       const struct dt_device_node *node)
 {
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a3ff701023..ad665cd3c0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1771,15 +1771,15 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
-#ifdef CONFIG_ARM_64
+#ifdef CONFIG_HAS_DOMAIN_TYPE
     /* if aarch32 mode is not supported at EL1 do not allow 32-bit domain */
-    if ( !(cpu_has_el1_32) && kinfo->arch.type == DOMAIN_32BIT )
+    if ( !cpu_has_el1_32 && (kinfo->type == DOMAIN_32BIT) )
     {
         printk("Platform does not support 32-bit domain\n");
         return -EINVAL;
     }
 
-    if ( is_sve_domain(d) && (kinfo->arch.type == DOMAIN_32BIT) )
+    if ( is_sve_domain(d) && (kinfo->type == DOMAIN_32BIT) )
     {
         printk("SVE is not available for 32-bit domain\n");
         return -EINVAL;
@@ -1893,10 +1893,8 @@ int __init construct_hwdom(struct kernel_info *kinfo,
 
     iommu_hwdom_init(d);
 
-#ifdef CONFIG_ARM_64
-    /* type must be set before allocate_memory */
-    d->arch.type = kinfo->arch.type;
-#endif
+    set_domain_type(d, kinfo);
+
     find_gnttab_region(d, kinfo);
     if ( is_domain_direct_mapped(d) )
         allocate_memory_11(d, kinfo);
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index ffe5d0d9f0..b24f02d269 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -18,18 +18,6 @@ struct hvm_domain
     uint64_t              params[HVM_NR_PARAMS];
 };
 
-#ifdef CONFIG_ARM_64
-enum domain_type {
-    DOMAIN_32BIT,
-    DOMAIN_64BIT,
-};
-#define is_32bit_domain(d) ((d)->arch.type == DOMAIN_32BIT)
-#define is_64bit_domain(d) ((d)->arch.type == DOMAIN_64BIT)
-#else
-#define is_32bit_domain(d) (1)
-#define is_64bit_domain(d) (0)
-#endif
-
 /*
  * Is the domain using the host memory layout?
  *
@@ -62,10 +50,6 @@ struct paging_domain {
 
 struct arch_domain
 {
-#ifdef CONFIG_ARM_64
-    enum domain_type type;
-#endif
-
 #ifdef CONFIG_ARM64_SVE
     /* max SVE encoded vector length */
     uint8_t sve_vl;
diff --git a/xen/arch/arm/include/asm/kernel.h b/xen/arch/arm/include/asm/kernel.h
index 7c3b7fde5b..21f4273fa1 100644
--- a/xen/arch/arm/include/asm/kernel.h
+++ b/xen/arch/arm/include/asm/kernel.h
@@ -10,10 +10,6 @@
 
 struct arch_kernel_info
 {
-#ifdef CONFIG_ARM_64
-    enum domain_type type;
-#endif
-
     /* Enable pl011 emulation */
     bool vpl011;
 };
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 7544fd50a2..9395b5af87 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -100,8 +100,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
     const struct membanks *mem = kernel_info_get_mem(info);
     paddr_t load_addr;
 
-#ifdef CONFIG_ARM_64
-    if ( (info->arch.type == DOMAIN_64BIT) && (info->zimage.start == 0) )
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    if ( (info->type == DOMAIN_64BIT) && (info->zimage.start == 0) )
         return mem->bank[0].start + info->zimage.text_offset;
 #endif
 
@@ -268,14 +268,14 @@ int __init kernel_uimage_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-#ifdef CONFIG_ARM_64
+#ifdef CONFIG_HAS_DOMAIN_TYPE
     switch ( uimage.arch )
     {
     case IH_ARCH_ARM:
-        info->arch.type = DOMAIN_32BIT;
+        info->type = DOMAIN_32BIT;
         break;
     case IH_ARCH_ARM64:
-        info->arch.type = DOMAIN_64BIT;
+        info->type = DOMAIN_64BIT;
         break;
     default:
         printk(XENLOG_ERR "Unsupported uImage arch type %d\n", uimage.arch);
@@ -345,7 +345,7 @@ static int __init kernel_zimage64_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-    info->arch.type = DOMAIN_64BIT;
+    info->type = DOMAIN_64BIT;
 
     return 0;
 }
@@ -396,8 +396,8 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-#ifdef CONFIG_ARM_64
-    info->arch.type = DOMAIN_32BIT;
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    info->type = DOMAIN_32BIT;
 #endif
 
     return 0;
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 0a20aa0a12..5ff71480ee 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -128,6 +128,9 @@ config HAS_DEVICE_TREE_DISCOVERY
 config HAS_DOM0LESS
 	bool
 
+config HAS_DOMAIN_TYPE
+	bool
+
 config HAS_DIT # Data Independent Timing
 	bool
 
diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
index faaf660424..4118dec76c 100644
--- a/xen/include/xen/dom0less-build.h
+++ b/xen/include/xen/dom0less-build.h
@@ -57,8 +57,6 @@ int init_vuart(struct domain *d, struct kernel_info *kinfo,
 int make_intc_domU_node(struct kernel_info *kinfo);
 int make_arch_nodes(struct kernel_info *kinfo);
 
-void set_domain_type(struct domain *d, struct kernel_info *kinfo);
-
 int init_intc_phandle(struct kernel_info *kinfo, const char *name,
                       const int node_next, const void *pfdt);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 93c0fd00c1..a095190fc7 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,6 +13,19 @@ struct guest_area {
     void *map;
 };
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+enum __packed domain_type {
+    DOMAIN_32BIT,
+    DOMAIN_64BIT,
+};
+#define is_32bit_domain(d) ((d)->type == DOMAIN_32BIT)
+#define is_64bit_domain(d) ((d)->type == DOMAIN_64BIT)
+#elif !defined(CONFIG_64BIT)
+/* At the moment on 32-bit-only platforms all domains are 32-bit. */
+#define is_32bit_domain(d) true
+#define is_64bit_domain(d) false
+#endif
+
 #include <asm/domain.h>
 
 typedef union {
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 0d40d8cfa1..9465a1021f 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -7,6 +7,7 @@
 #include <xen/device_tree.h>
 #include <xen/fdt-kernel.h>
 #include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/types.h>
 
 struct domain;
@@ -69,6 +70,15 @@ static inline uint32_t alloc_phandle(struct kernel_info *kinfo)
     return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++;
 }
 
+static inline void set_domain_type(struct domain *d, const struct kernel_info *kinfo)
+{
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    /* Type must be set before allocating memory. */
+    ASSERT(!domain_tot_pages(d));
+    d->type = kinfo->type;
+#endif
+}
+
 #endif /* __XEN_FDT_DOMAIN_BUILD_H__ */
 
 /*
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 4d0467bb39..86a37a1304 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -9,6 +9,7 @@
 
 #include <xen/bootinfo.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/types.h>
 
 #if __has_include(<asm/kernel.h>)
@@ -65,6 +66,10 @@ struct kernel_info {
         } zimage;
     };
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    enum domain_type type;
+#endif
+
 #if __has_include(<asm/kernel.h>)
     struct arch_kernel_info arch;
 #endif
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 212c7d765c..00db1da12f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -386,6 +386,10 @@ struct domain
 {
     domid_t          domain_id;
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    enum domain_type type;
+#endif
+
     unsigned int     max_vcpus;
 
     uint64_t         unique_id;       /* Unique domain identifier */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 07 14:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 14:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302791.1576533 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzc8-0001mt-Bt; Thu, 07 May 2026 14:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302791.1576533; Thu, 07 May 2026 14:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzc8-0001ml-96; Thu, 07 May 2026 14:22:08 +0000
Received: by outflank-mailman (input) for mailman id 1302791;
 Thu, 07 May 2026 14:22:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKzc7-0001mf-AW
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 14:22:07 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzc7-004JjT-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:07 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzc2-000o63-0i
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tLI1sJOfaX4R9Rm37jqdhbnNv5gaZJcLqbIvkHYlkMk=; b=BPnUuHdd4bOd6Y686ZzoC2a3kK
	xnQbPx0l+gZfcKLy/cvP6dnNxXTpWmmPAq+SpT9V/nhhyt2N9A+ZUoawkeYe0DRRBdROajC1dRWeC
	YEC+ocPId7f4FPoS2opY5PU5XEJivC/LYWyTC23ltzEYMMHqANvZ9r9RjqR5etxPlVew=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: make early NOW() uses slightly more precise
Message-Id: <E1wKzc2-000o63-0i@xenbits.xenproject.org>
Date: Thu, 07 May 2026 14:22:02 +0000

commit 4526d67634664bac3a441b37caa22d9b2e7a34d8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 7 13:25:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:10:52 2026 +0200

    x86/time: make early NOW() uses slightly more precise
    
    For early NOW() uses to yield sufficiently precise results (scaling incurs
    some error, which grows with the delta being scaled), init_percpu_time()
    wants to have run as early as possible. With 93340297802b ("x86/time:
    calibrate TSC against platform timer") having moved the invocation of
    init_platform_timer() from init_xen_time() to early_time_init(), this
    other call could be moved as well.
    
    Moving, however, has the unwanted effect of then growing the gap until
    time calibration runs for the 1st time. Therefore keep the present
    invocation, and add another from early_time_init().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 8209d37d32..c708c80be3 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2597,6 +2597,11 @@ int __init init_xen_time(void)
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
 
+    /*
+     * While early_time_init() called this already, call it again here to
+     * reduce the gap until local_time_calibration() gets to run for the
+     * first time.
+     */
     init_percpu_time();
 
     init_timer(&calibration_timer, time_calibration, NULL, 0);
@@ -2642,6 +2647,8 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
+    init_percpu_time();
+
     cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 07 14:22:18 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 14:22:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302793.1576537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzcI-0001qD-DL; Thu, 07 May 2026 14:22:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302793.1576537; Thu, 07 May 2026 14:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzcI-0001q4-AQ; Thu, 07 May 2026 14:22:18 +0000
Received: by outflank-mailman (input) for mailman id 1302793;
 Thu, 07 May 2026 14:22:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKzcH-0001ps-Cd
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 14:22:17 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzcH-004Jjj-17
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:17 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzcH-000o9Q-0y
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:17 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=awTYzEQoEwviPNqMj/7YZpkfaFIvFJyQGhO5QtDIg0g=; b=5fEzPdicS3kUj0c2h3QT3ziC7K
	N3Mv1w1cOZRl0LAZYbbMoAitx4pzDhyvTP4p4lsTkj5McI/EOylHX41bWQULO10SkGLfu/gEiYrRz
	bhjma4gyVBDa7lNADUcpiw62a7vncPMTIPk/EEdbPuJM6pDELmRrfCKxVgO8Gq7/WA+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: make do_settime() uses more accurate
Message-Id: <E1wKzcH-000o9Q-0y@xenbits.xenproject.org>
Date: Thu, 07 May 2026 14:22:17 +0000

commit 54ca0aadc8219b19199703038205cd01c2611995
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 7 13:26:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:10:52 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index c708c80be3..98e8ef19e4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2575,6 +2575,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2592,7 +2594,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2752,6 +2755,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2763,7 +2768,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 07 14:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 14:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302794.1576541 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzcX-0001sV-Es; Thu, 07 May 2026 14:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302794.1576541; Thu, 07 May 2026 14:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wKzcX-0001sL-CA; Thu, 07 May 2026 14:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1302794;
 Thu, 07 May 2026 14:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wKzcW-0001sF-Fq
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 14:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzcW-004Jjn-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wKzcR-000o9s-1I
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 14:22:27 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5GKV+78I+dBXiCEjsbU3/YcTwMMz3d9Oyimq/b1dkzY=; b=GsTomdBXl4zXoS+TYdgsgzgYuG
	u3OHvrVbUMAbvI+/wNS09/VJHAGUbg2I3RWt6EG6hyLyBtsQKF5Y9SjN6gPJgXHag/1OwqaR7tKF1
	swgH87SggMhnxKxspkLZSiVRY1dUzLSmjpzkB9Bfk6n2u4UEuHHGigGbXGnE6aFOAMrY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: fix MMIO alignment check in imsic_init()
Message-Id: <E1wKzcR-000o9s-1I@xenbits.xenproject.org>
Date: Thu, 07 May 2026 14:22:27 +0000

commit 2611377cf9c92b43b04a33810f03fa07bf8ba954
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 13:27:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:11:03 2026 +0200

    xen/riscv: fix MMIO alignment check in imsic_init()
    
    The MMIO alignment check in imsic_init() incorrectly uses cpu as
    the index into mmios[]. The loop index should be used instead.
    Otherwise, the alignment check may be performed on the wrong MMIO
    address.
    
    Fix the index used in the alignment check and corresponding printk.
    
    Fixes: c9bd8b322ecbb ("xen/riscv: imsic_init() implementation")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/imsic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index a4460576f6..f7b70a8da0 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -451,11 +451,11 @@ int __init imsic_init(const struct dt_device_node *node)
             continue;
         }
 
-        if ( !IS_ALIGNED(mmios[cpu].base_addr + reloff,
-                         IMSIC_MMIO_PAGE_SZ) )
+        if ( !IS_ALIGNED(mmios[index].base_addr + reloff, IMSIC_MMIO_PAGE_SZ) )
         {
             printk(XENLOG_WARNING "%s: MMIO address %#lx is not aligned on a page\n",
-                   node->name, msi[cpu].base_addr + reloff);
+                   node->name, mmios[index].base_addr + reloff);
+
             continue;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 07 16:22:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 16:22:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302890.1576554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UA-0001KR-PH; Thu, 07 May 2026 16:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302890.1576554; Thu, 07 May 2026 16:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UA-0001KK-MP; Thu, 07 May 2026 16:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1302890;
 Thu, 07 May 2026 16:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wL1U9-0001KE-UD
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 16:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1U9-004MaB-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1U9-000vz0-2T
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZoIMBRNcbUMxUdc+unA7r9c/79P59Yid7mwaHyGVyO0=; b=kTMz9EAyZ1gqxkkl/cd0UqdkFb
	2rNI+NiDZdZWHNCZ+XavDUmyNgbAgDYYo44xoE4nm/dqT3vrl1pop0gvaEn0eUWp5SePFnrJhy0gO
	l7pVBodl71IILVM5tDfDuFUqLhsnIdPsYz8bbBUd7D9CBl7VeAsJ3UqD8p0PIZ+beXZs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: introduce CONFIG_HAS_DOMAIN_TYPE
Message-Id: <E1wL1U9-000vz0-2T@xenbits.xenproject.org>
Date: Thu, 07 May 2026 16:22:01 +0000

commit 9f976dec039c2a5ddeb389efbaae8d726e17e84a
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:23 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 7 13:26:52 2026 +0200

    xen: introduce CONFIG_HAS_DOMAIN_TYPE
    
    As domain type is part of common code now there is no any reason
    to have architecture-specific set_domain_type() functions so
    it is dropped.
    
    Change the guard around access of kinfo->type to CONFIG_HAS_DOMAIN_TYPE
    for consistency. Also, drop and add some parentheses to be aligned
    with the similar if() below.
    
    x86 with CONFIG_64BIT=y shouldn't use is_{32,64}bit_domain() as
    x86 doesn't have support of CONFIG_HAS_DOMAIN_TYPE. Since x86_32 Xen no
    longer builds, the fallback is currently only relevant for arm32.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/Kconfig               |  1 +
 xen/arch/arm/arm64/domctl.c        |  4 ++--
 xen/arch/arm/dom0less-build.c      | 14 --------------
 xen/arch/arm/domain_build.c        | 12 +++++-------
 xen/arch/arm/include/asm/domain.h  | 16 ----------------
 xen/arch/arm/include/asm/kernel.h  |  4 ----
 xen/arch/arm/kernel.c              | 16 ++++++++--------
 xen/common/Kconfig                 |  3 +++
 xen/include/xen/dom0less-build.h   |  2 --
 xen/include/xen/domain.h           | 13 +++++++++++++
 xen/include/xen/fdt-domain-build.h | 10 ++++++++++
 xen/include/xen/fdt-kernel.h       |  5 +++++
 xen/include/xen/sched.h            |  4 ++++
 13 files changed, 51 insertions(+), 53 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 2f2b501fda..79622b46a1 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -7,6 +7,7 @@ config ARM_64
 	def_bool y
 	depends on !ARM_32
 	select 64BIT
+	select HAS_DOMAIN_TYPE
 	select HAS_FAST_MULTIPLY
 	select HAS_VPCI_GUEST_SUPPORT if PCI_PASSTHROUGH
 
diff --git a/xen/arch/arm/arm64/domctl.c b/xen/arch/arm/arm64/domctl.c
index 8720d126c9..9e9a29eb1e 100644
--- a/xen/arch/arm/arm64/domctl.c
+++ b/xen/arch/arm/arm64/domctl.c
@@ -21,10 +21,10 @@ static long switch_mode(struct domain *d, enum domain_type type)
         return -EINVAL;
     if ( domain_tot_pages(d) != 0 )
         return -EBUSY;
-    if ( d->arch.type == type )
+    if ( d->type == type )
         return 0;
 
-    d->arch.type = type;
+    d->type = type;
 
     if ( is_64bit_domain(d) )
         for_each_vcpu(d, v)
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 4181c10538..6f73c65e51 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -237,20 +237,6 @@ int __init make_arch_nodes(struct kernel_info *kinfo)
     return 0;
 }
 
-/* TODO: make arch.type generic ? */
-#ifdef CONFIG_ARM_64
-void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
-{
-    /* type must be set before allocate memory */
-    d->arch.type = kinfo->arch.type;
-}
-#else
-void __init set_domain_type(struct domain *d, struct kernel_info *kinfo)
-{
-    /* Nothing to do */
-}
-#endif
-
 int __init init_vuart(struct domain *d, struct kernel_info *kinfo,
                       const struct dt_device_node *node)
 {
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index a3ff701023..ad665cd3c0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1771,15 +1771,15 @@ int __init construct_domain(struct domain *d, struct kernel_info *kinfo)
     BUG_ON(d->vcpu[0] == NULL);
     BUG_ON(v->is_initialised);
 
-#ifdef CONFIG_ARM_64
+#ifdef CONFIG_HAS_DOMAIN_TYPE
     /* if aarch32 mode is not supported at EL1 do not allow 32-bit domain */
-    if ( !(cpu_has_el1_32) && kinfo->arch.type == DOMAIN_32BIT )
+    if ( !cpu_has_el1_32 && (kinfo->type == DOMAIN_32BIT) )
     {
         printk("Platform does not support 32-bit domain\n");
         return -EINVAL;
     }
 
-    if ( is_sve_domain(d) && (kinfo->arch.type == DOMAIN_32BIT) )
+    if ( is_sve_domain(d) && (kinfo->type == DOMAIN_32BIT) )
     {
         printk("SVE is not available for 32-bit domain\n");
         return -EINVAL;
@@ -1893,10 +1893,8 @@ int __init construct_hwdom(struct kernel_info *kinfo,
 
     iommu_hwdom_init(d);
 
-#ifdef CONFIG_ARM_64
-    /* type must be set before allocate_memory */
-    d->arch.type = kinfo->arch.type;
-#endif
+    set_domain_type(d, kinfo);
+
     find_gnttab_region(d, kinfo);
     if ( is_domain_direct_mapped(d) )
         allocate_memory_11(d, kinfo);
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index ffe5d0d9f0..b24f02d269 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -18,18 +18,6 @@ struct hvm_domain
     uint64_t              params[HVM_NR_PARAMS];
 };
 
-#ifdef CONFIG_ARM_64
-enum domain_type {
-    DOMAIN_32BIT,
-    DOMAIN_64BIT,
-};
-#define is_32bit_domain(d) ((d)->arch.type == DOMAIN_32BIT)
-#define is_64bit_domain(d) ((d)->arch.type == DOMAIN_64BIT)
-#else
-#define is_32bit_domain(d) (1)
-#define is_64bit_domain(d) (0)
-#endif
-
 /*
  * Is the domain using the host memory layout?
  *
@@ -62,10 +50,6 @@ struct paging_domain {
 
 struct arch_domain
 {
-#ifdef CONFIG_ARM_64
-    enum domain_type type;
-#endif
-
 #ifdef CONFIG_ARM64_SVE
     /* max SVE encoded vector length */
     uint8_t sve_vl;
diff --git a/xen/arch/arm/include/asm/kernel.h b/xen/arch/arm/include/asm/kernel.h
index 7c3b7fde5b..21f4273fa1 100644
--- a/xen/arch/arm/include/asm/kernel.h
+++ b/xen/arch/arm/include/asm/kernel.h
@@ -10,10 +10,6 @@
 
 struct arch_kernel_info
 {
-#ifdef CONFIG_ARM_64
-    enum domain_type type;
-#endif
-
     /* Enable pl011 emulation */
     bool vpl011;
 };
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 7544fd50a2..9395b5af87 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -100,8 +100,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
     const struct membanks *mem = kernel_info_get_mem(info);
     paddr_t load_addr;
 
-#ifdef CONFIG_ARM_64
-    if ( (info->arch.type == DOMAIN_64BIT) && (info->zimage.start == 0) )
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    if ( (info->type == DOMAIN_64BIT) && (info->zimage.start == 0) )
         return mem->bank[0].start + info->zimage.text_offset;
 #endif
 
@@ -268,14 +268,14 @@ int __init kernel_uimage_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-#ifdef CONFIG_ARM_64
+#ifdef CONFIG_HAS_DOMAIN_TYPE
     switch ( uimage.arch )
     {
     case IH_ARCH_ARM:
-        info->arch.type = DOMAIN_32BIT;
+        info->type = DOMAIN_32BIT;
         break;
     case IH_ARCH_ARM64:
-        info->arch.type = DOMAIN_64BIT;
+        info->type = DOMAIN_64BIT;
         break;
     default:
         printk(XENLOG_ERR "Unsupported uImage arch type %d\n", uimage.arch);
@@ -345,7 +345,7 @@ static int __init kernel_zimage64_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-    info->arch.type = DOMAIN_64BIT;
+    info->type = DOMAIN_64BIT;
 
     return 0;
 }
@@ -396,8 +396,8 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
 
     info->load = kernel_zimage_load;
 
-#ifdef CONFIG_ARM_64
-    info->arch.type = DOMAIN_32BIT;
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    info->type = DOMAIN_32BIT;
 #endif
 
     return 0;
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 0a20aa0a12..5ff71480ee 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -128,6 +128,9 @@ config HAS_DEVICE_TREE_DISCOVERY
 config HAS_DOM0LESS
 	bool
 
+config HAS_DOMAIN_TYPE
+	bool
+
 config HAS_DIT # Data Independent Timing
 	bool
 
diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
index faaf660424..4118dec76c 100644
--- a/xen/include/xen/dom0less-build.h
+++ b/xen/include/xen/dom0less-build.h
@@ -57,8 +57,6 @@ int init_vuart(struct domain *d, struct kernel_info *kinfo,
 int make_intc_domU_node(struct kernel_info *kinfo);
 int make_arch_nodes(struct kernel_info *kinfo);
 
-void set_domain_type(struct domain *d, struct kernel_info *kinfo);
-
 int init_intc_phandle(struct kernel_info *kinfo, const char *name,
                       const int node_next, const void *pfdt);
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 93c0fd00c1..a095190fc7 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -13,6 +13,19 @@ struct guest_area {
     void *map;
 };
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+enum __packed domain_type {
+    DOMAIN_32BIT,
+    DOMAIN_64BIT,
+};
+#define is_32bit_domain(d) ((d)->type == DOMAIN_32BIT)
+#define is_64bit_domain(d) ((d)->type == DOMAIN_64BIT)
+#elif !defined(CONFIG_64BIT)
+/* At the moment on 32-bit-only platforms all domains are 32-bit. */
+#define is_32bit_domain(d) true
+#define is_64bit_domain(d) false
+#endif
+
 #include <asm/domain.h>
 
 typedef union {
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 0d40d8cfa1..9465a1021f 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -7,6 +7,7 @@
 #include <xen/device_tree.h>
 #include <xen/fdt-kernel.h>
 #include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/types.h>
 
 struct domain;
@@ -69,6 +70,15 @@ static inline uint32_t alloc_phandle(struct kernel_info *kinfo)
     return kinfo->next_phandle >= GUEST_PHANDLE_GIC ? 0 : kinfo->next_phandle++;
 }
 
+static inline void set_domain_type(struct domain *d, const struct kernel_info *kinfo)
+{
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    /* Type must be set before allocating memory. */
+    ASSERT(!domain_tot_pages(d));
+    d->type = kinfo->type;
+#endif
+}
+
 #endif /* __XEN_FDT_DOMAIN_BUILD_H__ */
 
 /*
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 4d0467bb39..86a37a1304 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -9,6 +9,7 @@
 
 #include <xen/bootinfo.h>
 #include <xen/device_tree.h>
+#include <xen/domain.h>
 #include <xen/types.h>
 
 #if __has_include(<asm/kernel.h>)
@@ -65,6 +66,10 @@ struct kernel_info {
         } zimage;
     };
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    enum domain_type type;
+#endif
+
 #if __has_include(<asm/kernel.h>)
     struct arch_kernel_info arch;
 #endif
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 212c7d765c..00db1da12f 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -386,6 +386,10 @@ struct domain
 {
     domid_t          domain_id;
 
+#ifdef CONFIG_HAS_DOMAIN_TYPE
+    enum domain_type type;
+#endif
+
     unsigned int     max_vcpus;
 
     uint64_t         unique_id;       /* Unique domain identifier */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 07 16:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302891.1576558 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UK-0001MK-Rx; Thu, 07 May 2026 16:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302891.1576558; Thu, 07 May 2026 16:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UK-0001MC-PE; Thu, 07 May 2026 16:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1302891;
 Thu, 07 May 2026 16:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wL1UK-0001M4-0I
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 16:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1UJ-004MaH-39
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1UJ-000vzq-31
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Nh7ft8pj0D2wJ4XZeRRh09wqtgA1Ulds4eJoDMoxd4A=; b=Ql61Sx88u9OSI5DTwayN7Xdkjl
	UdjQHCyV9LglWznQmObd3UrpqFiIOdAQO2Qanmr3ZW4RiwHnuTi4Vhd3Oqk/x4KJEYJoYSf7ODr/1
	4DvUtW43YzxPEUjNhFxkw3F4JfVF34BGdSBRtsoNy4Mnpl1vK4Q7RxW+JVQuilMWcwEU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: make early NOW() uses slightly more precise
Message-Id: <E1wL1UJ-000vzq-31@xenbits.xenproject.org>
Date: Thu, 07 May 2026 16:22:11 +0000

commit 4526d67634664bac3a441b37caa22d9b2e7a34d8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 7 13:25:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:10:52 2026 +0200

    x86/time: make early NOW() uses slightly more precise
    
    For early NOW() uses to yield sufficiently precise results (scaling incurs
    some error, which grows with the delta being scaled), init_percpu_time()
    wants to have run as early as possible. With 93340297802b ("x86/time:
    calibrate TSC against platform timer") having moved the invocation of
    init_platform_timer() from init_xen_time() to early_time_init(), this
    other call could be moved as well.
    
    Moving, however, has the unwanted effect of then growing the gap until
    time calibration runs for the 1st time. Therefore keep the present
    invocation, and add another from early_time_init().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 8209d37d32..c708c80be3 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2597,6 +2597,11 @@ int __init init_xen_time(void)
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
 
+    /*
+     * While early_time_init() called this already, call it again here to
+     * reduce the gap until local_time_calibration() gets to run for the
+     * first time.
+     */
     init_percpu_time();
 
     init_timer(&calibration_timer, time_calibration, NULL, 0);
@@ -2642,6 +2647,8 @@ void __init early_time_init(void)
     set_time_scale(&t->tsc_scale, tmp);
     t->stamp.local_tsc = boot_tsc_stamp;
 
+    init_percpu_time();
+
     cpu_khz = DIV_ROUND(tmp, 1000);
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 07 16:22:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 16:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302892.1576562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UU-0001QI-T6; Thu, 07 May 2026 16:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302892.1576562; Thu, 07 May 2026 16:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1UU-0001QA-Qa; Thu, 07 May 2026 16:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1302892;
 Thu, 07 May 2026 16:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wL1UU-0001Q1-3I
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 16:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1UU-004MaR-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1UU-000w0Y-06
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=J7P5YLIsbBPmWJSmzp8OOYU1rDWV/GiswusPFoQWb5A=; b=Yya/ORqrZmzj94k9PX/2CjHM3l
	2TwIo7cQGXQ5xHKPCviuWLoNu6KqhoPRiILQu0BIQyd4So07muYbxdWOw0Lv9C7nOJYRURJl9NYTb
	AE8wz52vF0fd+YSInTaH57IqCC10XtrQI+1FzviKVYJt4XIt5nc1teqJq6Y/8qd4Rz6s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: make do_settime() uses more accurate
Message-Id: <E1wL1UU-000w0Y-06@xenbits.xenproject.org>
Date: Thu, 07 May 2026 16:22:22 +0000

commit 54ca0aadc8219b19199703038205cd01c2611995
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 7 13:26:03 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:10:52 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index c708c80be3..98e8ef19e4 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2575,6 +2575,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2592,7 +2594,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2752,6 +2755,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2763,7 +2768,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 07 16:22:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 07 May 2026 16:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1302893.1576566 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1Ue-0001SJ-Uf; Thu, 07 May 2026 16:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1302893.1576566; Thu, 07 May 2026 16:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wL1Ue-0001SB-Rw; Thu, 07 May 2026 16:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1302893;
 Thu, 07 May 2026 16:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wL1Ue-0001S3-6W
 for xen-changelog@lists.xenproject.org; Thu, 07 May 2026 16:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1Ue-004MaW-0W
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wL1Ue-000w15-0P
 for xen-changelog@lists.xenproject.org;
 Thu, 07 May 2026 16:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/A2Kha5p0chrVZ8IY/yc1+G3hnpglvyVekZoY2JNCRE=; b=Ncv08veuDK0ZNYwqBXqVXWXl94
	LwluNqvGd20FxKGQVYKZBwmhHVVcVt7qe+rgumvVw0jtaK5WiTO1tLKFrSz6Y2ZE9KKXVQwC9RgYy
	5KjRkf7triraXnlBSEqCmWi9+/NY0i/YfUbcF8Iw9JGVNFTFPa2YSW18TsmO5ZPTTeWM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: fix MMIO alignment check in imsic_init()
Message-Id: <E1wL1Ue-000w15-0P@xenbits.xenproject.org>
Date: Thu, 07 May 2026 16:22:32 +0000

commit 2611377cf9c92b43b04a33810f03fa07bf8ba954
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 13:27:07 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 7 16:11:03 2026 +0200

    xen/riscv: fix MMIO alignment check in imsic_init()
    
    The MMIO alignment check in imsic_init() incorrectly uses cpu as
    the index into mmios[]. The loop index should be used instead.
    Otherwise, the alignment check may be performed on the wrong MMIO
    address.
    
    Fix the index used in the alignment check and corresponding printk.
    
    Fixes: c9bd8b322ecbb ("xen/riscv: imsic_init() implementation")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/imsic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/imsic.c b/xen/arch/riscv/imsic.c
index a4460576f6..f7b70a8da0 100644
--- a/xen/arch/riscv/imsic.c
+++ b/xen/arch/riscv/imsic.c
@@ -451,11 +451,11 @@ int __init imsic_init(const struct dt_device_node *node)
             continue;
         }
 
-        if ( !IS_ALIGNED(mmios[cpu].base_addr + reloff,
-                         IMSIC_MMIO_PAGE_SZ) )
+        if ( !IS_ALIGNED(mmios[index].base_addr + reloff, IMSIC_MMIO_PAGE_SZ) )
         {
             printk(XENLOG_WARNING "%s: MMIO address %#lx is not aligned on a page\n",
-                   node->name, msi[cpu].base_addr + reloff);
+                   node->name, mmios[index].base_addr + reloff);
+
             continue;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 08 07:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 May 2026 07:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1303245.1576723 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wLFhm-0000gW-Nj; Fri, 08 May 2026 07:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1303245.1576723; Fri, 08 May 2026 07:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wLFhm-0000gO-Kq; Fri, 08 May 2026 07:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1303245;
 Fri, 08 May 2026 07:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wLFhm-0000gI-3m
 for xen-changelog@lists.xenproject.org; Fri, 08 May 2026 07:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wLFhm-005qYN-05
 for xen-changelog@lists.xenproject.org;
 Fri, 08 May 2026 07:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wLFhl-001tbC-2z
 for xen-changelog@lists.xenproject.org;
 Fri, 08 May 2026 07:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=D6EO51cza2zr/bw+AW0SLwuQGWtZtqNRpfx5qCASSqs=; b=RDIiDgvKyn8kyP4wJPcVLLESp5
	SxOy0P5YO+f9hjxDAJ0wUFfAFNZY90eMPDJA0FO3KXINVRq6lM2OIhTFFt6N+/Nn3mrcmrPZ2NyGe
	r1D3CgqWl3nUIAz/EWxaokbF+iD2eOpQYsKeIwVfe35Ax+UlcGzjaI4m4ojKNv0Oa+x4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: skip holes in physical address space when setting up frametable
Message-Id: <E1wLFhl-001tbC-2z@xenbits.xenproject.org>
Date: Fri, 08 May 2026 07:33:01 +0000

commit 10d417b8b62efa5093707c1dfe9bd48e0abeb331
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed May 6 10:41:37 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 8 08:52:27 2026 +0200

    xen/arm: skip holes in physical address space when setting up frametable
    
    Refactor setup_frametable_mappings() into init_frametable(), modeled
    after x86's implementation. Instead of mapping one contiguous frametable
    covering ram_start to ram_end (including holes), iterate the
    pdx_group_valid bitmap to allocate and map frametable memory only for
    valid PDX groups, skipping gaps in the physical address space.
    
    This reduces memory consumption on systems with sparse RAM layouts by
    not allocating frametable entries for non-existent memory regions.
    
    The chunk allocator rounds chunk_size up to PAGE_SIZE only, rather than
    to a larger mapping granularity, to avoid overshooting past chunk
    boundaries into subsequent gaps or valid regions. This rounding has no
    impact for in-loop chunks given that chunk size is a multiple of 14MB
    on Arm64 and 2MB on Arm32. The rounding matters only for the last
    out-of-loop chunk.
    
    Physical allocations prefer 32MB alignment so that map_pages_to_xen()
    can use the contiguous bit for larger TLB entries where virtual
    alignment also permits. Fall back to 2MB if the chunk is smaller than
    32MB.
    
    Add a comment explaining why we don't use pdx_to_page(). For complete
    discussion see [1].
    
    As ram_end is no longer needed by init_frametable(), drop the now-dead
    ram_end/bank_end computation from setup_mm().
    
    Update the MPU implementation to match the new init_frametable()
    signature. Since MPU has no virtual address translation (ma == va),
    hole-skipping is not possible and the frametable remains a single
    contiguous allocation.
    
    [1] https://lore.kernel.org/xen-devel/20260430125103.401811-1-michal.orzel@amd.com/T/#m803025eb6720a1425443dd0f8e72be93ef02f344
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm32/mmu/mm.c   |   3 +-
 xen/arch/arm/include/asm/mm.h |   4 +-
 xen/arch/arm/mm.c             |   5 +--
 xen/arch/arm/mmu/mm.c         | 100 ++++++++++++++++++++++++++++++++----------
 xen/arch/arm/mpu/mm.c         |  23 +++++-----
 5 files changed, 93 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 5e4766ddcf..0b595baa11 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -178,8 +178,7 @@ void __init setup_mm(void)
 
     setup_directmap_mappings(mfn_x(directmap_mfn_start), xenheap_pages);
 
-    /* Frame table covers all of RAM region, including holes */
-    setup_frametable_mappings(ram_start, ram_end);
+    init_frametable(ram_start);
 
     /*
      * The allocators may need to use map_domain_page() (such as for
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 72a6928624..2eb8465aa9 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -196,8 +196,8 @@ extern void *early_fdt_map(paddr_t fdt_paddr);
 extern void remove_early_mappings(void);
 /* Prepare the memory subystem to bring-up the given secondary CPU */
 extern int prepare_secondary_mm(int cpu);
-/* Map a frame table to cover physical addresses ps through pe */
-extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
+/* Map a frame table */
+void init_frametable(paddr_t ram_start);
 /* Helper function to setup memory management */
 void setup_mm_helper(void);
 /* map a physical range in virtual memory */
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6eddbcf912..65aea71c43 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -33,7 +33,6 @@ void __init setup_mm(void)
 {
     const struct membanks *banks = bootinfo_get_mem();
     paddr_t ram_start = INVALID_PADDR;
-    paddr_t ram_end = 0;
     paddr_t ram_size = 0;
     unsigned int i;
 
@@ -42,11 +41,9 @@ void __init setup_mm(void)
     for ( i = 0; i < banks->nr_banks; i++ )
     {
         const struct membank *bank = &banks->bank[i];
-        paddr_t bank_end = bank->start + bank->size;
 
         ram_size = ram_size + bank->size;
         ram_start = min(ram_start, bank->start);
-        ram_end = max(ram_end, bank_end);
     }
 
     total_pages = ram_size >> PAGE_SHIFT;
@@ -62,7 +59,7 @@ void __init setup_mm(void)
 
     setup_mm_helper();
 
-    setup_frametable_mappings(ram_start, ram_end);
+    init_frametable(ram_start);
 
     init_staticmem_pages();
     init_sharedmem_pages();
diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
index 6604f3bf4e..10c7dfb1ef 100644
--- a/xen/arch/arm/mmu/mm.c
+++ b/xen/arch/arm/mmu/mm.c
@@ -1,23 +1,61 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <xen/bitops.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/macros.h>
 #include <xen/mm.h>
 #include <xen/mm-frame.h>
 #include <xen/pdx.h>
+#include <xen/sizes.h>
 #include <xen/string.h>
 
-/* Map a frame table to cover physical addresses ps through pe */
-void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
+static void __init init_frametable_chunk(unsigned long pdx_s,
+                                         unsigned long pdx_e)
 {
-    unsigned long nr_pdxs = mfn_to_pdx(mfn_add(maddr_to_mfn(pe), -1)) -
-                            mfn_to_pdx(maddr_to_mfn(ps)) + 1;
-    unsigned long frametable_size = nr_pdxs * sizeof(struct page_info);
-    mfn_t base_mfn;
-    const unsigned long mapping_size = frametable_size < MB(32) ? MB(2)
-                                                                : MB(32);
+    unsigned long nr_pdxs = pdx_e - pdx_s;
+    unsigned long chunk_size = nr_pdxs * sizeof(struct page_info);
+    unsigned long pfn_align;
+    struct page_info *pg;
     int rc;
+    mfn_t base_mfn;
+
+    /*
+     * In-loop chunks span whole PDX groups, which are always page-size
+     * aligned. The last chunk ending at max_pdx may not be, so round up.
+     */
+    chunk_size = ROUNDUP(chunk_size, PAGE_SIZE);
+
+    /*
+     * Try to align the allocation to the contiguous mapping size so that
+     * map_pages_to_xen() can use the contiguous bit.
+     */
+    pfn_align = ((chunk_size >= MB(32)) ? MB(32) : MB(2)) >> PAGE_SHIFT;
+
+    base_mfn = alloc_boot_pages(chunk_size >> PAGE_SHIFT, pfn_align);
+
+    /*
+     * Resolve the frametable VA via mfn_to_page(pdx_to_mfn(...)) rather
+     * than pdx_to_page() because the generic pdx_to_page() does not subtract
+     * frametable_base_pdx. There's more work to be done to make it generic, so
+     * for now route through mfn_to_page(), which on Arm applies the
+     * frametable_base_pdx offset and yields the correct VA.
+     */
+    pg = mfn_to_page(pdx_to_mfn(pdx_s));
+    rc = map_pages_to_xen((unsigned long)pg, base_mfn,
+                          chunk_size >> PAGE_SHIFT,
+                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
+    if ( rc )
+        panic("Unable to setup the frametable mappings\n");
+
+    memset(pg, 0, nr_pdxs * sizeof(struct page_info));
+    memset(pg + nr_pdxs, -1,
+           chunk_size - nr_pdxs * sizeof(struct page_info));
+}
+
+void __init init_frametable(paddr_t ram_start)
+{
+    unsigned int sidx, nidx, max_idx;
 
     /*
      * The size of paddr_t should be sufficient for the complete range of
@@ -26,24 +64,40 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     BUILD_BUG_ON((sizeof(paddr_t) * BITS_PER_BYTE) < PADDR_BITS);
     BUILD_BUG_ON(sizeof(struct page_info) != PAGE_INFO_SIZE);
 
-    if ( frametable_size > FRAMETABLE_SIZE )
-        panic("The frametable cannot cover the physical region %#"PRIpaddr" - %#"PRIpaddr"\n",
-              ps, pe);
+    /* init_frametable_chunk() allocation alignment assumes 4KB granule */
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 
-    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ps));
-    /* Round up to 2M or 32M boundary, as appropriate. */
-    frametable_size = ROUNDUP(frametable_size, mapping_size);
-    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 32<<(20-12));
+    /* In-loop chunks must produce page-aligned frametable regions */
+    BUILD_BUG_ON((PDX_GROUP_COUNT * sizeof(struct page_info)) % PAGE_SIZE);
 
-    rc = map_pages_to_xen(FRAMETABLE_VIRT_START, base_mfn,
-                          frametable_size >> PAGE_SHIFT,
-                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
-    if ( rc )
-        panic("Unable to setup the frametable mappings.\n");
+    max_idx = DIV_ROUND_UP(max_pdx, PDX_GROUP_COUNT);
+    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ram_start));
+
+    /*
+     * Mapping address in init_frametable_chunk must be page-aligned
+     * for map_pages_to_xen(). Aligning to PDX_GROUP_COUNT guarantees this
+     * because PDX_GROUP_COUNT * sizeof(page_info) is always a multiple of
+     * PAGE_SIZE by construction.
+     */
+    frametable_base_pdx = ROUNDDOWN(frametable_base_pdx, PDX_GROUP_COUNT);
+
+    if ( (max_pdx - frametable_base_pdx) > FRAMETABLE_NR )
+        panic("Frametable too small\n");
+
+    for ( sidx = (frametable_base_pdx / PDX_GROUP_COUNT); ; sidx = nidx )
+    {
+        unsigned int eidx;
+
+        eidx = find_next_zero_bit(pdx_group_valid, max_idx, sidx);
+        nidx = find_next_bit(pdx_group_valid, max_idx, eidx);
+
+        if ( nidx >= max_idx )
+            break;
+
+        init_frametable_chunk(sidx * PDX_GROUP_COUNT, eidx * PDX_GROUP_COUNT);
+    }
 
-    memset(&frame_table[0], 0, nr_pdxs * sizeof(struct page_info));
-    memset(&frame_table[nr_pdxs], -1,
-           frametable_size - (nr_pdxs * sizeof(struct page_info)));
+    init_frametable_chunk(sidx * PDX_GROUP_COUNT, max_pdx);
 }
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index aff88bd3a9..9c568831c1 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -186,16 +186,15 @@ static int is_mm_attr_match(pr_t *region, unsigned int attributes)
     return 0;
 }
 
-/* Map a frame table to cover physical addresses ps through pe */
-void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
+/*
+ * Allocate a contiguous frame table covering ram_start through max_pdx.
+ * Unlike the MMU version, MPU cannot skip holes because there is no virtual
+ * address translation (ma == va).
+ */
+void __init init_frametable(paddr_t ram_start)
 {
+    unsigned long nr_pdxs, frametable_size;
     mfn_t base_mfn;
-    paddr_t aligned_ps = ROUNDUP(ps, PAGE_SIZE);
-    paddr_t aligned_pe = ROUNDDOWN(pe, PAGE_SIZE);
-
-    unsigned long nr_pdxs = mfn_to_pdx(mfn_add(maddr_to_mfn(aligned_pe), -1)) -
-                            mfn_to_pdx(maddr_to_mfn(aligned_ps)) + 1;
-    unsigned long frametable_size = nr_pdxs * sizeof(struct page_info);
 
     /*
      * The size of paddr_t should be sufficient for the complete range of
@@ -204,11 +203,13 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     BUILD_BUG_ON((sizeof(paddr_t) * BITS_PER_BYTE) < PADDR_BITS);
     BUILD_BUG_ON(sizeof(struct page_info) != PAGE_INFO_SIZE);
 
+    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ram_start));
+    nr_pdxs = max_pdx - frametable_base_pdx;
+    frametable_size = nr_pdxs * sizeof(struct page_info);
+
     if ( frametable_size > FRAMETABLE_SIZE )
-        panic("The frametable cannot cover the physical region %#"PRIpaddr" - %#"PRIpaddr"\n",
-              ps, pe);
+        panic("Frametable too small\n");
 
-    frametable_base_pdx = paddr_to_pdx(aligned_ps);
     frametable_size = ROUNDUP(frametable_size, PAGE_SIZE);
 
     base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 08 11:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 08 May 2026 11:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1303524.1576871 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wLJS4-0007AQ-16; Fri, 08 May 2026 11:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1303524.1576871; Fri, 08 May 2026 11:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wLJS3-0007AI-Ua; Fri, 08 May 2026 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1303524;
 Fri, 08 May 2026 11:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wLJS2-0007A7-B4
 for xen-changelog@lists.xenproject.org; Fri, 08 May 2026 11:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wLJS2-005vss-0s
 for xen-changelog@lists.xenproject.org;
 Fri, 08 May 2026 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wLJS2-0025hI-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 08 May 2026 11:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8DEGvF8e6jsDZ9IJ9Xsf6mMvsFnFiO+VNAYXyAFXZ2I=; b=i8fBYH/mDVwSpeBYbvUEDrJE8o
	MnPk1hg6IZfosQOFOpnFxHCPsVkPuLe4+W3aQmH2eAVO/T+bIzykHmo6j/WgucFiyUhUfyVYh7A8r
	nz3po1/7mT0WuARn6nSDF4zzvhaUt9RG8M8A/xX3ekPuZWNykJnICW/VNDU4NqHeNmC4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: skip holes in physical address space when setting up frametable
Message-Id: <E1wLJS2-0025hI-0j@xenbits.xenproject.org>
Date: Fri, 08 May 2026 11:33:02 +0000

commit 10d417b8b62efa5093707c1dfe9bd48e0abeb331
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed May 6 10:41:37 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 8 08:52:27 2026 +0200

    xen/arm: skip holes in physical address space when setting up frametable
    
    Refactor setup_frametable_mappings() into init_frametable(), modeled
    after x86's implementation. Instead of mapping one contiguous frametable
    covering ram_start to ram_end (including holes), iterate the
    pdx_group_valid bitmap to allocate and map frametable memory only for
    valid PDX groups, skipping gaps in the physical address space.
    
    This reduces memory consumption on systems with sparse RAM layouts by
    not allocating frametable entries for non-existent memory regions.
    
    The chunk allocator rounds chunk_size up to PAGE_SIZE only, rather than
    to a larger mapping granularity, to avoid overshooting past chunk
    boundaries into subsequent gaps or valid regions. This rounding has no
    impact for in-loop chunks given that chunk size is a multiple of 14MB
    on Arm64 and 2MB on Arm32. The rounding matters only for the last
    out-of-loop chunk.
    
    Physical allocations prefer 32MB alignment so that map_pages_to_xen()
    can use the contiguous bit for larger TLB entries where virtual
    alignment also permits. Fall back to 2MB if the chunk is smaller than
    32MB.
    
    Add a comment explaining why we don't use pdx_to_page(). For complete
    discussion see [1].
    
    As ram_end is no longer needed by init_frametable(), drop the now-dead
    ram_end/bank_end computation from setup_mm().
    
    Update the MPU implementation to match the new init_frametable()
    signature. Since MPU has no virtual address translation (ma == va),
    hole-skipping is not possible and the frametable remains a single
    contiguous allocation.
    
    [1] https://lore.kernel.org/xen-devel/20260430125103.401811-1-michal.orzel@amd.com/T/#m803025eb6720a1425443dd0f8e72be93ef02f344
    
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Tested-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/arm32/mmu/mm.c   |   3 +-
 xen/arch/arm/include/asm/mm.h |   4 +-
 xen/arch/arm/mm.c             |   5 +--
 xen/arch/arm/mmu/mm.c         | 100 ++++++++++++++++++++++++++++++++----------
 xen/arch/arm/mpu/mm.c         |  23 +++++-----
 5 files changed, 93 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/arm32/mmu/mm.c b/xen/arch/arm/arm32/mmu/mm.c
index 5e4766ddcf..0b595baa11 100644
--- a/xen/arch/arm/arm32/mmu/mm.c
+++ b/xen/arch/arm/arm32/mmu/mm.c
@@ -178,8 +178,7 @@ void __init setup_mm(void)
 
     setup_directmap_mappings(mfn_x(directmap_mfn_start), xenheap_pages);
 
-    /* Frame table covers all of RAM region, including holes */
-    setup_frametable_mappings(ram_start, ram_end);
+    init_frametable(ram_start);
 
     /*
      * The allocators may need to use map_domain_page() (such as for
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 72a6928624..2eb8465aa9 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -196,8 +196,8 @@ extern void *early_fdt_map(paddr_t fdt_paddr);
 extern void remove_early_mappings(void);
 /* Prepare the memory subystem to bring-up the given secondary CPU */
 extern int prepare_secondary_mm(int cpu);
-/* Map a frame table to cover physical addresses ps through pe */
-extern void setup_frametable_mappings(paddr_t ps, paddr_t pe);
+/* Map a frame table */
+void init_frametable(paddr_t ram_start);
 /* Helper function to setup memory management */
 void setup_mm_helper(void);
 /* map a physical range in virtual memory */
diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 6eddbcf912..65aea71c43 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -33,7 +33,6 @@ void __init setup_mm(void)
 {
     const struct membanks *banks = bootinfo_get_mem();
     paddr_t ram_start = INVALID_PADDR;
-    paddr_t ram_end = 0;
     paddr_t ram_size = 0;
     unsigned int i;
 
@@ -42,11 +41,9 @@ void __init setup_mm(void)
     for ( i = 0; i < banks->nr_banks; i++ )
     {
         const struct membank *bank = &banks->bank[i];
-        paddr_t bank_end = bank->start + bank->size;
 
         ram_size = ram_size + bank->size;
         ram_start = min(ram_start, bank->start);
-        ram_end = max(ram_end, bank_end);
     }
 
     total_pages = ram_size >> PAGE_SHIFT;
@@ -62,7 +59,7 @@ void __init setup_mm(void)
 
     setup_mm_helper();
 
-    setup_frametable_mappings(ram_start, ram_end);
+    init_frametable(ram_start);
 
     init_staticmem_pages();
     init_sharedmem_pages();
diff --git a/xen/arch/arm/mmu/mm.c b/xen/arch/arm/mmu/mm.c
index 6604f3bf4e..10c7dfb1ef 100644
--- a/xen/arch/arm/mmu/mm.c
+++ b/xen/arch/arm/mmu/mm.c
@@ -1,23 +1,61 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <xen/bitops.h>
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/macros.h>
 #include <xen/mm.h>
 #include <xen/mm-frame.h>
 #include <xen/pdx.h>
+#include <xen/sizes.h>
 #include <xen/string.h>
 
-/* Map a frame table to cover physical addresses ps through pe */
-void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
+static void __init init_frametable_chunk(unsigned long pdx_s,
+                                         unsigned long pdx_e)
 {
-    unsigned long nr_pdxs = mfn_to_pdx(mfn_add(maddr_to_mfn(pe), -1)) -
-                            mfn_to_pdx(maddr_to_mfn(ps)) + 1;
-    unsigned long frametable_size = nr_pdxs * sizeof(struct page_info);
-    mfn_t base_mfn;
-    const unsigned long mapping_size = frametable_size < MB(32) ? MB(2)
-                                                                : MB(32);
+    unsigned long nr_pdxs = pdx_e - pdx_s;
+    unsigned long chunk_size = nr_pdxs * sizeof(struct page_info);
+    unsigned long pfn_align;
+    struct page_info *pg;
     int rc;
+    mfn_t base_mfn;
+
+    /*
+     * In-loop chunks span whole PDX groups, which are always page-size
+     * aligned. The last chunk ending at max_pdx may not be, so round up.
+     */
+    chunk_size = ROUNDUP(chunk_size, PAGE_SIZE);
+
+    /*
+     * Try to align the allocation to the contiguous mapping size so that
+     * map_pages_to_xen() can use the contiguous bit.
+     */
+    pfn_align = ((chunk_size >= MB(32)) ? MB(32) : MB(2)) >> PAGE_SHIFT;
+
+    base_mfn = alloc_boot_pages(chunk_size >> PAGE_SHIFT, pfn_align);
+
+    /*
+     * Resolve the frametable VA via mfn_to_page(pdx_to_mfn(...)) rather
+     * than pdx_to_page() because the generic pdx_to_page() does not subtract
+     * frametable_base_pdx. There's more work to be done to make it generic, so
+     * for now route through mfn_to_page(), which on Arm applies the
+     * frametable_base_pdx offset and yields the correct VA.
+     */
+    pg = mfn_to_page(pdx_to_mfn(pdx_s));
+    rc = map_pages_to_xen((unsigned long)pg, base_mfn,
+                          chunk_size >> PAGE_SHIFT,
+                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
+    if ( rc )
+        panic("Unable to setup the frametable mappings\n");
+
+    memset(pg, 0, nr_pdxs * sizeof(struct page_info));
+    memset(pg + nr_pdxs, -1,
+           chunk_size - nr_pdxs * sizeof(struct page_info));
+}
+
+void __init init_frametable(paddr_t ram_start)
+{
+    unsigned int sidx, nidx, max_idx;
 
     /*
      * The size of paddr_t should be sufficient for the complete range of
@@ -26,24 +64,40 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     BUILD_BUG_ON((sizeof(paddr_t) * BITS_PER_BYTE) < PADDR_BITS);
     BUILD_BUG_ON(sizeof(struct page_info) != PAGE_INFO_SIZE);
 
-    if ( frametable_size > FRAMETABLE_SIZE )
-        panic("The frametable cannot cover the physical region %#"PRIpaddr" - %#"PRIpaddr"\n",
-              ps, pe);
+    /* init_frametable_chunk() allocation alignment assumes 4KB granule */
+    BUILD_BUG_ON(PAGE_SIZE != SZ_4K);
 
-    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ps));
-    /* Round up to 2M or 32M boundary, as appropriate. */
-    frametable_size = ROUNDUP(frametable_size, mapping_size);
-    base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 32<<(20-12));
+    /* In-loop chunks must produce page-aligned frametable regions */
+    BUILD_BUG_ON((PDX_GROUP_COUNT * sizeof(struct page_info)) % PAGE_SIZE);
 
-    rc = map_pages_to_xen(FRAMETABLE_VIRT_START, base_mfn,
-                          frametable_size >> PAGE_SHIFT,
-                          PAGE_HYPERVISOR_RW | _PAGE_BLOCK);
-    if ( rc )
-        panic("Unable to setup the frametable mappings.\n");
+    max_idx = DIV_ROUND_UP(max_pdx, PDX_GROUP_COUNT);
+    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ram_start));
+
+    /*
+     * Mapping address in init_frametable_chunk must be page-aligned
+     * for map_pages_to_xen(). Aligning to PDX_GROUP_COUNT guarantees this
+     * because PDX_GROUP_COUNT * sizeof(page_info) is always a multiple of
+     * PAGE_SIZE by construction.
+     */
+    frametable_base_pdx = ROUNDDOWN(frametable_base_pdx, PDX_GROUP_COUNT);
+
+    if ( (max_pdx - frametable_base_pdx) > FRAMETABLE_NR )
+        panic("Frametable too small\n");
+
+    for ( sidx = (frametable_base_pdx / PDX_GROUP_COUNT); ; sidx = nidx )
+    {
+        unsigned int eidx;
+
+        eidx = find_next_zero_bit(pdx_group_valid, max_idx, sidx);
+        nidx = find_next_bit(pdx_group_valid, max_idx, eidx);
+
+        if ( nidx >= max_idx )
+            break;
+
+        init_frametable_chunk(sidx * PDX_GROUP_COUNT, eidx * PDX_GROUP_COUNT);
+    }
 
-    memset(&frame_table[0], 0, nr_pdxs * sizeof(struct page_info));
-    memset(&frame_table[nr_pdxs], -1,
-           frametable_size - (nr_pdxs * sizeof(struct page_info)));
+    init_frametable_chunk(sidx * PDX_GROUP_COUNT, max_pdx);
 }
 
 /*
diff --git a/xen/arch/arm/mpu/mm.c b/xen/arch/arm/mpu/mm.c
index aff88bd3a9..9c568831c1 100644
--- a/xen/arch/arm/mpu/mm.c
+++ b/xen/arch/arm/mpu/mm.c
@@ -186,16 +186,15 @@ static int is_mm_attr_match(pr_t *region, unsigned int attributes)
     return 0;
 }
 
-/* Map a frame table to cover physical addresses ps through pe */
-void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
+/*
+ * Allocate a contiguous frame table covering ram_start through max_pdx.
+ * Unlike the MMU version, MPU cannot skip holes because there is no virtual
+ * address translation (ma == va).
+ */
+void __init init_frametable(paddr_t ram_start)
 {
+    unsigned long nr_pdxs, frametable_size;
     mfn_t base_mfn;
-    paddr_t aligned_ps = ROUNDUP(ps, PAGE_SIZE);
-    paddr_t aligned_pe = ROUNDDOWN(pe, PAGE_SIZE);
-
-    unsigned long nr_pdxs = mfn_to_pdx(mfn_add(maddr_to_mfn(aligned_pe), -1)) -
-                            mfn_to_pdx(maddr_to_mfn(aligned_ps)) + 1;
-    unsigned long frametable_size = nr_pdxs * sizeof(struct page_info);
 
     /*
      * The size of paddr_t should be sufficient for the complete range of
@@ -204,11 +203,13 @@ void __init setup_frametable_mappings(paddr_t ps, paddr_t pe)
     BUILD_BUG_ON((sizeof(paddr_t) * BITS_PER_BYTE) < PADDR_BITS);
     BUILD_BUG_ON(sizeof(struct page_info) != PAGE_INFO_SIZE);
 
+    frametable_base_pdx = mfn_to_pdx(maddr_to_mfn(ram_start));
+    nr_pdxs = max_pdx - frametable_base_pdx;
+    frametable_size = nr_pdxs * sizeof(struct page_info);
+
     if ( frametable_size > FRAMETABLE_SIZE )
-        panic("The frametable cannot cover the physical region %#"PRIpaddr" - %#"PRIpaddr"\n",
-              ps, pe);
+        panic("Frametable too small\n");
 
-    frametable_base_pdx = paddr_to_pdx(aligned_ps);
     frametable_size = ROUNDUP(frametable_size, PAGE_SIZE);
 
     base_mfn = alloc_boot_pages(frametable_size >> PAGE_SHIFT, 1);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 11 13:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 11 May 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306170.1578235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMQPX-0005Us-Df; Mon, 11 May 2026 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306170.1578235; Mon, 11 May 2026 13:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMQPX-0005Uk-As; Mon, 11 May 2026 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1306170;
 Mon, 11 May 2026 13:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMQPW-0005Ue-CI
 for xen-changelog@lists.xenproject.org; Mon, 11 May 2026 13:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMQPW-0005aG-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 11 May 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMQPW-000D7Y-0g
 for xen-changelog@lists.xenproject.org;
 Mon, 11 May 2026 13:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Kyt7W8B8z+BDLaiYamK7QzSuEvZP1jBs+VvSkQpmC4E=; b=OielHiT/bNP9RMA5NTYhAQVQAL
	ML681bVC+rmSR2C0Z4yFkmHMGERHao4OfjCnyj7GtEhfwgQshDkyfjYreLK6H0/P1ZwApcaXTixif
	ZNLm1biP427rsBaKb6fpq7iHoDkiXTKG6JYi20DFbryUTLSm85GMgOPFSw3pJWsvJxWU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] time: drop dead code from gmtime()
Message-Id: <E1wMQPW-000D7Y-0g@xenbits.xenproject.org>
Date: Mon, 11 May 2026 13:11:02 +0000

commit 4909438bc397b8d31d6b48a44498ca1ec242324b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 13:19:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 11 13:19:31 2026 +0200

    time: drop dead code from gmtime()
    
    "days", as calculated, can't be negative. Drop the respective loop and
    change its type. Similarly "rem" can't be negative and doesn't require
    more than 32 bits. Change its type, too.
    
    As a consequence, the tm_wday calculation also can't yield negative
    values, so the respective conditional can be dropped as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/time.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/xen/common/time.c b/xen/common/time.c
index c873b5731b..04a65f00b3 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -45,7 +45,8 @@ static DEFINE_SPINLOCK(wc_lock);
 struct tm gmtime(unsigned long t)
 {
     struct tm tbuf;
-    long days, rem;
+    unsigned long days;
+    unsigned int rem;
     int y;
     const unsigned short int *ip;
 
@@ -70,18 +71,11 @@ struct tm gmtime(unsigned long t)
     tbuf.tm_sec = rem % 60;
     /* January 1, 1970 was a Thursday.  */
     tbuf.tm_wday = (4 + days) % 7;
-    if ( tbuf.tm_wday < 0 )
-        tbuf.tm_wday += 7;
     while ( days >= (rem = __isleap(y) ? 366 : 365) )
     {
         ++y;
         days -= rem;
     }
-    while ( days < 0 )
-    {
-        --y;
-        days += __isleap(y) ? 366 : 365;
-    }
     tbuf.tm_year = y - 1900;
     tbuf.tm_yday = days;
     /* SAF-14-safe use boolean as an array index */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 01:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 01:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306511.1578410 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMcAF-0000KT-8f; Tue, 12 May 2026 01:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306511.1578410; Tue, 12 May 2026 01:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMcAF-0000KK-5S; Tue, 12 May 2026 01:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1306511;
 Tue, 12 May 2026 01:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMcAE-0000KE-B9
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 01:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMcAE-001QhD-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 01:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMcAE-000vGd-0V
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 01:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gIW4EPkqPWNQcIefKD1RCAGlOV1W/GUW4tnQNyGmDh4=; b=lcjvCWTd2ktu1Uem2cyzrbLRTU
	hQpmT9nz40KB6fAga7UP3E56/7YxbbeUkrDcwQAryPwJe0lryysAAWCtY99DC3q5YOahhEj1H9y80
	bUDVydjAPPLeaPXXKikB0YONif7ad5aXWGHvLe8L1hRIwiNsQ1YeOir7VeijkTXCLOT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: re-work Xen artifacts collection
Message-Id: <E1wMcAE-000vGd-0V@xenbits.xenproject.org>
Date: Tue, 12 May 2026 01:44:02 +0000

commit 87dd994a3e98f86c3e29505c4b11b14b8eb7af1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 15:04:32 2026 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon May 11 18:40:53 2026 -0700

    CI: re-work Xen artifacts collection
    
    There's no need to do this separately from three places. Once moved to the
    bottom of the script, the need for this to be a function also disappears.
    
    While there also make sure xen-syms is collected. This is rather more
    useful for analysis of possible problems than its stripped counterpart.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 359ee18444..2df154398d 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -44,30 +44,15 @@ cp xen/.config xen-config
 # Directory for the artefacts to be dumped into
 mkdir -p binaries
 
-collect_xen_artefacts()
-{
-    local f
-
-    for f in xen/xen xen/xen.efi; do
-        if [[ -f $f ]]; then
-            cp $f binaries/
-        fi
-    done
-}
-
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
     xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
 
     # Preserve artefacts
-    collect_xen_artefacts
     cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
 elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Xen-only build
     make -j$(nproc) xen
-
-    # Preserve artefacts
-    collect_xen_artefacts
 else
     # Full build.  Figure out our ./configure options
     cfgargs=("--prefix=/usr")
@@ -108,9 +93,16 @@ else
     make -j$(nproc) dist
 
     # Preserve artefacts
-    # Note: Some smoke tests depending on finding binaries/xen on a full build
-    # even though dist/ contains everything, while some containers don't even
-    # build Xen
     (cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
-    collect_xen_artefacts
 fi
+
+# Preserve Xen artefacts
+#
+# Note: Some smoke tests depend on finding binaries/xen on a full build
+# even though dist/ contains everything, while some containers don't even
+# build Xen.
+for f in xen/xen xen/xen-syms xen/xen.efi; do
+    if [[ -f $f ]]; then
+        cp $f binaries/
+    fi
+done
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 01:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 01:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306513.1578414 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMcAP-0000MU-9Y; Tue, 12 May 2026 01:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306513.1578414; Tue, 12 May 2026 01:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMcAP-0000MM-6s; Tue, 12 May 2026 01:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1306513;
 Tue, 12 May 2026 01:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMcAO-0000MG-Df
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 01:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMcAO-001QhH-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 01:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMcAO-000vHv-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 01:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=TQzqRC5Xk6PN5JG9EixJps0z9yhhfEM01r4izV/LHzw=; b=k0jYSQXcTejk+6KIxv0e5ev4sO
	uyqnmrEzIaUNBDiExHSsVxmB4J0rWffjWkGhHGfutl1WdOrGahpPR49Uxp9oyvQzqA/JyEszLM0fE
	d6VwBtRR9LrQlONO+OCGdFDWWm17ZVVn2ZM/XDWerulkc89gKHFLIi9zTeNVGpiy+vOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: collect certain intermediate files as artifacts
Message-Id: <E1wMcAO-000vHv-0v@xenbits.xenproject.org>
Date: Tue, 12 May 2026 01:44:12 +0000

commit 2121f895036809fccaa5181aed25a16b13adf647
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 15:05:02 2026 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon May 11 18:40:58 2026 -0700

    CI: collect certain intermediate files as artifacts
    
    When one of the linking passes fails, additional intermediate files are
    still in place. Having them available for analysis of the underlying
    problem can be pretty helpful. Collect some into a new intermediates/
    directory. (Nothing new will be collected if linking succeeds.)
    
    As the script is run with -e passed to bash, defer exit if the main
    "make" (or substituent script thereof) failed. This way more artifacts
    are collected, potentially making it easier to analyze the failure.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml |  1 +
 automation/scripts/build        | 25 ++++++++++++++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index f058957291..7f5b5938e8 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -6,6 +6,7 @@
   artifacts:
     paths:
       - binaries/
+      - intermediates/
       - xen-config
       - xen-cppcheck.txt
       - '*.log'
diff --git a/automation/scripts/build b/automation/scripts/build
index 2df154398d..bdaab11c37 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -37,22 +37,24 @@ else
     make -j$(nproc) -C xen olddefconfig
 fi
 
-# Save the config file before building because build failure causes the script
-# to exit early -- bash is invoked with -e.
+# Save the config file before building, just in case.
 cp xen/.config xen-config
 
-# Directory for the artefacts to be dumped into
-mkdir -p binaries
+# Directories for artefacts to be dumped into
+mkdir -p binaries intermediates
+
+# Script exit status, to be overridden by the main make's status below.
+ret=0
 
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
-    xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
+    xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc) || ret=$?
 
     # Preserve artefacts
     cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
 elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Xen-only build
-    make -j$(nproc) xen
+    make -j$(nproc) xen || ret=$?
 else
     # Full build.  Figure out our ./configure options
     cfgargs=("--prefix=/usr")
@@ -90,7 +92,7 @@ else
     fi
 
     ./configure "${cfgargs[@]}"
-    make -j$(nproc) dist
+    make -j$(nproc) dist || ret=$?
 
     # Preserve artefacts
     (cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
@@ -106,3 +108,12 @@ for f in xen/xen xen/xen-syms xen/xen.efi; do
         cp $f binaries/
     fi
 done
+
+# Preserve Xen intermediate files.  Some may be there only upon build failure.
+for f in xen/.xen-syms.* xen/.xen.efi.*; do
+    if [[ -f $f ]]; then
+        cp $f intermediates/
+    fi
+done
+
+exit $ret
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 02:55:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 02:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306543.1578418 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdGx-0000s5-2L; Tue, 12 May 2026 02:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306543.1578418; Tue, 12 May 2026 02:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdGw-0000rx-Vs; Tue, 12 May 2026 02:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1306543;
 Tue, 12 May 2026 02:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMdGv-0000rr-Km
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 02:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdGv-001SPj-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdGv-000ys3-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hhVGNiKTF+K+reh4BL9wN/y4EuVoPnf7I9ctuSU3yag=; b=SELbC3PKE68nVf+APuUaOgHdpf
	8m4HMU/aSKODe+WXbYOYmVR1dDwkoCiIexMdFghoWEoJjEj2IvZICRRBH6KRXwu9lxaYDs0iM5sTH
	yzd7aiOtoDKpVEp7uiUD6JVpp38lDS/hzghq0ZkwaLqul/7PFBG2eo5Nx+3ZDjx1Ng2o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] time: drop dead code from gmtime()
Message-Id: <E1wMdGv-000ys3-1i@xenbits.xenproject.org>
Date: Tue, 12 May 2026 02:55:01 +0000

commit 4909438bc397b8d31d6b48a44498ca1ec242324b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 13:19:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 11 13:19:31 2026 +0200

    time: drop dead code from gmtime()
    
    "days", as calculated, can't be negative. Drop the respective loop and
    change its type. Similarly "rem" can't be negative and doesn't require
    more than 32 bits. Change its type, too.
    
    As a consequence, the tm_wday calculation also can't yield negative
    values, so the respective conditional can be dropped as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/time.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/xen/common/time.c b/xen/common/time.c
index c873b5731b..04a65f00b3 100644
--- a/xen/common/time.c
+++ b/xen/common/time.c
@@ -45,7 +45,8 @@ static DEFINE_SPINLOCK(wc_lock);
 struct tm gmtime(unsigned long t)
 {
     struct tm tbuf;
-    long days, rem;
+    unsigned long days;
+    unsigned int rem;
     int y;
     const unsigned short int *ip;
 
@@ -70,18 +71,11 @@ struct tm gmtime(unsigned long t)
     tbuf.tm_sec = rem % 60;
     /* January 1, 1970 was a Thursday.  */
     tbuf.tm_wday = (4 + days) % 7;
-    if ( tbuf.tm_wday < 0 )
-        tbuf.tm_wday += 7;
     while ( days >= (rem = __isleap(y) ? 366 : 365) )
     {
         ++y;
         days -= rem;
     }
-    while ( days < 0 )
-    {
-        --y;
-        days += __isleap(y) ? 366 : 365;
-    }
     tbuf.tm_year = y - 1900;
     tbuf.tm_yday = days;
     /* SAF-14-safe use boolean as an array index */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 02:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 02:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306544.1578422 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdH7-0000td-3O; Tue, 12 May 2026 02:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306544.1578422; Tue, 12 May 2026 02:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdH7-0000tV-0v; Tue, 12 May 2026 02:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1306544;
 Tue, 12 May 2026 02:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMdH5-0000tF-ND
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 02:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdH6-001SRx-02
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdH5-000ysR-24
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/lSW9CBXGZi516urgrBt5sCHv9VFImTWasQIkbKlmeA=; b=nmnBblX7oKLhSaFys9hP9ehQrW
	64ltMSq3pO30ksJ43xXBSFnLRx153kK4GyYBrHOoK/kDwS5HO8fiGXVMpHs/lGbAqgUev5NPEN/nO
	eCwI2VrCYRg2DDv9TXB6EJcTI7wdFLMdDWj/TpsSdeGugwhtSycGk8W4dJVwJmtXpDYY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: re-work Xen artifacts collection
Message-Id: <E1wMdH5-000ysR-24@xenbits.xenproject.org>
Date: Tue, 12 May 2026 02:55:11 +0000

commit 87dd994a3e98f86c3e29505c4b11b14b8eb7af1a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 15:04:32 2026 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon May 11 18:40:53 2026 -0700

    CI: re-work Xen artifacts collection
    
    There's no need to do this separately from three places. Once moved to the
    bottom of the script, the need for this to be a function also disappears.
    
    While there also make sure xen-syms is collected. This is rather more
    useful for analysis of possible problems than its stripped counterpart.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 359ee18444..2df154398d 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -44,30 +44,15 @@ cp xen/.config xen-config
 # Directory for the artefacts to be dumped into
 mkdir -p binaries
 
-collect_xen_artefacts()
-{
-    local f
-
-    for f in xen/xen xen/xen.efi; do
-        if [[ -f $f ]]; then
-            cp $f binaries/
-        fi
-    done
-}
-
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
     xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
 
     # Preserve artefacts
-    collect_xen_artefacts
     cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
 elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Xen-only build
     make -j$(nproc) xen
-
-    # Preserve artefacts
-    collect_xen_artefacts
 else
     # Full build.  Figure out our ./configure options
     cfgargs=("--prefix=/usr")
@@ -108,9 +93,16 @@ else
     make -j$(nproc) dist
 
     # Preserve artefacts
-    # Note: Some smoke tests depending on finding binaries/xen on a full build
-    # even though dist/ contains everything, while some containers don't even
-    # build Xen
     (cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
-    collect_xen_artefacts
 fi
+
+# Preserve Xen artefacts
+#
+# Note: Some smoke tests depend on finding binaries/xen on a full build
+# even though dist/ contains everything, while some containers don't even
+# build Xen.
+for f in xen/xen xen/xen-syms xen/xen.efi; do
+    if [[ -f $f ]]; then
+        cp $f binaries/
+    fi
+done
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 02:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 02:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306545.1578425 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdHH-0000vw-4o; Tue, 12 May 2026 02:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306545.1578425; Tue, 12 May 2026 02:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMdHH-0000vo-2E; Tue, 12 May 2026 02:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1306545;
 Tue, 12 May 2026 02:55:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMdHF-0000vh-QF
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 02:55:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdHG-001SS4-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMdHF-000yut-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 02:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yEHBuOrOLdrfj41L94NA9mmXCuty+w5uX7c7XzcGenY=; b=sgztSSLGtHVDlR8U39yTU3uuOk
	urE0PjBMjs9hbUQySxLrmKknSSwgPxAuz73tYHBAzj2QmkNYTuofSaKCYaJgiAMHOG6FzXcKEcLGF
	1ZXjX1fOcMWrla1eylrS/mHmQ81JX/KGrDqZtEp6Ca9tObgJHu2PuSXNktY+qqOrLl2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: collect certain intermediate files as artifacts
Message-Id: <E1wMdHF-000yut-2N@xenbits.xenproject.org>
Date: Tue, 12 May 2026 02:55:21 +0000

commit 2121f895036809fccaa5181aed25a16b13adf647
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 11 15:05:02 2026 +0200
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Mon May 11 18:40:58 2026 -0700

    CI: collect certain intermediate files as artifacts
    
    When one of the linking passes fails, additional intermediate files are
    still in place. Having them available for analysis of the underlying
    problem can be pretty helpful. Collect some into a new intermediates/
    directory. (Nothing new will be collected if linking succeeds.)
    
    As the script is run with -e passed to bash, defer exit if the main
    "make" (or substituent script thereof) failed. This way more artifacts
    are collected, potentially making it easier to analyze the failure.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml |  1 +
 automation/scripts/build        | 25 ++++++++++++++++++-------
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index f058957291..7f5b5938e8 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -6,6 +6,7 @@
   artifacts:
     paths:
       - binaries/
+      - intermediates/
       - xen-config
       - xen-cppcheck.txt
       - '*.log'
diff --git a/automation/scripts/build b/automation/scripts/build
index 2df154398d..bdaab11c37 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -37,22 +37,24 @@ else
     make -j$(nproc) -C xen olddefconfig
 fi
 
-# Save the config file before building because build failure causes the script
-# to exit early -- bash is invoked with -e.
+# Save the config file before building, just in case.
 cp xen/.config xen-config
 
-# Directory for the artefacts to be dumped into
-mkdir -p binaries
+# Directories for artefacts to be dumped into
+mkdir -p binaries intermediates
+
+# Script exit status, to be overridden by the main make's status below.
+ret=0
 
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
-    xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
+    xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc) || ret=$?
 
     # Preserve artefacts
     cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
 elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Xen-only build
-    make -j$(nproc) xen
+    make -j$(nproc) xen || ret=$?
 else
     # Full build.  Figure out our ./configure options
     cfgargs=("--prefix=/usr")
@@ -90,7 +92,7 @@ else
     fi
 
     ./configure "${cfgargs[@]}"
-    make -j$(nproc) dist
+    make -j$(nproc) dist || ret=$?
 
     # Preserve artefacts
     (cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
@@ -106,3 +108,12 @@ for f in xen/xen xen/xen-syms xen/xen.efi; do
         cp $f binaries/
     fi
 done
+
+# Preserve Xen intermediate files.  Some may be there only upon build failure.
+for f in xen/.xen-syms.* xen/.xen.efi.*; do
+    if [[ -f $f ]]; then
+        cp $f intermediates/
+    fi
+done
+
+exit $ret
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 09:44:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 09:44:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306674.1578502 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMjem-00060x-5G; Tue, 12 May 2026 09:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306674.1578502; Tue, 12 May 2026 09:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMjem-00060p-25; Tue, 12 May 2026 09:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1306674;
 Tue, 12 May 2026 09:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMjek-00060j-F3
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 09:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMjek-001aik-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 09:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMjek-001Kke-0v
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 09:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Af9eCpz1O2feQddcxb0oosRHxqo7IAWwZUvBOu+Eqhw=; b=kDZi1ROAm2rFISodIPl0VvvRJ4
	UhjyOEZqmg++uhESzQ3AOr8yGphut8+ITJfdus1Vwn6fORPD5kkkZ0A0gwrQjAC+V48jR8jrg1JLv
	0KhKn6eH6GP+igMwoE1jbcgiuZw+DCVhirmPmkJhMfA9aRB2NiZ9GAfVfozbl2Tt2sxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MCE: adjust S3 resume handling
Message-Id: <E1wMjek-001Kke-0v@xenbits.xenproject.org>
Date: Tue, 12 May 2026 09:44:02 +0000

commit d9b3aceae1ebe859c3aa8413bf0d90cfa508be54
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 12 08:31:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 12 08:31:31 2026 +0200

    x86/MCE: adjust S3 resume handling
    
    The BSP resume path calls mcheck_init() with the address of
    boot_cpu_data, thus rendering comparisons against that pointer
    ineffective. The additional "bsp" boolean needs to be used (and
    propagated as necessary) instead.
    
    While touching intel_init_thermal(), constify its 1st parameter, which
    in turn requires touching intel_thermal_supported() as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.c   |  4 ++--
 xen/arch/x86/cpu/mcheck/mce_intel.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 25c29eb3d2..bf353c9a69 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -318,7 +318,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
         mcequirk_amd_apply(quirkflag);
 
     if ( cpu_has(c, X86_FEATURE_AMD_PPIN) &&
-         (c == &boot_cpu_data || ppin_msr) )
+         (bsp || ppin_msr) )
     {
         uint64_t val;
 
@@ -333,7 +333,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
 
         if ( !(val & PPIN_ENABLE) )
             ppin_msr = 0;
-        else if ( c == &boot_cpu_data )
+        else if ( bsp )
             ppin_msr = MSR_AMD_PPIN;
     }
 
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 839a0e5ba9..673e608376 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -87,7 +87,7 @@ static void cf_check intel_thermal_interrupt(void)
 }
 
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
-static bool intel_thermal_supported(struct cpuinfo_x86 *c)
+static bool intel_thermal_supported(const struct cpuinfo_x86 *c)
 {
     if ( !cpu_has_apic )
         return false;
@@ -110,7 +110,7 @@ static void __init mcheck_intel_therm_init(void)
 }
 
 /* P4/Xeon Thermal regulation detect and init */
-static void intel_init_thermal(struct cpuinfo_x86 *c)
+static void intel_init_thermal(const struct cpuinfo_x86 *c, bool bsp)
 {
     uint64_t msr_content;
     uint32_t val;
@@ -143,7 +143,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
     if ( (msr_content & (1ULL<<3))
          && (val & APIC_DM_MASK) == APIC_DM_SMI )
     {
-        if ( c == &boot_cpu_data )
+        if ( bsp )
             printk(KERN_DEBUG "Thermal monitoring handled by SMI\n");
         return; /* -EBUSY */
     }
@@ -154,7 +154,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
     /* check whether a vector already exists, temporarily masked? */
     if ( val & APIC_VECTOR_MASK )
     {
-        if ( c == &boot_cpu_data )
+        if ( bsp )
             printk(KERN_DEBUG "Thermal LVT vector (%#x) already installed\n",
                    val & APIC_VECTOR_MASK);
         return; /* -EBUSY */
@@ -852,7 +852,7 @@ static void intel_init_mce(bool bsp)
     mce_uhandler_num = ARRAY_SIZE(intel_mce_uhandlers);
 }
 
-static void intel_init_ppin(const struct cpuinfo_x86 *c)
+static void intel_init_ppin(const struct cpuinfo_x86 *c, bool bsp)
 {
     /*
      * Even if testing the presence of the MSR would be enough, we don't
@@ -881,7 +881,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
     case INTEL_SAPPHIRERAPIDS_X:
     case INTEL_EMERALDRAPIDS_X:
 
-        if ( (c != &boot_cpu_data && !ppin_msr) ||
+        if ( (!bsp && !ppin_msr) ||
              rdmsr_safe(MSR_PPIN_CTL, &val) )
             return;
 
@@ -894,7 +894,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
 
         if ( !(val & PPIN_ENABLE) )
             ppin_msr = 0;
-        else if ( c == &boot_cpu_data )
+        else if ( bsp )
             ppin_msr = MSR_PPIN;
 
         break;
@@ -995,9 +995,9 @@ enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp)
 
     intel_init_cmci(c);
 
-    intel_init_thermal(c);
+    intel_init_thermal(c, bsp);
 
-    intel_init_ppin(c);
+    intel_init_ppin(c, bsp);
 
     return mcheck_intel;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 09:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 09:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306675.1578506 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMjew-00063A-7X; Tue, 12 May 2026 09:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306675.1578506; Tue, 12 May 2026 09:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMjew-000632-4o; Tue, 12 May 2026 09:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1306675;
 Tue, 12 May 2026 09:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMjeu-00062r-H7
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 09:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMjeu-001aio-2e
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 09:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMjeu-001KmN-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 09:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gVzKpbOYVE/t9ZLnhwJ3PmnDB4qw1iJaalmVuLUoDc4=; b=zoGWUDaRDEvkW4jP0GY6TUTT1u
	mzRz+GKBqcZC+xJiV6Lp40wK2aCwMrk54jXmCIgbZRgdJk9l2PxXrhn0ei82ovGBgqI6Sx5nirz9z
	UsIZbqO5ALD9UCOzn91IA932LAD4wO5iuZx3nz5nOzdXbq4WLXVS8B/bgS2oDoeq8c0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: support LKGS
Message-Id: <E1wMjeu-001KmN-1U@xenbits.xenproject.org>
Date: Tue, 12 May 2026 09:44:12 +0000

commit a6b143e5a3a5733c12b71e7e2f5b6e9300e5920a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 12 08:31:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 12 08:31:59 2026 +0200

    x86emul: support LKGS
    
    Provide support for this insn, which is a prereq to FRED. CPUID-wise,
    while its and FRED's enumerators were already introduced, their dependency
    still needs adding.
    
    While adding a testcase, also add a SWAPGS one. In order to not affect
    the behavior of pre-existing tests, install write_{segment,msr} hooks
    only transiently.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/predicates.c        |  1 +
 tools/tests/x86_emulator/test_x86_emulator.c | 96 ++++++++++++++++++++++++++++
 tools/tests/x86_emulator/x86-emulate.c       |  1 +
 xen/arch/x86/x86_emulate/decode.c            |  6 +-
 xen/arch/x86/x86_emulate/private.h           |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.c       | 33 +++++++++-
 xen/tools/gen-cpuid.py                       |  3 +-
 7 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 019c2ced8a..8ff2653895 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -326,6 +326,7 @@ static const struct {
     { { 0x00, 0x18 }, { 2, 2 }, T, R }, /* ltr */
     { { 0x00, 0x20 }, { 2, 2 }, T, R }, /* verr */
     { { 0x00, 0x28 }, { 2, 2 }, T, R }, /* verw */
+    { { 0x00, 0x30 }, { 0, 2 }, T, R, pfx_f2 }, /* lkgs */
     { { 0x01, 0x00 }, { 2, 2 }, F, W }, /* sgdt */
     { { 0x01, 0x08 }, { 2, 2 }, F, W }, /* sidt */
     { { 0x01, 0x10 }, { 2, 2 }, F, R }, /* lgdt */
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 20929b80c6..af29b106f1 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -673,6 +673,10 @@ static int blk(
     return x86_emul_blk((void *)offset, p_data, bytes, eflags, state, ctxt);
 }
 
+#ifdef __x86_64__
+static unsigned long gs_base, gs_base_shadow;
+#endif
+
 static int read_segment(
     enum x86_segment seg,
     struct segment_register *reg,
@@ -682,9 +686,26 @@ static int read_segment(
         return X86EMUL_UNHANDLEABLE;
     memset(reg, 0, sizeof(*reg));
     reg->p = 1;
+
     return X86EMUL_OKAY;
 }
 
+#ifdef __x86_64__
+static int write_segment(
+    enum x86_segment seg,
+    const struct segment_register *reg,
+    struct x86_emulate_ctxt *ctxt)
+{
+    if ( !is_x86_user_segment(seg) )
+        return X86EMUL_UNHANDLEABLE;
+
+    if ( seg == x86_seg_gs )
+        gs_base = reg->base;
+
+    return X86EMUL_OKAY;
+}
+#endif
+
 static int read_msr(
     unsigned int reg,
     uint64_t *val,
@@ -696,6 +717,20 @@ static int read_msr(
         *val = ctxt->addr_size > 32 ? EFER_LME | EFER_LMA : 0;
         return X86EMUL_OKAY;
 
+#ifdef __x86_64__
+    case MSR_GS_BASE:
+        if ( ctxt->addr_size < 64 )
+            break;
+        *val = gs_base;
+        return X86EMUL_OKAY;
+
+    case MSR_SHADOW_GS_BASE:
+        if ( ctxt->addr_size < 64 )
+            break;
+        *val = gs_base_shadow;
+        return X86EMUL_OKAY;
+#endif
+
     case MSR_TSC_AUX:
 #define TSC_AUX_VALUE 0xCACACACA
         *val = TSC_AUX_VALUE;
@@ -705,6 +740,32 @@ static int read_msr(
     return X86EMUL_UNHANDLEABLE;
 }
 
+#ifdef __x86_64__
+static int write_msr(
+    unsigned int reg,
+    uint64_t val,
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
+{
+    switch ( reg )
+    {
+    case MSR_GS_BASE:
+        if ( ctxt->addr_size < 64 || !is_canonical_address(val) )
+            break;
+        gs_base = val;
+        return X86EMUL_OKAY;
+
+    case MSR_SHADOW_GS_BASE:
+        if ( ctxt->addr_size < 64 || !is_canonical_address(val) )
+            break;
+        gs_base_shadow = val;
+        return X86EMUL_OKAY;
+    }
+
+    return X86EMUL_UNHANDLEABLE;
+}
+#endif
+
 #define INVPCID_ADDR 0x12345678
 #define INVPCID_PCID 0x123
 
@@ -1339,6 +1400,41 @@ int main(int argc, char **argv)
         printf("%u bytes read - ", bytes_read);
         goto fail;
     }
+    printf("okay\n");
+
+    emulops.write_segment = write_segment;
+    emulops.write_msr     = write_msr;
+
+    printf("%-40s", "Testing swapgs...");
+    instr[0] = 0x0f; instr[1] = 0x01; instr[2] = 0xf8;
+    regs.eip = (unsigned long)&instr[0];
+    gs_base = 0xffffeeeecccc8888UL;
+    gs_base_shadow = 0x0000111122224444UL;
+    rc = x86_emulate(&ctxt, &emulops);
+    if ( (rc != X86EMUL_OKAY) ||
+         (regs.eip != (unsigned long)&instr[3]) ||
+         (gs_base != 0x0000111122224444UL) ||
+         (gs_base_shadow != 0xffffeeeecccc8888UL) )
+        goto fail;
+    printf("okay\n");
+
+    printf("%-40s", "Testing lkgs 2(%rdx)...");
+    instr[0] = 0xf2; instr[1] = 0x0f; instr[2] = 0x00; instr[3] = 0x72; instr[4] = 0x02;
+    regs.eip = (unsigned long)&instr[0];
+    regs.edx = (unsigned long)res;
+    res[0]   = 0x00004444;
+    res[1]   = 0x8888cccc;
+    i = cpu_policy.extd.nscb; cpu_policy.extd.nscb = true; /* for AMD */
+    rc = x86_emulate(&ctxt, &emulops);
+    if ( (rc != X86EMUL_OKAY) ||
+         (regs.eip != (unsigned long)&instr[5]) ||
+         (gs_base != 0x0000111122224444UL) ||
+         gs_base_shadow )
+        goto fail;
+
+    cpu_policy.extd.nscb = i;
+    emulops.write_segment = NULL;
+    emulops.write_msr     = NULL;
 #endif
     printf("okay\n");
 
diff --git a/tools/tests/x86_emulator/x86-emulate.c b/tools/tests/x86_emulator/x86-emulate.c
index 379e206dd3..b22c7d6add 100644
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -85,6 +85,7 @@ bool emul_test_init(void)
     cpu_policy.feat.invpcid = true;
     cpu_policy.feat.adx = true;
     cpu_policy.feat.rdpid = true;
+    cpu_policy.feat.lkgs = true;
     cpu_policy.feat.wrmsrns = true;
     cpu_policy.extd.clzero = true;
 
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 346777422b..2c13356c4d 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -745,8 +745,12 @@ decode_twobyte(struct x86_emulate_state *s,
         case 0:
             s->desc |= DstMem | SrcImplicit | Mov;
             break;
+        case 6:
+            if ( !(s->modrm_reg & 1) && mode_64bit() )
+            {
         case 2: case 4:
-            s->desc |= SrcMem16;
+                s->desc |= SrcMem16;
+            }
             break;
         }
         break;
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index dfdc263f9c..6c96f72327 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -609,6 +609,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #define vcpu_has_avx_vnni()    (ctxt->cpuid->feat.avx_vnni)
 #define vcpu_has_avx512_bf16() (ctxt->cpuid->feat.avx512_bf16)
 #define vcpu_has_cmpccxadd()   (ctxt->cpuid->feat.cmpccxadd)
+#define vcpu_has_lkgs()        (ctxt->cpuid->feat.lkgs)
 #define vcpu_has_wrmsrns()     (ctxt->cpuid->feat.wrmsrns)
 #define vcpu_has_avx_ifma()    (ctxt->cpuid->feat.avx_ifma)
 #define vcpu_has_avx_vnni_int8() (ctxt->cpuid->feat.avx_vnni_int8)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e58735ee95..364e6c092d 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2899,8 +2899,37 @@ x86_emulate(
                 break;
             }
             break;
-        default:
-            generate_exception_if(true, X86_EXC_UD);
+
+        case 6: /* lkgs */
+            generate_exception_if((modrm_reg & 1) || vex.pfx != vex_f2,
+                                  X86_EXC_UD);
+            generate_exception_if(!mode_64bit() || !mode_ring0(), X86_EXC_UD);
+            vcpu_must_have(lkgs);
+            fail_if(!ops->read_msr || !ops->write_segment || !ops->write_msr);
+            if ( (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+                                     ctxt)) != X86EMUL_OKAY ||
+                 (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
+                                     ctxt)) != X86EMUL_OKAY )
+                goto done;
+            dst.orig_val = sreg.base; /* Preserve current GS Base. */
+            if ( (rc = protmode_load_seg(x86_seg_gs, src.val, false, &sreg,
+                                         ctxt, ops)) != X86EMUL_OKAY )
+                goto done;
+            /* Write new base into SHADOW_GS, zero extended from GDT/LDT. */
+            if ( (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
+                                      ctxt, false)) != X86EMUL_OKAY ||
+                 (sreg.base = dst.orig_val, /* Reinstate original GS Base. */
+                  (rc = ops->write_segment(x86_seg_gs, &sreg,
+                                           ctxt)) != X86EMUL_OKAY) )
+            {
+                /*
+                 * In real hardware, access to the registers cannot fail.  It
+                 * is an error in Xen if the writes fail.
+                 */
+                ASSERT_UNREACHABLE();
+                x86_emul_reset_event(ctxt);
+                generate_exception(X86_EXC_DF, 0);
+            }
             break;
         }
         break;
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index b751dbab27..a30c68b40a 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -282,7 +282,8 @@ def crunch_numbers(state):
         # superpages, PCID and PKU are only available in 4 level paging.
         # NO_LMSL indicates the absense of Long Mode Segment Limits, which
         # have been dropped in hardware.
-        LM: [CX16, PCID, LAHF_LM, PAGE1GB, PKU, NO_LMSL, AMX_TILE, CMPCCXADD],
+        LM: [CX16, PCID, LAHF_LM, PAGE1GB, PKU, NO_LMSL, AMX_TILE, CMPCCXADD,
+             LKGS],
 
         # AMD K6-2+ and K6-III processors shipped with 3DNow+, beyond the
         # standard 3DNow in the earlier K6 processors.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 10:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 10:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306698.1578519 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMkap-0005ws-Ij; Tue, 12 May 2026 10:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306698.1578519; Tue, 12 May 2026 10:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMkap-0005wj-Fp; Tue, 12 May 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1306698;
 Tue, 12 May 2026 10:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMkan-0005wd-Mm
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 10:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMkan-001btA-35
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 10:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMkan-001NlP-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 10:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mp7FRUYtEFXJWs57eR70s4vw4CoxHBqSzoxptKUHuJE=; b=Of5Oputmnq3vTaNsTxNz5ubdw5
	I+uaotxzItPTzDEgmG3yjf7vUv5M+nzRyTBip+VVYfrzVfAfr0+jY6ziA5YqVwibstKf9aircE1a5
	tESs5oPebDCrHCe+gHHCvPBpLHPPorBu5IFKNJm/v0vO1Zn1mF5eGkwyfhNCxAH/rXmQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MCE: adjust S3 resume handling
Message-Id: <E1wMkan-001NlP-1k@xenbits.xenproject.org>
Date: Tue, 12 May 2026 10:44:01 +0000

commit d9b3aceae1ebe859c3aa8413bf0d90cfa508be54
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 12 08:31:31 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 12 08:31:31 2026 +0200

    x86/MCE: adjust S3 resume handling
    
    The BSP resume path calls mcheck_init() with the address of
    boot_cpu_data, thus rendering comparisons against that pointer
    ineffective. The additional "bsp" boolean needs to be used (and
    propagated as necessary) instead.
    
    While touching intel_init_thermal(), constify its 1st parameter, which
    in turn requires touching intel_thermal_supported() as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.c   |  4 ++--
 xen/arch/x86/cpu/mcheck/mce_intel.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 25c29eb3d2..bf353c9a69 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -318,7 +318,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
         mcequirk_amd_apply(quirkflag);
 
     if ( cpu_has(c, X86_FEATURE_AMD_PPIN) &&
-         (c == &boot_cpu_data || ppin_msr) )
+         (bsp || ppin_msr) )
     {
         uint64_t val;
 
@@ -333,7 +333,7 @@ amd_mcheck_init(const struct cpuinfo_x86 *c, bool bsp)
 
         if ( !(val & PPIN_ENABLE) )
             ppin_msr = 0;
-        else if ( c == &boot_cpu_data )
+        else if ( bsp )
             ppin_msr = MSR_AMD_PPIN;
     }
 
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 839a0e5ba9..673e608376 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -87,7 +87,7 @@ static void cf_check intel_thermal_interrupt(void)
 }
 
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
-static bool intel_thermal_supported(struct cpuinfo_x86 *c)
+static bool intel_thermal_supported(const struct cpuinfo_x86 *c)
 {
     if ( !cpu_has_apic )
         return false;
@@ -110,7 +110,7 @@ static void __init mcheck_intel_therm_init(void)
 }
 
 /* P4/Xeon Thermal regulation detect and init */
-static void intel_init_thermal(struct cpuinfo_x86 *c)
+static void intel_init_thermal(const struct cpuinfo_x86 *c, bool bsp)
 {
     uint64_t msr_content;
     uint32_t val;
@@ -143,7 +143,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
     if ( (msr_content & (1ULL<<3))
          && (val & APIC_DM_MASK) == APIC_DM_SMI )
     {
-        if ( c == &boot_cpu_data )
+        if ( bsp )
             printk(KERN_DEBUG "Thermal monitoring handled by SMI\n");
         return; /* -EBUSY */
     }
@@ -154,7 +154,7 @@ static void intel_init_thermal(struct cpuinfo_x86 *c)
     /* check whether a vector already exists, temporarily masked? */
     if ( val & APIC_VECTOR_MASK )
     {
-        if ( c == &boot_cpu_data )
+        if ( bsp )
             printk(KERN_DEBUG "Thermal LVT vector (%#x) already installed\n",
                    val & APIC_VECTOR_MASK);
         return; /* -EBUSY */
@@ -852,7 +852,7 @@ static void intel_init_mce(bool bsp)
     mce_uhandler_num = ARRAY_SIZE(intel_mce_uhandlers);
 }
 
-static void intel_init_ppin(const struct cpuinfo_x86 *c)
+static void intel_init_ppin(const struct cpuinfo_x86 *c, bool bsp)
 {
     /*
      * Even if testing the presence of the MSR would be enough, we don't
@@ -881,7 +881,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
     case INTEL_SAPPHIRERAPIDS_X:
     case INTEL_EMERALDRAPIDS_X:
 
-        if ( (c != &boot_cpu_data && !ppin_msr) ||
+        if ( (!bsp && !ppin_msr) ||
              rdmsr_safe(MSR_PPIN_CTL, &val) )
             return;
 
@@ -894,7 +894,7 @@ static void intel_init_ppin(const struct cpuinfo_x86 *c)
 
         if ( !(val & PPIN_ENABLE) )
             ppin_msr = 0;
-        else if ( c == &boot_cpu_data )
+        else if ( bsp )
             ppin_msr = MSR_PPIN;
 
         break;
@@ -995,9 +995,9 @@ enum mcheck_type intel_mcheck_init(struct cpuinfo_x86 *c, bool bsp)
 
     intel_init_cmci(c);
 
-    intel_init_thermal(c);
+    intel_init_thermal(c, bsp);
 
-    intel_init_ppin(c);
+    intel_init_ppin(c, bsp);
 
     return mcheck_intel;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 10:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 10:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306699.1578525 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMkaz-0005ye-LB; Tue, 12 May 2026 10:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306699.1578525; Tue, 12 May 2026 10:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMkaz-0005yW-H8; Tue, 12 May 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1306699;
 Tue, 12 May 2026 10:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMkax-0005yK-RP
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 10:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMkay-001btR-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 10:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMkax-001Nmx-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 10:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IHBL3PODPXZeN4k92+/TwdVEup/xu6GrNqucOKpwpgY=; b=HTq1fm9OhC4EyOTEGox7wz/fwM
	wbTyCybAbs1OCtiByGU3mvzz/U2NHgmp+pchvPPhEExXSsvRiVJZGu4Gh3zcqvNdfkszSRZjkwggv
	Z5YO6Ac2npmZotPjmJ/p8DRzKpA351eybWl7lDlA7gGu2UbW6GpITVC0vN1bGXRY5zFk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: support LKGS
Message-Id: <E1wMkax-001Nmx-2I@xenbits.xenproject.org>
Date: Tue, 12 May 2026 10:44:11 +0000

commit a6b143e5a3a5733c12b71e7e2f5b6e9300e5920a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 12 08:31:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 12 08:31:59 2026 +0200

    x86emul: support LKGS
    
    Provide support for this insn, which is a prereq to FRED. CPUID-wise,
    while its and FRED's enumerators were already introduced, their dependency
    still needs adding.
    
    While adding a testcase, also add a SWAPGS one. In order to not affect
    the behavior of pre-existing tests, install write_{segment,msr} hooks
    only transiently.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/x86_emulator/predicates.c        |  1 +
 tools/tests/x86_emulator/test_x86_emulator.c | 96 ++++++++++++++++++++++++++++
 tools/tests/x86_emulator/x86-emulate.c       |  1 +
 xen/arch/x86/x86_emulate/decode.c            |  6 +-
 xen/arch/x86/x86_emulate/private.h           |  1 +
 xen/arch/x86/x86_emulate/x86_emulate.c       | 33 +++++++++-
 xen/tools/gen-cpuid.py                       |  3 +-
 7 files changed, 137 insertions(+), 4 deletions(-)

diff --git a/tools/tests/x86_emulator/predicates.c b/tools/tests/x86_emulator/predicates.c
index 019c2ced8a..8ff2653895 100644
--- a/tools/tests/x86_emulator/predicates.c
+++ b/tools/tests/x86_emulator/predicates.c
@@ -326,6 +326,7 @@ static const struct {
     { { 0x00, 0x18 }, { 2, 2 }, T, R }, /* ltr */
     { { 0x00, 0x20 }, { 2, 2 }, T, R }, /* verr */
     { { 0x00, 0x28 }, { 2, 2 }, T, R }, /* verw */
+    { { 0x00, 0x30 }, { 0, 2 }, T, R, pfx_f2 }, /* lkgs */
     { { 0x01, 0x00 }, { 2, 2 }, F, W }, /* sgdt */
     { { 0x01, 0x08 }, { 2, 2 }, F, W }, /* sidt */
     { { 0x01, 0x10 }, { 2, 2 }, F, R }, /* lgdt */
diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 20929b80c6..af29b106f1 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -673,6 +673,10 @@ static int blk(
     return x86_emul_blk((void *)offset, p_data, bytes, eflags, state, ctxt);
 }
 
+#ifdef __x86_64__
+static unsigned long gs_base, gs_base_shadow;
+#endif
+
 static int read_segment(
     enum x86_segment seg,
     struct segment_register *reg,
@@ -682,9 +686,26 @@ static int read_segment(
         return X86EMUL_UNHANDLEABLE;
     memset(reg, 0, sizeof(*reg));
     reg->p = 1;
+
     return X86EMUL_OKAY;
 }
 
+#ifdef __x86_64__
+static int write_segment(
+    enum x86_segment seg,
+    const struct segment_register *reg,
+    struct x86_emulate_ctxt *ctxt)
+{
+    if ( !is_x86_user_segment(seg) )
+        return X86EMUL_UNHANDLEABLE;
+
+    if ( seg == x86_seg_gs )
+        gs_base = reg->base;
+
+    return X86EMUL_OKAY;
+}
+#endif
+
 static int read_msr(
     unsigned int reg,
     uint64_t *val,
@@ -696,6 +717,20 @@ static int read_msr(
         *val = ctxt->addr_size > 32 ? EFER_LME | EFER_LMA : 0;
         return X86EMUL_OKAY;
 
+#ifdef __x86_64__
+    case MSR_GS_BASE:
+        if ( ctxt->addr_size < 64 )
+            break;
+        *val = gs_base;
+        return X86EMUL_OKAY;
+
+    case MSR_SHADOW_GS_BASE:
+        if ( ctxt->addr_size < 64 )
+            break;
+        *val = gs_base_shadow;
+        return X86EMUL_OKAY;
+#endif
+
     case MSR_TSC_AUX:
 #define TSC_AUX_VALUE 0xCACACACA
         *val = TSC_AUX_VALUE;
@@ -705,6 +740,32 @@ static int read_msr(
     return X86EMUL_UNHANDLEABLE;
 }
 
+#ifdef __x86_64__
+static int write_msr(
+    unsigned int reg,
+    uint64_t val,
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
+{
+    switch ( reg )
+    {
+    case MSR_GS_BASE:
+        if ( ctxt->addr_size < 64 || !is_canonical_address(val) )
+            break;
+        gs_base = val;
+        return X86EMUL_OKAY;
+
+    case MSR_SHADOW_GS_BASE:
+        if ( ctxt->addr_size < 64 || !is_canonical_address(val) )
+            break;
+        gs_base_shadow = val;
+        return X86EMUL_OKAY;
+    }
+
+    return X86EMUL_UNHANDLEABLE;
+}
+#endif
+
 #define INVPCID_ADDR 0x12345678
 #define INVPCID_PCID 0x123
 
@@ -1339,6 +1400,41 @@ int main(int argc, char **argv)
         printf("%u bytes read - ", bytes_read);
         goto fail;
     }
+    printf("okay\n");
+
+    emulops.write_segment = write_segment;
+    emulops.write_msr     = write_msr;
+
+    printf("%-40s", "Testing swapgs...");
+    instr[0] = 0x0f; instr[1] = 0x01; instr[2] = 0xf8;
+    regs.eip = (unsigned long)&instr[0];
+    gs_base = 0xffffeeeecccc8888UL;
+    gs_base_shadow = 0x0000111122224444UL;
+    rc = x86_emulate(&ctxt, &emulops);
+    if ( (rc != X86EMUL_OKAY) ||
+         (regs.eip != (unsigned long)&instr[3]) ||
+         (gs_base != 0x0000111122224444UL) ||
+         (gs_base_shadow != 0xffffeeeecccc8888UL) )
+        goto fail;
+    printf("okay\n");
+
+    printf("%-40s", "Testing lkgs 2(%rdx)...");
+    instr[0] = 0xf2; instr[1] = 0x0f; instr[2] = 0x00; instr[3] = 0x72; instr[4] = 0x02;
+    regs.eip = (unsigned long)&instr[0];
+    regs.edx = (unsigned long)res;
+    res[0]   = 0x00004444;
+    res[1]   = 0x8888cccc;
+    i = cpu_policy.extd.nscb; cpu_policy.extd.nscb = true; /* for AMD */
+    rc = x86_emulate(&ctxt, &emulops);
+    if ( (rc != X86EMUL_OKAY) ||
+         (regs.eip != (unsigned long)&instr[5]) ||
+         (gs_base != 0x0000111122224444UL) ||
+         gs_base_shadow )
+        goto fail;
+
+    cpu_policy.extd.nscb = i;
+    emulops.write_segment = NULL;
+    emulops.write_msr     = NULL;
 #endif
     printf("okay\n");
 
diff --git a/tools/tests/x86_emulator/x86-emulate.c b/tools/tests/x86_emulator/x86-emulate.c
index 379e206dd3..b22c7d6add 100644
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -85,6 +85,7 @@ bool emul_test_init(void)
     cpu_policy.feat.invpcid = true;
     cpu_policy.feat.adx = true;
     cpu_policy.feat.rdpid = true;
+    cpu_policy.feat.lkgs = true;
     cpu_policy.feat.wrmsrns = true;
     cpu_policy.extd.clzero = true;
 
diff --git a/xen/arch/x86/x86_emulate/decode.c b/xen/arch/x86/x86_emulate/decode.c
index 346777422b..2c13356c4d 100644
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -745,8 +745,12 @@ decode_twobyte(struct x86_emulate_state *s,
         case 0:
             s->desc |= DstMem | SrcImplicit | Mov;
             break;
+        case 6:
+            if ( !(s->modrm_reg & 1) && mode_64bit() )
+            {
         case 2: case 4:
-            s->desc |= SrcMem16;
+                s->desc |= SrcMem16;
+            }
             break;
         }
         break;
diff --git a/xen/arch/x86/x86_emulate/private.h b/xen/arch/x86/x86_emulate/private.h
index dfdc263f9c..6c96f72327 100644
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -609,6 +609,7 @@ amd_like(const struct x86_emulate_ctxt *ctxt)
 #define vcpu_has_avx_vnni()    (ctxt->cpuid->feat.avx_vnni)
 #define vcpu_has_avx512_bf16() (ctxt->cpuid->feat.avx512_bf16)
 #define vcpu_has_cmpccxadd()   (ctxt->cpuid->feat.cmpccxadd)
+#define vcpu_has_lkgs()        (ctxt->cpuid->feat.lkgs)
 #define vcpu_has_wrmsrns()     (ctxt->cpuid->feat.wrmsrns)
 #define vcpu_has_avx_ifma()    (ctxt->cpuid->feat.avx_ifma)
 #define vcpu_has_avx_vnni_int8() (ctxt->cpuid->feat.avx_vnni_int8)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index e58735ee95..364e6c092d 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2899,8 +2899,37 @@ x86_emulate(
                 break;
             }
             break;
-        default:
-            generate_exception_if(true, X86_EXC_UD);
+
+        case 6: /* lkgs */
+            generate_exception_if((modrm_reg & 1) || vex.pfx != vex_f2,
+                                  X86_EXC_UD);
+            generate_exception_if(!mode_64bit() || !mode_ring0(), X86_EXC_UD);
+            vcpu_must_have(lkgs);
+            fail_if(!ops->read_msr || !ops->write_segment || !ops->write_msr);
+            if ( (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
+                                     ctxt)) != X86EMUL_OKAY ||
+                 (rc = ops->read_msr(MSR_GS_BASE, &sreg.base,
+                                     ctxt)) != X86EMUL_OKAY )
+                goto done;
+            dst.orig_val = sreg.base; /* Preserve current GS Base. */
+            if ( (rc = protmode_load_seg(x86_seg_gs, src.val, false, &sreg,
+                                         ctxt, ops)) != X86EMUL_OKAY )
+                goto done;
+            /* Write new base into SHADOW_GS, zero extended from GDT/LDT. */
+            if ( (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
+                                      ctxt, false)) != X86EMUL_OKAY ||
+                 (sreg.base = dst.orig_val, /* Reinstate original GS Base. */
+                  (rc = ops->write_segment(x86_seg_gs, &sreg,
+                                           ctxt)) != X86EMUL_OKAY) )
+            {
+                /*
+                 * In real hardware, access to the registers cannot fail.  It
+                 * is an error in Xen if the writes fail.
+                 */
+                ASSERT_UNREACHABLE();
+                x86_emul_reset_event(ctxt);
+                generate_exception(X86_EXC_DF, 0);
+            }
             break;
         }
         break;
diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index b751dbab27..a30c68b40a 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -282,7 +282,8 @@ def crunch_numbers(state):
         # superpages, PCID and PKU are only available in 4 level paging.
         # NO_LMSL indicates the absense of Long Mode Segment Limits, which
         # have been dropped in hardware.
-        LM: [CX16, PCID, LAHF_LM, PAGE1GB, PKU, NO_LMSL, AMX_TILE, CMPCCXADD],
+        LM: [CX16, PCID, LAHF_LM, PAGE1GB, PKU, NO_LMSL, AMX_TILE, CMPCCXADD,
+             LKGS],
 
         # AMD K6-2+ and K6-III processors shipped with 3DNow+, beyond the
         # standard 3DNow in the earlier K6 processors.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 14:44:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 14:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1306830.1578581 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMoL5-0005Ht-6C; Tue, 12 May 2026 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1306830.1578581; Tue, 12 May 2026 14:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMoL5-0005Hk-3V; Tue, 12 May 2026 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1306830;
 Tue, 12 May 2026 14:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMoL4-0005He-B4
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 14:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMoL4-001gQy-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMoL4-001bKx-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 14:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EpANvxcUBje1vddJXaeqbkzp6YDHu7A9ISksUKHW74A=; b=jMgvqIXyKko8+aATBDHZhgO1W1
	SR+aVghfIVeV1G65c6OK64+kLlEgFevW5DbFn4C1N2M/j0CRVPIV/sxPACiL/uXTs5967URz4/cGE
	+O4Qv2QwcJkaRhC+N3VnaUy7zPQNsKhV6lFh+2ntEAUanqoZ+Mjds415JsFZIvXy3olA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: sci: Don't create a domain with unsatisfied user requests
Message-Id: <E1wMoL4-001bKx-0o@xenbits.xenproject.org>
Date: Tue, 12 May 2026 14:44:02 +0000

commit f7b9752dc88c626192d3115ace7585b20a025433
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue May 12 09:52:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue May 12 13:31:01 2026 +0200

    xen/arm: sci: Don't create a domain with unsatisfied user requests
    
    On Arm we stay on the safe side and refuse to create a domain on user
    requests (e.g. via xl.cfg, DT options) that cannot be satisfied due to
    the feature not being compiled in. SCI fall through the crack and does not
    adhere to that i.e. a user request for SCI type other than NONE when
    CONFIG_SCMI_SMC (and thus CONFIG_ARM_SCI) is not set would be silently
    ignored. Fix it by not allowing anything else other than NONE if the
    feature is not enabled.
    
    Fixes: 10e7473d6024 ("xen/arm: scmi-smc: passthrough SCMI SMC to domain, single agent")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/dom0less-build.c           | 11 +++++++++--
 xen/arch/arm/include/asm/firmware/sci.h |  5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 6f73c65e51..52cf788a45 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -273,8 +273,7 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
 
     d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
 
-    if ( !IS_ENABLED(CONFIG_ARM_SCI) ||
-         !dt_property_read_bool(node, "xen,sci_type") )
+    if ( !dt_property_read_bool(node, "xen,sci_type") )
         return 0;
 
     ret = dt_property_read_string(node, "xen,sci_type", &sci_type);
@@ -284,7 +283,15 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
     if ( !strcmp(sci_type, "none") )
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
     else if ( !strcmp(sci_type, "scmi_smc") )
+    {
+        if ( !IS_ENABLED(CONFIG_SCMI_SMC) )
+        {
+            printk(XENLOG_ERR "xen,sci_type=scmi_smc requested, but CONFIG_SCMI_SMC not set\n");
+            return -EINVAL;
+        }
+
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC;
+    }
     else
     {
         printk(XENLOG_ERR "xen,sci_type in not valid (%s) for domain %s\n",
diff --git a/xen/arch/arm/include/asm/firmware/sci.h b/xen/arch/arm/include/asm/firmware/sci.h
index 3500216bc2..485ce211c9 100644
--- a/xen/arch/arm/include/asm/firmware/sci.h
+++ b/xen/arch/arm/include/asm/firmware/sci.h
@@ -148,6 +148,8 @@ int sci_dt_finalize(struct domain *d, void *fdt);
 int sci_assign_dt_device(struct domain *d, struct dt_device_node *dev);
 #else
 
+#include <public/arch-arm.h>
+
 static inline bool sci_domain_is_enabled(struct domain *d)
 {
     return false;
@@ -162,6 +164,9 @@ static inline int sci_domain_init(struct domain *d,
 static inline int
 sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
 {
+    if ( config->arch.arm_sci_type != XEN_DOMCTL_CONFIG_ARM_SCI_NONE )
+        return -EINVAL;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307233.1578922 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMphH-00050P-4i; Tue, 12 May 2026 16:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307233.1578922; Tue, 12 May 2026 16:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMphH-00050F-20; Tue, 12 May 2026 16:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1307233;
 Tue, 12 May 2026 16:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMphF-000507-Vh
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMphG-001iWm-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMphF-001gcq-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GGEfOp2Ay/P33pptV1hFh34IK2LI1vTLUHRVr6SVFY4=; b=44O82w8mDn8n/Q/fsBUXHuMJX8
	pW8ulmPC4XRlLsRqqWZKWLsu5s+dqgeedsRk5Gims7edjUXQFi7+F6QO08cjOJsqgqvn4dU33j3w8
	MM3SZedY4WWubk1vU4w3HY9X/5NtNnleIWOEhstXmg3u/zexW4+pX1qYp/fi5tQQco2M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/dom0: enable pf-fixup by default for PVH dom0
Message-Id: <E1wMphF-001gcq-2q@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:11:01 +0000

commit fa8687810af66ec37940ecc93e2ef4e9a47889a2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 8 10:55:09 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue May 12 18:02:44 2026 +0200

    x86/dom0: enable pf-fixup by default for PVH dom0
    
    A non-trivial amount of issues related to PVH dom0 are fixed by enabling
    the `pf-fixup` command line option, and no issues have been reported as a
    result of its usage.  Enable the option by default to make PVH dom0 more
    robust in its default configuration.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md                      | 2 ++
 docs/misc/xen-command-line.pandoc | 8 ++++++--
 xen/arch/x86/hvm/emulate.c        | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce46020dbd..25f5a192ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - On x86:
+   - Enable pf-fixup option by default for PVH dom0.
 
 ### Added
  - Support for per-domain Xenstore quota in C xenstored (includes
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 6c77129732..2da90548d8 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -849,7 +849,7 @@ Controls for how dom0 is constructed on x86 systems.
     If using this option is necessary to fix an issue, please report a bug.
 
 *   The `pf-fixup` boolean is only applicable when using a PVH dom0 and
-    defaults to false.
+    defaults to true.
 
     When running dom0 in PVH mode the dom0 kernel has no way to map MMIO
     regions into its physical memory map, such mode relies on Xen dom0 builder
@@ -857,10 +857,14 @@ Controls for how dom0 is constructed on x86 systems.
     access.  However Xen doesn't have a complete picture of the host memory
     map, due to not being able to process ACPI dynamic tables.
 
-    The `pf-fixup` option allows Xen to attempt to add missing MMIO regions
+    The `pf-fixup` option causes Xen to attempt to add missing MMIO regions
     to the dom0 physical memory map in response to page-faults generated by
     dom0 trying to access unpopulated entries in the memory map.
 
+    Users having to disable the feature to boot in PVH dom0 mode should report
+    it to the xen-devel mailing list, together with Xen and dom0 output with the
+    option enabled.
+
 Enables features on dom0 on Arm systems.
 
 *   The `sve` integer parameter enables Arm SVE usage for Dom0 and sets the
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index f3aae158e9..bb1bb03ac4 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -165,7 +165,7 @@ void hvmemul_cancel(struct vcpu *v)
     hvmemul_cache_disable(v);
 }
 
-bool __ro_after_init opt_dom0_pf_fixup;
+bool __ro_after_init opt_dom0_pf_fixup = true;
 static int hwdom_fixup_p2m(paddr_t addr)
 {
     unsigned long gfn = paddr_to_pfn(addr);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307235.1578926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMphR-00052g-5t; Tue, 12 May 2026 16:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307235.1578926; Tue, 12 May 2026 16:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMphR-00052Y-3K; Tue, 12 May 2026 16:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1307235;
 Tue, 12 May 2026 16:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMphQ-00052H-13
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMphQ-001iWv-12
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMphP-001ge4-38
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0XRJrJySKTeaHkxOXuSL6FleZFKi4Ass6ekcjTnuXVg=; b=nohmWTZDOsvnxy18DOXGezZSGu
	N0sBWpsBI5KMsrT7jz/4nJMoRbeoJyTGbF64ijRrzt1XzIrIzT5vYEmJ+pCChMT3tIEJ82J44EhGV
	Sp2YgEOtSlNom1ukHI+FmKS7zDc9eOmAqNCEd29nwft7owq3TyU+hiBoB/LVQFDoX3ew=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMphP-001ge4-38@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:11:11 +0000

commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 12 17:05:30 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 712734a6e7..70783c9a0a 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1015,11 +1015,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.family == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.family == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.family == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307249.1578939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMprv-0007HG-4F; Tue, 12 May 2026 16:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307249.1578939; Tue, 12 May 2026 16:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMprv-0007H8-1e; Tue, 12 May 2026 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1307249;
 Tue, 12 May 2026 16:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMpru-0007H2-An
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpru-001iih-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpru-001hPx-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XXDn9tk0pxjptVsVFnr01eIBiXkmBF7rlCNXuofyUf4=; b=YUYONbUfZFfwKvNsn+KeU1syR+
	5Nk6CZhkM6GUMgyA79U6rVeZ2NNFqRsZ5aNYk2bC5wEfRwNKyHDOZKifeNz/T6NemOxZB+Foz3XiS
	v/9TxG/1bEfzF0EvUkuQINb0PZ4Q10E9jWUqvIwpatZ9uz5cjlsVyay0BMGofTxG5P44=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMpru-001hPx-0h@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:02 +0000

commit 8af05b49176dc22db12d6743a927899561314ec8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:30:12 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 1bb0766ebf..b5bf2b732e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1116,11 +1116,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307250.1578943 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMps6-0007Kh-5c; Tue, 12 May 2026 16:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307250.1578943; Tue, 12 May 2026 16:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMps6-0007KZ-33; Tue, 12 May 2026 16:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1307250;
 Tue, 12 May 2026 16:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMps4-0007KI-Hm
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMps4-001iiq-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMps4-001hRB-1Y
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KRFntS7fgSJf3Ye/+Tbhb939ou8HVHI0q6803prCBGI=; b=YD6pm1nFG89oCu42qF7TEEPSMd
	m7Nx7xLIHO/mZfX4DWOOoNR1bo20Xk8tvbIZyEWGERcZA0KKe2EbVQJKeHevQ3FERkB0VuF7CCqj+
	vW4kJ/VEJDK2bgl+kI70rfvDkCIgzaeMskjg1fCIvO+ub8sYERVV3vEH8+3UAtuH5Tt0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMps4-001hRB-1Y@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:12 +0000

commit 3ed365e3f9ee281a8b34d65b6f5a4bf04bc871e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:31:11 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 43883e04db..3914032269 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1050,11 +1050,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307251.1578947 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsG-0007Mk-70; Tue, 12 May 2026 16:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307251.1578947; Tue, 12 May 2026 16:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsG-0007Mb-4L; Tue, 12 May 2026 16:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1307251;
 Tue, 12 May 2026 16:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMpsE-0007MV-QD
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsF-001iiw-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsE-001hS4-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+srcKVGIIXkzYxcjQXMkC2sZpklCykF+r9nJMQYQYIk=; b=4VjQCv6Da00jXh3GoX4hfMLhjs
	moisj7IelhHzSp3r8DfNMB5W5zGIXyAFrtfmVUlPF2eG1MKt/WVDEuST7x4qW30C5VHYx8Rp6DTw6
	tmGRB1iI5PQ30W9ueVjdMnCAoJcHAspgEgJa8mrpzgrtwcPqekYeLd8scOmfYlJLDsSA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMpsE-001hS4-2P@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:22 +0000

commit 8056c4032f2956041b0c0a3d31a12b474caa61de
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:32:52 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 12876de1df..3416fb1a93 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1050,11 +1050,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307252.1578950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsQ-0007Oj-8L; Tue, 12 May 2026 16:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307252.1578950; Tue, 12 May 2026 16:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsQ-0007Ob-5k; Tue, 12 May 2026 16:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1307252;
 Tue, 12 May 2026 16:22:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMpsP-0007OT-23
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsP-001ij0-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsP-001hSt-00
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3Tu1S7gz9/eXctyMLZ4l26AhwwbW+i+sJfsvUxT+hoI=; b=HGydwhEfunR6G1zQRi0Aaal9VO
	YsFbjM50llB9g45zPMuB3nvnfIY4XxMXZMl9PtxvZpCDr9VW7fZJAKAvALLiEYcGn+Q1w2RlGFloq
	kxUvbZFBDO2n7bT3OiwQF/a/MjlaOl/w8aUShEtP4AlYClUgKWKaISblzdd2OgknNPoQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMpsP-001hSt-00@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:33 +0000

commit 581a10f8846768920e7f809e1c51cf2a9f13cbce
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:32:57 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 43cd3ae9ba..89284b740b 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1049,11 +1049,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307253.1578955 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsb-0007Qm-9s; Tue, 12 May 2026 16:22:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307253.1578955; Tue, 12 May 2026 16:22:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsb-0007Qe-76; Tue, 12 May 2026 16:22:45 +0000
Received: by outflank-mailman (input) for mailman id 1307253;
 Tue, 12 May 2026 16:22:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMpsZ-0007QY-Fm
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsZ-001ij6-2W
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsZ-001hUL-1M
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jLh+8tSjwA0akvnzGHI5/XdHdfQcfSxncShuBqUdjas=; b=1YaiTNlcL+YSBqLX7SCGfIudc2
	Ln23+2vr1Bq/FS8vaGocPHLfeWeFk8FgKtv67TTF85H8w3Sbnp7njITPVUFKj8cx3F5Dp29o/iUzY
	cIrWDp6yZUxoAH2n8LGD5kvXGZgA5+M8W8EZrfUcsWd//kspCOe6qMJPTvm2wuTF+NtE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/spec-ctrl: Support for SRSO_U/S_NO and SRSO_MSR_FIX
Message-Id: <E1wMpsZ-001hUL-1M@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:43 +0000

commit 550d632f9b7e2599b8485246aa33d7d01cb95d47
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Mar 25 15:14:46 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 16:07:05 2026 +0100

    x86/spec-ctrl: Support for SRSO_U/S_NO and SRSO_MSR_FIX
    
    AMD have updated the SRSO whitepaper[1] with further information.  These
    features exist on AMD Zen5 CPUs and are necessary for Xen to use.
    
    The two features are in principle unrelated:
    
     * SRSO_U/S_NO is an enumeration saying that SRSO attacks can't cross the
       User(CPL3) / Supervisor(CPL<3) boundary.  i.e. Xen don't need to use
       IBPB-on-entry for PV64.  PV32 guests are explicitly unsupported for
       speculative issues, and excluded from consideration for simplicity.
    
     * SRSO_MSR_FIX is an enumeration identifying that the BP_SPEC_REDUCE bit is
       available in MSR_BP_CFG.  When set, SRSO attacks can't cross the host/guest
       boundary.  i.e. Xen don't need to use IBPB-on-entry for HVM.
    
    Extend ibpb_calculations() to account for these when calculating
    opt_ibpb_entry_{pv,hvm} defaults.  Add a `bp-spec-reduce=<bool>` option to
    control the use of BP_SPEC_REDUCE, with it active by default.
    
    Because MSR_BP_CFG is core-scoped with a race condition updating it, repurpose
    amd_check_erratum_1485() into amd_check_bp_cfg() and calculate all updates at
    once.
    
    Xen also needs to to advertise SRSO_U/S_NO to guests to allow the guest kernel
    to skip SRSO mitigations too:
    
     * This is trivial for HVM guests.  It is also is accurate for PV32 guests
       too, but we have already excluded them from consideration, and do so again
       here to simplify the policy logic.
    
     * As written, SRSO_U/S_NO does not help for the PV64 user->kernel boundary.
       However, after discussing with AMD, an implementation detail of having
       BP_SPEC_REDUCE active causes the PV64 user->kernel boundary to have the
       property described by SRSO_U/S_NO, so we can advertise SRSO_U/S_NO to
       guests when the BP_SPEC_REDUCE precondition is met.
    
    Finally, fix a typo in the SRSO_NO's comment.
    
    [1] https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a1746cd4434dd27ca2da8430dfb10edc76264bb3)
---
 docs/misc/xen-command-line.pandoc           |  9 +++++-
 xen/arch/x86/cpu-policy.c                   | 21 +++++++++++++
 xen/arch/x86/cpu/amd.c                      | 29 ++++++++++++++----
 xen/arch/x86/include/asm/msr-index.h        |  1 +
 xen/arch/x86/include/asm/spec_ctrl.h        |  1 +
 xen/arch/x86/spec_ctrl.c                    | 47 +++++++++++++++++++++++------
 xen/include/public/arch-x86/cpufeatureset.h |  4 ++-
 7 files changed, 94 insertions(+), 18 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4f2907eb67..ad80277326 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2330,7 +2330,7 @@ By default SSBD will be mitigated at runtime (i.e `ssbd=runtime`).
 >              {ibrs,ibpb,ssbd,psfd,
 >              eager-fpu,l1d-flush,branch-harden,srb-lock,
 >              unpriv-mmio,gds-mit,div-scrub,lock-harden,
->              bhi-dis-s}=<bool> ]`
+>              bhi-dis-s,bp-spec-reduce}=<bool> ]`
 
 Controls for speculative execution sidechannel mitigations.  By default, Xen
 will pick the most appropriate mitigations based on compiled in support,
@@ -2479,6 +2479,13 @@ boolean can be used to force or prevent Xen from using speculation barriers to
 protect lock critical regions.  This mitigation won't be engaged by default,
 and needs to be explicitly enabled on the command line.
 
+On hardware supporting SRSO_MSR_FIX, the `bp-spec-reduce=` option can be used
+to force or prevent Xen from using MSR_BP_CFG.BP_SPEC_REDUCE to mitigate the
+SRSO (Speculative Return Stack Overflow) vulnerability.  Xen will use
+bp-spec-reduce when available, as it is preferable to using `ibpb-entry=hvm`
+to mitigate SRSO for HVM guests, and because it is a prerequisite to advertise
+SRSO_U/S_NO to PV guests.
+
 ### sync_console
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f259c77435..9224c36d81 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -14,6 +14,7 @@
 #include <asm/msr-index.h>
 #include <asm/paging.h>
 #include <asm/setup.h>
+#include <asm/spec_ctrl.h>
 #include <asm/xstate.h>
 
 struct cpu_policy __ro_after_init     raw_cpu_policy;
@@ -650,6 +651,26 @@ static void __init calculate_pv_max_policy(void)
         __clear_bit(X86_FEATURE_IBRS, fs);
     }
 
+    /*
+     * SRSO_U/S_NO means that the CPU is not vulnerable to SRSO attacks across
+     * the User (CPL3) / Supervisor (CPL<3) boundary.
+     *
+     * PV32 guests are unsupported for speculative issues, and excluded from
+     * consideration for simplicity.
+     *
+     * The PV64 user/kernel boundary is CPL3 on both sides, so SRSO_U/S_NO
+     * won't convey the meaning that a PV kernel expects.
+     *
+     * After discussions with AMD, an implementation detail of having
+     * BP_SPEC_REDUCE active causes the PV64 user/kernel boundary to have a
+     * property compatible with the meaning of SRSO_U/S_NO.
+     *
+     * If BP_SPEC_REDUCE isn't active, remove SRSO_U/S_NO from the PV max
+     * policy, which will cause it to filter out of PV default too.
+     */
+    if ( !boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) || !opt_bp_spec_reduce )
+        __clear_bit(X86_FEATURE_SRSO_US_NO, fs);
+
     guest_common_max_feature_adjustments(fs);
     guest_common_feature_adjustments(fs);
 
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 3312d896dd..8c4e50de45 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1018,16 +1018,33 @@ static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_FP_CFG, val | new);
 }
 
-static void amd_check_erratum_1485(void)
+static void amd_check_bp_cfg(void)
 {
-	uint64_t val, chickenbit = (1 << 5);
+	uint64_t val, new = 0;
 
-	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x19 || !is_zen4_uarch())
+	/*
+	 * AMD Erratum #1485.  Set bit 5, as instructed.
+	 */
+	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+		new |= (1 << 5);
+
+	/*
+	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
+	 * default.  This lets us do two things:
+	 *
+	 * 1) Avoid IBPB-on-entry to mitigate SRSO attacks from HVM guests.
+	 * 2) Advertise SRSO_US_NO to PV guests.
+	 */
+	if (boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) && opt_bp_spec_reduce)
+		new |= BP_CFG_SPEC_REDUCE;
+
+	/* Avoid reading BP_CFG if we don't intend to change anything. */
+	if (!new)
 		return;
 
 	rdmsrl(MSR_AMD64_BP_CFG, val);
 
-	if (val & chickenbit)
+	if ((val & new) == new)
 		return;
 
 	/*
@@ -1036,7 +1053,7 @@ static void amd_check_erratum_1485(void)
 	 * same time before the chickenbit is set. It's benign because the
 	 * value being written is the same on both.
 	 */
-	wrmsrl(MSR_AMD64_BP_CFG, val | chickenbit);
+	wrmsrl(MSR_AMD64_BP_CFG, val | new);
 }
 
 static void cf_check init_amd(struct cpuinfo_x86 *c)
@@ -1314,7 +1331,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		disable_c1_ramping();
 
 	amd_check_zenbleed();
-	amd_check_erratum_1485();
+	amd_check_bp_cfg();
 
 	if (fam17_c6_disabled)
 		fam17_disable_c6(NULL);
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index bed0ab7b21..db3db08a54 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -391,6 +391,7 @@
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
 #define MSR_AMD64_BP_CFG		0xc001102e
+#define  BP_CFG_SPEC_REDUCE		(_AC(1, ULL) <<  4)
 #define MSR_AMD64_DE_CFG2		0xc00110e3
 
 #define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
diff --git a/xen/arch/x86/include/asm/spec_ctrl.h b/xen/arch/x86/include/asm/spec_ctrl.h
index 60844b755d..b7349ac898 100644
--- a/xen/arch/x86/include/asm/spec_ctrl.h
+++ b/xen/arch/x86/include/asm/spec_ctrl.h
@@ -102,6 +102,7 @@ extern int8_t opt_xpti_hwdom, opt_xpti_domu;
 
 extern bool cpu_has_bug_l1tf;
 extern int8_t opt_pv_l1tf_hwdom, opt_pv_l1tf_domu;
+extern bool opt_bp_spec_reduce;
 
 /*
  * The L1D address mask, which might be wider than reported in CPUID, and the
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 5005f0acdd..b71fe0a4ec 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -95,6 +95,7 @@ static bool __initdata opt_unpriv_mmio;
 static bool __ro_after_init opt_verw_mmio;
 static int8_t __initdata opt_gds_mit = -1;
 static int8_t __initdata opt_div_scrub = -1;
+bool __ro_after_init opt_bp_spec_reduce = true;
 
 static int __init cf_check parse_spec_ctrl(const char *s)
 {
@@ -155,6 +156,7 @@ static int __init cf_check parse_spec_ctrl(const char *s)
             opt_unpriv_mmio = false;
             opt_gds_mit = 0;
             opt_div_scrub = 0;
+            opt_bp_spec_reduce = false;
         }
         else if ( val > 0 )
             rc = -EINVAL;
@@ -375,6 +377,8 @@ static int __init cf_check parse_spec_ctrl(const char *s)
             opt_gds_mit = val;
         else if ( (val = parse_boolean("div-scrub", s, ss)) >= 0 )
             opt_div_scrub = val;
+        else if ( (val = parse_boolean("bp-spec-reduce", s, ss)) >= 0 )
+            opt_bp_spec_reduce = val;
         else
             rc = -EINVAL;
 
@@ -517,7 +521,7 @@ static void __init print_details(enum ind_thunk thunk)
      * Hardware read-only information, stating immunity to certain issues, or
      * suggestions of which mitigation to use.
      */
-    printk("  Hardware hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+    printk("  Hardware hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
            (caps & ARCH_CAPS_RDCL_NO)                        ? " RDCL_NO"        : "",
            (caps & ARCH_CAPS_EIBRS)                          ? " EIBRS"          : "",
            (caps & ARCH_CAPS_RSBA)                           ? " RSBA"           : "",
@@ -542,11 +546,12 @@ static void __init print_details(enum ind_thunk thunk)
            (e8b  & cpufeat_mask(X86_FEATURE_IBPB_RET))       ? " IBPB_RET"       : "",
            (e21a & cpufeat_mask(X86_FEATURE_IBPB_BRTYPE))    ? " IBPB_BRTYPE"    : "",
            (e21a & cpufeat_mask(X86_FEATURE_SRSO_NO))        ? " SRSO_NO"        : "",
+           (e21a & cpufeat_mask(X86_FEATURE_SRSO_US_NO))     ? " SRSO_US_NO"     : "",
            (e21c & cpufeat_mask(X86_FEATURE_TSA_SQ_NO))      ? " TSA_SQ_NO"      : "",
            (e21c & cpufeat_mask(X86_FEATURE_TSA_L1_NO))      ? " TSA_L1_NO"      : "");
 
     /* Hardware features which need driving to mitigate issues. */
-    printk("  Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+    printk("  Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
            (e8b  & cpufeat_mask(X86_FEATURE_IBPB)) ||
            (_7d0 & cpufeat_mask(X86_FEATURE_IBRSB))          ? " IBPB"           : "",
            (e8b  & cpufeat_mask(X86_FEATURE_IBRS)) ||
@@ -566,6 +571,7 @@ static void __init print_details(enum ind_thunk thunk)
            (caps & ARCH_CAPS_GDS_CTRL)                       ? " GDS_CTRL"       : "",
            (caps & ARCH_CAPS_RFDS_CLEAR)                     ? " RFDS_CLEAR"     : "",
            (e21a & cpufeat_mask(X86_FEATURE_SBPB))           ? " SBPB"           : "",
+           (e21a & cpufeat_mask(X86_FEATURE_SRSO_MSR_FIX))   ? " SRSO_MSR_FIX"   : "",
            (e21a & cpufeat_mask(X86_FEATURE_VERW_CLEAR))     ? " VERW_CLEAR"     : "");
 
     /* Compiled-in support which pertains to mitigations. */
@@ -1138,7 +1144,7 @@ static void __init div_calculations(bool hw_smt_enabled)
 
 static void __init ibpb_calculations(void)
 {
-    bool def_ibpb_entry = false;
+    bool def_ibpb_entry_pv = false, def_ibpb_entry_hvm = false;
 
     /* Check we have hardware IBPB support before using it... */
     if ( !boot_cpu_has(X86_FEATURE_IBRSB) && !boot_cpu_has(X86_FEATURE_IBPB) )
@@ -1163,22 +1169,43 @@ static void __init ibpb_calculations(void)
          * Confusion.  Mitigate with IBPB-on-entry.
          */
         if ( !boot_cpu_has(X86_FEATURE_BTC_NO) )
-            def_ibpb_entry = true;
+            def_ibpb_entry_pv = def_ibpb_entry_hvm = true;
 
         /*
-         * Further to BTC, Zen3/4 CPUs suffer from Speculative Return Stack
-         * Overflow in most configurations.  Mitigate with IBPB-on-entry if we
-         * have the microcode that makes this an effective option.
+         * In addition to BTC, Zen3 and later CPUs suffer from Speculative
+         * Return Stack Overflow in most configurations.  If we have microcode
+         * that makes IBPB-on-entry an effective mitigation, see about using
+         * it.
          */
         if ( !boot_cpu_has(X86_FEATURE_SRSO_NO) &&
              boot_cpu_has(X86_FEATURE_IBPB_BRTYPE) )
-            def_ibpb_entry = true;
+        {
+            /*
+             * SRSO_U/S_NO is a subset of SRSO_NO, identifying that SRSO isn't
+             * possible across the User (CPL3) / Supervisor (CPL<3) boundary.
+             *
+             * Ignoring PV32 (not security supported for speculative issues),
+             * this means we only need to use IBPB-on-entry for PV guests on
+             * hardware which doesn't enumerate SRSO_US_NO.
+             */
+            if ( !boot_cpu_has(X86_FEATURE_SRSO_US_NO) )
+                def_ibpb_entry_pv = true;
+
+            /*
+             * SRSO_MSR_FIX enumerates that we can use MSR_BP_CFG.SPEC_REDUCE
+             * to mitigate SRSO across the host/guest boundary.  We only need
+             * to use IBPB-on-entry for HVM guests if we haven't enabled this
+             * control.
+             */
+            if ( !boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) || !opt_bp_spec_reduce )
+                def_ibpb_entry_hvm = true;
+        }
     }
 
     if ( opt_ibpb_entry_pv == -1 )
-        opt_ibpb_entry_pv = IS_ENABLED(CONFIG_PV) && def_ibpb_entry;
+        opt_ibpb_entry_pv = IS_ENABLED(CONFIG_PV) && def_ibpb_entry_pv;
     if ( opt_ibpb_entry_hvm == -1 )
-        opt_ibpb_entry_hvm = IS_ENABLED(CONFIG_HVM) && def_ibpb_entry;
+        opt_ibpb_entry_hvm = IS_ENABLED(CONFIG_HVM) && def_ibpb_entry_hvm;
 
     if ( opt_ibpb_entry_pv )
     {
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 42db132b4c..12ca3efc5c 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -289,7 +289,9 @@ XEN_CPUFEATURE(NSCB,               11*32+ 6) /*A  Null Selector Clears Base (and
 XEN_CPUFEATURE(AUTO_IBRS,          11*32+ 8) /*   Automatic IBRS */
 XEN_CPUFEATURE(SBPB,               11*32+27) /*A  Selective Branch Predictor Barrier */
 XEN_CPUFEATURE(IBPB_BRTYPE,        11*32+28) /*A  IBPB flushes Branch Type predictions too */
-XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulenrable to Speculative Return Stack Overflow */
+XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulnerable to Speculative Return Stack Overflow */
+XEN_CPUFEATURE(SRSO_US_NO,         11*32+30) /*A! Hardware not vulnerable to SRSO across the User/Supervisor boundary */
+XEN_CPUFEATURE(SRSO_MSR_FIX,       11*32+31) /*   MSR_BP_CFG.BP_SPEC_REDUCE available */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1.ebx, word 12 */
 XEN_CPUFEATURE(INTEL_PPIN,         12*32+ 0) /*   Protected Processor Inventory Number */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:22:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:22:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307254.1578959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsl-0007TC-CL; Tue, 12 May 2026 16:22:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307254.1578959; Tue, 12 May 2026 16:22:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMpsl-0007T3-9o; Tue, 12 May 2026 16:22:55 +0000
Received: by outflank-mailman (input) for mailman id 1307254;
 Tue, 12 May 2026 16:22:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMpsj-0007Sv-Ij
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:22:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsj-001ijU-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMpsj-001hVe-1e
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:22:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ms2xlLo3Ls8QaJXzZLZggiqkfyVAyK6vMyORHW7t6qE=; b=CyMzB0jVNAWfZnIqrhibNxGEu4
	LzPFrtecVfYYXGNnT7CQkAoO1I2yRhNTx0HEQdi8vQXzVYOs1aonyb66zK6l0iaY0Hgf8MvabKKEF
	51s8Q2dQpdZozFCHeHXz33EUtS4FtNJVONuCOG4q1c1GnDH3/dn20NiJ7oq+fKDb8qx8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMpsj-001hVe-1e@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:22:53 +0000

commit caf651fdbcad3b3ae798172b46953ea1aa08a646
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 16:07:50 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c4e50de45..86268e8619 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1022,11 +1022,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307260.1578962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMqDD-00024u-Qu; Tue, 12 May 2026 16:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307260.1578962; Tue, 12 May 2026 16:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMqDD-00024m-OO; Tue, 12 May 2026 16:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1307260;
 Tue, 12 May 2026 16:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMqDC-00024f-IV
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMqDC-001j5L-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMqDC-001jEo-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eegrUbQuwxAgkKtEy8pQ771X8QWi/p6hIxy+nS14yAw=; b=GPtP8OdCFW3CsiTW2pGSpIgxoY
	efFQjX+VmVfQV5fgn7u47Wzo7zZeRFCiiDC9cq4IpdUBfHZZg49l9Hrt49t3t2i35mBVWHaMLbd6X
	IlCDXXTSJ/bEzWpX3Xdq+vXVqyUsCLgykZzzyD0KovtWrkzvS5W8AaruUYlTVcxUrYjQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/spec-ctrl: Support for SRSO_U/S_NO and SRSO_MSR_FIX
Message-Id: <E1wMqDC-001jEo-1K@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:44:02 +0000

commit 550d632f9b7e2599b8485246aa33d7d01cb95d47
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Mar 25 15:14:46 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 16:07:05 2026 +0100

    x86/spec-ctrl: Support for SRSO_U/S_NO and SRSO_MSR_FIX
    
    AMD have updated the SRSO whitepaper[1] with further information.  These
    features exist on AMD Zen5 CPUs and are necessary for Xen to use.
    
    The two features are in principle unrelated:
    
     * SRSO_U/S_NO is an enumeration saying that SRSO attacks can't cross the
       User(CPL3) / Supervisor(CPL<3) boundary.  i.e. Xen don't need to use
       IBPB-on-entry for PV64.  PV32 guests are explicitly unsupported for
       speculative issues, and excluded from consideration for simplicity.
    
     * SRSO_MSR_FIX is an enumeration identifying that the BP_SPEC_REDUCE bit is
       available in MSR_BP_CFG.  When set, SRSO attacks can't cross the host/guest
       boundary.  i.e. Xen don't need to use IBPB-on-entry for HVM.
    
    Extend ibpb_calculations() to account for these when calculating
    opt_ibpb_entry_{pv,hvm} defaults.  Add a `bp-spec-reduce=<bool>` option to
    control the use of BP_SPEC_REDUCE, with it active by default.
    
    Because MSR_BP_CFG is core-scoped with a race condition updating it, repurpose
    amd_check_erratum_1485() into amd_check_bp_cfg() and calculate all updates at
    once.
    
    Xen also needs to to advertise SRSO_U/S_NO to guests to allow the guest kernel
    to skip SRSO mitigations too:
    
     * This is trivial for HVM guests.  It is also is accurate for PV32 guests
       too, but we have already excluded them from consideration, and do so again
       here to simplify the policy logic.
    
     * As written, SRSO_U/S_NO does not help for the PV64 user->kernel boundary.
       However, after discussing with AMD, an implementation detail of having
       BP_SPEC_REDUCE active causes the PV64 user->kernel boundary to have the
       property described by SRSO_U/S_NO, so we can advertise SRSO_U/S_NO to
       guests when the BP_SPEC_REDUCE precondition is met.
    
    Finally, fix a typo in the SRSO_NO's comment.
    
    [1] https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit a1746cd4434dd27ca2da8430dfb10edc76264bb3)
---
 docs/misc/xen-command-line.pandoc           |  9 +++++-
 xen/arch/x86/cpu-policy.c                   | 21 +++++++++++++
 xen/arch/x86/cpu/amd.c                      | 29 ++++++++++++++----
 xen/arch/x86/include/asm/msr-index.h        |  1 +
 xen/arch/x86/include/asm/spec_ctrl.h        |  1 +
 xen/arch/x86/spec_ctrl.c                    | 47 +++++++++++++++++++++++------
 xen/include/public/arch-x86/cpufeatureset.h |  4 ++-
 7 files changed, 94 insertions(+), 18 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 4f2907eb67..ad80277326 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2330,7 +2330,7 @@ By default SSBD will be mitigated at runtime (i.e `ssbd=runtime`).
 >              {ibrs,ibpb,ssbd,psfd,
 >              eager-fpu,l1d-flush,branch-harden,srb-lock,
 >              unpriv-mmio,gds-mit,div-scrub,lock-harden,
->              bhi-dis-s}=<bool> ]`
+>              bhi-dis-s,bp-spec-reduce}=<bool> ]`
 
 Controls for speculative execution sidechannel mitigations.  By default, Xen
 will pick the most appropriate mitigations based on compiled in support,
@@ -2479,6 +2479,13 @@ boolean can be used to force or prevent Xen from using speculation barriers to
 protect lock critical regions.  This mitigation won't be engaged by default,
 and needs to be explicitly enabled on the command line.
 
+On hardware supporting SRSO_MSR_FIX, the `bp-spec-reduce=` option can be used
+to force or prevent Xen from using MSR_BP_CFG.BP_SPEC_REDUCE to mitigate the
+SRSO (Speculative Return Stack Overflow) vulnerability.  Xen will use
+bp-spec-reduce when available, as it is preferable to using `ibpb-entry=hvm`
+to mitigate SRSO for HVM guests, and because it is a prerequisite to advertise
+SRSO_U/S_NO to PV guests.
+
 ### sync_console
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index f259c77435..9224c36d81 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -14,6 +14,7 @@
 #include <asm/msr-index.h>
 #include <asm/paging.h>
 #include <asm/setup.h>
+#include <asm/spec_ctrl.h>
 #include <asm/xstate.h>
 
 struct cpu_policy __ro_after_init     raw_cpu_policy;
@@ -650,6 +651,26 @@ static void __init calculate_pv_max_policy(void)
         __clear_bit(X86_FEATURE_IBRS, fs);
     }
 
+    /*
+     * SRSO_U/S_NO means that the CPU is not vulnerable to SRSO attacks across
+     * the User (CPL3) / Supervisor (CPL<3) boundary.
+     *
+     * PV32 guests are unsupported for speculative issues, and excluded from
+     * consideration for simplicity.
+     *
+     * The PV64 user/kernel boundary is CPL3 on both sides, so SRSO_U/S_NO
+     * won't convey the meaning that a PV kernel expects.
+     *
+     * After discussions with AMD, an implementation detail of having
+     * BP_SPEC_REDUCE active causes the PV64 user/kernel boundary to have a
+     * property compatible with the meaning of SRSO_U/S_NO.
+     *
+     * If BP_SPEC_REDUCE isn't active, remove SRSO_U/S_NO from the PV max
+     * policy, which will cause it to filter out of PV default too.
+     */
+    if ( !boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) || !opt_bp_spec_reduce )
+        __clear_bit(X86_FEATURE_SRSO_US_NO, fs);
+
     guest_common_max_feature_adjustments(fs);
     guest_common_feature_adjustments(fs);
 
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 3312d896dd..8c4e50de45 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1018,16 +1018,33 @@ static void amd_init_fp_cfg(const struct cpuinfo_x86 *c)
     wrmsrl(MSR_AMD64_FP_CFG, val | new);
 }
 
-static void amd_check_erratum_1485(void)
+static void amd_check_bp_cfg(void)
 {
-	uint64_t val, chickenbit = (1 << 5);
+	uint64_t val, new = 0;
 
-	if (cpu_has_hypervisor || boot_cpu_data.x86 != 0x19 || !is_zen4_uarch())
+	/*
+	 * AMD Erratum #1485.  Set bit 5, as instructed.
+	 */
+	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+		new |= (1 << 5);
+
+	/*
+	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
+	 * default.  This lets us do two things:
+	 *
+	 * 1) Avoid IBPB-on-entry to mitigate SRSO attacks from HVM guests.
+	 * 2) Advertise SRSO_US_NO to PV guests.
+	 */
+	if (boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) && opt_bp_spec_reduce)
+		new |= BP_CFG_SPEC_REDUCE;
+
+	/* Avoid reading BP_CFG if we don't intend to change anything. */
+	if (!new)
 		return;
 
 	rdmsrl(MSR_AMD64_BP_CFG, val);
 
-	if (val & chickenbit)
+	if ((val & new) == new)
 		return;
 
 	/*
@@ -1036,7 +1053,7 @@ static void amd_check_erratum_1485(void)
 	 * same time before the chickenbit is set. It's benign because the
 	 * value being written is the same on both.
 	 */
-	wrmsrl(MSR_AMD64_BP_CFG, val | chickenbit);
+	wrmsrl(MSR_AMD64_BP_CFG, val | new);
 }
 
 static void cf_check init_amd(struct cpuinfo_x86 *c)
@@ -1314,7 +1331,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		disable_c1_ramping();
 
 	amd_check_zenbleed();
-	amd_check_erratum_1485();
+	amd_check_bp_cfg();
 
 	if (fam17_c6_disabled)
 		fam17_disable_c6(NULL);
diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h
index bed0ab7b21..db3db08a54 100644
--- a/xen/arch/x86/include/asm/msr-index.h
+++ b/xen/arch/x86/include/asm/msr-index.h
@@ -391,6 +391,7 @@
 #define AMD64_DE_CFG_LFENCE_SERIALISE	(_AC(1, ULL) << 1)
 #define MSR_AMD64_EX_CFG		0xc001102c
 #define MSR_AMD64_BP_CFG		0xc001102e
+#define  BP_CFG_SPEC_REDUCE		(_AC(1, ULL) <<  4)
 #define MSR_AMD64_DE_CFG2		0xc00110e3
 
 #define MSR_AMD64_DR0_ADDRESS_MASK	0xc0011027
diff --git a/xen/arch/x86/include/asm/spec_ctrl.h b/xen/arch/x86/include/asm/spec_ctrl.h
index 60844b755d..b7349ac898 100644
--- a/xen/arch/x86/include/asm/spec_ctrl.h
+++ b/xen/arch/x86/include/asm/spec_ctrl.h
@@ -102,6 +102,7 @@ extern int8_t opt_xpti_hwdom, opt_xpti_domu;
 
 extern bool cpu_has_bug_l1tf;
 extern int8_t opt_pv_l1tf_hwdom, opt_pv_l1tf_domu;
+extern bool opt_bp_spec_reduce;
 
 /*
  * The L1D address mask, which might be wider than reported in CPUID, and the
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 5005f0acdd..b71fe0a4ec 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -95,6 +95,7 @@ static bool __initdata opt_unpriv_mmio;
 static bool __ro_after_init opt_verw_mmio;
 static int8_t __initdata opt_gds_mit = -1;
 static int8_t __initdata opt_div_scrub = -1;
+bool __ro_after_init opt_bp_spec_reduce = true;
 
 static int __init cf_check parse_spec_ctrl(const char *s)
 {
@@ -155,6 +156,7 @@ static int __init cf_check parse_spec_ctrl(const char *s)
             opt_unpriv_mmio = false;
             opt_gds_mit = 0;
             opt_div_scrub = 0;
+            opt_bp_spec_reduce = false;
         }
         else if ( val > 0 )
             rc = -EINVAL;
@@ -375,6 +377,8 @@ static int __init cf_check parse_spec_ctrl(const char *s)
             opt_gds_mit = val;
         else if ( (val = parse_boolean("div-scrub", s, ss)) >= 0 )
             opt_div_scrub = val;
+        else if ( (val = parse_boolean("bp-spec-reduce", s, ss)) >= 0 )
+            opt_bp_spec_reduce = val;
         else
             rc = -EINVAL;
 
@@ -517,7 +521,7 @@ static void __init print_details(enum ind_thunk thunk)
      * Hardware read-only information, stating immunity to certain issues, or
      * suggestions of which mitigation to use.
      */
-    printk("  Hardware hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+    printk("  Hardware hints:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
            (caps & ARCH_CAPS_RDCL_NO)                        ? " RDCL_NO"        : "",
            (caps & ARCH_CAPS_EIBRS)                          ? " EIBRS"          : "",
            (caps & ARCH_CAPS_RSBA)                           ? " RSBA"           : "",
@@ -542,11 +546,12 @@ static void __init print_details(enum ind_thunk thunk)
            (e8b  & cpufeat_mask(X86_FEATURE_IBPB_RET))       ? " IBPB_RET"       : "",
            (e21a & cpufeat_mask(X86_FEATURE_IBPB_BRTYPE))    ? " IBPB_BRTYPE"    : "",
            (e21a & cpufeat_mask(X86_FEATURE_SRSO_NO))        ? " SRSO_NO"        : "",
+           (e21a & cpufeat_mask(X86_FEATURE_SRSO_US_NO))     ? " SRSO_US_NO"     : "",
            (e21c & cpufeat_mask(X86_FEATURE_TSA_SQ_NO))      ? " TSA_SQ_NO"      : "",
            (e21c & cpufeat_mask(X86_FEATURE_TSA_L1_NO))      ? " TSA_L1_NO"      : "");
 
     /* Hardware features which need driving to mitigate issues. */
-    printk("  Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+    printk("  Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
            (e8b  & cpufeat_mask(X86_FEATURE_IBPB)) ||
            (_7d0 & cpufeat_mask(X86_FEATURE_IBRSB))          ? " IBPB"           : "",
            (e8b  & cpufeat_mask(X86_FEATURE_IBRS)) ||
@@ -566,6 +571,7 @@ static void __init print_details(enum ind_thunk thunk)
            (caps & ARCH_CAPS_GDS_CTRL)                       ? " GDS_CTRL"       : "",
            (caps & ARCH_CAPS_RFDS_CLEAR)                     ? " RFDS_CLEAR"     : "",
            (e21a & cpufeat_mask(X86_FEATURE_SBPB))           ? " SBPB"           : "",
+           (e21a & cpufeat_mask(X86_FEATURE_SRSO_MSR_FIX))   ? " SRSO_MSR_FIX"   : "",
            (e21a & cpufeat_mask(X86_FEATURE_VERW_CLEAR))     ? " VERW_CLEAR"     : "");
 
     /* Compiled-in support which pertains to mitigations. */
@@ -1138,7 +1144,7 @@ static void __init div_calculations(bool hw_smt_enabled)
 
 static void __init ibpb_calculations(void)
 {
-    bool def_ibpb_entry = false;
+    bool def_ibpb_entry_pv = false, def_ibpb_entry_hvm = false;
 
     /* Check we have hardware IBPB support before using it... */
     if ( !boot_cpu_has(X86_FEATURE_IBRSB) && !boot_cpu_has(X86_FEATURE_IBPB) )
@@ -1163,22 +1169,43 @@ static void __init ibpb_calculations(void)
          * Confusion.  Mitigate with IBPB-on-entry.
          */
         if ( !boot_cpu_has(X86_FEATURE_BTC_NO) )
-            def_ibpb_entry = true;
+            def_ibpb_entry_pv = def_ibpb_entry_hvm = true;
 
         /*
-         * Further to BTC, Zen3/4 CPUs suffer from Speculative Return Stack
-         * Overflow in most configurations.  Mitigate with IBPB-on-entry if we
-         * have the microcode that makes this an effective option.
+         * In addition to BTC, Zen3 and later CPUs suffer from Speculative
+         * Return Stack Overflow in most configurations.  If we have microcode
+         * that makes IBPB-on-entry an effective mitigation, see about using
+         * it.
          */
         if ( !boot_cpu_has(X86_FEATURE_SRSO_NO) &&
              boot_cpu_has(X86_FEATURE_IBPB_BRTYPE) )
-            def_ibpb_entry = true;
+        {
+            /*
+             * SRSO_U/S_NO is a subset of SRSO_NO, identifying that SRSO isn't
+             * possible across the User (CPL3) / Supervisor (CPL<3) boundary.
+             *
+             * Ignoring PV32 (not security supported for speculative issues),
+             * this means we only need to use IBPB-on-entry for PV guests on
+             * hardware which doesn't enumerate SRSO_US_NO.
+             */
+            if ( !boot_cpu_has(X86_FEATURE_SRSO_US_NO) )
+                def_ibpb_entry_pv = true;
+
+            /*
+             * SRSO_MSR_FIX enumerates that we can use MSR_BP_CFG.SPEC_REDUCE
+             * to mitigate SRSO across the host/guest boundary.  We only need
+             * to use IBPB-on-entry for HVM guests if we haven't enabled this
+             * control.
+             */
+            if ( !boot_cpu_has(X86_FEATURE_SRSO_MSR_FIX) || !opt_bp_spec_reduce )
+                def_ibpb_entry_hvm = true;
+        }
     }
 
     if ( opt_ibpb_entry_pv == -1 )
-        opt_ibpb_entry_pv = IS_ENABLED(CONFIG_PV) && def_ibpb_entry;
+        opt_ibpb_entry_pv = IS_ENABLED(CONFIG_PV) && def_ibpb_entry_pv;
     if ( opt_ibpb_entry_hvm == -1 )
-        opt_ibpb_entry_hvm = IS_ENABLED(CONFIG_HVM) && def_ibpb_entry;
+        opt_ibpb_entry_hvm = IS_ENABLED(CONFIG_HVM) && def_ibpb_entry_hvm;
 
     if ( opt_ibpb_entry_pv )
     {
diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index 42db132b4c..12ca3efc5c 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -289,7 +289,9 @@ XEN_CPUFEATURE(NSCB,               11*32+ 6) /*A  Null Selector Clears Base (and
 XEN_CPUFEATURE(AUTO_IBRS,          11*32+ 8) /*   Automatic IBRS */
 XEN_CPUFEATURE(SBPB,               11*32+27) /*A  Selective Branch Predictor Barrier */
 XEN_CPUFEATURE(IBPB_BRTYPE,        11*32+28) /*A  IBPB flushes Branch Type predictions too */
-XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulenrable to Speculative Return Stack Overflow */
+XEN_CPUFEATURE(SRSO_NO,            11*32+29) /*A  Hardware not vulnerable to Speculative Return Stack Overflow */
+XEN_CPUFEATURE(SRSO_US_NO,         11*32+30) /*A! Hardware not vulnerable to SRSO across the User/Supervisor boundary */
+XEN_CPUFEATURE(SRSO_MSR_FIX,       11*32+31) /*   MSR_BP_CFG.BP_SPEC_REDUCE available */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1.ebx, word 12 */
 XEN_CPUFEATURE(INTEL_PPIN,         12*32+ 0) /*   Protected Processor Inventory Number */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue May 12 16:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 16:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307261.1578967 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMqDN-00026Y-Su; Tue, 12 May 2026 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307261.1578967; Tue, 12 May 2026 16:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMqDN-00026Q-Px; Tue, 12 May 2026 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1307261;
 Tue, 12 May 2026 16:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMqDM-00026I-KM
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 16:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMqDM-001j5P-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMqDM-001jGW-1n
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 16:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E8qWVeaREdJ2gqzmOCwxz00mL+AhDbAqLyLJB04F2Js=; b=M8DOvdszHijUZV4E7Dn29zW71I
	sAe9nRppfnhh3v6IPSswWVzoQ7/FkXmSDmHg69Bn1364J0MyFMVb9IT7TSBDllF5tMzzHAqvPp/HU
	j+EOH6begMyb1p/RKmZKRi9njbv3Jbnc+p0jhhHeKu9eOXFaBryhHSvcwUZtVgaE9YZQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMqDM-001jGW-1n@xenbits.xenproject.org>
Date: Tue, 12 May 2026 16:44:12 +0000

commit caf651fdbcad3b3ae798172b46953ea1aa08a646
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 16:07:50 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 8c4e50de45..86268e8619 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1022,11 +1022,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Tue May 12 18:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 18:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307431.1579142 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsFz-0004oS-Pw; Tue, 12 May 2026 18:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307431.1579142; Tue, 12 May 2026 18:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsFz-0004oJ-N9; Tue, 12 May 2026 18:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1307431;
 Tue, 12 May 2026 18:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMsFy-0004oD-Dw
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 18:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsFy-001lfq-26
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsFy-001x00-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tId8ig2BtpbfwlAqEKXpFk9AU7qglxPec0nxp24pTPs=; b=4Guk310MFJvINung1B7NfgqeHR
	yg60upMAkCA82LrTyWx3B0hBFymcMkIgXLNVQp/5dWHEncRLH1itqWKiTUFN0bDFWW0kLojylJYnh
	QESuhz0DjENmhrye4bHTlZGkdpl646P3AsPHVRq/oOH5ATV+vWkEih32EbtYpu3BJkhM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: sci: Don't create a domain with unsatisfied user requests
Message-Id: <E1wMsFy-001x00-0n@xenbits.xenproject.org>
Date: Tue, 12 May 2026 18:55:02 +0000

commit f7b9752dc88c626192d3115ace7585b20a025433
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue May 12 09:52:55 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue May 12 13:31:01 2026 +0200

    xen/arm: sci: Don't create a domain with unsatisfied user requests
    
    On Arm we stay on the safe side and refuse to create a domain on user
    requests (e.g. via xl.cfg, DT options) that cannot be satisfied due to
    the feature not being compiled in. SCI fall through the crack and does not
    adhere to that i.e. a user request for SCI type other than NONE when
    CONFIG_SCMI_SMC (and thus CONFIG_ARM_SCI) is not set would be silently
    ignored. Fix it by not allowing anything else other than NONE if the
    feature is not enabled.
    
    Fixes: 10e7473d6024 ("xen/arm: scmi-smc: passthrough SCMI SMC to domain, single agent")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/dom0less-build.c           | 11 +++++++++--
 xen/arch/arm/include/asm/firmware/sci.h |  5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 6f73c65e51..52cf788a45 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -273,8 +273,7 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
 
     d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
 
-    if ( !IS_ENABLED(CONFIG_ARM_SCI) ||
-         !dt_property_read_bool(node, "xen,sci_type") )
+    if ( !dt_property_read_bool(node, "xen,sci_type") )
         return 0;
 
     ret = dt_property_read_string(node, "xen,sci_type", &sci_type);
@@ -284,7 +283,15 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
     if ( !strcmp(sci_type, "none") )
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_NONE;
     else if ( !strcmp(sci_type, "scmi_smc") )
+    {
+        if ( !IS_ENABLED(CONFIG_SCMI_SMC) )
+        {
+            printk(XENLOG_ERR "xen,sci_type=scmi_smc requested, but CONFIG_SCMI_SMC not set\n");
+            return -EINVAL;
+        }
+
         d_cfg->arch.arm_sci_type = XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC;
+    }
     else
     {
         printk(XENLOG_ERR "xen,sci_type in not valid (%s) for domain %s\n",
diff --git a/xen/arch/arm/include/asm/firmware/sci.h b/xen/arch/arm/include/asm/firmware/sci.h
index 3500216bc2..485ce211c9 100644
--- a/xen/arch/arm/include/asm/firmware/sci.h
+++ b/xen/arch/arm/include/asm/firmware/sci.h
@@ -148,6 +148,8 @@ int sci_dt_finalize(struct domain *d, void *fdt);
 int sci_assign_dt_device(struct domain *d, struct dt_device_node *dev);
 #else
 
+#include <public/arch-arm.h>
+
 static inline bool sci_domain_is_enabled(struct domain *d)
 {
     return false;
@@ -162,6 +164,9 @@ static inline int sci_domain_init(struct domain *d,
 static inline int
 sci_domain_sanitise_config(struct xen_domctl_createdomain *config)
 {
+    if ( config->arch.arm_sci_type != XEN_DOMCTL_CONFIG_ARM_SCI_NONE )
+        return -EINVAL;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 18:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 18:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307432.1579146 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsG9-0004qY-SQ; Tue, 12 May 2026 18:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307432.1579146; Tue, 12 May 2026 18:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsG9-0004qQ-Pg; Tue, 12 May 2026 18:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1307432;
 Tue, 12 May 2026 18:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMsG8-0004qE-GP
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 18:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsG8-001lhv-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsG8-001x0S-1F
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+6u7Hr+YoRKjRXJtGXHpPDefZUQFJ45ybrRaI9sY3lM=; b=PhWJvLmur8Qduy6O/Xu1VePpIh
	8lFMtb/16BmTmoXx2ZKoapvkJydRASPDCykM669xwLZ6A8EW/GfdfMFFT3HEbP17sDjI0mO9CaBT6
	bY6fJ+Hm21vYjkBOtZrr2HxHA7kBnvZ8HT99cxhE7uwdyOpIqa7Z5+xc4gQtgwOnc7/E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/dom0: enable pf-fixup by default for PVH dom0
Message-Id: <E1wMsG8-001x0S-1F@xenbits.xenproject.org>
Date: Tue, 12 May 2026 18:55:12 +0000

commit fa8687810af66ec37940ecc93e2ef4e9a47889a2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri May 8 10:55:09 2026 +0200
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue May 12 18:02:44 2026 +0200

    x86/dom0: enable pf-fixup by default for PVH dom0
    
    A non-trivial amount of issues related to PVH dom0 are fixed by enabling
    the `pf-fixup` command line option, and no issues have been reported as a
    result of its usage.  Enable the option by default to make PVH dom0 more
    robust in its default configuration.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 CHANGELOG.md                      | 2 ++
 docs/misc/xen-command-line.pandoc | 8 ++++++--
 xen/arch/x86/hvm/emulate.c        | 2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ce46020dbd..25f5a192ed 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - On x86:
+   - Enable pf-fixup option by default for PVH dom0.
 
 ### Added
  - Support for per-domain Xenstore quota in C xenstored (includes
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 6c77129732..2da90548d8 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -849,7 +849,7 @@ Controls for how dom0 is constructed on x86 systems.
     If using this option is necessary to fix an issue, please report a bug.
 
 *   The `pf-fixup` boolean is only applicable when using a PVH dom0 and
-    defaults to false.
+    defaults to true.
 
     When running dom0 in PVH mode the dom0 kernel has no way to map MMIO
     regions into its physical memory map, such mode relies on Xen dom0 builder
@@ -857,10 +857,14 @@ Controls for how dom0 is constructed on x86 systems.
     access.  However Xen doesn't have a complete picture of the host memory
     map, due to not being able to process ACPI dynamic tables.
 
-    The `pf-fixup` option allows Xen to attempt to add missing MMIO regions
+    The `pf-fixup` option causes Xen to attempt to add missing MMIO regions
     to the dom0 physical memory map in response to page-faults generated by
     dom0 trying to access unpopulated entries in the memory map.
 
+    Users having to disable the feature to boot in PVH dom0 mode should report
+    it to the xen-devel mailing list, together with Xen and dom0 output with the
+    option enabled.
+
 Enables features on dom0 on Arm systems.
 
 *   The `sve` integer parameter enables Arm SVE usage for Dom0 and sets the
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index f3aae158e9..bb1bb03ac4 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -165,7 +165,7 @@ void hvmemul_cancel(struct vcpu *v)
     hvmemul_cache_disable(v);
 }
 
-bool __ro_after_init opt_dom0_pf_fixup;
+bool __ro_after_init opt_dom0_pf_fixup = true;
 static int hwdom_fixup_p2m(paddr_t addr)
 {
     unsigned long gfn = paddr_to_pfn(addr);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 18:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 18:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307433.1579149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsGJ-0004sm-Td; Tue, 12 May 2026 18:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307433.1579149; Tue, 12 May 2026 18:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMsGJ-0004se-R4; Tue, 12 May 2026 18:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1307433;
 Tue, 12 May 2026 18:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMsGI-0004sX-J1
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 18:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsGI-001li2-2g
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMsGI-001x2n-1X
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 18:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ic0n0+RkYelC2SLvvUPIoG/U+D8LSHo03N9wBVtYrxQ=; b=xdN0VIhpL8tut8qeggn5s5RroQ
	4HPa/FZoHp5eNdXXbo8ysSCr+aQO8TMhV3ge11Bhl6aCj7QeEW18uOgornrBX7jARmIcxfyeu9/4j
	rJqDapaJpGRKzqTs1ASctA9EpkfM0hg9lRagFRKU21GE/TqDQBQPf9DWcrThNpdUy20k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMsGI-001x2n-1X@xenbits.xenproject.org>
Date: Tue, 12 May 2026 18:55:22 +0000

commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 12 17:05:30 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 712734a6e7..70783c9a0a 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1015,11 +1015,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.family == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.family == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.family == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 12 20:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 20:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307443.1579158 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcL-0007ZH-NU; Tue, 12 May 2026 20:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307443.1579158; Tue, 12 May 2026 20:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcL-0007Z9-Kp; Tue, 12 May 2026 20:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1307443;
 Tue, 12 May 2026 20:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMtcK-0007YG-74
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 20:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtcK-001nFs-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtcK-00232X-0R
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tf2rPZYNdeT/ltPl3wlXeLis95rRQE4b6w4D0YcGsDI=; b=GzU0CflDQmTvPOqqjzRy0zJGIS
	w7mS5DUba4yS0jFuYWxVqbd1HRK6G5n4pIUui5cKVrIdQrt3vw96m19v0pYWL05L7YYrPZYYlEe9V
	PNzFMXs5t0eogYnLLiapMQm8trgFvCiokwC/VpiyAWy+DY7d9JSFFEpROwPS5r4KLbK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMtcK-00232X-0R@xenbits.xenproject.org>
Date: Tue, 12 May 2026 20:22:12 +0000

commit 8056c4032f2956041b0c0a3d31a12b474caa61de
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:32:52 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 12876de1df..3416fb1a93 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1050,11 +1050,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Tue May 12 20:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 20:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307442.1579153 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcB-0007WX-MH; Tue, 12 May 2026 20:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307442.1579153; Tue, 12 May 2026 20:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcB-0007WP-JL; Tue, 12 May 2026 20:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1307442;
 Tue, 12 May 2026 20:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMtc9-0007WJ-VF
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 20:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtcA-001nFo-0k
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtc9-00231U-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UOhQwQIittNDE0BOTW8JLbrfhXG/DSghtgbqDfYXYNo=; b=WQrmRoOUEUawOP2t2VbBQ1WR4E
	RVYTSgIvktKbhSl5KjGLOiMHlauWbYsi0OOuPkLT1AOwMUo4btO6h2t5TfSfJxquEkRUVnQUf1VDY
	jHwmzy1HACBI1w1h0UUDY2uZl1atfXxONHRwlpA4aHrNyFsb2GVsX0N6CKUSF1H4EN8s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMtc9-00231U-2o@xenbits.xenproject.org>
Date: Tue, 12 May 2026 20:22:01 +0000

commit 3ed365e3f9ee281a8b34d65b6f5a4bf04bc871e4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:31:11 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 43883e04db..3914032269 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1050,11 +1050,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 12 20:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 20:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307444.1579161 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcV-0007br-Om; Tue, 12 May 2026 20:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307444.1579161; Tue, 12 May 2026 20:22:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMtcV-0007bi-M6; Tue, 12 May 2026 20:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1307444;
 Tue, 12 May 2026 20:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMtcU-0007bZ-FH
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 20:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtcU-001nFw-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMtcU-00233R-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=VwIdgYUJA5VJhxgUjGTEhoVKZxlSJdMRLf5W9q0b1Y8=; b=yTqtJl3wVKWIdt8RFxHS8iHM/Z
	SD9P7FCVgxvQOEiW4mEflbnsLkCvvKNhU6S7T/NYpXoy9KvA4HzLtaXil5ECRL48f9cKaM9e0oF8p
	5xwtBIRFAcFod/1upHguT0Na9C6bvATHuELN5VLZKnEchjFe+VIedle5TsBYVFCeqNgQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMtcU-00233R-1I@xenbits.xenproject.org>
Date: Tue, 12 May 2026 20:22:22 +0000

commit 581a10f8846768920e7f809e1c51cf2a9f13cbce
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:32:57 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 43cd3ae9ba..89284b740b 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1049,11 +1049,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Tue May 12 20:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 12 May 2026 20:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307452.1579165 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMu87-0002sV-V0; Tue, 12 May 2026 20:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307452.1579165; Tue, 12 May 2026 20:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wMu87-0002sL-SM; Tue, 12 May 2026 20:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1307452;
 Tue, 12 May 2026 20:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wMu86-0002rz-5E
 for xen-changelog@lists.xenproject.org; Tue, 12 May 2026 20:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMu86-001nnW-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wMu86-00255I-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 12 May 2026 20:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+7tpBpULVGH122M3FDbCMldBKMvJv6CzPgJ3NXQn654=; b=CFdaJu8qyFjxr3t/GkLJDKpaki
	jrp/jjAQdEXV/qJTiJLG2GOsT7D001sJvS9FZpqa8raGoxAoA2WW6xbEUnIZfWcNq8VNtW+0tgjD9
	YcI1aDp8HnsFbzgB1L5lfBaOgCeT63ZVML9860RVY27kYR6T+Fu9zga02KOa0N/3ve88=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/amd: Mitigate AMD-SN-7052
Message-Id: <E1wMu86-00255I-0B@xenbits.xenproject.org>
Date: Tue, 12 May 2026 20:55:02 +0000

commit 8af05b49176dc22db12d6743a927899561314ec8
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Nov 4 18:08:07 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 6 15:30:12 2026 +0100

    x86/amd: Mitigate AMD-SN-7052
    
    This is XSA-490 / CVE-2025-54518.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    (cherry picked from commit 8070bdfa7220e772fae248abd3cbf5e87fc0fefb)
---
 xen/arch/x86/cpu/amd.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 1bb0766ebf..b5bf2b732e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1116,11 +1116,25 @@ static void amd_check_bp_cfg(void)
 {
 	uint64_t val, new = 0;
 
-	/*
-	 * AMD Erratum #1485.  Set bit 5, as instructed.
-	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
-		new |= (1 << 5);
+	if (!cpu_has_hypervisor) {
+		/*
+		 * AMD Erratum #1485.  If SMT is enabled and STIBP disabled,
+		 * the CPU may fetch incorrect instruction bytes.
+		 *
+		 * Set bit 5, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+			new |= (1 << 5);
+
+		/*
+		 * AMD SB-7052.  CPU OP Cache corruption, causing instructions
+		 * to be executed at a higher privilege.
+		 *
+		 * Set bit 33, as instructed.
+		 */
+		if (boot_cpu_data.x86 == 0x17 && is_zen2_uarch())
+			new |= (1UL << 33);
+	}
 
 	/*
 	 * On hardware supporting SRSO_MSR_FIX, activate BP_SPEC_REDUCE by
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed May 13 09:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 09:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307727.1579304 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5cM-0004ek-Te; Wed, 13 May 2026 09:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307727.1579304; Wed, 13 May 2026 09:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5cM-0004eb-Qk; Wed, 13 May 2026 09:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1307727;
 Wed, 13 May 2026 09:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN5cL-0004eV-PY
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 09:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cL-003BT8-21
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cL-002lxp-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Jsn+rSSjXwM0jCj6juXs7xE2f+Pp+Gs4XLP2NEhzWAs=; b=FfAZPK7u1bQO+jbYy+t7ja4zJV
	/qZt/oQlR6mbEQuS2dnWSnqfLOhlN5gRG4YXb4+CxZlhUyuVaQDOxH+vdnMezv0jzu8nKu0/FmvWy
	iKBoAHGRE8JEBS18Z8fjtV53HTODvnqSnR8hYgMy4Jtnmq7VkPeXOeK/uesphSNH4Bz4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wN5cL-002lxp-1q@xenbits.xenproject.org>
Date: Wed, 13 May 2026 09:11:01 +0000

commit 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 13 09:59:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 09:59:19 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 3b53471af0..066498e07e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -569,12 +569,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1ad4b51c5b..c90517e846 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -960,7 +960,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -995,8 +995,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -1014,8 +1031,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -1038,7 +1055,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -1052,13 +1072,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 09:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 09:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307728.1579309 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5cW-0004hC-Vx; Wed, 13 May 2026 09:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307728.1579309; Wed, 13 May 2026 09:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5cW-0004h4-TT; Wed, 13 May 2026 09:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1307728;
 Wed, 13 May 2026 09:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN5cV-0004gt-Pz
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 09:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cV-003BTV-2V
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cV-002lyV-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nv7f1IpHQq65oJCroDE7hQgP1pjoS8X5PxS4Ks5Ss3I=; b=aOA8QpIfzRUMaGwOmUsfko5Y5x
	ymBa9XKn473VNWEZ2PECF4lPf8bgmuKNpzMpUEdG0Zv4IEhTG0WLDjO8zAqtjAICy61Q/B3I1J03h
	JVaSFX1m2qbKqY2ANIpxSKBsVxBbevNcuqpOda8oCIXMq670GYL2fGcUsJ2TvOrYdhuM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] hypfs: add ASSERT_UNREACHABLE() in hypfs_get_entry_rel()
Message-Id: <E1wN5cV-002lyV-2C@xenbits.xenproject.org>
Date: Wed, 13 May 2026 09:11:11 +0000

commit 1044a59e8e533a07eed3be37411a0f4a3c26b6fd
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Wed May 13 10:00:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 10:00:05 2026 +0200

    hypfs: add ASSERT_UNREACHABLE() in hypfs_get_entry_rel()
    
    The statement 'return ERR_PTR(-ENOENT);' on the final line of the
    function 'hypfs_get_entry_rel()' is unreachable because the logic within
    the infinite loop 'for (;;)' provides all possible exit paths for the
    function. So there is no execution path to exit the loop and reach the
    final that statement.
    
    This unreachable code violates MISRA C Rule 2.1 which states: "A project
    shall not contain unreachable code".
    
    To fix that and potential compilers "control reaches end of non-void
    function" warning, mark the code path as unreachable using macro
    'ASSERT_UNREACHABLE()'.
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/hypfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c
index cdf4ee0171..02fb234568 100644
--- a/xen/common/hypfs.c
+++ b/xen/common/hypfs.c
@@ -348,6 +348,7 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct hypfs_entry_dir *dir,
         dir = container_of(entry, struct hypfs_entry_dir, e);
     }
 
+    ASSERT_UNREACHABLE();
     return ERR_PTR(-ENOENT);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 09:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 09:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307729.1579312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5ch-0004jJ-19; Wed, 13 May 2026 09:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307729.1579312; Wed, 13 May 2026 09:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN5cg-0004jB-Uk; Wed, 13 May 2026 09:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1307729;
 Wed, 13 May 2026 09:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN5cf-0004j0-TF
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 09:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cf-003BTb-2n
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN5cf-002lzo-2g
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 09:11:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=47uBb5LcS9l7SwpCoHZR5vjoyc7itFOsJBz+mBN3Umo=; b=NtD4jyOsz1lBlaneZ0Pw+3qtQl
	evrbCpI3V881DH+3DmQB7HNxfX/yQfFAub2cqRpRzVQs94twBlVbICAtZ7U/ds/+BU+Cyfrlk9vv6
	XRoBOCMitxynnb+n3ViZ3kTSXlIm9QijvbmF0dtYwWSSJ6bG3jwF2zyHnYWPW849qP40=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: explicitly specify source file name for symtab
Message-Id: <E1wN5cf-002lzo-2g@xenbits.xenproject.org>
Date: Wed, 13 May 2026 09:11:21 +0000

commit c5d554edff679302b94aecb67bfe9792a2c33aa6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 13 10:00:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 10:00:52 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Makefile | 5 ++++-
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 477e3cbe7a..2d13e9d7e8 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -200,7 +200,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
-	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
+	$(objtree)/tools/symbols $(all_symbols) --source-name=$(@F).S --empty \
+		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
@@ -210,6 +211,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -220,6 +222,7 @@ endif
 		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).2s.S
 	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(call compare-symbol-tables, $(dot-target).1r.o, $(dot-target).2r.o)
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 3c6f13de38..fa07201771 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -66,6 +66,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -356,6 +357,7 @@ static void write_src(void)
 	printf("#define ALGN 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -679,6 +681,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 10:22:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 10:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307759.1579335 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6j5-0006WM-5V; Wed, 13 May 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307759.1579335; Wed, 13 May 2026 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6j5-0006WE-2e; Wed, 13 May 2026 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1307759;
 Wed, 13 May 2026 10:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN6j4-0006W8-BN
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 10:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6j4-003Cno-0o
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6j4-002qER-0c
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4gkYovDPUJ1AqHVywMZf3wbcx+fa85dC0yP8nGblpuI=; b=0l0e3WWNqYWdwX4a5oTLg2/Bwh
	cPB9rmBnmDHQbjRVjBByIwHvP8l+mEICrtBu02CJKUPGZMVnSEV7LLKn+JE7PlJ66HzQEiATa+DZa
	pP+R+dB9YbeMxl5biKEVCrCiItnLp8Vc967kxynL4CZB3yrXDy7+vudz/iJpyVY4/nfI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wN6j4-002qER-0c@xenbits.xenproject.org>
Date: Wed, 13 May 2026 10:22:02 +0000

commit 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 13 09:59:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 09:59:19 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 3b53471af0..066498e07e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -569,12 +569,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 1ad4b51c5b..c90517e846 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -960,7 +960,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -995,8 +995,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -1014,8 +1031,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -1038,7 +1055,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -1052,13 +1072,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307760.1579339 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6jF-0006Zm-6X; Wed, 13 May 2026 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307760.1579339; Wed, 13 May 2026 10:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6jF-0006Ze-43; Wed, 13 May 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1307760;
 Wed, 13 May 2026 10:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN6jE-0006ZK-Bt
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 10:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6jE-003Co8-16
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6jE-002qFK-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lEPoIWBtAkWvO3O7sB+IJDSS1ycq8tzM4jqBKwa9UZQ=; b=1Ip10XB2MLY8AlxegkSWdyd1kC
	WxIs3Kc1YvyX1WeahJzrmkrHfnITrHCVJn+DrFDEB0MC1PZnS4VyWcFxfLPC6grYA3mSgo95BO2bF
	LDRLLFKCwLDOgaIPgePilWC071GQQVHTOtv+ldtfxZh0Pb+KpWDHN7/waBHVjHXN4UeU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] hypfs: add ASSERT_UNREACHABLE() in hypfs_get_entry_rel()
Message-Id: <E1wN6jE-002qFK-0y@xenbits.xenproject.org>
Date: Wed, 13 May 2026 10:22:12 +0000

commit 1044a59e8e533a07eed3be37411a0f4a3c26b6fd
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Wed May 13 10:00:05 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 10:00:05 2026 +0200

    hypfs: add ASSERT_UNREACHABLE() in hypfs_get_entry_rel()
    
    The statement 'return ERR_PTR(-ENOENT);' on the final line of the
    function 'hypfs_get_entry_rel()' is unreachable because the logic within
    the infinite loop 'for (;;)' provides all possible exit paths for the
    function. So there is no execution path to exit the loop and reach the
    final that statement.
    
    This unreachable code violates MISRA C Rule 2.1 which states: "A project
    shall not contain unreachable code".
    
    To fix that and potential compilers "control reaches end of non-void
    function" warning, mark the code path as unreachable using macro
    'ASSERT_UNREACHABLE()'.
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
---
 xen/common/hypfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/hypfs.c b/xen/common/hypfs.c
index cdf4ee0171..02fb234568 100644
--- a/xen/common/hypfs.c
+++ b/xen/common/hypfs.c
@@ -348,6 +348,7 @@ static struct hypfs_entry *hypfs_get_entry_rel(struct hypfs_entry_dir *dir,
         dir = container_of(entry, struct hypfs_entry_dir, e);
     }
 
+    ASSERT_UNREACHABLE();
     return ERR_PTR(-ENOENT);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 10:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 10:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1307761.1579342 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6jQ-0006c8-7z; Wed, 13 May 2026 10:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1307761.1579342; Wed, 13 May 2026 10:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wN6jQ-0006c0-5L; Wed, 13 May 2026 10:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1307761;
 Wed, 13 May 2026 10:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wN6jO-0006bs-Fw
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 10:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6jO-003CoC-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wN6jO-002qFx-1H
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 10:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QFwVFZXER1JRnc998RAc9D9iL8QaViDyCKDKLN+s5nQ=; b=xf/GNeaDQ1dKSCRnHQPW2SK+El
	IidCiB68Cb8tSI7yOes+C/DqYLB5OExpdwOII9WFwpr4ebvybCGIN1ofQGl+Uva96mfQsrBcO6Z44
	59QwR+9IGb53ZQEYWvuwEFGpFjy6LxVEZ4qJavCmieYL2kmh8vyOUYWlKzloYaXhjedk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: explicitly specify source file name for symtab
Message-Id: <E1wN6jO-002qFx-1H@xenbits.xenproject.org>
Date: Wed, 13 May 2026 10:22:22 +0000

commit c5d554edff679302b94aecb67bfe9792a2c33aa6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 13 10:00:52 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 13 10:00:52 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Makefile | 5 ++++-
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 477e3cbe7a..2d13e9d7e8 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -200,7 +200,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
-	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
+	$(objtree)/tools/symbols $(all_symbols) --source-name=$(@F).S --empty \
+		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
@@ -210,6 +211,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -220,6 +222,7 @@ endif
 		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).2s.S
 	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(call compare-symbol-tables, $(dot-target).1r.o, $(dot-target).2r.o)
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 3c6f13de38..fa07201771 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -66,6 +66,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -356,6 +357,7 @@ static void write_src(void)
 	printf("#define ALGN 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -679,6 +681,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 16:55:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 16:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308309.1579814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrP-0003Bh-U6; Wed, 13 May 2026 16:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308309.1579814; Wed, 13 May 2026 16:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrP-0003BZ-RP; Wed, 13 May 2026 16:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1308309;
 Wed, 13 May 2026 16:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNCrO-0003BT-PC
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 16:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrO-003KdZ-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrO-003KPf-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fIXE+kGzpQf/5zCpBqaJU1zqIPx11ITXF2ISlTW0amA=; b=Qy7yUAaQYcJ6IVY2h6dqnabUTa
	et/Y83TVh3DH1ELKYnAIW83TK82AHtf2ylfdSaQ2KdDAtwYC1DbEJr3ZIaWs9YSUuKwQRrhpTYRnc
	K/v6wyQbWubD57zZBod+EJ6w2lbIvu5vetsZSYo8vjRUoWikvzZRt8q+dBmtPNz988tM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Don't toggle local event delivery on STGI/CLGI
Message-Id: <E1wNCrO-003KPf-1V@xenbits.xenproject.org>
Date: Wed, 13 May 2026 16:55:02 +0000

commit 6a6e1e17d662984ab3f5cfb6e84568c810a35fb7
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Thu May 7 11:55:06 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    x86/svm: Don't toggle local event delivery on STGI/CLGI
    
    There is no need to explicitly enable/disable local event delivery on
    STGI/CLGI since HVM event delivery already takes into account the state
    of the GIF (and IF). This ensures the behaviour is consistent regardless
    of whether vGIF is used.
    
    Fold the functions into the callers since they are now only a single
    assignment.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index ef6fa5d23b..64fbfe8fa7 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -19,22 +19,6 @@
 #define NSVM_ERROR_VVMCB        1
 #define NSVM_ERROR_VMENTRY      2
 
-static void
-nestedsvm_vcpu_clgi(struct vcpu *v)
-{
-    /* clear gif flag */
-    vcpu_nestedsvm(v).ns_gif = 0;
-    local_event_delivery_disable(); /* mask events for PV drivers */
-}
-
-static void
-nestedsvm_vcpu_stgi(struct vcpu *v)
-{
-    /* enable gif flag */
-    vcpu_nestedsvm(v).ns_gif = 1;
-    local_event_delivery_enable(); /* unmask events for PV drivers */
-}
-
 int nestedsvm_vmcb_map(struct vcpu *v, uint64_t vmcbaddr)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
@@ -161,7 +145,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
 
     svm->ns_iomap = NULL;
 
-    nestedsvm_vcpu_stgi(v);
+    svm->ns_gif = 1;
     return 0;
 }
 
@@ -667,7 +651,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
         return ret;
     }
 
-    nestedsvm_vcpu_stgi(v);
+    svm->ns_gif = 1;
     return 0;
 }
 
@@ -1214,7 +1198,7 @@ nestedsvm_vmexit_defer(struct vcpu *v,
     if ( vmcb->_vintr.fields.vgif_enable )
         vmcb->_vintr.fields.vgif = 0;
     else
-        nestedsvm_vcpu_clgi(v);
+        svm->ns_gif = 0;
 
     svm->ns_vmexit.exitcode = exitcode;
     svm->ns_vmexit.exitinfo1 = exitinfo1;
@@ -1502,7 +1486,7 @@ void svm_vmexit_do_stgi(struct cpu_user_regs *regs, struct vcpu *v)
     if ( (inst_len = svm_get_insn_len(v, INSTR_STGI)) == 0 )
         return;
 
-    nestedsvm_vcpu_stgi(v);
+    vcpu_nestedsvm(v).ns_gif = 1;
 
     __update_guest_eip(regs, inst_len);
 }
@@ -1523,7 +1507,7 @@ void svm_vmexit_do_clgi(struct cpu_user_regs *regs, struct vcpu *v)
     if ( (inst_len = svm_get_insn_len(v, INSTR_CLGI)) == 0 )
         return;
 
-    nestedsvm_vcpu_clgi(v);
+    vcpu_nestedsvm(v).ns_gif = 0;
 
     /* After a CLGI no interrupts should come */
     intr = vmcb_get_vintr(vmcb);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 16:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 16:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308310.1579818 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrZ-0003Dc-VS; Wed, 13 May 2026 16:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308310.1579818; Wed, 13 May 2026 16:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrZ-0003DV-Sq; Wed, 13 May 2026 16:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1308310;
 Wed, 13 May 2026 16:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNCrY-0003Ct-Nq
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 16:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrY-003Kfv-2F
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrY-003KZl-29
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1tJjJ8PaY2NgY4ZWCwzc902T3K+jUQCQIwJ/3cwsuIs=; b=b1FrHiusHK1nwDwPaEu+8V5DvX
	3Q82MJKPJwTUjQJRt3lcGz6XfZYiuZ+nTWyWBexPDMVLFk8U3gfr0l6Yj9KHPVWw+yHc9icddzeNj
	TN2em6KfraLkx2ypIErU6BdEwN134XFWruhdWpYveKurkFaZJiCvCuJjEgAthiZC9y/c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] nestedsvm: Clear GIF when injecting VMEXIT
Message-Id: <E1wNCrY-003KZl-29@xenbits.xenproject.org>
Date: Wed, 13 May 2026 16:55:12 +0000

commit 5fa2c5849f8d7a6e6a87f6e3478e8522b4d20d79
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Thu May 7 11:55:07 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    nestedsvm: Clear GIF when injecting VMEXIT
    
    If L1 executes VMRUN with the GIF set and it fails consistency checks,
    Xen will inject a VMEXIT and fail the assert checking the GIF is cleared.
    
    Instead, clear the GIF when injecting a VMEXIT to match what hardware
    does.
    
    Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 64fbfe8fa7..9899cb2147 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -717,9 +717,9 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
     if ( vmcb->_vintr.fields.vgif_enable )
-        ASSERT(vmcb->_vintr.fields.vgif == 0);
+        vmcb->_vintr.fields.vgif = 0;
     else
-        ASSERT(svm->ns_gif == 0);
+        svm->ns_gif = 0;
 
     ns_vmcb = nv->nv_vvmcx;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 16:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 16:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308311.1579821 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrk-0003GE-0z; Wed, 13 May 2026 16:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308311.1579821; Wed, 13 May 2026 16:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrj-0003G6-UV; Wed, 13 May 2026 16:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1308311;
 Wed, 13 May 2026 16:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNCri-0003G0-S5
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 16:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCri-003Kg2-2i
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCri-003Kac-2P
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JwZy/Afm1RLCRxxrPyqBs/XSMYiBnlqQdbIRbI8VfPo=; b=DDqNEdj0hoSNbUV8fcPJEkpG3o
	9/dUEQ/l6HogzGkt2jl3wtN2OxEaK5ONrDNSustMpnsOHxyYJf84stJTJPjoCGwzOz1btfRaQDNXL
	YDj6nPsfDDlxWD7jmrNcDWLXRyJp9hK4LLRE5osJWA37v/5MOGXvUMyT9ccBb5cdy2go=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tests/paging-mempool: Misc cleanup
Message-Id: <E1wNCri-003Kac-2P@xenbits.xenproject.org>
Date: Wed, 13 May 2026 16:55:22 +0000

commit d53ba690b0d23ebe9265aa731c0fc3586c035fc4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 11 16:17:38 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tests/paging-mempool: Misc cleanup
    
    ... ahead of extending it with a second test.
    
    Rename run_tests() to test_paging_mempool_size() and have it return int so the
    new run_tests() can decide whether to run subsequent tests or not.
    
    Comment the parameters to xc_domain_populate_physmap_exact() to make it
    clearer what's going on, and remove the page added to the physmap when the
    test is done.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/paging-mempool/test-paging-mempool.c | 26 +++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 1ebc13455a..9ef8252126 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -15,6 +15,7 @@ static unsigned int nr_failures;
 ({                                              \
     nr_failures++;                              \
     (void)printf(fmt, ##__VA_ARGS__);           \
+    -1;                                         \
 })
 
 static xc_interface *xch;
@@ -40,7 +41,7 @@ static uint64_t default_mempool_size_bytes =
     16 << 12;
 #endif
 
-static void run_tests(void)
+static int test_paging_mempool_size(void)
 {
     xen_pfn_t physmap[] = { 0 };
     uint64_t size_bytes, old_size_bytes;
@@ -80,7 +81,9 @@ static void run_tests(void)
         return fail("  Fail: setmaxmem: : %d - %s\n",
                     errno, strerror(errno));
 
-    rc = xc_domain_populate_physmap_exact(xch, domid, 1, 0, 0, physmap);
+    rc = xc_domain_populate_physmap_exact(
+        xch, domid, ARRAY_SIZE(physmap),
+        0 /* order 4k */, 0 /* flags */, physmap);
     if ( rc )
         return fail("  Fail: populate physmap: %d - %s\n",
                     errno, strerror(errno));
@@ -98,6 +101,11 @@ static void run_tests(void)
         return fail("  Fail: mempool size changed %"PRIu64" => %"PRIu64"\n",
                     old_size_bytes, size_bytes);
 
+    /* We added one 4k page.  Check we can remove it. */
+    rc = xc_domain_remove_from_physmap(xch, domid, physmap[0]);
+    if ( rc )
+        return fail("  Fail: remove from physmap: %d - %s\n",
+                    errno, strerror(errno));
 
 
     printf("Test bad set size\n");
@@ -134,6 +142,19 @@ static void run_tests(void)
     if ( size_bytes != 64 << 20 )
         return fail("  Fail: expected mempool size %u, got %"PRIu64"\n",
                     64 << 20, size_bytes);
+
+    return 0;
+}
+
+static int run_tests(void)
+{
+    int rc;
+
+    rc = test_paging_mempool_size();
+    if ( rc )
+        return rc;
+
+    return 0;
 }
 
 int main(int argc, char **argv)
@@ -143,7 +164,6 @@ int main(int argc, char **argv)
     printf("Paging mempool tests\n");
 
     xch = xc_interface_open(NULL, NULL, 0);
-
     if ( !xch )
         err(1, "xc_interface_open");
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 16:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 16:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308312.1579826 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCru-0003IA-2a; Wed, 13 May 2026 16:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308312.1579826; Wed, 13 May 2026 16:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCrt-0003I2-Vw; Wed, 13 May 2026 16:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1308312;
 Wed, 13 May 2026 16:55:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNCrt-0003Hv-0k
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 16:55:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrs-003Kg6-3C
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCrs-003Kfk-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w+z4qo4dtJYIsmcsBGhYt5ri3vUvpY0DrUB4WKa132w=; b=cx8PT5yalc12B68PzD6LYL6VVV
	+kkgfZptDU8yopVmZYbHSB8fbb5ifUTHB/JzDuSsCgvMMEtEtk0pMxZ0TJMQTF91rSaEiX9wTLXpr
	HYAOt7aUG85NdhZuazjEFCYiyqP9M7BKJlyg17fbO/rE3YWVgvWpHqKpo3QltGmNz/ao=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tests/paging-mempool: Extend to test P2M relocation
Message-Id: <E1wNCrs-003Kfk-2t@xenbits.xenproject.org>
Date: Wed, 13 May 2026 16:55:32 +0000

commit 66c982a5d3614f0905952d8cf8af1b467c516994
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 11 16:26:12 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tests/paging-mempool: Extend to test P2M relocation
    
    XENMAPSPACE_gmfn_range was found to be buggy with overlapping ranges, and the
    fix is sufficiently far from clear that yours truly decided a test was in
    order.
    
    XENMAPSPACE_gmfn_range is exposed by xendevicemodel_relocate_memory() so take
    the opportunity to create a better example for others to copy.
    
    The test works as follows.  Populate 2M of RAM in the guest, marking the pages
    so they can be identified later.  Then construct four relocation test
    cases (overlapping vs non-overlapping, forwards vs backwards) using the marks
    in the guest pages to confirm that the P2M was adjusted correctly.
    
    The use of XEN_DOMCTL_CDF_iommu forces xenmem_add_to_physmap() to limit the
    iteration count to a maximum of 16.  Use this to force a continuation and
    exercise more of the logic.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/paging-mempool/Makefile              |   4 +
 tools/tests/paging-mempool/test-paging-mempool.c | 205 ++++++++++++++++++++++-
 xen/common/memory.c                              |   2 +-
 3 files changed, 209 insertions(+), 2 deletions(-)

diff --git a/tools/tests/paging-mempool/Makefile b/tools/tests/paging-mempool/Makefile
index a1e12584ce..7444d81b84 100644
--- a/tools/tests/paging-mempool/Makefile
+++ b/tools/tests/paging-mempool/Makefile
@@ -25,9 +25,13 @@ uninstall:
 
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxendevicemodel)
+CFLAGS += $(CFLAGS_libxenforeignmemory)
 CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(LDLIBS_libxenctrl)
+LDFLAGS += $(LDLIBS_libxendevicemodel)
+LDFLAGS += $(LDLIBS_libxenforeignmemory)
 LDFLAGS += $(APPEND_LDFLAGS)
 
 %.o: Makefile
diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 9ef8252126..3c87925288 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -6,6 +6,7 @@
 #include <sys/mman.h>
 
 #include <xenctrl.h>
+#include <xendevicemodel.h>
 #include <xenforeignmemory.h>
 #include <xengnttab.h>
 #include <xen-tools/common-macros.h>
@@ -19,10 +20,15 @@ static unsigned int nr_failures;
 })
 
 static xc_interface *xch;
+static xendevicemodel_handle *dh;
+static xenforeignmemory_handle *fh;
 static uint32_t domid;
 
 static struct xen_domctl_createdomain create = {
-    .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
+    .flags = (XEN_DOMCTL_CDF_hvm |
+              XEN_DOMCTL_CDF_hap |
+              XEN_DOMCTL_CDF_iommu |
+              0),
     .max_vcpus = 1,
     .max_grant_frames = 1,
     .grant_opts = XEN_DOMCTL_GRANT_version(1),
@@ -146,6 +152,191 @@ static int test_paging_mempool_size(void)
     return 0;
 }
 
+static int mark_guest_mem(xen_pfn_t gfn, size_t count)
+{
+    xen_pfn_t gfns[count];
+    uint32_t *mem;
+    size_t i;
+    int rc;
+
+    for ( i = 0; i < count; ++i )
+        gfns[i] = gfn + i;
+
+    mem = xenforeignmemory_map(fh, domid, PROT_READ | PROT_WRITE,
+                               count, gfns, NULL);
+    if ( !mem )
+        return fail("  Fail: mark mem foreign map: %d - %s\n",
+                    errno, strerror(errno));
+
+    for ( i = 0; i < count; ++i )
+    {
+        uint32_t *mark = &mem[i << 10];
+
+        *mark = ~i;
+    }
+
+    rc = xenforeignmemory_unmap(fh, mem, count);
+    if ( rc )
+        return fail("  Fail: mark mem foreign unmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    return 0;
+}
+
+static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
+{
+    xen_pfn_t gfns[count];
+    int errs[count];
+    uint32_t *mem;
+    size_t i;
+    int rc = 0;
+
+    for ( i = 0; i < count; ++i )
+        gfns[i] = gfn + i;
+
+    mem = xenforeignmemory_map(fh, domid, PROT_READ,
+                               count, gfns, errs);
+    if ( !mem )
+        return fail("    Fail: check mark foreign map: %d - %s\n",
+                    errno, strerror(errno));
+
+    for ( i = 0; i < count; ++i )
+    {
+        uint32_t *mark = &mem[i << 10];
+        uint32_t exp = ~(mark_start + i);
+
+        if ( errs[i] )
+        {
+            rc = -1;
+            fail("    Fail: check mark unable to map gfn %05lx: %d\n",
+                 gfns[i], errs[i]);
+            continue;
+        }
+
+        if ( *mark == exp )
+            continue;
+
+        fail("    Fail: check mark: gfn %05lx expecting %08x (%u), got %08x (%u)\n",
+               gfns[i], exp, ~exp, *mark, ~*mark);
+        rc = -1;
+    }
+
+    if ( xenforeignmemory_unmap(fh, mem, count) )
+        return fail("    Fail: check marks foreign unmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    return rc;
+}
+
+static int test_p2m_relocate_memory(void)
+{
+#define GFN_2M ((2UL << 20) >> 12)
+#define GFN_4M ((4UL << 20) >> 12)
+
+    xen_pfn_t physmap[] = { GFN_2M };
+    int rc;
+
+    /*
+     * Inherited state of the domain:
+     * - Unlimited allocation
+     * - XEN_DOMCTL_CDF_iommu, which causes xendevicemodel_relocate_memory()
+     *   to undergo continuations every 16 pages
+     *
+     * Construction of the test:
+     * - Populate 2M at 2M, mark the pages.
+     */
+    printf("Test p2m memory relocation\n");
+
+    rc = xc_domain_populate_physmap_exact(
+        xch, domid, ARRAY_SIZE(physmap),
+        9 /* order 2M */, 0 /* flags */, physmap);
+    if ( rc )
+        return fail("  Fail: populate physmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = mark_guest_mem(GFN_2M, 1 << 9 /* order 2M */);
+    if ( rc )
+        return rc;
+
+    /* Sanity check the start and end markers. */
+    if ( (rc = check_guest_marks(GFN_2M,     0,       8)) ||
+         (rc = check_guest_marks(GFN_4M - 8, 512 - 8, 8)) )
+        return rc;
+
+
+#define GFN_PAIR(g, c) (g), ((g) + (c) - 1)
+
+    /*
+     * Move the final 32 pages below 4M forward by 32 pages.  All destination
+     * GFNs free, and no overlap.
+     */
+    printf("  Test forward, no overlap:    GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_4M - 32, 32), GFN_PAIR(GFN_4M, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_4M - 32, GFN_4M);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_4M, 512 - 32, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the next 32 pages below 4M forward by 1 page.  The region is
+     * almost completely overlapping.
+     */
+    printf("  Test forward, overlapping:   GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_4M - 64, 32), GFN_PAIR(GFN_4M - 63, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_4M - 64, GFN_4M - 63);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_4M - 63, 512 - 64, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the first 32 pages above 2M backwards by 32 pages.  All
+     * destination GFNs free, and no overlap.
+     */
+    printf("  Test backwards, no overlap:  GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_2M, 32), GFN_PAIR(GFN_2M - 32, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_2M, GFN_2M - 32);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_2M - 32, 0, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the next 32 pages above 2M backwards by 1 page.  The region is
+     * almost completely overlapping.
+     */
+    printf("  Test backwards, overlapping: GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_2M + 32, 32), GFN_PAIR(GFN_2M + 31, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_2M + 32, GFN_2M + 31);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_2M + 31, 32, 32);
+    if ( rc )
+        return rc;
+
+    return 0;
+
+#undef GFN_PAIR
+#undef GFN_4M
+#undef GFN_2M
+}
+
 static int run_tests(void)
 {
     int rc;
@@ -154,6 +345,10 @@ static int run_tests(void)
     if ( rc )
         return rc;
 
+    rc = test_p2m_relocate_memory();
+    if ( rc )
+        return rc;
+
     return 0;
 }
 
@@ -167,6 +362,14 @@ int main(int argc, char **argv)
     if ( !xch )
         err(1, "xc_interface_open");
 
+    dh = xendevicemodel_open(NULL, 0);
+    if ( !dh )
+        err(1, "xendevicemodel_open");
+
+    fh = xenforeignmemory_open(NULL, 0);
+    if ( !fh )
+        err(1, "xenforeignmemory_open");
+
     rc = xc_domain_create(xch, &domid, &create);
     if ( rc )
     {
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c90517e846..3672bda025 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -962,7 +962,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     unsigned int done = 0;
     long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
-    struct page_info *pages[16];
+    struct page_info *pages[16]; /* If changing this, adjust test-paging-mempool too */
 
     if ( !paging_mode_translate(d) )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 16:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 16:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308313.1579830 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCs4-0003K6-3d; Wed, 13 May 2026 16:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308313.1579830; Wed, 13 May 2026 16:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNCs4-0003Jy-16; Wed, 13 May 2026 16:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1308313;
 Wed, 13 May 2026 16:55:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNCs3-0003Jq-3c
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 16:55:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCs3-003KgC-0G
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNCs3-003Kyu-09
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 16:55:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xjlgrjx+9kaRVHtt5rxuqRQ4P9dQtOY/cCLInFMPG4Y=; b=cXZlW8Oy2+ziWfN2BLv0uyDes+
	VwdTae7OA1xKm9Sh2Gn+Usue2x9hx2agpFHY0Rypim8eUHnyuNt8kDRLKBAw+syktxa9dnBLJmFCd
	yIvajT5ZsA5vht5ha5aqS+J0CTQ/j+TK9D3OG9QXBqqd888X58iwojmZBED9z3uOZeWk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/libxl: Fix libxl_nocpuid.c build with json-c
Message-Id: <E1wNCs3-003Kyu-09@xenbits.xenproject.org>
Date: Wed, 13 May 2026 16:55:43 +0000

commit ca7906501ee8d5d0744fbcfe092633559dedd7f5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 16:53:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tools/libxl: Fix libxl_nocpuid.c build with json-c
    
    libxl_nocpuid.c needs the same treatment as libxl_cpuid.c
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c
index 0630959e76..ce334633b3 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,21 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    *jso_r = NULL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     return 0;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 13 23:44:18 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 23:44:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308557.1579951 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFD-00056T-W3; Wed, 13 May 2026 23:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308557.1579951; Wed, 13 May 2026 23:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFD-00056K-Sl; Wed, 13 May 2026 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1308557;
 Wed, 13 May 2026 23:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNJFC-00056C-He
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 23:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFC-003Rvk-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFC-003lmO-1A
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ANNTeDfN6E0qY2zA8b86ExForWsLL9l5KqmivZ3U8BM=; b=4rw/6VOMpIl4+EeHE7dzdvorch
	Mxl3qV3bGYsiByxWL6jdsSCuYavHPFqoH49xgcQQrg2+mM0XDRagwFlzFIyfDr0sadObWPAdeIKFT
	DMGFgZ5HIbB6gAJ4i41JUruXfUwuQWp1EjHQuFWj5jJrOrBL5BB+osC0+OWjcqbpOf2w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Don't toggle local event delivery on STGI/CLGI
Message-Id: <E1wNJFC-003lmO-1A@xenbits.xenproject.org>
Date: Wed, 13 May 2026 23:44:02 +0000

commit 6a6e1e17d662984ab3f5cfb6e84568c810a35fb7
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Thu May 7 11:55:06 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    x86/svm: Don't toggle local event delivery on STGI/CLGI
    
    There is no need to explicitly enable/disable local event delivery on
    STGI/CLGI since HVM event delivery already takes into account the state
    of the GIF (and IF). This ensures the behaviour is consistent regardless
    of whether vGIF is used.
    
    Fold the functions into the callers since they are now only a single
    assignment.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index ef6fa5d23b..64fbfe8fa7 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -19,22 +19,6 @@
 #define NSVM_ERROR_VVMCB        1
 #define NSVM_ERROR_VMENTRY      2
 
-static void
-nestedsvm_vcpu_clgi(struct vcpu *v)
-{
-    /* clear gif flag */
-    vcpu_nestedsvm(v).ns_gif = 0;
-    local_event_delivery_disable(); /* mask events for PV drivers */
-}
-
-static void
-nestedsvm_vcpu_stgi(struct vcpu *v)
-{
-    /* enable gif flag */
-    vcpu_nestedsvm(v).ns_gif = 1;
-    local_event_delivery_enable(); /* unmask events for PV drivers */
-}
-
 int nestedsvm_vmcb_map(struct vcpu *v, uint64_t vmcbaddr)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
@@ -161,7 +145,7 @@ int cf_check nsvm_vcpu_reset(struct vcpu *v)
 
     svm->ns_iomap = NULL;
 
-    nestedsvm_vcpu_stgi(v);
+    svm->ns_gif = 1;
     return 0;
 }
 
@@ -667,7 +651,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
         return ret;
     }
 
-    nestedsvm_vcpu_stgi(v);
+    svm->ns_gif = 1;
     return 0;
 }
 
@@ -1214,7 +1198,7 @@ nestedsvm_vmexit_defer(struct vcpu *v,
     if ( vmcb->_vintr.fields.vgif_enable )
         vmcb->_vintr.fields.vgif = 0;
     else
-        nestedsvm_vcpu_clgi(v);
+        svm->ns_gif = 0;
 
     svm->ns_vmexit.exitcode = exitcode;
     svm->ns_vmexit.exitinfo1 = exitinfo1;
@@ -1502,7 +1486,7 @@ void svm_vmexit_do_stgi(struct cpu_user_regs *regs, struct vcpu *v)
     if ( (inst_len = svm_get_insn_len(v, INSTR_STGI)) == 0 )
         return;
 
-    nestedsvm_vcpu_stgi(v);
+    vcpu_nestedsvm(v).ns_gif = 1;
 
     __update_guest_eip(regs, inst_len);
 }
@@ -1523,7 +1507,7 @@ void svm_vmexit_do_clgi(struct cpu_user_regs *regs, struct vcpu *v)
     if ( (inst_len = svm_get_insn_len(v, INSTR_CLGI)) == 0 )
         return;
 
-    nestedsvm_vcpu_clgi(v);
+    vcpu_nestedsvm(v).ns_gif = 0;
 
     /* After a CLGI no interrupts should come */
     intr = vmcb_get_vintr(vmcb);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 23:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 23:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308558.1579954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFO-00058r-1i; Wed, 13 May 2026 23:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308558.1579954; Wed, 13 May 2026 23:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFN-00058i-VR; Wed, 13 May 2026 23:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1308558;
 Wed, 13 May 2026 23:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNJFM-00058Q-Jk
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 23:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFM-003Rvo-1p
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFM-003lnp-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+MlBccossBxJDmVECVOmx0CPZOlHiBePoBiKEcVyH7Y=; b=Z+QbiuVF982OrtikolI60IqQce
	QlNC8kUpPuZgPq1soGKEwGJik9g1Glp3lSobkNpbjWaPzTzO41xYk07rFb24S9pSKmWO0M/VnIlTk
	1foa+jTq26V2lIxgWX3vjIsze12Ylk0ijCdFkA1eUmkYs8AOYG8AubK5BgY6nphTVzJc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] nestedsvm: Clear GIF when injecting VMEXIT
Message-Id: <E1wNJFM-003lnp-1f@xenbits.xenproject.org>
Date: Wed, 13 May 2026 23:44:12 +0000

commit 5fa2c5849f8d7a6e6a87f6e3478e8522b4d20d79
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Thu May 7 11:55:07 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    nestedsvm: Clear GIF when injecting VMEXIT
    
    If L1 executes VMRUN with the GIF set and it fails consistency checks,
    Xen will inject a VMEXIT and fail the assert checking the GIF is cleared.
    
    Instead, clear the GIF when injecting a VMEXIT to match what hardware
    does.
    
    Fixes: 9a779e4fc161 ("Implement SVM specific part for Nested Virtualization")
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/nestedsvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 64fbfe8fa7..9899cb2147 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -717,9 +717,9 @@ nsvm_vcpu_vmexit_inject(struct vcpu *v, struct cpu_user_regs *regs,
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
 
     if ( vmcb->_vintr.fields.vgif_enable )
-        ASSERT(vmcb->_vintr.fields.vgif == 0);
+        vmcb->_vintr.fields.vgif = 0;
     else
-        ASSERT(svm->ns_gif == 0);
+        svm->ns_gif = 0;
 
     ns_vmcb = nv->nv_vvmcx;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 23:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 23:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308559.1579959 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFY-0005BC-34; Wed, 13 May 2026 23:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308559.1579959; Wed, 13 May 2026 23:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFY-0005B4-0R; Wed, 13 May 2026 23:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1308559;
 Wed, 13 May 2026 23:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNJFW-0005Aw-N0
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 23:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFW-003RwA-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFW-003lp3-20
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kkbAPDSJkezYXI+OWuUL9tspf6mKIUxeoCF153xnhEw=; b=mmnqw25avRUte7odq3PA0Q6JDe
	8GcBZTSd9Kc9XtcytzLSoa2Nb9k81eTDgAnLKt5gMS6PdTueRXu2kgaVF8A4cdvMEdZtMpUtkgFsP
	Bz7XFl8jmI9s0J1n6NDUNiQbeTjfJLBuMxJjC1+OuxLCCWzy4J4h6oCbPPbvv5shS4ag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tests/paging-mempool: Misc cleanup
Message-Id: <E1wNJFW-003lp3-20@xenbits.xenproject.org>
Date: Wed, 13 May 2026 23:44:22 +0000

commit d53ba690b0d23ebe9265aa731c0fc3586c035fc4
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 11 16:17:38 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tests/paging-mempool: Misc cleanup
    
    ... ahead of extending it with a second test.
    
    Rename run_tests() to test_paging_mempool_size() and have it return int so the
    new run_tests() can decide whether to run subsequent tests or not.
    
    Comment the parameters to xc_domain_populate_physmap_exact() to make it
    clearer what's going on, and remove the page added to the physmap when the
    test is done.
    
    No practical change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/paging-mempool/test-paging-mempool.c | 26 +++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 1ebc13455a..9ef8252126 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -15,6 +15,7 @@ static unsigned int nr_failures;
 ({                                              \
     nr_failures++;                              \
     (void)printf(fmt, ##__VA_ARGS__);           \
+    -1;                                         \
 })
 
 static xc_interface *xch;
@@ -40,7 +41,7 @@ static uint64_t default_mempool_size_bytes =
     16 << 12;
 #endif
 
-static void run_tests(void)
+static int test_paging_mempool_size(void)
 {
     xen_pfn_t physmap[] = { 0 };
     uint64_t size_bytes, old_size_bytes;
@@ -80,7 +81,9 @@ static void run_tests(void)
         return fail("  Fail: setmaxmem: : %d - %s\n",
                     errno, strerror(errno));
 
-    rc = xc_domain_populate_physmap_exact(xch, domid, 1, 0, 0, physmap);
+    rc = xc_domain_populate_physmap_exact(
+        xch, domid, ARRAY_SIZE(physmap),
+        0 /* order 4k */, 0 /* flags */, physmap);
     if ( rc )
         return fail("  Fail: populate physmap: %d - %s\n",
                     errno, strerror(errno));
@@ -98,6 +101,11 @@ static void run_tests(void)
         return fail("  Fail: mempool size changed %"PRIu64" => %"PRIu64"\n",
                     old_size_bytes, size_bytes);
 
+    /* We added one 4k page.  Check we can remove it. */
+    rc = xc_domain_remove_from_physmap(xch, domid, physmap[0]);
+    if ( rc )
+        return fail("  Fail: remove from physmap: %d - %s\n",
+                    errno, strerror(errno));
 
 
     printf("Test bad set size\n");
@@ -134,6 +142,19 @@ static void run_tests(void)
     if ( size_bytes != 64 << 20 )
         return fail("  Fail: expected mempool size %u, got %"PRIu64"\n",
                     64 << 20, size_bytes);
+
+    return 0;
+}
+
+static int run_tests(void)
+{
+    int rc;
+
+    rc = test_paging_mempool_size();
+    if ( rc )
+        return rc;
+
+    return 0;
 }
 
 int main(int argc, char **argv)
@@ -143,7 +164,6 @@ int main(int argc, char **argv)
     printf("Paging mempool tests\n");
 
     xch = xc_interface_open(NULL, NULL, 0);
-
     if ( !xch )
         err(1, "xc_interface_open");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 23:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 23:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308560.1579963 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFi-0005DG-4f; Wed, 13 May 2026 23:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308560.1579963; Wed, 13 May 2026 23:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFi-0005D8-1x; Wed, 13 May 2026 23:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1308560;
 Wed, 13 May 2026 23:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNJFg-0005D1-Rc
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 23:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFg-003RwE-2f
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFg-003lqM-2N
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+3JHunbBkaZ2jYbNHeAm1AiewOMcyRlvV9qLS2un7wU=; b=G5I0W/EYYygzzTcOWSgbs4yOao
	yjpG5FyMfI5WNSbYKs0xGS6ADGOWxSz965Ho03gsk7utsXXTXW4Bp6E4p5YqqZO6LCPtBxV/yFu6l
	MGxoQaWPeRy+7+3r7389k4RHynnV9y2E6YLQy4G2xikxuo0sci5dRUq+7koqKO8LpJpg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tests/paging-mempool: Extend to test P2M relocation
Message-Id: <E1wNJFg-003lqM-2N@xenbits.xenproject.org>
Date: Wed, 13 May 2026 23:44:32 +0000

commit 66c982a5d3614f0905952d8cf8af1b467c516994
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 11 16:26:12 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tests/paging-mempool: Extend to test P2M relocation
    
    XENMAPSPACE_gmfn_range was found to be buggy with overlapping ranges, and the
    fix is sufficiently far from clear that yours truly decided a test was in
    order.
    
    XENMAPSPACE_gmfn_range is exposed by xendevicemodel_relocate_memory() so take
    the opportunity to create a better example for others to copy.
    
    The test works as follows.  Populate 2M of RAM in the guest, marking the pages
    so they can be identified later.  Then construct four relocation test
    cases (overlapping vs non-overlapping, forwards vs backwards) using the marks
    in the guest pages to confirm that the P2M was adjusted correctly.
    
    The use of XEN_DOMCTL_CDF_iommu forces xenmem_add_to_physmap() to limit the
    iteration count to a maximum of 16.  Use this to force a continuation and
    exercise more of the logic.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/paging-mempool/Makefile              |   4 +
 tools/tests/paging-mempool/test-paging-mempool.c | 205 ++++++++++++++++++++++-
 xen/common/memory.c                              |   2 +-
 3 files changed, 209 insertions(+), 2 deletions(-)

diff --git a/tools/tests/paging-mempool/Makefile b/tools/tests/paging-mempool/Makefile
index a1e12584ce..7444d81b84 100644
--- a/tools/tests/paging-mempool/Makefile
+++ b/tools/tests/paging-mempool/Makefile
@@ -25,9 +25,13 @@ uninstall:
 
 CFLAGS += $(CFLAGS_xeninclude)
 CFLAGS += $(CFLAGS_libxenctrl)
+CFLAGS += $(CFLAGS_libxendevicemodel)
+CFLAGS += $(CFLAGS_libxenforeignmemory)
 CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(LDLIBS_libxenctrl)
+LDFLAGS += $(LDLIBS_libxendevicemodel)
+LDFLAGS += $(LDLIBS_libxenforeignmemory)
 LDFLAGS += $(APPEND_LDFLAGS)
 
 %.o: Makefile
diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 9ef8252126..3c87925288 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -6,6 +6,7 @@
 #include <sys/mman.h>
 
 #include <xenctrl.h>
+#include <xendevicemodel.h>
 #include <xenforeignmemory.h>
 #include <xengnttab.h>
 #include <xen-tools/common-macros.h>
@@ -19,10 +20,15 @@ static unsigned int nr_failures;
 })
 
 static xc_interface *xch;
+static xendevicemodel_handle *dh;
+static xenforeignmemory_handle *fh;
 static uint32_t domid;
 
 static struct xen_domctl_createdomain create = {
-    .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
+    .flags = (XEN_DOMCTL_CDF_hvm |
+              XEN_DOMCTL_CDF_hap |
+              XEN_DOMCTL_CDF_iommu |
+              0),
     .max_vcpus = 1,
     .max_grant_frames = 1,
     .grant_opts = XEN_DOMCTL_GRANT_version(1),
@@ -146,6 +152,191 @@ static int test_paging_mempool_size(void)
     return 0;
 }
 
+static int mark_guest_mem(xen_pfn_t gfn, size_t count)
+{
+    xen_pfn_t gfns[count];
+    uint32_t *mem;
+    size_t i;
+    int rc;
+
+    for ( i = 0; i < count; ++i )
+        gfns[i] = gfn + i;
+
+    mem = xenforeignmemory_map(fh, domid, PROT_READ | PROT_WRITE,
+                               count, gfns, NULL);
+    if ( !mem )
+        return fail("  Fail: mark mem foreign map: %d - %s\n",
+                    errno, strerror(errno));
+
+    for ( i = 0; i < count; ++i )
+    {
+        uint32_t *mark = &mem[i << 10];
+
+        *mark = ~i;
+    }
+
+    rc = xenforeignmemory_unmap(fh, mem, count);
+    if ( rc )
+        return fail("  Fail: mark mem foreign unmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    return 0;
+}
+
+static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
+{
+    xen_pfn_t gfns[count];
+    int errs[count];
+    uint32_t *mem;
+    size_t i;
+    int rc = 0;
+
+    for ( i = 0; i < count; ++i )
+        gfns[i] = gfn + i;
+
+    mem = xenforeignmemory_map(fh, domid, PROT_READ,
+                               count, gfns, errs);
+    if ( !mem )
+        return fail("    Fail: check mark foreign map: %d - %s\n",
+                    errno, strerror(errno));
+
+    for ( i = 0; i < count; ++i )
+    {
+        uint32_t *mark = &mem[i << 10];
+        uint32_t exp = ~(mark_start + i);
+
+        if ( errs[i] )
+        {
+            rc = -1;
+            fail("    Fail: check mark unable to map gfn %05lx: %d\n",
+                 gfns[i], errs[i]);
+            continue;
+        }
+
+        if ( *mark == exp )
+            continue;
+
+        fail("    Fail: check mark: gfn %05lx expecting %08x (%u), got %08x (%u)\n",
+               gfns[i], exp, ~exp, *mark, ~*mark);
+        rc = -1;
+    }
+
+    if ( xenforeignmemory_unmap(fh, mem, count) )
+        return fail("    Fail: check marks foreign unmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    return rc;
+}
+
+static int test_p2m_relocate_memory(void)
+{
+#define GFN_2M ((2UL << 20) >> 12)
+#define GFN_4M ((4UL << 20) >> 12)
+
+    xen_pfn_t physmap[] = { GFN_2M };
+    int rc;
+
+    /*
+     * Inherited state of the domain:
+     * - Unlimited allocation
+     * - XEN_DOMCTL_CDF_iommu, which causes xendevicemodel_relocate_memory()
+     *   to undergo continuations every 16 pages
+     *
+     * Construction of the test:
+     * - Populate 2M at 2M, mark the pages.
+     */
+    printf("Test p2m memory relocation\n");
+
+    rc = xc_domain_populate_physmap_exact(
+        xch, domid, ARRAY_SIZE(physmap),
+        9 /* order 2M */, 0 /* flags */, physmap);
+    if ( rc )
+        return fail("  Fail: populate physmap: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = mark_guest_mem(GFN_2M, 1 << 9 /* order 2M */);
+    if ( rc )
+        return rc;
+
+    /* Sanity check the start and end markers. */
+    if ( (rc = check_guest_marks(GFN_2M,     0,       8)) ||
+         (rc = check_guest_marks(GFN_4M - 8, 512 - 8, 8)) )
+        return rc;
+
+
+#define GFN_PAIR(g, c) (g), ((g) + (c) - 1)
+
+    /*
+     * Move the final 32 pages below 4M forward by 32 pages.  All destination
+     * GFNs free, and no overlap.
+     */
+    printf("  Test forward, no overlap:    GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_4M - 32, 32), GFN_PAIR(GFN_4M, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_4M - 32, GFN_4M);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_4M, 512 - 32, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the next 32 pages below 4M forward by 1 page.  The region is
+     * almost completely overlapping.
+     */
+    printf("  Test forward, overlapping:   GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_4M - 64, 32), GFN_PAIR(GFN_4M - 63, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_4M - 64, GFN_4M - 63);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_4M - 63, 512 - 64, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the first 32 pages above 2M backwards by 32 pages.  All
+     * destination GFNs free, and no overlap.
+     */
+    printf("  Test backwards, no overlap:  GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_2M, 32), GFN_PAIR(GFN_2M - 32, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_2M, GFN_2M - 32);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_2M - 32, 0, 32);
+    if ( rc )
+        return rc;
+
+    /*
+     * Move the next 32 pages above 2M backwards by 1 page.  The region is
+     * almost completely overlapping.
+     */
+    printf("  Test backwards, overlapping: GFNs [%lx...%lx] -> [%lx...%lx]\n",
+           GFN_PAIR(GFN_2M + 32, 32), GFN_PAIR(GFN_2M + 31, 32));
+
+    rc = xendevicemodel_relocate_memory(dh, domid, 32, GFN_2M + 32, GFN_2M + 31);
+    if ( rc )
+        return fail("  Fail: relocate memory: %d - %s\n",
+                    errno, strerror(errno));
+
+    rc = check_guest_marks(GFN_2M + 31, 32, 32);
+    if ( rc )
+        return rc;
+
+    return 0;
+
+#undef GFN_PAIR
+#undef GFN_4M
+#undef GFN_2M
+}
+
 static int run_tests(void)
 {
     int rc;
@@ -154,6 +345,10 @@ static int run_tests(void)
     if ( rc )
         return rc;
 
+    rc = test_p2m_relocate_memory();
+    if ( rc )
+        return rc;
+
     return 0;
 }
 
@@ -167,6 +362,14 @@ int main(int argc, char **argv)
     if ( !xch )
         err(1, "xc_interface_open");
 
+    dh = xendevicemodel_open(NULL, 0);
+    if ( !dh )
+        err(1, "xendevicemodel_open");
+
+    fh = xenforeignmemory_open(NULL, 0);
+    if ( !fh )
+        err(1, "xenforeignmemory_open");
+
     rc = xc_domain_create(xch, &domid, &create);
     if ( rc )
     {
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c90517e846..3672bda025 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -962,7 +962,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
     unsigned int done = 0;
     long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
-    struct page_info *pages[16];
+    struct page_info *pages[16]; /* If changing this, adjust test-paging-mempool too */
 
     if ( !paging_mode_translate(d) )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 13 23:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 13 May 2026 23:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308561.1579968 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFs-0005FC-6D; Wed, 13 May 2026 23:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308561.1579968; Wed, 13 May 2026 23:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNJFs-0005F2-3P; Wed, 13 May 2026 23:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1308561;
 Wed, 13 May 2026 23:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNJFq-0005Ew-UK
 for xen-changelog@lists.xenproject.org; Wed, 13 May 2026 23:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFq-003RwI-2v
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNJFq-003lrm-2p
 for xen-changelog@lists.xenproject.org;
 Wed, 13 May 2026 23:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=BcTcm6UhrcjqWdRZZLSwd6GvKz69MgxmxQWVBv42C54=; b=jdNRyGDpdRmrWKH/cUBLKPGeTK
	KmrzE44SOks6tsc1JDkeSCG+f5KXWR+XlxTRiMUWnc/si7ucTdwbwy5yQHnB4odeD4qkLdT+4ozez
	Hzf25WnLiHygeseosjZfFvLpXaWwQO06EejAZU6Nm3mezEpIr9skMjdlwz7045Csq9w0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/libxl: Fix libxl_nocpuid.c build with json-c
Message-Id: <E1wNJFq-003lrm-2p@xenbits.xenproject.org>
Date: Wed, 13 May 2026 23:44:42 +0000

commit ca7906501ee8d5d0744fbcfe092633559dedd7f5
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 16:53:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed May 13 16:44:34 2026 +0100

    tools/libxl: Fix libxl_nocpuid.c build with json-c
    
    libxl_nocpuid.c needs the same treatment as libxl_cpuid.c
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c
index 0630959e76..ce334633b3 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,21 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    *jso_r = NULL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     return 0;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 06:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 06:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308666.1580032 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPd1-0004mR-Kj; Thu, 14 May 2026 06:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308666.1580032; Thu, 14 May 2026 06:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPd1-0004mJ-Hb; Thu, 14 May 2026 06:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1308666;
 Thu, 14 May 2026 06:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNPd0-0004mD-3C
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 06:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPcz-004hP7-32
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPcz-0048HP-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+OLIPOO2jNqamN0wUI19Ba7HDMzHEffr/Gi1EkiaXcs=; b=q4OvAfi3svUyOJ4PYr7gZC5Gcg
	vzYXFXd3oNEoWva117MF1eQpw6OOXtmJrPH65SWhlAkkhqqi06EGmJLny+6M4LSEZhVYJNtB1cjYT
	i7Z4aEAM8v6HaJCXZ7u/N9uSRfBroxr4fSItK0sFERVF2p/e+CgXifzSyXXUj8sZZ8k0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: arm: fix len type for guest copy functions
Message-Id: <E1wNPcz-0048HP-2r@xenbits.xenproject.org>
Date: Thu, 14 May 2026 06:33:01 +0000

commit e4424b9a635623b247a9a070db1238bf93f94764
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:40 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: arm: fix len type for guest copy functions
    
    Widen the len argument of copy_to_guest_phys_flush_dcache() and the
    copy_to_guest_phys_cb typedef from unsigned int to unsigned long, as
    the function can be used to copy large blobs such as the initrd which
    may exceed 4GB. Update the internal copy_guest() len argument to
    unsigned long accordingly.
    
    Change the type for local variable size in copy_guest() to avoid
    compilation error because of type mismatch.
    
    raw_* wrappers above copy_guest() keep returning unsigned long to
    avoid type narrowing; it is not an issue for raw_*'s len argument
    to remain 'unsigned int' since the assignment to copy_guest()'s wider
    unsigned long parameter is safe and there is no raw_* users who
    are using a value bigger than what can fit into 'unsigned int'.
    
    Fixes: 2986481b3d9e6 ("xen/arm: guest_copy: Extend the prototype to pass the vCPU")
    Fixes: 5302bd490bea7 ("xen/arm: Introduce copy_to_guest_phys_flush_dcache")
    Fixes: d07b7369aa65b ("xen/common: dom0less: introduce common domain-build.c")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/guestcopy.c                | 6 +++---
 xen/arch/arm/include/asm/guest_access.h | 2 +-
 xen/include/xen/fdt-domain-build.h      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index fdb06422b8..86f1c9d0e3 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -53,7 +53,7 @@ static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
     return page;
 }
 
-static unsigned long copy_guest(void *buf, uint64_t addr, unsigned int len,
+static unsigned long copy_guest(void *buf, uint64_t addr, unsigned long len,
                                 copy_info_t info, unsigned int flags)
 {
     /* XXX needs to handle faults */
@@ -65,7 +65,7 @@ static unsigned long copy_guest(void *buf, uint64_t addr, unsigned int len,
     while ( len )
     {
         void *p;
-        unsigned int size = min(len, (unsigned int)PAGE_SIZE - offset);
+        unsigned long size = min(len, PAGE_SIZE + 0UL - offset);
         struct page_info *page;
 
         page = translate_get_page(info, addr, flags & COPY_linear,
@@ -136,7 +136,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from,
 unsigned long copy_to_guest_phys_flush_dcache(struct domain *d,
                                               paddr_t gpa,
                                               void *buf,
-                                              unsigned int len)
+                                              unsigned long len)
 {
     return copy_guest(buf, gpa, len, GPA_INFO(d),
                       COPY_to_guest | COPY_ipa | COPY_flush_dcache);
diff --git a/xen/arch/arm/include/asm/guest_access.h b/xen/arch/arm/include/asm/guest_access.h
index 18c88b70d7..c13cbec55b 100644
--- a/xen/arch/arm/include/asm/guest_access.h
+++ b/xen/arch/arm/include/asm/guest_access.h
@@ -14,7 +14,7 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 unsigned long copy_to_guest_phys_flush_dcache(struct domain *d,
                                               paddr_t gpa,
                                               void *buf,
-                                              unsigned int len);
+                                              unsigned long len);
 
 int access_guest_memory_by_gpa(struct domain *d, paddr_t gpa, void *buf,
                                uint32_t size, bool is_write);
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 9465a1021f..671486c1c8 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -48,7 +48,7 @@ static inline int get_allocation_size(paddr_t size)
 typedef unsigned long (*copy_to_guest_phys_cb)(struct domain *d,
                                                paddr_t gpa,
                                                void *buf,
-                                               unsigned int len);
+                                               unsigned long len);
 
 void initrd_load(struct kernel_info *kinfo,
                  copy_to_guest_phys_cb cb);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 06:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 06:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308667.1580037 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdB-0004oM-OV; Thu, 14 May 2026 06:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308667.1580037; Thu, 14 May 2026 06:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdB-0004oE-Kq; Thu, 14 May 2026 06:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1308667;
 Thu, 14 May 2026 06:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNPdA-0004nt-2Y
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 06:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdA-004hPE-08
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdA-0048Hu-00
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WV9DYwfLKu+JyvnBC06NSHct04iOinSONwdfjTxoJeg=; b=KD+18hYTBs4uwxeJwo1Lb3EdDa
	72Nfe6IqaTn2bxDs0zs0AzvsE0CBBBeY5R+U2dXjw+phCFqNS3LZeGww8MZ5Q0hQUD56M9vQtgFvS
	WtDX1sWVO18mSk7UgywI+EaEtzJS/saATHSUSYXDxMxb/QNrJqPOKdUBXIcyxfZr9Qsw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/dom0less: rename kernel_zimage_probe() to kernel_image_probe()
Message-Id: <E1wNPdA-0048Hu-00@xenbits.xenproject.org>
Date: Thu, 14 May 2026 06:33:12 +0000

commit 17b9e56a92bd3f6a8ca37806706f87c94e886e23
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:41 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen/dom0less: rename kernel_zimage_probe() to kernel_image_probe()
    
    The helper kernel_zimage_probe() is referenced from common code
    (xen/common/device-tree/kernel.c), but its name is tied to the zImage
    format which is specific to Arm (from architectures supported by Xen).
    
    Other architectures supported by Xen, such as RISC-V, do not use the
    zImage format and instead rely on other kernel image types (e.g. Image
    or compressed Image variants: Image.gz, etc). Using "zimage" in the
    name is therefore misleading in architecture-independent code.
    
    Rename kernel_zimage_probe() to kernel_image_probe() and update the
    associated structure field from "zimage" to "image" to reflect that the
    code handles generic kernel images rather than the zImage format
    specifically.
    
    No functional change intended.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/kernel.c           | 50 ++++++++++++++++++++---------------------
 xen/common/device-tree/kernel.c |  2 +-
 xen/include/xen/fdt-kernel.h    |  6 ++---
 3 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 9395b5af87..b72585b7fe 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -101,8 +101,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
     paddr_t load_addr;
 
 #ifdef CONFIG_HAS_DOMAIN_TYPE
-    if ( (info->type == DOMAIN_64BIT) && (info->zimage.start == 0) )
-        return mem->bank[0].start + info->zimage.text_offset;
+    if ( (info->type == DOMAIN_64BIT) && (info->image.start == 0) )
+        return mem->bank[0].start + info->image.text_offset;
 #endif
 
     /*
@@ -111,19 +111,19 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
      * and above 32MiB. Load it as high as possible within these
      * constraints, while also avoiding the DTB.
      */
-    if ( info->zimage.start == 0 )
+    if ( info->image.start == 0 )
     {
         paddr_t load_end;
 
         load_end = mem->bank[0].start + mem->bank[0].size;
         load_end = MIN(mem->bank[0].start + MB(128), load_end);
 
-        load_addr = load_end - info->zimage.len;
+        load_addr = load_end - info->image.len;
         /* Align to 2MB */
         load_addr &= ~((2 << 20) - 1);
     }
     else
-        load_addr = info->zimage.start;
+        load_addr = info->image.start;
 
     return load_addr;
 }
@@ -131,8 +131,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
 static void __init kernel_zimage_load(struct kernel_info *info)
 {
     paddr_t load_addr = kernel_zimage_place(info);
-    paddr_t paddr = info->zimage.kernel_addr;
-    paddr_t len = info->zimage.len;
+    paddr_t paddr = info->image.kernel_addr;
+    paddr_t len = info->image.len;
     void *kernel;
     int rc;
 
@@ -215,7 +215,7 @@ int __init kernel_uimage_probe(struct kernel_info *info,
         return -EOPNOTSUPP;
     }
 
-    info->zimage.start = be32_to_cpu(uimage.load);
+    info->image.start = be32_to_cpu(uimage.load);
     info->entry = be32_to_cpu(uimage.ep);
 
     /*
@@ -224,20 +224,20 @@ int __init kernel_uimage_probe(struct kernel_info *info,
      * independent image. That means Xen is free to load such an image at
      * any valid address.
      */
-    if ( info->zimage.start == 0 )
+    if ( info->image.start == 0 )
         printk(XENLOG_INFO
                "No load address provided. Xen will decide where to load it.\n");
     else
         printk(XENLOG_INFO
                "Provided load address: %"PRIpaddr" and entry address: %"PRIpaddr"\n",
-               info->zimage.start, info->entry);
+               info->image.start, info->entry);
 
     /*
      * If the image supports position independent execution, then user cannot
      * provide an entry point as Xen will load such an image at any appropriate
      * memory address. Thus, we need to return error.
      */
-    if ( (info->zimage.start == 0) && (info->entry != 0) )
+    if ( (info->image.start == 0) && (info->entry != 0) )
     {
         printk(XENLOG_ERR
                "Entry point cannot be non zero for PIE image.\n");
@@ -257,13 +257,13 @@ int __init kernel_uimage_probe(struct kernel_info *info,
         if ( rc )
             return rc;
 
-        info->zimage.kernel_addr = mod->start;
-        info->zimage.len = mod->size;
+        info->image.kernel_addr = mod->start;
+        info->image.len = mod->size;
     }
     else
     {
-        info->zimage.kernel_addr = addr + sizeof(uimage);
-        info->zimage.len = len;
+        info->image.kernel_addr = addr + sizeof(uimage);
+        info->image.len = len;
     }
 
     info->load = kernel_zimage_load;
@@ -287,9 +287,9 @@ int __init kernel_uimage_probe(struct kernel_info *info,
      * header. In other words if the user provides a uImage header on top of
      * zImage or zImage64 header, Xen uses the attributes of uImage header only.
      * Thus, Xen uses uimage.load attribute to determine the load address and
-     * zimage.text_offset is ignored.
+     * image.text_offset is ignored.
      */
-    info->zimage.text_offset = 0;
+    info->image.text_offset = 0;
 #endif
 
     return 0;
@@ -338,10 +338,10 @@ static int __init kernel_zimage64_probe(struct kernel_info *info,
     if ( (end - start) > size )
         return -EINVAL;
 
-    info->zimage.kernel_addr = addr;
-    info->zimage.len = end - start;
-    info->zimage.text_offset = zimage.text_offset;
-    info->zimage.start = 0;
+    info->image.kernel_addr = addr;
+    info->image.len = end - start;
+    info->image.text_offset = zimage.text_offset;
+    info->image.start = 0;
 
     info->load = kernel_zimage_load;
 
@@ -389,10 +389,10 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
         }
     }
 
-    info->zimage.kernel_addr = addr;
+    info->image.kernel_addr = addr;
 
-    info->zimage.start = start;
-    info->zimage.len = end - start;
+    info->image.start = start;
+    info->image.len = end - start;
 
     info->load = kernel_zimage_load;
 
@@ -403,7 +403,7 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
     return 0;
 }
 
-int __init kernel_zimage_probe(struct kernel_info *info, paddr_t addr,
+int __init kernel_image_probe(struct kernel_info *info, paddr_t addr,
                                paddr_t size)
 {
     int rc;
diff --git a/xen/common/device-tree/kernel.c b/xen/common/device-tree/kernel.c
index 28096121a5..cfa27464f0 100644
--- a/xen/common/device-tree/kernel.c
+++ b/xen/common/device-tree/kernel.c
@@ -235,7 +235,7 @@ int __init kernel_probe(struct kernel_info *info,
     if ( rc && rc != -EINVAL )
         return rc;
 
-    rc = kernel_zimage_probe(info, mod->start, mod->size);
+    rc = kernel_image_probe(info, mod->start, mod->size);
 
     return rc;
 }
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 86a37a1304..8cd1670c2c 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -63,7 +63,7 @@ struct kernel_info {
             paddr_t text_offset; /* 64-bit Image only */
 #endif
             paddr_t start; /* Must be 0 for 64-bit Image */
-        } zimage;
+        } image;
     };
 
 #ifdef CONFIG_HAS_DOMAIN_TYPE
@@ -113,7 +113,7 @@ kernel_info_get_mem_const(const struct kernel_info *kinfo)
  * Probe the kernel to detemine its type and select a loader.
  *
  * Sets in info:
- *  ->load hook, and sets loader specific variables ->zimage
+ *  ->load hook, and sets loader specific variables ->image
  */
 int kernel_probe(struct kernel_info *info, const struct dt_device_node *domain);
 
@@ -133,7 +133,7 @@ void kernel_load(struct kernel_info *info);
 
 int kernel_decompress(struct boot_module *mod, uint32_t offset);
 
-int kernel_zimage_probe(struct kernel_info *info, paddr_t addr, paddr_t size);
+int kernel_image_probe(struct kernel_info *info, paddr_t addr, paddr_t size);
 
 /*
  * uImage isn't really used nowadays thereby leave kernel_uimage_probe()
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 06:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 06:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308668.1580040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdL-0004ql-P9; Thu, 14 May 2026 06:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308668.1580040; Thu, 14 May 2026 06:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdL-0004qd-MK; Thu, 14 May 2026 06:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1308668;
 Thu, 14 May 2026 06:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNPdK-0004qP-5E
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 06:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdK-004hPb-0P
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdK-0048IK-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cZzA9tlEZrPXCHS9T9PMr+9ENds5rJclocfeW04RwyY=; b=fLybCjJI3kl7eCxbk1q/BbFLX7
	Vqz2NS/vy4dUn5avtHgYpM8igRVandc6Cp7xUy1WouBCFhadTMi7+9K4iaYmgs5Mzc2kyiZNzLZ0m
	gxWxALGSM+BTf0NCOEsZE4ex+/pnEPKIuTxXLe45CV5aW55eQxlThuwMxiswe4bqcP+M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: move declaration of fw_unreserved_regions() to common header
Message-Id: <E1wNPdK-0048IK-0J@xenbits.xenproject.org>
Date: Thu, 14 May 2026 06:33:22 +0000

commit 392f93542193365357abf92a9fdbec4fcb67bf08
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:42 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: move declaration of fw_unreserved_regions() to common header
    
    Since the implementation of fw_unreserved_regions() is in common code, move
    its declaration to xen/bootinfo.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h | 3 ---
 xen/include/xen/bootinfo.h       | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 899e33925c..0d29b46ea5 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -43,9 +43,6 @@ int acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]);
 void create_dom0(void);
 
 void discard_initial_modules(void);
-void fw_unreserved_regions(paddr_t s, paddr_t e,
-                           void (*cb)(paddr_t ps, paddr_t pe),
-                           unsigned int first);
 
 void init_pdx(void);
 void setup_mm(void);
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index f834f19571..dbf492c2e3 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -210,4 +210,8 @@ static inline struct membanks *membanks_xzalloc(unsigned int nr,
     return banks;
 }
 
+void fw_unreserved_regions(paddr_t s, paddr_t e,
+                           void (*cb)(paddr_t ps, paddr_t pe),
+                           unsigned int first);
+
 #endif /* XEN_BOOTINFO_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 06:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 06:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308669.1580044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdV-0004t4-QO; Thu, 14 May 2026 06:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308669.1580044; Thu, 14 May 2026 06:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdV-0004sw-Nk; Thu, 14 May 2026 06:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1308669;
 Thu, 14 May 2026 06:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNPdU-0004sn-8z
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 06:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdU-004hPf-0o
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPdU-0048Ig-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nMqYKfZA5xT2ZmMiC4enIidl7oSVjlrrCREOD7jXgDY=; b=4RP2LK+Y7/4nh0SA2E8W2qx1A9
	exIClbPXpP3qT+ITiCDZClkrZcz2lcsZb6QSQRcIW656y9mW2xpMfJG7xTzA9uGAWtXONUvgAzGBk
	dBICxklRU8L2Ti33F5itUrtJs4MnkEHGzIadNqY4R6G3iGjb1BdRNoTgzcpYHDT/XMgs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: introduce domain-layout.h with common domain_use_host_layout()
Message-Id: <E1wNPdU-0048Ig-0b@xenbits.xenproject.org>
Date: Thu, 14 May 2026 06:33:32 +0000

commit b71811efe6e09ddb0fc3719ba47330a5c24a2e90
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:43 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: introduce domain-layout.h with common domain_use_host_layout()
    
    domain_use_host_layout() is not architecture-specific and may be needed
    on x86 [1]. Replace the ARM-specific macro in asm/domain.h with a common
    static inline in a new dedicated header, xen/domain-layout.h.
    
    xen/domain.h would be the natural home, but placing it there would
    require including xen/paging.h (for paging_mode_translate()) and
    xen/sched.h (for is_hardware_domain()), which would introduce circular
    dependencies. A separate header that callers opt into avoids this.
    
    Adjust the implementation to take paging_mode_translate() into account
    so it works correctly for all architectures, including x86. Some extra
    details about implementation [2] and [3].
    
    To avoid the following compilation issue:
    
    In file included from ./include/xen/paging.h:4,
                     from ./include/xen/domain-layout.h:6,
                     from common/device-tree/domain-build.c:4:
    ./arch/riscv/include/asm/paging.h:17:48: error: 'struct page_info'
    declared inside parameter list will not be visible outside of this
    definition or declaration [-Werror]
       17 | void paging_free_page(struct domain *d, struct page_info *pg);
    
    add the forward declaration of struct page_info to RISC-V's asm/paging.h.
    
    [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602161038120.359097@ubuntu-linux-20-04-desktop/
    [2] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602271742400.3148344@ubuntu-linux-20-04-desktop/
    [3] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602271750190.3148344@ubuntu-linux-20-04-desktop/
    
    Suggested-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c           |  1 +
 xen/arch/arm/include/asm/domain.h     | 14 --------------
 xen/arch/arm/vgic-v3.c                |  1 +
 xen/arch/riscv/include/asm/paging.h   |  1 +
 xen/common/device-tree/domain-build.c |  1 +
 xen/include/xen/domain-layout.h       | 28 ++++++++++++++++++++++++++++
 6 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index ad665cd3c0..1efddc60ef 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2,6 +2,7 @@
 #include <xen/init.h>
 #include <xen/bootinfo.h>
 #include <xen/compile.h>
+#include <xen/domain-layout.h>
 #include <xen/dom0less-build.h>
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index b24f02d269..46a5cdc0c8 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -18,20 +18,6 @@ struct hvm_domain
     uint64_t              params[HVM_NR_PARAMS];
 };
 
-/*
- * Is the domain using the host memory layout?
- *
- * Direct-mapped domain will always have the RAM mapped with GFN == MFN.
- * To avoid any trouble finding space, it is easier to force using the
- * host memory layout.
- *
- * The hardware domain will use the host layout regardless of
- * direct-mapped because some OS may rely on a specific address ranges
- * for the devices.
- */
-#define domain_use_host_layout(d) (is_domain_direct_mapped(d) || \
-                                   is_hardware_domain(d))
-
 struct vtimer {
     struct vcpu *v;
     int irq;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 77aab5c3c2..77517c3030 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -10,6 +10,7 @@
  */
 
 #include <xen/bitops.h>
+#include <xen/domain-layout.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index c1d225d02b..e487c89a4c 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -4,6 +4,7 @@
 #include <asm-generic/paging.h>
 
 struct domain;
+struct page_info;
 
 int paging_domain_init(struct domain *d);
 
diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index c51520ebad..6949203dac 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
 #include <xen/bootinfo.h>
+#include <xen/domain-layout.h>
 #include <xen/fdt-domain-build.h>
 #include <xen/init.h>
 #include <xen/lib.h>
diff --git a/xen/include/xen/domain-layout.h b/xen/include/xen/domain-layout.h
new file mode 100644
index 0000000000..cc5e56c9da
--- /dev/null
+++ b/xen/include/xen/domain-layout.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DOMAIN_LAYOUT_H
+#define XEN_DOMAIN_LAYOUT_H
+
+#include <xen/paging.h>
+#include <xen/sched.h>
+
+/*
+ * Is a domain using the host memory layout?
+ *
+ * domain_use_host_layout() is always False for PV domains (including Dom0).
+ *
+ * Direct-mapped domains (autotranslated domains with memory allocated
+ * contiguously and mapped 1:1 so that GFN == MFN) must use the host
+ * memory layout since GFN == MFN by definition.
+ *
+ * The hardware domain will use the host layout (regardless of
+ * direct-mapped) because some OS may rely on specific address ranges
+ * for the devices.
+ */
+static inline bool domain_use_host_layout(const struct domain *d)
+{
+    return paging_mode_translate(d) &&
+           (is_domain_direct_mapped(d) || is_hardware_domain(d));
+}
+
+#endif /* XEN_DOMAIN_LAYOUT_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 06:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 06:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308670.1580048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdf-0004v4-Ro; Thu, 14 May 2026 06:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308670.1580048; Thu, 14 May 2026 06:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNPdf-0004uw-PB; Thu, 14 May 2026 06:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1308670;
 Thu, 14 May 2026 06:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNPde-0004up-Bi
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 06:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPde-004hPj-15
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNPde-0048J9-0y
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 06:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H/eO723ERU5+4e4w5pVdTRq2tZSkfOpG09ueBJQh1Lc=; b=oNWR2pz4gLuC8+KkdJlKTEE5dD
	8IDUl/TMpnbuwPUPVm5Dpq4KT8S4yAHBlTEcTzjgbo/+QtsWzMfyUzUbFDM9MYz5t9+aSDrUA8Chh
	JGq9FWZpJ9jHagSmb63VL+qPNGyrJf+DMiBvPyD1ptpDDPjNzCew0yvcj7LEcOegcmIg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/device-tree: use p2m_gpa_bits in common code
Message-Id: <E1wNPde-0048J9-0y@xenbits.xenproject.org>
Date: Thu, 14 May 2026 06:33:42 +0000

commit b37c6c65c9213f3fb969c488e64f9189c700f97b
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:44 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen/device-tree: use p2m_gpa_bits in common code
    
    The IPA terminology is Arm-specific, so rename p2m_ipa_bits to
    p2m_gpa_bits to use architecture-neutral naming in
    xen/common/device-tree/ code.
    
    No functional changes.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/p2m.h        | 3 +++
 xen/common/device-tree/domain-build.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 010ce8c9eb..23500713a1 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -14,6 +14,9 @@
 /* Holds the bit size of IPAs in p2m tables.  */
 extern unsigned int p2m_ipa_bits;
 
+/* Common-code alias; ARM keeps the IPA spelling internally */
+#define p2m_gpa_bits p2m_ipa_bits
+
 #define MAX_VMID_8_BIT  (1UL << 8)
 #define MAX_VMID_16_BIT (1UL << 16)
 
diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 6949203dac..2a760b007b 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -221,7 +221,7 @@ int __init find_unallocated_memory(const struct kernel_info *kinfo,
     }
 
     start = 0;
-    end = (1ULL << p2m_ipa_bits) - 1;
+    end = (1ULL << p2m_gpa_bits) - 1;
     res = rangeset_report_ranges(unalloc_mem, PFN_DOWN(start), PFN_DOWN(end),
                                  cb, free_regions);
     if ( res )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 07:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 07:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308708.1580079 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZ5-00066w-HU; Thu, 14 May 2026 07:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308708.1580079; Thu, 14 May 2026 07:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZ5-00066o-Ev; Thu, 14 May 2026 07:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1308708;
 Thu, 14 May 2026 07:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNQZ4-00066i-6r
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 07:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZ4-004iYw-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZ3-004DU2-3C
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v4GJphLOKm9fj5UquA+FbJGMRONxslM6DQLrEW+21/Y=; b=OtgFBDjONLbgId/ogs1Ph5Hcuh
	+lRON0nvLAuEo1kiXDyLh/FkM2nv9q6Qb3tvRtAiv2S9kn+TpakVTWlx+MBsEijBDjOHCvYo4bjcp
	Y3LT/01aav9wQK+rtUTW8RM9oQgHEo/vfZeDrl/+LlQCttGdaI2Go2yeWPwxM00XDWoM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: arm: fix len type for guest copy functions
Message-Id: <E1wNQZ3-004DU2-3C@xenbits.xenproject.org>
Date: Thu, 14 May 2026 07:33:01 +0000

commit e4424b9a635623b247a9a070db1238bf93f94764
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:40 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: arm: fix len type for guest copy functions
    
    Widen the len argument of copy_to_guest_phys_flush_dcache() and the
    copy_to_guest_phys_cb typedef from unsigned int to unsigned long, as
    the function can be used to copy large blobs such as the initrd which
    may exceed 4GB. Update the internal copy_guest() len argument to
    unsigned long accordingly.
    
    Change the type for local variable size in copy_guest() to avoid
    compilation error because of type mismatch.
    
    raw_* wrappers above copy_guest() keep returning unsigned long to
    avoid type narrowing; it is not an issue for raw_*'s len argument
    to remain 'unsigned int' since the assignment to copy_guest()'s wider
    unsigned long parameter is safe and there is no raw_* users who
    are using a value bigger than what can fit into 'unsigned int'.
    
    Fixes: 2986481b3d9e6 ("xen/arm: guest_copy: Extend the prototype to pass the vCPU")
    Fixes: 5302bd490bea7 ("xen/arm: Introduce copy_to_guest_phys_flush_dcache")
    Fixes: d07b7369aa65b ("xen/common: dom0less: introduce common domain-build.c")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/guestcopy.c                | 6 +++---
 xen/arch/arm/include/asm/guest_access.h | 2 +-
 xen/include/xen/fdt-domain-build.h      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index fdb06422b8..86f1c9d0e3 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -53,7 +53,7 @@ static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
     return page;
 }
 
-static unsigned long copy_guest(void *buf, uint64_t addr, unsigned int len,
+static unsigned long copy_guest(void *buf, uint64_t addr, unsigned long len,
                                 copy_info_t info, unsigned int flags)
 {
     /* XXX needs to handle faults */
@@ -65,7 +65,7 @@ static unsigned long copy_guest(void *buf, uint64_t addr, unsigned int len,
     while ( len )
     {
         void *p;
-        unsigned int size = min(len, (unsigned int)PAGE_SIZE - offset);
+        unsigned long size = min(len, PAGE_SIZE + 0UL - offset);
         struct page_info *page;
 
         page = translate_get_page(info, addr, flags & COPY_linear,
@@ -136,7 +136,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from,
 unsigned long copy_to_guest_phys_flush_dcache(struct domain *d,
                                               paddr_t gpa,
                                               void *buf,
-                                              unsigned int len)
+                                              unsigned long len)
 {
     return copy_guest(buf, gpa, len, GPA_INFO(d),
                       COPY_to_guest | COPY_ipa | COPY_flush_dcache);
diff --git a/xen/arch/arm/include/asm/guest_access.h b/xen/arch/arm/include/asm/guest_access.h
index 18c88b70d7..c13cbec55b 100644
--- a/xen/arch/arm/include/asm/guest_access.h
+++ b/xen/arch/arm/include/asm/guest_access.h
@@ -14,7 +14,7 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 unsigned long copy_to_guest_phys_flush_dcache(struct domain *d,
                                               paddr_t gpa,
                                               void *buf,
-                                              unsigned int len);
+                                              unsigned long len);
 
 int access_guest_memory_by_gpa(struct domain *d, paddr_t gpa, void *buf,
                                uint32_t size, bool is_write);
diff --git a/xen/include/xen/fdt-domain-build.h b/xen/include/xen/fdt-domain-build.h
index 9465a1021f..671486c1c8 100644
--- a/xen/include/xen/fdt-domain-build.h
+++ b/xen/include/xen/fdt-domain-build.h
@@ -48,7 +48,7 @@ static inline int get_allocation_size(paddr_t size)
 typedef unsigned long (*copy_to_guest_phys_cb)(struct domain *d,
                                                paddr_t gpa,
                                                void *buf,
-                                               unsigned int len);
+                                               unsigned long len);
 
 void initrd_load(struct kernel_info *kinfo,
                  copy_to_guest_phys_cb cb);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 07:33:17 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 07:33:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308709.1580082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZF-00069A-K8; Thu, 14 May 2026 07:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308709.1580082; Thu, 14 May 2026 07:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZF-000692-HZ; Thu, 14 May 2026 07:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1308709;
 Thu, 14 May 2026 07:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNQZE-00068s-9E
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 07:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZE-004iZ0-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZE-004DVF-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Aa+WyDWlBKBdVVMc0GBayAzpYzHmRkWUKpTWqpdexEs=; b=ttxW3BKWIXSkSKhIjKA2Qn1IDj
	sTvB1W9XTWPR/wmizCDLPpbRtCgwV/fbj58azzj7pymdYp1JCB06cN0wAgO6wDVkVMpf9g+5zRBv8
	+CfNBjrkyge3pWoQ4az8aHqHi6dBwsTYzIAQBKwFpGvqpnKob91Dfmlw1+CdT0cc/MN4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/dom0less: rename kernel_zimage_probe() to kernel_image_probe()
Message-Id: <E1wNQZE-004DVF-0U@xenbits.xenproject.org>
Date: Thu, 14 May 2026 07:33:12 +0000

commit 17b9e56a92bd3f6a8ca37806706f87c94e886e23
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:41 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen/dom0less: rename kernel_zimage_probe() to kernel_image_probe()
    
    The helper kernel_zimage_probe() is referenced from common code
    (xen/common/device-tree/kernel.c), but its name is tied to the zImage
    format which is specific to Arm (from architectures supported by Xen).
    
    Other architectures supported by Xen, such as RISC-V, do not use the
    zImage format and instead rely on other kernel image types (e.g. Image
    or compressed Image variants: Image.gz, etc). Using "zimage" in the
    name is therefore misleading in architecture-independent code.
    
    Rename kernel_zimage_probe() to kernel_image_probe() and update the
    associated structure field from "zimage" to "image" to reflect that the
    code handles generic kernel images rather than the zImage format
    specifically.
    
    No functional change intended.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/kernel.c           | 50 ++++++++++++++++++++---------------------
 xen/common/device-tree/kernel.c |  2 +-
 xen/include/xen/fdt-kernel.h    |  6 ++---
 3 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 9395b5af87..b72585b7fe 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -101,8 +101,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
     paddr_t load_addr;
 
 #ifdef CONFIG_HAS_DOMAIN_TYPE
-    if ( (info->type == DOMAIN_64BIT) && (info->zimage.start == 0) )
-        return mem->bank[0].start + info->zimage.text_offset;
+    if ( (info->type == DOMAIN_64BIT) && (info->image.start == 0) )
+        return mem->bank[0].start + info->image.text_offset;
 #endif
 
     /*
@@ -111,19 +111,19 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
      * and above 32MiB. Load it as high as possible within these
      * constraints, while also avoiding the DTB.
      */
-    if ( info->zimage.start == 0 )
+    if ( info->image.start == 0 )
     {
         paddr_t load_end;
 
         load_end = mem->bank[0].start + mem->bank[0].size;
         load_end = MIN(mem->bank[0].start + MB(128), load_end);
 
-        load_addr = load_end - info->zimage.len;
+        load_addr = load_end - info->image.len;
         /* Align to 2MB */
         load_addr &= ~((2 << 20) - 1);
     }
     else
-        load_addr = info->zimage.start;
+        load_addr = info->image.start;
 
     return load_addr;
 }
@@ -131,8 +131,8 @@ static paddr_t __init kernel_zimage_place(struct kernel_info *info)
 static void __init kernel_zimage_load(struct kernel_info *info)
 {
     paddr_t load_addr = kernel_zimage_place(info);
-    paddr_t paddr = info->zimage.kernel_addr;
-    paddr_t len = info->zimage.len;
+    paddr_t paddr = info->image.kernel_addr;
+    paddr_t len = info->image.len;
     void *kernel;
     int rc;
 
@@ -215,7 +215,7 @@ int __init kernel_uimage_probe(struct kernel_info *info,
         return -EOPNOTSUPP;
     }
 
-    info->zimage.start = be32_to_cpu(uimage.load);
+    info->image.start = be32_to_cpu(uimage.load);
     info->entry = be32_to_cpu(uimage.ep);
 
     /*
@@ -224,20 +224,20 @@ int __init kernel_uimage_probe(struct kernel_info *info,
      * independent image. That means Xen is free to load such an image at
      * any valid address.
      */
-    if ( info->zimage.start == 0 )
+    if ( info->image.start == 0 )
         printk(XENLOG_INFO
                "No load address provided. Xen will decide where to load it.\n");
     else
         printk(XENLOG_INFO
                "Provided load address: %"PRIpaddr" and entry address: %"PRIpaddr"\n",
-               info->zimage.start, info->entry);
+               info->image.start, info->entry);
 
     /*
      * If the image supports position independent execution, then user cannot
      * provide an entry point as Xen will load such an image at any appropriate
      * memory address. Thus, we need to return error.
      */
-    if ( (info->zimage.start == 0) && (info->entry != 0) )
+    if ( (info->image.start == 0) && (info->entry != 0) )
     {
         printk(XENLOG_ERR
                "Entry point cannot be non zero for PIE image.\n");
@@ -257,13 +257,13 @@ int __init kernel_uimage_probe(struct kernel_info *info,
         if ( rc )
             return rc;
 
-        info->zimage.kernel_addr = mod->start;
-        info->zimage.len = mod->size;
+        info->image.kernel_addr = mod->start;
+        info->image.len = mod->size;
     }
     else
     {
-        info->zimage.kernel_addr = addr + sizeof(uimage);
-        info->zimage.len = len;
+        info->image.kernel_addr = addr + sizeof(uimage);
+        info->image.len = len;
     }
 
     info->load = kernel_zimage_load;
@@ -287,9 +287,9 @@ int __init kernel_uimage_probe(struct kernel_info *info,
      * header. In other words if the user provides a uImage header on top of
      * zImage or zImage64 header, Xen uses the attributes of uImage header only.
      * Thus, Xen uses uimage.load attribute to determine the load address and
-     * zimage.text_offset is ignored.
+     * image.text_offset is ignored.
      */
-    info->zimage.text_offset = 0;
+    info->image.text_offset = 0;
 #endif
 
     return 0;
@@ -338,10 +338,10 @@ static int __init kernel_zimage64_probe(struct kernel_info *info,
     if ( (end - start) > size )
         return -EINVAL;
 
-    info->zimage.kernel_addr = addr;
-    info->zimage.len = end - start;
-    info->zimage.text_offset = zimage.text_offset;
-    info->zimage.start = 0;
+    info->image.kernel_addr = addr;
+    info->image.len = end - start;
+    info->image.text_offset = zimage.text_offset;
+    info->image.start = 0;
 
     info->load = kernel_zimage_load;
 
@@ -389,10 +389,10 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
         }
     }
 
-    info->zimage.kernel_addr = addr;
+    info->image.kernel_addr = addr;
 
-    info->zimage.start = start;
-    info->zimage.len = end - start;
+    info->image.start = start;
+    info->image.len = end - start;
 
     info->load = kernel_zimage_load;
 
@@ -403,7 +403,7 @@ static int __init kernel_zimage32_probe(struct kernel_info *info,
     return 0;
 }
 
-int __init kernel_zimage_probe(struct kernel_info *info, paddr_t addr,
+int __init kernel_image_probe(struct kernel_info *info, paddr_t addr,
                                paddr_t size)
 {
     int rc;
diff --git a/xen/common/device-tree/kernel.c b/xen/common/device-tree/kernel.c
index 28096121a5..cfa27464f0 100644
--- a/xen/common/device-tree/kernel.c
+++ b/xen/common/device-tree/kernel.c
@@ -235,7 +235,7 @@ int __init kernel_probe(struct kernel_info *info,
     if ( rc && rc != -EINVAL )
         return rc;
 
-    rc = kernel_zimage_probe(info, mod->start, mod->size);
+    rc = kernel_image_probe(info, mod->start, mod->size);
 
     return rc;
 }
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 86a37a1304..8cd1670c2c 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -63,7 +63,7 @@ struct kernel_info {
             paddr_t text_offset; /* 64-bit Image only */
 #endif
             paddr_t start; /* Must be 0 for 64-bit Image */
-        } zimage;
+        } image;
     };
 
 #ifdef CONFIG_HAS_DOMAIN_TYPE
@@ -113,7 +113,7 @@ kernel_info_get_mem_const(const struct kernel_info *kinfo)
  * Probe the kernel to detemine its type and select a loader.
  *
  * Sets in info:
- *  ->load hook, and sets loader specific variables ->zimage
+ *  ->load hook, and sets loader specific variables ->image
  */
 int kernel_probe(struct kernel_info *info, const struct dt_device_node *domain);
 
@@ -133,7 +133,7 @@ void kernel_load(struct kernel_info *info);
 
 int kernel_decompress(struct boot_module *mod, uint32_t offset);
 
-int kernel_zimage_probe(struct kernel_info *info, paddr_t addr, paddr_t size);
+int kernel_image_probe(struct kernel_info *info, paddr_t addr, paddr_t size);
 
 /*
  * uImage isn't really used nowadays thereby leave kernel_uimage_probe()
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 07:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 07:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308710.1580087 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZP-0006BE-LW; Thu, 14 May 2026 07:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308710.1580087; Thu, 14 May 2026 07:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZP-0006B6-Iz; Thu, 14 May 2026 07:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1308710;
 Thu, 14 May 2026 07:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNQZO-0006Ao-Bo
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 07:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZO-004iZT-0u
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZO-004DVn-0n
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nFU0s/ea3UXB/jQnpi8bjiYuoC6MLceVomwLCgzUchk=; b=l5loBxZydsn4kVLApHMm01+Uso
	PIIIfLny39vod1npiDKqAWZiLnyKl1dMx5+sHiVdDPS9aV43LY6prsShFHr9eUoRNHDL0msQ1kG2D
	cWOrP9H2Xk3qbUyzhJyr5hFh2Yyh5FfoZKOwYXwa0wRcTp3S3D2MQF+QlfvexYx3DnLE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: move declaration of fw_unreserved_regions() to common header
Message-Id: <E1wNQZO-004DVn-0n@xenbits.xenproject.org>
Date: Thu, 14 May 2026 07:33:22 +0000

commit 392f93542193365357abf92a9fdbec4fcb67bf08
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:42 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: move declaration of fw_unreserved_regions() to common header
    
    Since the implementation of fw_unreserved_regions() is in common code, move
    its declaration to xen/bootinfo.h.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/setup.h | 3 ---
 xen/include/xen/bootinfo.h       | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 899e33925c..0d29b46ea5 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -43,9 +43,6 @@ int acpi_make_efi_nodes(void *fdt, struct membank tbl_add[]);
 void create_dom0(void);
 
 void discard_initial_modules(void);
-void fw_unreserved_regions(paddr_t s, paddr_t e,
-                           void (*cb)(paddr_t ps, paddr_t pe),
-                           unsigned int first);
 
 void init_pdx(void);
 void setup_mm(void);
diff --git a/xen/include/xen/bootinfo.h b/xen/include/xen/bootinfo.h
index f834f19571..dbf492c2e3 100644
--- a/xen/include/xen/bootinfo.h
+++ b/xen/include/xen/bootinfo.h
@@ -210,4 +210,8 @@ static inline struct membanks *membanks_xzalloc(unsigned int nr,
     return banks;
 }
 
+void fw_unreserved_regions(paddr_t s, paddr_t e,
+                           void (*cb)(paddr_t ps, paddr_t pe),
+                           unsigned int first);
+
 #endif /* XEN_BOOTINFO_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 07:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 07:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308711.1580090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZZ-0006DQ-N4; Thu, 14 May 2026 07:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308711.1580090; Thu, 14 May 2026 07:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZZ-0006DI-KY; Thu, 14 May 2026 07:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1308711;
 Thu, 14 May 2026 07:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNQZY-0006DB-DF
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 07:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZY-004iZc-1D
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZY-004DX6-16
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GNCtO+TskOH/WMkoEPeB2Lmq37xpACjJpaPfEQ8uqSA=; b=TWOJqQG9hkYEgNLOyOZLeRIrHA
	meM+gJvcVkE6rZY/+9wula3ZdRnIEpfPWhpqbHp99lbeBxyortTVEng+mNsjfC0HnaLxVH2sNg059
	Hq6lXT+BpIigSnRL7VwBvpRWM2sQ89qQPuPIYc6fR4Map8WIh5bAHPt1ecHeAcoaK7vE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: introduce domain-layout.h with common domain_use_host_layout()
Message-Id: <E1wNQZY-004DX6-16@xenbits.xenproject.org>
Date: Thu, 14 May 2026 07:33:32 +0000

commit b71811efe6e09ddb0fc3719ba47330a5c24a2e90
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:43 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen: introduce domain-layout.h with common domain_use_host_layout()
    
    domain_use_host_layout() is not architecture-specific and may be needed
    on x86 [1]. Replace the ARM-specific macro in asm/domain.h with a common
    static inline in a new dedicated header, xen/domain-layout.h.
    
    xen/domain.h would be the natural home, but placing it there would
    require including xen/paging.h (for paging_mode_translate()) and
    xen/sched.h (for is_hardware_domain()), which would introduce circular
    dependencies. A separate header that callers opt into avoids this.
    
    Adjust the implementation to take paging_mode_translate() into account
    so it works correctly for all architectures, including x86. Some extra
    details about implementation [2] and [3].
    
    To avoid the following compilation issue:
    
    In file included from ./include/xen/paging.h:4,
                     from ./include/xen/domain-layout.h:6,
                     from common/device-tree/domain-build.c:4:
    ./arch/riscv/include/asm/paging.h:17:48: error: 'struct page_info'
    declared inside parameter list will not be visible outside of this
    definition or declaration [-Werror]
       17 | void paging_free_page(struct domain *d, struct page_info *pg);
    
    add the forward declaration of struct page_info to RISC-V's asm/paging.h.
    
    [1] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602161038120.359097@ubuntu-linux-20-04-desktop/
    [2] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602271742400.3148344@ubuntu-linux-20-04-desktop/
    [3] https://lore.kernel.org/xen-devel/alpine.DEB.2.22.394.2602271750190.3148344@ubuntu-linux-20-04-desktop/
    
    Suggested-by: Stefano Stabellini <sstabellini@kernel.org>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/domain_build.c           |  1 +
 xen/arch/arm/include/asm/domain.h     | 14 --------------
 xen/arch/arm/vgic-v3.c                |  1 +
 xen/arch/riscv/include/asm/paging.h   |  1 +
 xen/common/device-tree/domain-build.c |  1 +
 xen/include/xen/domain-layout.h       | 28 ++++++++++++++++++++++++++++
 6 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index ad665cd3c0..1efddc60ef 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2,6 +2,7 @@
 #include <xen/init.h>
 #include <xen/bootinfo.h>
 #include <xen/compile.h>
+#include <xen/domain-layout.h>
 #include <xen/dom0less-build.h>
 #include <xen/fdt-domain-build.h>
 #include <xen/fdt-kernel.h>
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index b24f02d269..46a5cdc0c8 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -18,20 +18,6 @@ struct hvm_domain
     uint64_t              params[HVM_NR_PARAMS];
 };
 
-/*
- * Is the domain using the host memory layout?
- *
- * Direct-mapped domain will always have the RAM mapped with GFN == MFN.
- * To avoid any trouble finding space, it is easier to force using the
- * host memory layout.
- *
- * The hardware domain will use the host layout regardless of
- * direct-mapped because some OS may rely on a specific address ranges
- * for the devices.
- */
-#define domain_use_host_layout(d) (is_domain_direct_mapped(d) || \
-                                   is_hardware_domain(d))
-
 struct vtimer {
     struct vcpu *v;
     int irq;
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 77aab5c3c2..77517c3030 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -10,6 +10,7 @@
  */
 
 #include <xen/bitops.h>
+#include <xen/domain-layout.h>
 #include <xen/init.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
diff --git a/xen/arch/riscv/include/asm/paging.h b/xen/arch/riscv/include/asm/paging.h
index c1d225d02b..e487c89a4c 100644
--- a/xen/arch/riscv/include/asm/paging.h
+++ b/xen/arch/riscv/include/asm/paging.h
@@ -4,6 +4,7 @@
 #include <asm-generic/paging.h>
 
 struct domain;
+struct page_info;
 
 int paging_domain_init(struct domain *d);
 
diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index c51520ebad..6949203dac 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
 #include <xen/bootinfo.h>
+#include <xen/domain-layout.h>
 #include <xen/fdt-domain-build.h>
 #include <xen/init.h>
 #include <xen/lib.h>
diff --git a/xen/include/xen/domain-layout.h b/xen/include/xen/domain-layout.h
new file mode 100644
index 0000000000..cc5e56c9da
--- /dev/null
+++ b/xen/include/xen/domain-layout.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef XEN_DOMAIN_LAYOUT_H
+#define XEN_DOMAIN_LAYOUT_H
+
+#include <xen/paging.h>
+#include <xen/sched.h>
+
+/*
+ * Is a domain using the host memory layout?
+ *
+ * domain_use_host_layout() is always False for PV domains (including Dom0).
+ *
+ * Direct-mapped domains (autotranslated domains with memory allocated
+ * contiguously and mapped 1:1 so that GFN == MFN) must use the host
+ * memory layout since GFN == MFN by definition.
+ *
+ * The hardware domain will use the host layout (regardless of
+ * direct-mapped) because some OS may rely on specific address ranges
+ * for the devices.
+ */
+static inline bool domain_use_host_layout(const struct domain *d)
+{
+    return paging_mode_translate(d) &&
+           (is_domain_direct_mapped(d) || is_hardware_domain(d));
+}
+
+#endif /* XEN_DOMAIN_LAYOUT_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 07:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 07:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308712.1580094 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZj-0006FX-Oc; Thu, 14 May 2026 07:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308712.1580094; Thu, 14 May 2026 07:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNQZj-0006FP-Lv; Thu, 14 May 2026 07:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1308712;
 Thu, 14 May 2026 07:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNQZi-0006FI-Gz
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 07:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZi-004iZi-1a
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNQZi-004DYV-1U
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 07:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZalPdbm/SzfJgM/1LYBG9XTbkUW+NqA3mAalVPwo1UY=; b=6FaGmhQG3iUHlPmo9b7+K71esj
	9Eb9BKXy6/Z+M9trx4QA1U77/gxe9ToW0TnaxqXUSk2hF+sIsVfwsRfaTat+HeJ9auJ5EKKLWjZJh
	zIhZAs0BM2+uOlqku3W+BMXHYltwwrEH6qC9SxRbdu8ohQeZSbDkpPVk0rg/61i8o9Qk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/device-tree: use p2m_gpa_bits in common code
Message-Id: <E1wNQZi-004DYV-1U@xenbits.xenproject.org>
Date: Thu, 14 May 2026 07:33:42 +0000

commit b37c6c65c9213f3fb969c488e64f9189c700f97b
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:44 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu May 14 08:24:15 2026 +0200

    xen/device-tree: use p2m_gpa_bits in common code
    
    The IPA terminology is Arm-specific, so rename p2m_ipa_bits to
    p2m_gpa_bits to use architecture-neutral naming in
    xen/common/device-tree/ code.
    
    No functional changes.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/p2m.h        | 3 +++
 xen/common/device-tree/domain-build.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 010ce8c9eb..23500713a1 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -14,6 +14,9 @@
 /* Holds the bit size of IPAs in p2m tables.  */
 extern unsigned int p2m_ipa_bits;
 
+/* Common-code alias; ARM keeps the IPA spelling internally */
+#define p2m_gpa_bits p2m_ipa_bits
+
 #define MAX_VMID_8_BIT  (1UL << 8)
 #define MAX_VMID_16_BIT (1UL << 16)
 
diff --git a/xen/common/device-tree/domain-build.c b/xen/common/device-tree/domain-build.c
index 6949203dac..2a760b007b 100644
--- a/xen/common/device-tree/domain-build.c
+++ b/xen/common/device-tree/domain-build.c
@@ -221,7 +221,7 @@ int __init find_unallocated_memory(const struct kernel_info *kinfo,
     }
 
     start = 0;
-    end = (1ULL << p2m_ipa_bits) - 1;
+    end = (1ULL << p2m_gpa_bits) - 1;
     res = rangeset_report_ranges(unalloc_mem, PFN_DOWN(start), PFN_DOWN(end),
                                  cb, free_regions);
     if ( res )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 12:44:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 12:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1308880.1580162 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNVQ3-00038G-TZ; Thu, 14 May 2026 12:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1308880.1580162; Thu, 14 May 2026 12:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNVQ3-000388-QC; Thu, 14 May 2026 12:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1308880;
 Thu, 14 May 2026 12:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNVQ2-000382-Ab
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 12:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNVQ2-004p4U-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 12:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNVQ2-004UXl-0h
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 12:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Xs1/NFagI8PtQ5GvTbFZuSeWZZne9F1B98VGlBPoaLo=; b=242lSPv9K4BH4eDzlobe+Q6A4s
	zFkJrJxpUYgAJ6DdAmavXTwcv3pvuWI6MPup5//i9kRoLH4ogR1VYjqaWyIvINSoTD1Ujy0atnz+k
	fMVY54JEYVJovtrWwBDIiY/CEKkqsClwb+J53Pnb+SkRtAcwwaXBKzSaph2gs1wgH1Io=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wNVQ2-004UXl-0h@xenbits.xenproject.org>
Date: Thu, 14 May 2026 12:44:02 +0000

commit 79e060ea03583cd83ddc7e520dcd7c5c418841f3
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu May 14 12:16:20 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 13:38:04 2026 +0100

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 15:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 15:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309023.1580222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNYEE-0005VR-FH; Thu, 14 May 2026 15:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309023.1580222; Thu, 14 May 2026 15:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNYEE-0005VI-BO; Thu, 14 May 2026 15:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1309023;
 Thu, 14 May 2026 15:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNYED-0005VC-L4
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 15:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNYED-004sJW-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNYED-004cxg-1L
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 15:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=R8S6Vk2WBtigt6F9cTouet+OuYeKO/6DffRj+frOQIs=; b=ndqlQIEMbjQ0iRal4Xv2g/Ks41
	vWD/C6RbxfjKaurW4ssLURYmbrcDQ7md6S0CuVP1rx2ZjdDL+a6RT9mxedCCfL7p2uOpwnmd2L7+W
	TZtsbOCe98LLhgBtZADMiwfOkSr8KkH607OMTSEzXPyLCUFTu5ImDgnDz3AImivC3RKI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wNYED-004cxg-1L@xenbits.xenproject.org>
Date: Thu, 14 May 2026 15:44:01 +0000

commit 79e060ea03583cd83ddc7e520dcd7c5c418841f3
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Thu May 14 12:16:20 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 13:38:04 2026 +0100

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 18:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 18:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309197.1580296 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNarm-0000HM-Mh; Thu, 14 May 2026 18:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309197.1580296; Thu, 14 May 2026 18:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNarm-0000HC-Jn; Thu, 14 May 2026 18:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1309197;
 Thu, 14 May 2026 18:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNarm-0000H6-5Z
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 18:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNarm-004vvn-05
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 18:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNarl-004rpx-38
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 18:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SL+Z2cwtdRkX/Ab0iAlX6YsvmYag/nmkDLO+V1xa2s0=; b=ryoUi+p4eODUrxDwkgLUzSPrRE
	OzCmSX7WUmGWujHXcR2ctXOBb7K3oj2a/zeZxSiFMIPsa5X620Z7ij77JIhcQ7jKV0w/GFbQpjiL4
	RPAbzDuCX9ZNq/0zOa9Eq7RUAvMkx8Hkx2vdTEEoAgCPHV1E4LXdkI1aZohwqnkXCrj4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] kexec: kexec_crash_save_info() vs Misra C:2012 rule 8.3
Message-Id: <E1wNarl-004rpx-38@xenbits.xenproject.org>
Date: Thu, 14 May 2026 18:33:01 +0000

commit ae995a5500c0542b63fdf80cc4489503ebcde6f5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 14 19:16:01 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 19:28:44 2026 +0100

    kexec: kexec_crash_save_info() vs Misra C:2012 rule 8.3
    
    ... ("All declarations of an object or function shall use the same names
    and type qualifiers"). The declaration doesn't use the typedef, so the
    definition shouldn't either.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 1a3a20e1c9..65776a95fd 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -333,7 +333,7 @@ void kexec_crash_save_cpu(void)
 }
 
 /* Set up the single Xen-specific-info crash note. */
-crash_xen_info_t *kexec_crash_save_info(void)
+struct crash_xen_info *kexec_crash_save_info(void)
 {
     int cpu = smp_processor_id();
     crash_xen_info_t info;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 18:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 18:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309198.1580300 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNarw-0000Iv-OP; Thu, 14 May 2026 18:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309198.1580300; Thu, 14 May 2026 18:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNarw-0000Io-L4; Thu, 14 May 2026 18:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1309198;
 Thu, 14 May 2026 18:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNarw-0000Ig-4o
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 18:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNarw-004vvr-0N
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 18:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNarw-004rqn-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 18:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cgEJF58wUNxaCeRYjF1udb13pObBlXzdLuEzMTbX+6s=; b=Gl00AlQ5X4h7z8BKxm+efwMScF
	0i+YXi0vQWJWa5mT7e7tjVEOvi4yEDHa9gW/kLUpdQqUWgp4QgLENWEAOcnPbEFBBWfs0zb+ScFoP
	OeqkHB3QMt9GaE+5srDUCP3HzguYRA2OdNEP2tNw+k17v45Bo8XEn+0XOVVSZTNp3ks8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] crypto/rijndael: adjust for Misra C:2012 rule 8.3
Message-Id: <E1wNarw-004rqn-0F@xenbits.xenproject.org>
Date: Thu, 14 May 2026 18:33:12 +0000

commit 59264b89473ecd274717786a26bb0d36c2cf8f9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 14 19:18:05 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 19:28:44 2026 +0100

    crypto/rijndael: adjust for Misra C:2012 rule 8.3
    
    ... ("All declarations of an object or function shall use the same names
    and type qualifiers"). Bring declarations in line with the corresponding
    definitions, accepting the use of the being-phased-out u<N> types. While
    we don't define NEED_RIJNDAEL_DECRYPT, cover rijndaelKeySetupDec() as
    well for completeness, including fixing a typo in a parameter name.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/crypto/rijndael.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index aa66051fd3..49bb1f3be1 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -50,9 +50,8 @@ int	rijndael_set_key_enc_only(rijndael_ctx *ctx, const unsigned char *key, int b
 void	rijndael_decrypt(rijndael_ctx *ctx, const unsigned char *src, unsigned char *dst);
 void	rijndael_encrypt(rijndael_ctx *ctx, const unsigned char *src, unsigned char *dst);
 
-int	rijndaelKeySetupEnc(unsigned int rk[], const unsigned char cipherKey[], int keyBits);
-int	rijndaelKeySetupDec(unsigned int rk[], const unsigned char cipkerKey[], int keyBits);
-void	rijndaelEncrypt(const unsigned int rk[], int Nr, const unsigned char pt[16],
-			unsigned char ct[16]);
+int	rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits);
+int	rijndaelKeySetupDec(u32 rk[], const u8 cipherKey[], int keyBits);
+void	rijndaelEncrypt(const u32 rk[], int Nr, const u8 pt[16], u8 ct[16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 14 19:33:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 19:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309229.1580306 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNbnq-000090-QB; Thu, 14 May 2026 19:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309229.1580306; Thu, 14 May 2026 19:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNbnq-00008q-MT; Thu, 14 May 2026 19:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1309229;
 Thu, 14 May 2026 19:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNbnp-00008k-Tl
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 19:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNbnp-004wwW-2m
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 19:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNbnp-004uku-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 19:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mtD1jGXivhhJdI90/tYs7+7JAK6+pAcJxYN6cD4Lk7E=; b=aj6BUqIg4POIDRgzDhEmjA3QDm
	MM6Y4VEPpsD7l+kuYxHQQrRMQpEtrL3chPnT1hp4d1gz3o42xV0x8DlMcqy085E/Mcb1W479LoChp
	XLaJhiwsrFvU3WWh3LxK7KRorbq5RvpzG526vwGz2uXdoVDJBK3sXgTe6Qfy7sLR6nhU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] kexec: kexec_crash_save_info() vs Misra C:2012 rule 8.3
Message-Id: <E1wNbnp-004uku-2b@xenbits.xenproject.org>
Date: Thu, 14 May 2026 19:33:01 +0000

commit ae995a5500c0542b63fdf80cc4489503ebcde6f5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 14 19:16:01 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 19:28:44 2026 +0100

    kexec: kexec_crash_save_info() vs Misra C:2012 rule 8.3
    
    ... ("All declarations of an object or function shall use the same names
    and type qualifiers"). The declaration doesn't use the typedef, so the
    definition shouldn't either.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/common/kexec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 1a3a20e1c9..65776a95fd 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -333,7 +333,7 @@ void kexec_crash_save_cpu(void)
 }
 
 /* Set up the single Xen-specific-info crash note. */
-crash_xen_info_t *kexec_crash_save_info(void)
+struct crash_xen_info *kexec_crash_save_info(void)
 {
     int cpu = smp_processor_id();
     crash_xen_info_t info;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 14 19:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 14 May 2026 19:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309230.1580308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNbo0-0000Am-R2; Thu, 14 May 2026 19:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309230.1580308; Thu, 14 May 2026 19:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNbo0-0000Ae-Nw; Thu, 14 May 2026 19:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1309230;
 Thu, 14 May 2026 19:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNbo0-0000AS-1h
 for xen-changelog@lists.xenproject.org; Thu, 14 May 2026 19:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNbo0-004wwo-01
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 19:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNbnz-004ulY-2w
 for xen-changelog@lists.xenproject.org;
 Thu, 14 May 2026 19:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KWqX60QZDc0xuSoYBOK8FkEn3umGw00X43BzEtN6HaA=; b=VXfpNudU5W2NfO0aYo0dPv8955
	HsZbjI2qvWwJ/TLO+nLSkAulZzUOfR+tjXgFKTsdglX5nLUWg2r8gilMWNsJmZfhbS+egxgaibA60
	Prc14N/2jrUXR8LXFk8nBMDHHzo4hLGlSKtHbWH8Vdti7U9R5EDtyXLSBAtWi7DO2KVA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] crypto/rijndael: adjust for Misra C:2012 rule 8.3
Message-Id: <E1wNbnz-004ulY-2w@xenbits.xenproject.org>
Date: Thu, 14 May 2026 19:33:11 +0000

commit 59264b89473ecd274717786a26bb0d36c2cf8f9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 14 19:18:05 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 14 19:28:44 2026 +0100

    crypto/rijndael: adjust for Misra C:2012 rule 8.3
    
    ... ("All declarations of an object or function shall use the same names
    and type qualifiers"). Bring declarations in line with the corresponding
    definitions, accepting the use of the being-phased-out u<N> types. While
    we don't define NEED_RIJNDAEL_DECRYPT, cover rijndaelKeySetupDec() as
    well for completeness, including fixing a typo in a parameter name.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/crypto/rijndael.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index aa66051fd3..49bb1f3be1 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -50,9 +50,8 @@ int	rijndael_set_key_enc_only(rijndael_ctx *ctx, const unsigned char *key, int b
 void	rijndael_decrypt(rijndael_ctx *ctx, const unsigned char *src, unsigned char *dst);
 void	rijndael_encrypt(rijndael_ctx *ctx, const unsigned char *src, unsigned char *dst);
 
-int	rijndaelKeySetupEnc(unsigned int rk[], const unsigned char cipherKey[], int keyBits);
-int	rijndaelKeySetupDec(unsigned int rk[], const unsigned char cipkerKey[], int keyBits);
-void	rijndaelEncrypt(const unsigned int rk[], int Nr, const unsigned char pt[16],
-			unsigned char ct[16]);
+int	rijndaelKeySetupEnc(u32 rk[], const u8 cipherKey[], int keyBits);
+int	rijndaelKeySetupDec(u32 rk[], const u8 cipherKey[], int keyBits);
+void	rijndaelEncrypt(const u32 rk[], int Nr, const u8 pt[16], u8 ct[16]);
 
 #endif /* __RIJNDAEL_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 15 07:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 07:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309671.1580717 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmrz-0000FR-1Y; Fri, 15 May 2026 07:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309671.1580717; Fri, 15 May 2026 07:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmry-0000FJ-UT; Fri, 15 May 2026 07:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1309671;
 Fri, 15 May 2026 07:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNmrx-0000FD-Sa
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 07:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNmrx-006I59-2c
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNmrx-005Zwb-2T
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4lrt6srqceEVSme9ZD6yfTR4aVaYaBlPtMSplyWn5Xw=; b=7AQLXCdDeXw5+5wPGHiHbfjaJk
	uAAgB9vNK8xZ2Y7i+eNKQw18g4l+NGJvYjnBYHGzaLpzAtkaF6CZ6Whxq+MKdSyrrPjfrD2u9LokT
	hlNf32Bm+PW91SBHRkPOeGXh4ChlVQDgnyTSRswYLCJ5Ysumt9xbPgLTD2mEgkHFy2dM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: implement setup_virt_paging for MPU systems
Message-Id: <E1wNmrx-005Zwb-2T@xenbits.xenproject.org>
Date: Fri, 15 May 2026 07:22:01 +0000

commit a5aa6a7379ee89128106928f6d6315d0fed3c63c
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed May 13 13:41:36 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: implement setup_virt_paging for MPU systems
    
    Implement setup_virt_paging for AArch64 MPU systems, taking care of
    stage 2 address translation regime, IPA bits, supported VMID length
    configuration and VTCR_EL2/VSTCR_EL2 register programming.
    
    Implement also the Armv8-R specific changes to ID_AA64MMFR0_EL1,
    related to the supported memory system architecture (PMSA/VMSA)
    and check that when MPU is built, the underlying HW is compatible
    with PMSA. By default MPU at EL2 and EL1 is required.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/mpu/p2m.c             | 80 +++++++++++++++++++++++++++++++-
 xen/arch/arm/include/asm/arm64/sysregs.h |  4 ++
 xen/arch/arm/include/asm/cpufeature.h    | 13 ++++--
 xen/arch/arm/include/asm/processor.h     |  8 ++++
 4 files changed, 101 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
index b6d8b2777b..4547417df9 100644
--- a/xen/arch/arm/arm64/mpu/p2m.c
+++ b/xen/arch/arm/arm64/mpu/p2m.c
@@ -2,11 +2,89 @@
 
 #include <xen/bug.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <asm/p2m.h>
 
 void __init setup_virt_paging(void)
 {
-    BUG_ON("unimplemented");
+    register_t vtcr_el2 = READ_SYSREG(VTCR_EL2);
+    register_t vstcr_el2 = READ_SYSREG(VSTCR_EL2);
+
+    /* PA size */
+    const unsigned int pa_range_info[] = {32, 36, 40, 42, 44, 48, 52, 0,
+                                          /* Invalid */};
+
+    /*
+     * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
+     * with IPA bits == PA bits, compare against PA size.
+     */
+    if ( pa_range_info[system_cpuinfo.mm64.pa_range] < p2m_ipa_bits )
+        p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range];
+
+    /*
+     * The MSA and MSA_frac fields in the ID_AA64MMFR0_EL1 register identify the
+     * memory system configurations supported. In Armv8-R AArch64, the
+     * only permitted value for ID_AA64MMFR0_EL1.MSA is 0b1111.
+     */
+    if ( system_cpuinfo.mm64.msa != MM64_MSA_PMSA_SUPPORT )
+        goto fault;
+
+    /* Permitted values for ID_AA64MMFR0_EL1.MSA_frac are 0b0001 and 0b0010. */
+    if ( (system_cpuinfo.mm64.msa_frac != MM64_MSA_FRAC_PMSA_SUPPORT) &&
+         (system_cpuinfo.mm64.msa_frac != MM64_MSA_FRAC_VMSA_SUPPORT) )
+        goto fault;
+
+    /* Stage 1 EL1&0 translation regime uses PMSAv8 by default */
+    vtcr_el2 &= ~VTCR_MSA;
+
+    /*
+     * Clear VTCR_EL2.NSA bit to configure non-secure stage 2 translation output
+     * address space to access the Secure PA space as Armv8-R only implements
+     * secure state.
+     */
+    vtcr_el2 &= ~VTCR_NSA;
+
+    /*
+     * cpuinfo sanitization makes sure we support 16-bits VMID only if all cores
+     * are supporting it.
+     *
+     * Set the VS bit only if 16 bit VMID is supported.
+     */
+    if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
+    {
+        vtcr_el2 |= VTCR_VS;
+        max_vmid = MAX_VMID_16_BIT;
+    }
+    else
+        vtcr_el2 &= ~VTCR_VS;
+
+    WRITE_SYSREG(vtcr_el2, VTCR_EL2);
+
+    p2m_vmid_allocator_init();
+
+    /*
+     * VSTCR_EL2.SA defines secure stage 2 translation output address space.
+     * To make sure that all stage 2 translations for the Secure PA space access
+     * the Secure PA space, we keep SA bit as 0.
+     *
+     * VSTCR_EL2.SC is NS check enable bit. To make sure that Stage 2 NS
+     * configuration is checked against stage 1 NS configuration in EL1&0
+     * translation regime for the given address, and generates a fault if they
+     * are different, we set SC bit 1.
+     */
+    vstcr_el2 &= ~VSTCR_EL2_SA;
+    vstcr_el2 |= VSTCR_EL2_SC;
+    WRITE_SYSREG(vstcr_el2, VSTCR_EL2);
+
+    printk("P2M: %u-bit IPA with %u-bit PA and %u-bit VMID\n",
+           p2m_ipa_bits,
+           pa_range_info[system_cpuinfo.mm64.pa_range],
+           (MAX_VMID == MAX_VMID_16_BIT) ? 16 : 8);
+
+    return;
+
+ fault:
+    panic("Hardware with no PMSAv8-64 support in any translation regime\n");
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index 19d409d3eb..f3c11d871e 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,10 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+/* Virtualization Secure Translation Control Register */
+#define VSTCR_EL2_SA                 (_AC(0x1,U) << 30)
+#define VSTCR_EL2_SC                 (_AC(0x1,U) << 20)
+
 #ifdef CONFIG_MPU
 /*
  * The Armv8-R AArch64 architecture always executes code in Secure
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index 13353c8e1a..bf902a3970 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -248,6 +248,12 @@ struct cpuinfo_arm {
             unsigned long tgranule_16K:4;
             unsigned long tgranule_64K:4;
             unsigned long tgranule_4K:4;
+#ifdef CONFIG_MPU
+            unsigned long __res0:16;
+            unsigned long msa:4;
+            unsigned long msa_frac:4;
+            unsigned long __res1:8;
+#else
             unsigned long tgranule_16k_2:4;
             unsigned long tgranule_64k_2:4;
             unsigned long tgranule_4k_2:4;
@@ -255,6 +261,7 @@ struct cpuinfo_arm {
             unsigned long __res0:8;
             unsigned long fgt:4;
             unsigned long ecv:4;
+#endif
 
             /* MMFR1 */
             unsigned long hafdbs:4;
@@ -267,13 +274,13 @@ struct cpuinfo_arm {
             unsigned long xnx:4;
             unsigned long twed:4;
             unsigned long ets:4;
-            unsigned long __res1:4;
+            unsigned long __res2:4;
             unsigned long afp:4;
-            unsigned long __res2:12;
+            unsigned long __res3:12;
             unsigned long ecbhb:4;
 
             /* MMFR2 */
-            unsigned long __res3:64;
+            unsigned long __res4:64;
         };
     } mm64;
 
diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 1a48c9ff3b..895d7cd502 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -403,6 +403,9 @@
 
 #define VTCR_RES1       (_AC(1,UL)<<31)
 
+#define VTCR_MSA        (_AC(0x1,UL)<<31)
+#define VTCR_NSA        (_AC(0x1,UL)<<30)
+
 /* HCPTR Hyp. Coprocessor Trap Register */
 #define HCPTR_TAM       ((_AC(1,U)<<30))
 #define HCPTR_TTA       ((_AC(1,U)<<20))        /* Trap trace registers */
@@ -464,6 +467,11 @@
 #define MM64_VMID_16_BITS_SUPPORT   0x2
 #endif
 
+#define MM64_MSA_PMSA_SUPPORT       0xf
+#define MM64_MSA_FRAC_NONE_SUPPORT  0x0
+#define MM64_MSA_FRAC_PMSA_SUPPORT  0x1
+#define MM64_MSA_FRAC_VMSA_SUPPORT  0x2
+
 #ifndef __ASSEMBLER__
 
 extern register_t __cpu_logical_map[];
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 15 07:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 07:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309672.1580720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmsA-0000JH-4Q; Fri, 15 May 2026 07:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309672.1580720; Fri, 15 May 2026 07:22:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmsA-0000J9-1l; Fri, 15 May 2026 07:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1309672;
 Fri, 15 May 2026 07:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNms7-0000IE-Vf
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 07:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNms7-006I5D-34
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNms7-005Zx2-2o
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZYJr4qEtb3wT2Kdr4zG8KQzVHOLqyYqG4JHu5VkothQ=; b=x0EjmykCJPAVp43Qcae/oFg6Yo
	ywitnsM3L3spR4KnggXeP4SciNDE4Jdichkmo7I5FJMwf4g0ddgW95r1e7Os1WA0+M2xG6TbU2G5f
	Gq6BP67ePdyYxrejroE9zyFNOFU3wJ8b3QxlKGuJwySmwrhA5ywEF2A9okulU6QqIzMQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Introduce `v8r_el1_msa` device tree property for domains
Message-Id: <E1wNms7-005Zx2-2o@xenbits.xenproject.org>
Date: Fri, 15 May 2026 07:22:11 +0000

commit 1afacf7b153763ee9c8a7a2ded1409a3eecc0dd1
Author:     Harry Ramsey <harry.ramsey@arm.com>
AuthorDate: Wed May 13 13:41:37 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: Introduce `v8r_el1_msa` device tree property for domains
    
    Add a new device tree property `v8r_el1_msa` to select the MSA (memory
    system architecture) at EL1 for Armv8-R architecture: MPU or MMU, the
    former is the default if the property is not passed.
    
    Implement the dom0less path to parse the new device tree property, add
    a new domctl hypercall input parameter `v8r_el1_msa` for arm and
    add the sanitisation in arch_sanitise_domain_config(), the parameter
    is intended to be used on CONFIG_MPU systems and returns an error if
    selected for MMU.
    
    While there, add explicit padding and check that it's zero during
    arch domain config sanitisation, given the breaking change, bump the
    XEN_DOMCTL_INTERFACE_VERSION.
    
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 docs/misc/arm/device-tree/booting.txt   | 14 ++++++++
 xen/arch/arm/dom0less-build.c           | 62 +++++++++++++++++++++++++++++++++
 xen/arch/arm/domain.c                   | 37 ++++++++++++++++++++
 xen/arch/arm/include/asm/domain.h       |  4 +++
 xen/arch/arm/include/asm/domain_build.h | 10 ++++++
 xen/arch/arm/mpu/arm64/mm.c             |  5 +++
 xen/include/public/arch-arm.h           |  7 ++++
 xen/include/public/domctl.h             |  4 +--
 8 files changed, 141 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index 977b428608..f73839df09 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -322,6 +322,20 @@ with the following properties:
     Should be used together with scmi-smc-passthrough Xen command line
     option.
 
+- v8r_el1_msa
+
+    A string property specifying whether, on Armv8-R systems at EL1, a domain
+    should use PMSAv8 (MPU) or VMSAv8 (MMU).
+
+    - "mmu"
+    Enables VMSAv8 at EL1. This requires hardware support and is only
+    optionally available on AArch64. Not supported on AArch32.
+
+    - "mpu"
+    Enables PMSAv8 at EL1. This is the default behavior when the property is
+    not passed. This configuration requires static allocation (xen,static-mem)
+    and direct mapping (direct-map).
+
 Under the "xen,domain" compatible node, one or more sub-nodes are present
 for the DomU kernel and ramdisk.
 
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 52cf788a45..3f48f74226 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -302,6 +302,65 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
     return 0;
 }
 
+static int __init
+domu_dt_v8r_el1_msa_parse(const struct dt_device_node *node,
+                          struct xen_domctl_createdomain *d_cfg,
+                          unsigned int flags)
+{
+    const char *value;
+    int ret;
+
+    if ( !IS_ENABLED(CONFIG_MPU) )
+    {
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE;
+
+        if ( !dt_property_read_bool(node, "v8r_el1_msa") )
+            return 0;
+
+        printk(XENLOG_ERR
+               "v8r_el1_msa not supported on this build for domain %s\n",
+               dt_node_full_name(node));
+        return -EINVAL;
+    }
+
+    ret = dt_property_read_string(node, "v8r_el1_msa", &value);
+    /* Property absent: PMSA is the default */
+    if ( ret == -EINVAL )
+        value = "mpu";
+    else if ( ret )
+        return ret;
+
+    if ( !strcmp(value, "mpu") )
+    {
+        if ( !(flags & CDF_staticmem) || !(flags & CDF_directmap) )
+        {
+            printk(XENLOG_ERR
+                   "v8r_el1_msa=mpu requires static-mem and direct-map for domain %s\n",
+                   dt_node_full_name(node));
+            return -EINVAL;
+        }
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA;
+        return 0;
+    }
+
+    if ( !strcmp(value, "mmu") )
+    {
+        if ( !has_v8r_vmsa_support() )
+        {
+            printk(XENLOG_ERR
+                   "v8r_el1_msa=mmu unsupported by platform for domain %s\n",
+                   dt_node_full_name(node));
+            return -EINVAL;
+        }
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA;
+        return 0;
+    }
+
+    printk(XENLOG_ERR "v8r_el1_msa value '%s' not valid for domain %s\n",
+           value, dt_node_full_name(node));
+    return -EINVAL;
+}
+
 int __init arch_parse_dom0less_node(struct dt_device_node *node,
                                     struct boot_domain *bd)
 {
@@ -315,6 +374,9 @@ int __init arch_parse_dom0less_node(struct dt_device_node *node,
     if ( domu_dt_sci_parse(node, d_cfg) )
         panic("Error getting SCI configuration\n");
 
+    if ( domu_dt_v8r_el1_msa_parse(node, d_cfg, flags) )
+        panic("Error getting v8r_el1_msa configuration\n");
+
     if ( !dt_property_read_u32(node, "nr_spis", &d_cfg->arch.nr_spis) )
     {
         int vpl011_virq = GUEST_VPL011_SPI;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 26380a807c..baa3a5d708 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -538,6 +538,25 @@ void vcpu_switch_to_aarch64_mode(struct vcpu *v)
     v->arch.hcr_el2 |= HCR_RW;
 }
 
+static bool v8r_el1_msa_domain_sanitise_config(
+    const struct xen_domctl_createdomain *config)
+{
+    switch ( config->arch.v8r_el1_msa )
+    {
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE:
+        return !IS_ENABLED(CONFIG_MPU);
+
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA:
+        return IS_ENABLED(CONFIG_MPU);
+
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA:
+        return IS_ENABLED(CONFIG_MPU) && IS_ENABLED(CONFIG_ARM_64);
+
+    default:
+        return false;
+    }
+}
+
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     unsigned int max_vcpus;
@@ -554,6 +573,14 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    /* Check config structure padding */
+    if ( config->arch.pad )
+    {
+        dprintk(XENLOG_INFO,
+                "Invalid domain configuration during domain creation\n");
+        return -EINVAL;
+    }
+
     /* Check feature flags */
     if ( sve_vl_bits > 0 )
     {
@@ -630,6 +657,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( !v8r_el1_msa_domain_sanitise_config(config) )
+    {
+        dprintk(XENLOG_INFO, "Unsupported v8r_el1_msa value\n");
+        return -EINVAL;
+    }
+
     return sci_domain_sanitise_config(config);
 }
 
@@ -722,6 +755,10 @@ int arch_domain_create(struct domain *d,
     d->arch.sve_vl = config->arch.sve_vl;
 #endif
 
+#ifdef CONFIG_MPU
+    d->arch.v8r_el1_msa = config->arch.v8r_el1_msa;
+#endif
+
     if ( (rc = sci_domain_init(d, config)) != 0 )
         goto fail;
 
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 46a5cdc0c8..c3d2c4981f 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -98,6 +98,10 @@ struct arch_domain
 #endif
 
     struct resume_info resume_ctx;
+
+#ifdef CONFIG_MPU
+    uint8_t v8r_el1_msa;
+#endif
 }  __cacheline_aligned;
 
 struct arch_vcpu
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index 6674dac5e2..df8b361b3d 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -19,6 +19,16 @@ int prepare_acpi(struct domain *d, struct kernel_info *kinfo);
 
 int add_ext_regions(unsigned long s_gfn, unsigned long e_gfn, void *data);
 
+#if defined(CONFIG_MPU) && defined(CONFIG_ARM_64)
+/* Utility function to determine if an Armv8-R processor supports VMSA. */
+bool has_v8r_vmsa_support(void);
+#else
+static inline bool has_v8r_vmsa_support(void)
+{
+    return false;
+}
+#endif /* CONFIG_MPU */
+
 #endif
 
 /*
diff --git a/xen/arch/arm/mpu/arm64/mm.c b/xen/arch/arm/mpu/arm64/mm.c
index ed643cad40..b07e729a7d 100644
--- a/xen/arch/arm/mpu/arm64/mm.c
+++ b/xen/arch/arm/mpu/arm64/mm.c
@@ -32,6 +32,11 @@
         break;                                                  \
     }
 
+bool has_v8r_vmsa_support(void)
+{
+    return system_cpuinfo.mm64.msa_frac == MM64_MSA_FRAC_VMSA_SUPPORT;
+}
+
 /*
  * Armv8-R supports direct access and indirect access to the MPU regions through
  * registers:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cd563cf706..7d6f87e8b2 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -330,6 +330,10 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 #define XEN_DOMCTL_CONFIG_ARM_SCI_NONE      0
 #define XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC  1
 
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE    0
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA    1
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA    2
+
 struct xen_arch_domainconfig {
     /* IN/OUT */
     uint8_t gic_version;
@@ -355,6 +359,9 @@ struct xen_arch_domainconfig {
     uint32_t clock_frequency;
     /* IN */
     uint8_t arm_sci_type;
+    /* IN */
+    uint8_t v8r_el1_msa;
+    uint16_t pad;
 };
 #endif /* __XEN__ || __XEN_TOOLS__ */
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 8f6708c0a7..23124547f3 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -30,9 +30,9 @@
  * fields) don't require a change of the version.
  * Stable ops are NOT covered by XEN_DOMCTL_INTERFACE_VERSION!
  *
- * Last version bump: Xen 4.19
+ * Last version bump: Xen 4.22
  */
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000017
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000018
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 15 07:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 07:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309673.1580725 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmsK-0000LJ-5q; Fri, 15 May 2026 07:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309673.1580725; Fri, 15 May 2026 07:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNmsK-0000L9-38; Fri, 15 May 2026 07:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1309673;
 Fri, 15 May 2026 07:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNmsI-0000Ky-2e
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 07:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNmsI-006I5H-0A
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNmsI-005Zxc-01
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 07:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uxKThhxDbVXNZtcaGca+QSG5zgL6nFAq9cdd80T8Xpk=; b=nJSv98GmkcoF3eZX97nWXebPhf
	L9r3q4mUUFoK53TQExhPNHGq9KJL+Q4kiZqeZbCsowGFAOCBF2ALrzJ8+eLySGWIk22NxUJJnIGGe
	/QRTNpCp2t/xzbeIRwQFNwJovs28GuSMkUfxBh5Ew1dzvQCja0Lk1HOx4/tWOH413og0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/mpu: Implement p2m tables
Message-Id: <E1wNmsI-005Zxc-01@xenbits.xenproject.org>
Date: Fri, 15 May 2026 07:22:22 +0000

commit cd5fe09e50111b7c367335f2874b8c91b023e1cd
Author:     Harry Ramsey <harry.ramsey@arm.com>
AuthorDate: Wed May 13 13:41:38 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: Implement p2m tables
    
    Implement `p2m_alloc_table`, `p2m_init` and `p2m_final_teardown` for MPU
    systems.
    
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/arm32/mpu.h |  2 +
 xen/arch/arm/include/asm/arm64/mpu.h |  2 +
 xen/arch/arm/include/asm/mpu/p2m.h   |  8 ++++
 xen/arch/arm/include/asm/p2m.h       |  5 +++
 xen/arch/arm/mpu/p2m.c               | 72 ++++++++++++++++++++++++++++++++++--
 5 files changed, 86 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/mpu.h b/xen/arch/arm/include/asm/arm32/mpu.h
index 2cf0f8cbac..d565230f84 100644
--- a/xen/arch/arm/include/asm/arm32/mpu.h
+++ b/xen/arch/arm/include/asm/arm32/mpu.h
@@ -11,6 +11,8 @@
  */
 #define MPU_REGION_RES0       0x0
 
+#define VSCTLR_VMID_SHIFT     16
+
 /* Hypervisor Protection Region Base Address Register */
 typedef union {
     struct {
diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
index 4f694190a8..8b86a03fee 100644
--- a/xen/arch/arm/include/asm/arm64/mpu.h
+++ b/xen/arch/arm/include/asm/arm64/mpu.h
@@ -7,6 +7,8 @@
 
 #define MPU_REGION_RES0        (0xFFFFULL << 48)
 
+#define VSCTLR_VMID_SHIFT      48
+
 /* Protection Region Base Address Register */
 typedef union {
     struct __packed {
diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
index e46d9e757a..1484c75b55 100644
--- a/xen/arch/arm/include/asm/mpu/p2m.h
+++ b/xen/arch/arm/include/asm/mpu/p2m.h
@@ -3,8 +3,16 @@
 #ifndef __ARM_MPU_P2M_H__
 #define __ARM_MPU_P2M_H__
 
+#include <xen/bitops.h>
+#include <xen/macros.h>
+#include <xen/page-size.h>
+#include <asm/mpu.h>
+
 struct p2m_domain;
 
+#define P2M_ROOT_PAGES DIV_ROUND_UP(MAX_MPU_REGION_NR * sizeof(pr_t), PAGE_SIZE)
+#define P2M_ROOT_ORDER get_count_order(P2M_ROOT_PAGES)
+
 static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
 
 static inline void p2m_tlb_flush_sync(struct p2m_domain *p2m) {}
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 23500713a1..4a4913716b 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -51,8 +51,13 @@ struct p2m_domain {
     /* Current VMID in use */
     uint16_t vmid;
 
+#ifdef CONFIG_MMU
     /* Current Translation Table Base Register for the p2m */
     uint64_t vttbr;
+#else
+    /* Current Virtualization System Control Register for the p2m */
+    register_t vsctlr;
+#endif
 
     /* Highest guest frame that's ever been mapped in the p2m */
     gfn_t max_mapped_gfn;
diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
index f7fb58ab6a..f3ca8a4ab3 100644
--- a/xen/arch/arm/mpu/p2m.c
+++ b/xen/arch/arm/mpu/p2m.c
@@ -28,10 +28,63 @@ void p2m_dump_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
+static int p2m_alloc_table(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    void *table = alloc_xenheap_pages(P2M_ROOT_ORDER, 0);
+    unsigned int i;
+
+    if ( !table )
+    {
+        printk(XENLOG_G_ERR "%pd: p2m: unable to allocate P2M MPU mapping table\n",
+               d);
+        return -ENOMEM;
+    }
+
+    p2m->root = virt_to_page(table);
+
+    for ( i = 0; i < P2M_ROOT_PAGES; i++ )
+        clear_page(table + (i * PAGE_SIZE));
+
+    return 0;
+}
+
 int p2m_init(struct domain *d)
 {
-    BUG_ON("unimplemented");
-    return -EINVAL;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int rc = 0;
+    unsigned int cpu;
+
+    rwlock_init(&p2m->lock);
+
+    p2m->vmid = INVALID_VMID;
+    p2m->max_mapped_gfn = _gfn(0);
+    p2m->lowest_mapped_gfn = _gfn(ULONG_MAX);
+
+    p2m->default_access = p2m_access_rwx;
+    /* mem_access is NOT supported on MPU system. */
+    p2m->mem_access_enabled = false;
+
+    /* Ensure that the type chosen is large enough for MAX_VIRT_CPUS. */
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < MAX_VIRT_CPUS);
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < INVALID_VCPU_ID);
+
+    for_each_possible_cpu(cpu)
+        p2m->last_vcpu_ran[cpu] = INVALID_VCPU_ID;
+
+    /*
+     * "Trivial" initialization is now complete. Set the backpointer so that
+     * p2m_teardown() and related functions know to do something.
+     */
+    p2m->domain = d;
+
+    rc = p2m_alloc_vmid(d);
+    if ( rc )
+        return rc;
+
+    p2m->vsctlr = ((register_t)p2m->vmid << VSCTLR_VMID_SHIFT);
+
+    return p2m_alloc_table(d);
 }
 
 void p2m_save_state(struct vcpu *p)
@@ -46,7 +99,20 @@ void p2m_restore_state(struct vcpu *n)
 
 void p2m_final_teardown(struct domain *d)
 {
-    BUG_ON("unimplemented");
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /* p2m not actually initialized */
+    if ( !p2m->domain )
+        return;
+
+    if ( p2m->root )
+        free_xenheap_pages(page_to_virt(p2m->root), P2M_ROOT_ORDER);
+
+    p2m->root = NULL;
+
+    p2m_free_vmid(d);
+
+    p2m->domain = NULL;
 }
 
 bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 15 08:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 08:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309712.1580756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndP-00012g-En; Fri, 15 May 2026 08:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309712.1580756; Fri, 15 May 2026 08:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndP-00012Y-CA; Fri, 15 May 2026 08:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1309712;
 Fri, 15 May 2026 08:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNndO-00012S-6K
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 08:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndO-006JW7-0P
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndO-005cVu-0G
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=RgjCX+FbxmDxjB0b0HTXG9Fl2EsAiXQg7ptAvKBgSZ8=; b=R48EWw7f9VIXGfsQI4De6Fv9yO
	BeCyE09kHC2kx9xHq0js+lilQICxKTA9hdRaroK3aYIXL8XxHBfTWWCJ2fdCojgjuCllZTT5zRKty
	zhmMYgev8vDLCCgggoeaE5D29COmQBgYjqGHe7xWHdSGazrrGkeoW5Jjf75YjNWuV4fk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: implement setup_virt_paging for MPU systems
Message-Id: <E1wNndO-005cVu-0G@xenbits.xenproject.org>
Date: Fri, 15 May 2026 08:11:02 +0000

commit a5aa6a7379ee89128106928f6d6315d0fed3c63c
Author:     Penny Zheng <Penny.Zheng@arm.com>
AuthorDate: Wed May 13 13:41:36 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: implement setup_virt_paging for MPU systems
    
    Implement setup_virt_paging for AArch64 MPU systems, taking care of
    stage 2 address translation regime, IPA bits, supported VMID length
    configuration and VTCR_EL2/VSTCR_EL2 register programming.
    
    Implement also the Armv8-R specific changes to ID_AA64MMFR0_EL1,
    related to the supported memory system architecture (PMSA/VMSA)
    and check that when MPU is built, the underlying HW is compatible
    with PMSA. By default MPU at EL2 and EL1 is required.
    
    Signed-off-by: Penny Zheng <penny.zheng@arm.com>
    Signed-off-by: Wei Chen <wei.chen@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Hari Limaye <hari.limaye@arm.com>
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm64/mpu/p2m.c             | 80 +++++++++++++++++++++++++++++++-
 xen/arch/arm/include/asm/arm64/sysregs.h |  4 ++
 xen/arch/arm/include/asm/cpufeature.h    | 13 ++++--
 xen/arch/arm/include/asm/processor.h     |  8 ++++
 4 files changed, 101 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/mpu/p2m.c b/xen/arch/arm/arm64/mpu/p2m.c
index b6d8b2777b..4547417df9 100644
--- a/xen/arch/arm/arm64/mpu/p2m.c
+++ b/xen/arch/arm/arm64/mpu/p2m.c
@@ -2,11 +2,89 @@
 
 #include <xen/bug.h>
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <asm/p2m.h>
 
 void __init setup_virt_paging(void)
 {
-    BUG_ON("unimplemented");
+    register_t vtcr_el2 = READ_SYSREG(VTCR_EL2);
+    register_t vstcr_el2 = READ_SYSREG(VSTCR_EL2);
+
+    /* PA size */
+    const unsigned int pa_range_info[] = {32, 36, 40, 42, 44, 48, 52, 0,
+                                          /* Invalid */};
+
+    /*
+     * Restrict "p2m_ipa_bits" if needed. As P2M table is always configured
+     * with IPA bits == PA bits, compare against PA size.
+     */
+    if ( pa_range_info[system_cpuinfo.mm64.pa_range] < p2m_ipa_bits )
+        p2m_ipa_bits = pa_range_info[system_cpuinfo.mm64.pa_range];
+
+    /*
+     * The MSA and MSA_frac fields in the ID_AA64MMFR0_EL1 register identify the
+     * memory system configurations supported. In Armv8-R AArch64, the
+     * only permitted value for ID_AA64MMFR0_EL1.MSA is 0b1111.
+     */
+    if ( system_cpuinfo.mm64.msa != MM64_MSA_PMSA_SUPPORT )
+        goto fault;
+
+    /* Permitted values for ID_AA64MMFR0_EL1.MSA_frac are 0b0001 and 0b0010. */
+    if ( (system_cpuinfo.mm64.msa_frac != MM64_MSA_FRAC_PMSA_SUPPORT) &&
+         (system_cpuinfo.mm64.msa_frac != MM64_MSA_FRAC_VMSA_SUPPORT) )
+        goto fault;
+
+    /* Stage 1 EL1&0 translation regime uses PMSAv8 by default */
+    vtcr_el2 &= ~VTCR_MSA;
+
+    /*
+     * Clear VTCR_EL2.NSA bit to configure non-secure stage 2 translation output
+     * address space to access the Secure PA space as Armv8-R only implements
+     * secure state.
+     */
+    vtcr_el2 &= ~VTCR_NSA;
+
+    /*
+     * cpuinfo sanitization makes sure we support 16-bits VMID only if all cores
+     * are supporting it.
+     *
+     * Set the VS bit only if 16 bit VMID is supported.
+     */
+    if ( system_cpuinfo.mm64.vmid_bits == MM64_VMID_16_BITS_SUPPORT )
+    {
+        vtcr_el2 |= VTCR_VS;
+        max_vmid = MAX_VMID_16_BIT;
+    }
+    else
+        vtcr_el2 &= ~VTCR_VS;
+
+    WRITE_SYSREG(vtcr_el2, VTCR_EL2);
+
+    p2m_vmid_allocator_init();
+
+    /*
+     * VSTCR_EL2.SA defines secure stage 2 translation output address space.
+     * To make sure that all stage 2 translations for the Secure PA space access
+     * the Secure PA space, we keep SA bit as 0.
+     *
+     * VSTCR_EL2.SC is NS check enable bit. To make sure that Stage 2 NS
+     * configuration is checked against stage 1 NS configuration in EL1&0
+     * translation regime for the given address, and generates a fault if they
+     * are different, we set SC bit 1.
+     */
+    vstcr_el2 &= ~VSTCR_EL2_SA;
+    vstcr_el2 |= VSTCR_EL2_SC;
+    WRITE_SYSREG(vstcr_el2, VSTCR_EL2);
+
+    printk("P2M: %u-bit IPA with %u-bit PA and %u-bit VMID\n",
+           p2m_ipa_bits,
+           pa_range_info[system_cpuinfo.mm64.pa_range],
+           (MAX_VMID == MAX_VMID_16_BIT) ? 16 : 8);
+
+    return;
+
+ fault:
+    panic("Hardware with no PMSAv8-64 support in any translation regime\n");
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index 19d409d3eb..f3c11d871e 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,10 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+/* Virtualization Secure Translation Control Register */
+#define VSTCR_EL2_SA                 (_AC(0x1,U) << 30)
+#define VSTCR_EL2_SC                 (_AC(0x1,U) << 20)
+
 #ifdef CONFIG_MPU
 /*
  * The Armv8-R AArch64 architecture always executes code in Secure
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index 13353c8e1a..bf902a3970 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -248,6 +248,12 @@ struct cpuinfo_arm {
             unsigned long tgranule_16K:4;
             unsigned long tgranule_64K:4;
             unsigned long tgranule_4K:4;
+#ifdef CONFIG_MPU
+            unsigned long __res0:16;
+            unsigned long msa:4;
+            unsigned long msa_frac:4;
+            unsigned long __res1:8;
+#else
             unsigned long tgranule_16k_2:4;
             unsigned long tgranule_64k_2:4;
             unsigned long tgranule_4k_2:4;
@@ -255,6 +261,7 @@ struct cpuinfo_arm {
             unsigned long __res0:8;
             unsigned long fgt:4;
             unsigned long ecv:4;
+#endif
 
             /* MMFR1 */
             unsigned long hafdbs:4;
@@ -267,13 +274,13 @@ struct cpuinfo_arm {
             unsigned long xnx:4;
             unsigned long twed:4;
             unsigned long ets:4;
-            unsigned long __res1:4;
+            unsigned long __res2:4;
             unsigned long afp:4;
-            unsigned long __res2:12;
+            unsigned long __res3:12;
             unsigned long ecbhb:4;
 
             /* MMFR2 */
-            unsigned long __res3:64;
+            unsigned long __res4:64;
         };
     } mm64;
 
diff --git a/xen/arch/arm/include/asm/processor.h b/xen/arch/arm/include/asm/processor.h
index 1a48c9ff3b..895d7cd502 100644
--- a/xen/arch/arm/include/asm/processor.h
+++ b/xen/arch/arm/include/asm/processor.h
@@ -403,6 +403,9 @@
 
 #define VTCR_RES1       (_AC(1,UL)<<31)
 
+#define VTCR_MSA        (_AC(0x1,UL)<<31)
+#define VTCR_NSA        (_AC(0x1,UL)<<30)
+
 /* HCPTR Hyp. Coprocessor Trap Register */
 #define HCPTR_TAM       ((_AC(1,U)<<30))
 #define HCPTR_TTA       ((_AC(1,U)<<20))        /* Trap trace registers */
@@ -464,6 +467,11 @@
 #define MM64_VMID_16_BITS_SUPPORT   0x2
 #endif
 
+#define MM64_MSA_PMSA_SUPPORT       0xf
+#define MM64_MSA_FRAC_NONE_SUPPORT  0x0
+#define MM64_MSA_FRAC_PMSA_SUPPORT  0x1
+#define MM64_MSA_FRAC_VMSA_SUPPORT  0x2
+
 #ifndef __ASSEMBLER__
 
 extern register_t __cpu_logical_map[];
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 15 08:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 08:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309713.1580760 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndZ-00014U-Hx; Fri, 15 May 2026 08:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309713.1580760; Fri, 15 May 2026 08:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndZ-00014M-Dc; Fri, 15 May 2026 08:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1309713;
 Fri, 15 May 2026 08:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNndY-00014E-8p
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 08:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndY-006JWC-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndY-005cWO-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=H8nqWk2tWSDpbUgQtYJ9K5PWrtKMDv8uHCmLGJVlWDU=; b=WEPYmWzDyFiUNuUjKDj2SIVTHx
	q7qDEwktcI1VgSyp7jRQXIb6KcUpCvBbHIDs6cwuC85gs9pBEL6xn1y4Fq+AffT5596hFbDFqgNlA
	qljew0VQLBatk6KAaC6Qdwjg7564F28NIXSY1/WwxCz1/xYr47onUB4+0PsnqUtHjUKU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Introduce `v8r_el1_msa` device tree property for domains
Message-Id: <E1wNndY-005cWO-0c@xenbits.xenproject.org>
Date: Fri, 15 May 2026 08:11:12 +0000

commit 1afacf7b153763ee9c8a7a2ded1409a3eecc0dd1
Author:     Harry Ramsey <harry.ramsey@arm.com>
AuthorDate: Wed May 13 13:41:37 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: Introduce `v8r_el1_msa` device tree property for domains
    
    Add a new device tree property `v8r_el1_msa` to select the MSA (memory
    system architecture) at EL1 for Armv8-R architecture: MPU or MMU, the
    former is the default if the property is not passed.
    
    Implement the dom0less path to parse the new device tree property, add
    a new domctl hypercall input parameter `v8r_el1_msa` for arm and
    add the sanitisation in arch_sanitise_domain_config(), the parameter
    is intended to be used on CONFIG_MPU systems and returns an error if
    selected for MMU.
    
    While there, add explicit padding and check that it's zero during
    arch domain config sanitisation, given the breaking change, bump the
    XEN_DOMCTL_INTERFACE_VERSION.
    
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 docs/misc/arm/device-tree/booting.txt   | 14 ++++++++
 xen/arch/arm/dom0less-build.c           | 62 +++++++++++++++++++++++++++++++++
 xen/arch/arm/domain.c                   | 37 ++++++++++++++++++++
 xen/arch/arm/include/asm/domain.h       |  4 +++
 xen/arch/arm/include/asm/domain_build.h | 10 ++++++
 xen/arch/arm/mpu/arm64/mm.c             |  5 +++
 xen/include/public/arch-arm.h           |  7 ++++
 xen/include/public/domctl.h             |  4 +--
 8 files changed, 141 insertions(+), 2 deletions(-)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index 977b428608..f73839df09 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -322,6 +322,20 @@ with the following properties:
     Should be used together with scmi-smc-passthrough Xen command line
     option.
 
+- v8r_el1_msa
+
+    A string property specifying whether, on Armv8-R systems at EL1, a domain
+    should use PMSAv8 (MPU) or VMSAv8 (MMU).
+
+    - "mmu"
+    Enables VMSAv8 at EL1. This requires hardware support and is only
+    optionally available on AArch64. Not supported on AArch32.
+
+    - "mpu"
+    Enables PMSAv8 at EL1. This is the default behavior when the property is
+    not passed. This configuration requires static allocation (xen,static-mem)
+    and direct mapping (direct-map).
+
 Under the "xen,domain" compatible node, one or more sub-nodes are present
 for the DomU kernel and ramdisk.
 
diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 52cf788a45..3f48f74226 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -302,6 +302,65 @@ static int __init domu_dt_sci_parse(struct dt_device_node *node,
     return 0;
 }
 
+static int __init
+domu_dt_v8r_el1_msa_parse(const struct dt_device_node *node,
+                          struct xen_domctl_createdomain *d_cfg,
+                          unsigned int flags)
+{
+    const char *value;
+    int ret;
+
+    if ( !IS_ENABLED(CONFIG_MPU) )
+    {
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE;
+
+        if ( !dt_property_read_bool(node, "v8r_el1_msa") )
+            return 0;
+
+        printk(XENLOG_ERR
+               "v8r_el1_msa not supported on this build for domain %s\n",
+               dt_node_full_name(node));
+        return -EINVAL;
+    }
+
+    ret = dt_property_read_string(node, "v8r_el1_msa", &value);
+    /* Property absent: PMSA is the default */
+    if ( ret == -EINVAL )
+        value = "mpu";
+    else if ( ret )
+        return ret;
+
+    if ( !strcmp(value, "mpu") )
+    {
+        if ( !(flags & CDF_staticmem) || !(flags & CDF_directmap) )
+        {
+            printk(XENLOG_ERR
+                   "v8r_el1_msa=mpu requires static-mem and direct-map for domain %s\n",
+                   dt_node_full_name(node));
+            return -EINVAL;
+        }
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA;
+        return 0;
+    }
+
+    if ( !strcmp(value, "mmu") )
+    {
+        if ( !has_v8r_vmsa_support() )
+        {
+            printk(XENLOG_ERR
+                   "v8r_el1_msa=mmu unsupported by platform for domain %s\n",
+                   dt_node_full_name(node));
+            return -EINVAL;
+        }
+        d_cfg->arch.v8r_el1_msa = XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA;
+        return 0;
+    }
+
+    printk(XENLOG_ERR "v8r_el1_msa value '%s' not valid for domain %s\n",
+           value, dt_node_full_name(node));
+    return -EINVAL;
+}
+
 int __init arch_parse_dom0less_node(struct dt_device_node *node,
                                     struct boot_domain *bd)
 {
@@ -315,6 +374,9 @@ int __init arch_parse_dom0less_node(struct dt_device_node *node,
     if ( domu_dt_sci_parse(node, d_cfg) )
         panic("Error getting SCI configuration\n");
 
+    if ( domu_dt_v8r_el1_msa_parse(node, d_cfg, flags) )
+        panic("Error getting v8r_el1_msa configuration\n");
+
     if ( !dt_property_read_u32(node, "nr_spis", &d_cfg->arch.nr_spis) )
     {
         int vpl011_virq = GUEST_VPL011_SPI;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 26380a807c..baa3a5d708 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -538,6 +538,25 @@ void vcpu_switch_to_aarch64_mode(struct vcpu *v)
     v->arch.hcr_el2 |= HCR_RW;
 }
 
+static bool v8r_el1_msa_domain_sanitise_config(
+    const struct xen_domctl_createdomain *config)
+{
+    switch ( config->arch.v8r_el1_msa )
+    {
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE:
+        return !IS_ENABLED(CONFIG_MPU);
+
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA:
+        return IS_ENABLED(CONFIG_MPU);
+
+    case XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA:
+        return IS_ENABLED(CONFIG_MPU) && IS_ENABLED(CONFIG_ARM_64);
+
+    default:
+        return false;
+    }
+}
+
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     unsigned int max_vcpus;
@@ -554,6 +573,14 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    /* Check config structure padding */
+    if ( config->arch.pad )
+    {
+        dprintk(XENLOG_INFO,
+                "Invalid domain configuration during domain creation\n");
+        return -EINVAL;
+    }
+
     /* Check feature flags */
     if ( sve_vl_bits > 0 )
     {
@@ -630,6 +657,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( !v8r_el1_msa_domain_sanitise_config(config) )
+    {
+        dprintk(XENLOG_INFO, "Unsupported v8r_el1_msa value\n");
+        return -EINVAL;
+    }
+
     return sci_domain_sanitise_config(config);
 }
 
@@ -722,6 +755,10 @@ int arch_domain_create(struct domain *d,
     d->arch.sve_vl = config->arch.sve_vl;
 #endif
 
+#ifdef CONFIG_MPU
+    d->arch.v8r_el1_msa = config->arch.v8r_el1_msa;
+#endif
+
     if ( (rc = sci_domain_init(d, config)) != 0 )
         goto fail;
 
diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
index 46a5cdc0c8..c3d2c4981f 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -98,6 +98,10 @@ struct arch_domain
 #endif
 
     struct resume_info resume_ctx;
+
+#ifdef CONFIG_MPU
+    uint8_t v8r_el1_msa;
+#endif
 }  __cacheline_aligned;
 
 struct arch_vcpu
diff --git a/xen/arch/arm/include/asm/domain_build.h b/xen/arch/arm/include/asm/domain_build.h
index 6674dac5e2..df8b361b3d 100644
--- a/xen/arch/arm/include/asm/domain_build.h
+++ b/xen/arch/arm/include/asm/domain_build.h
@@ -19,6 +19,16 @@ int prepare_acpi(struct domain *d, struct kernel_info *kinfo);
 
 int add_ext_regions(unsigned long s_gfn, unsigned long e_gfn, void *data);
 
+#if defined(CONFIG_MPU) && defined(CONFIG_ARM_64)
+/* Utility function to determine if an Armv8-R processor supports VMSA. */
+bool has_v8r_vmsa_support(void);
+#else
+static inline bool has_v8r_vmsa_support(void)
+{
+    return false;
+}
+#endif /* CONFIG_MPU */
+
 #endif
 
 /*
diff --git a/xen/arch/arm/mpu/arm64/mm.c b/xen/arch/arm/mpu/arm64/mm.c
index ed643cad40..b07e729a7d 100644
--- a/xen/arch/arm/mpu/arm64/mm.c
+++ b/xen/arch/arm/mpu/arm64/mm.c
@@ -32,6 +32,11 @@
         break;                                                  \
     }
 
+bool has_v8r_vmsa_support(void)
+{
+    return system_cpuinfo.mm64.msa_frac == MM64_MSA_FRAC_VMSA_SUPPORT;
+}
+
 /*
  * Armv8-R supports direct access and indirect access to the MPU regions through
  * registers:
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index cd563cf706..7d6f87e8b2 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -330,6 +330,10 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 #define XEN_DOMCTL_CONFIG_ARM_SCI_NONE      0
 #define XEN_DOMCTL_CONFIG_ARM_SCI_SCMI_SMC  1
 
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_NONE    0
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_PMSA    1
+#define XEN_DOMCTL_CONFIG_ARM_V8R_EL1_MSA_VMSA    2
+
 struct xen_arch_domainconfig {
     /* IN/OUT */
     uint8_t gic_version;
@@ -355,6 +359,9 @@ struct xen_arch_domainconfig {
     uint32_t clock_frequency;
     /* IN */
     uint8_t arm_sci_type;
+    /* IN */
+    uint8_t v8r_el1_msa;
+    uint16_t pad;
 };
 #endif /* __XEN__ || __XEN_TOOLS__ */
 
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 8f6708c0a7..23124547f3 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -30,9 +30,9 @@
  * fields) don't require a change of the version.
  * Stable ops are NOT covered by XEN_DOMCTL_INTERFACE_VERSION!
  *
- * Last version bump: Xen 4.19
+ * Last version bump: Xen 4.22
  */
-#define XEN_DOMCTL_INTERFACE_VERSION 0x00000017
+#define XEN_DOMCTL_INTERFACE_VERSION 0x00000018
 
 /*
  * NB. xen_domctl.domain is an IN/OUT parameter for this operation.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 15 08:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 15 May 2026 08:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1309714.1580764 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndj-00016y-JI; Fri, 15 May 2026 08:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1309714.1580764; Fri, 15 May 2026 08:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wNndj-00016q-Gd; Fri, 15 May 2026 08:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1309714;
 Fri, 15 May 2026 08:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wNndi-00016h-Bp
 for xen-changelog@lists.xenproject.org; Fri, 15 May 2026 08:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndi-006JWI-15
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wNndi-005cXa-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 15 May 2026 08:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zd274XFnfBeSImeMEjPIoMdMIAJlzeKi7t+5X2a5PNY=; b=ILh1j6um8eK+I27zmJkiA8k2nB
	xpVHQtU2D1RjE4j/Hdy9XLRJgf4ouXptyv9j72mISZ/S7EwPwygv2EhCcRxV+NSfGKxkzdAecRNFe
	kCg28Co9LOArRnlJg5ljsWLAvq1WSpRILFQQd2P4aJjxQHoecCo+Y215hg5+mQ6UOWUM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/mpu: Implement p2m tables
Message-Id: <E1wNndi-005cXa-0v@xenbits.xenproject.org>
Date: Fri, 15 May 2026 08:11:22 +0000

commit cd5fe09e50111b7c367335f2874b8c91b023e1cd
Author:     Harry Ramsey <harry.ramsey@arm.com>
AuthorDate: Wed May 13 13:41:38 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Fri May 15 09:08:19 2026 +0200

    arm/mpu: Implement p2m tables
    
    Implement `p2m_alloc_table`, `p2m_init` and `p2m_final_teardown` for MPU
    systems.
    
    Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/arm32/mpu.h |  2 +
 xen/arch/arm/include/asm/arm64/mpu.h |  2 +
 xen/arch/arm/include/asm/mpu/p2m.h   |  8 ++++
 xen/arch/arm/include/asm/p2m.h       |  5 +++
 xen/arch/arm/mpu/p2m.c               | 72 ++++++++++++++++++++++++++++++++++--
 5 files changed, 86 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/arm32/mpu.h b/xen/arch/arm/include/asm/arm32/mpu.h
index 2cf0f8cbac..d565230f84 100644
--- a/xen/arch/arm/include/asm/arm32/mpu.h
+++ b/xen/arch/arm/include/asm/arm32/mpu.h
@@ -11,6 +11,8 @@
  */
 #define MPU_REGION_RES0       0x0
 
+#define VSCTLR_VMID_SHIFT     16
+
 /* Hypervisor Protection Region Base Address Register */
 typedef union {
     struct {
diff --git a/xen/arch/arm/include/asm/arm64/mpu.h b/xen/arch/arm/include/asm/arm64/mpu.h
index 4f694190a8..8b86a03fee 100644
--- a/xen/arch/arm/include/asm/arm64/mpu.h
+++ b/xen/arch/arm/include/asm/arm64/mpu.h
@@ -7,6 +7,8 @@
 
 #define MPU_REGION_RES0        (0xFFFFULL << 48)
 
+#define VSCTLR_VMID_SHIFT      48
+
 /* Protection Region Base Address Register */
 typedef union {
     struct __packed {
diff --git a/xen/arch/arm/include/asm/mpu/p2m.h b/xen/arch/arm/include/asm/mpu/p2m.h
index e46d9e757a..1484c75b55 100644
--- a/xen/arch/arm/include/asm/mpu/p2m.h
+++ b/xen/arch/arm/include/asm/mpu/p2m.h
@@ -3,8 +3,16 @@
 #ifndef __ARM_MPU_P2M_H__
 #define __ARM_MPU_P2M_H__
 
+#include <xen/bitops.h>
+#include <xen/macros.h>
+#include <xen/page-size.h>
+#include <asm/mpu.h>
+
 struct p2m_domain;
 
+#define P2M_ROOT_PAGES DIV_ROUND_UP(MAX_MPU_REGION_NR * sizeof(pr_t), PAGE_SIZE)
+#define P2M_ROOT_ORDER get_count_order(P2M_ROOT_PAGES)
+
 static inline void p2m_clear_root_pages(struct p2m_domain *p2m) {}
 
 static inline void p2m_tlb_flush_sync(struct p2m_domain *p2m) {}
diff --git a/xen/arch/arm/include/asm/p2m.h b/xen/arch/arm/include/asm/p2m.h
index 23500713a1..4a4913716b 100644
--- a/xen/arch/arm/include/asm/p2m.h
+++ b/xen/arch/arm/include/asm/p2m.h
@@ -51,8 +51,13 @@ struct p2m_domain {
     /* Current VMID in use */
     uint16_t vmid;
 
+#ifdef CONFIG_MMU
     /* Current Translation Table Base Register for the p2m */
     uint64_t vttbr;
+#else
+    /* Current Virtualization System Control Register for the p2m */
+    register_t vsctlr;
+#endif
 
     /* Highest guest frame that's ever been mapped in the p2m */
     gfn_t max_mapped_gfn;
diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c
index f7fb58ab6a..f3ca8a4ab3 100644
--- a/xen/arch/arm/mpu/p2m.c
+++ b/xen/arch/arm/mpu/p2m.c
@@ -28,10 +28,63 @@ void p2m_dump_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
+static int p2m_alloc_table(struct domain *d)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    void *table = alloc_xenheap_pages(P2M_ROOT_ORDER, 0);
+    unsigned int i;
+
+    if ( !table )
+    {
+        printk(XENLOG_G_ERR "%pd: p2m: unable to allocate P2M MPU mapping table\n",
+               d);
+        return -ENOMEM;
+    }
+
+    p2m->root = virt_to_page(table);
+
+    for ( i = 0; i < P2M_ROOT_PAGES; i++ )
+        clear_page(table + (i * PAGE_SIZE));
+
+    return 0;
+}
+
 int p2m_init(struct domain *d)
 {
-    BUG_ON("unimplemented");
-    return -EINVAL;
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    int rc = 0;
+    unsigned int cpu;
+
+    rwlock_init(&p2m->lock);
+
+    p2m->vmid = INVALID_VMID;
+    p2m->max_mapped_gfn = _gfn(0);
+    p2m->lowest_mapped_gfn = _gfn(ULONG_MAX);
+
+    p2m->default_access = p2m_access_rwx;
+    /* mem_access is NOT supported on MPU system. */
+    p2m->mem_access_enabled = false;
+
+    /* Ensure that the type chosen is large enough for MAX_VIRT_CPUS. */
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < MAX_VIRT_CPUS);
+    BUILD_BUG_ON((1 << (sizeof(p2m->last_vcpu_ran[0]) * 8)) < INVALID_VCPU_ID);
+
+    for_each_possible_cpu(cpu)
+        p2m->last_vcpu_ran[cpu] = INVALID_VCPU_ID;
+
+    /*
+     * "Trivial" initialization is now complete. Set the backpointer so that
+     * p2m_teardown() and related functions know to do something.
+     */
+    p2m->domain = d;
+
+    rc = p2m_alloc_vmid(d);
+    if ( rc )
+        return rc;
+
+    p2m->vsctlr = ((register_t)p2m->vmid << VSCTLR_VMID_SHIFT);
+
+    return p2m_alloc_table(d);
 }
 
 void p2m_save_state(struct vcpu *p)
@@ -46,7 +99,20 @@ void p2m_restore_state(struct vcpu *n)
 
 void p2m_final_teardown(struct domain *d)
 {
-    BUG_ON("unimplemented");
+    struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+    /* p2m not actually initialized */
+    if ( !p2m->domain )
+        return;
+
+    if ( p2m->root )
+        free_xenheap_pages(page_to_virt(p2m->root), P2M_ROOT_ORDER);
+
+    p2m->root = NULL;
+
+    p2m_free_vmid(d);
+
+    p2m->domain = NULL;
 }
 
 bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311681.1581776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPL-0006Qp-QJ; Mon, 18 May 2026 08:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311681.1581776; Mon, 18 May 2026 08:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPL-0006Qf-Ni; Mon, 18 May 2026 08:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1311681;
 Mon, 18 May 2026 08:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtPK-0006QU-Cv
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPK-00BP1b-12
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPK-00AfBp-0a
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dbNVFN0D7M5kjj9nrxXRzsRWTqmEqbqmE24L6iYWhr0=; b=JtwHwBr02gcRFihwcPF3kmc4Is
	bp1HjQFpqxqvjsxHlqM/xVu0IUkvUzqRjMl9M7oSqJu2zNnDyRoYq0T2cEM4QuYrOwxBY0YD6M2/o
	tWS25U6Fso31ijQYWfFoGRsdabHTUAreySOjLxZkUhuMUwFKXQUUj/s5nCD9Q5fdpso4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume
Message-Id: <E1wOtPK-00AfBp-0a@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:02 +0000

commit c6627327af2a5438adc74f77aafea6ffd16e74ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:54:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:54:36 2026 +0200

    x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume
    
    mwait_idle_cpu_init() is only called for APs, yet MSR writes will
    typically need re-doing post-S3 even for the BSP. When multiple cores /
    threads are present (and to come back online) in a package, for package
    scope MSRs this may be covered by APs doing the writes, but we can't rely
    on that.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/acpi/power.c        |  2 ++
 xen/arch/x86/cpu/mwait-idle.c    | 49 +++++++++++++++++++++++++---------------
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 27d672ad5d..3452650a61 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -28,6 +28,7 @@
 #include <asm/io_apic.h>
 #include <asm/irq.h>
 #include <asm/microcode.h>
+#include <asm/mwait.h>
 #include <asm/prot-key.h>
 #include <asm/spec_ctrl.h>
 #include <asm/tboot.h>
@@ -299,6 +300,7 @@ static int enter_state(u32 state)
     acpi_sleep_post(state);
     if ( hvm_cpu_up() )
         BUG();
+    mwait_idle_resume();
     cpufreq_add_cpu(0);
 
  enable_cpu:
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index c0d5767f87..d575a256a4 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1677,6 +1677,28 @@ static int __init mwait_idle_probe(void)
 	return 0;
 }
 
+static void mwait_idle_cpu_tweak(unsigned int cpu)
+{
+	if (icpu->auto_demotion_disable_flags)
+		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
+
+	if (icpu->byt_auto_demotion_disable_flag)
+		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
+
+	switch (icpu->c1e_promotion) {
+	case C1E_PROMOTION_DISABLE:
+		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
+		break;
+
+	case C1E_PROMOTION_ENABLE:
+		on_selected_cpus(cpumask_of(cpu), c1e_promotion_enable, NULL, 1);
+		break;
+
+	case C1E_PROMOTION_PRESERVE:
+		break;
+	}
+}
+
 static int cf_check mwait_idle_cpu_init(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -1759,24 +1781,7 @@ static int cf_check mwait_idle_cpu_init(
 		dev->count++;
 	}
 
-	if (icpu->auto_demotion_disable_flags)
-		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
-
-	if (icpu->byt_auto_demotion_disable_flag)
-		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
-
-	switch (icpu->c1e_promotion) {
-	case C1E_PROMOTION_DISABLE:
-		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
-		break;
-
-	case C1E_PROMOTION_ENABLE:
-		on_selected_cpus(cpumask_of(cpu), c1e_promotion_enable, NULL, 1);
-		break;
-
-	case C1E_PROMOTION_PRESERVE:
-		break;
-	}
+	mwait_idle_cpu_tweak(cpu);
 
 	return NOTIFY_DONE;
 }
@@ -1808,6 +1813,14 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 	return err;
 }
 
+void mwait_idle_resume(void)
+{
+	if (!icpu)
+		return;
+
+	mwait_idle_cpu_tweak(smp_processor_id());
+}
+
 /* Helper function for HPET. */
 bool __init mwait_pc10_supported(void)
 {
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..8f547d330d 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -14,9 +14,12 @@
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+
 #ifdef CONFIG_INTEL
+void mwait_idle_resume(void);
 bool mwait_pc10_supported(void);
 #else
+static inline void mwait_idle_resume(void) {}
 static inline bool mwait_pc10_supported(void)
 {
     return false;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311683.1581781 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPV-0006T4-SQ; Mon, 18 May 2026 08:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311683.1581781; Mon, 18 May 2026 08:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPV-0006Ss-PH; Mon, 18 May 2026 08:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1311683;
 Mon, 18 May 2026 08:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtPU-0006Sb-FW
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPU-00BP1f-1P
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPU-00AfHZ-1E
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=4qYj8H9HV4tzMizBQOB7h0VD6CbBJwTXhZnWackT5xc=; b=J3p5lyVNcAC5Iztlctl/fmKjRV
	0kOhYfeJ1ewLFh5iWBlQN2XSEwF6IWkNyHqlrDjHlv2k+g0Hbl1WAwB7hC6oolNjWc4Ef81RfDYTg
	qnmAgASaxUgmiN8fRf6N+z++OGk/1y5ya0JAbk3Fmjk3i2Aj7PcVk2i2Tf1jOWM0v0/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: clean up BYT/CHT auto demotion disable
Message-Id: <E1wOtPU-00AfHZ-1E@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:12 +0000

commit 68b307f90a5739ed512946f42f716383a58dc4c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:06 2026 +0200

    x86/mwait-idle: clean up BYT/CHT auto demotion disable
    
    Bay Trail (BYT) and Cherry Trail (CHT) platforms have a very specific way
    of disabling auto-demotion via specific MSR bits. Clean up the code so that
    BYT/CHT-specifics do not show up in the common 'struct idle_cpu' data
    structure.
    
    Remove the 'byt_auto_demotion_disable_flag' flag from 'struct idle_cpu',
    because a better coding pattern is to avoid very case-specific fields like
    'bool byt_auto_demotion_disable_flag' in a common data structure, which is
    used for all platforms, not only BYT/CHT. The code is just more readable
    when common data structures contain only commonly used fields.
    
    Instead, match BYT/CHT in the 'intel_idle_init_cstates_icpu()' function,
    and introduce a small helper to take care of BYT/CHT auto-demotion. This
    is consistent with how platform-specific things are done for other
    platforms.
    
    No intended functional changes.
    
    Inspired by (and description largely taken from) Linux'es c93d13b661a6
    ("intel_idle: clean up BYT/CHT auto demotion disable").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d575a256a4..8982b28543 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -103,7 +103,6 @@ struct idle_cpu {
 	 * Indicate which enable bits to clear here.
 	 */
 	unsigned long auto_demotion_disable_flags;
-	bool byt_auto_demotion_disable_flag;
 	enum c1e_promotion c1e_promotion;
 };
 
@@ -1144,7 +1143,7 @@ static void cf_check auto_demotion_disable(void *dummy)
 	wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
 }
 
-static void cf_check byt_auto_demotion_disable(void *dummy)
+static void byt_cht_auto_demotion_disable(void)
 {
 	wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0);
 	wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0);
@@ -1195,13 +1194,11 @@ static const struct idle_cpu idle_cpu_snb = {
 static const struct idle_cpu idle_cpu_byt = {
 	.state_table = byt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
-	.byt_auto_demotion_disable_flag = true,
 };
 
 static const struct idle_cpu idle_cpu_cht = {
 	.state_table = cht_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
-	.byt_auto_demotion_disable_flag = true,
 };
 
 static const struct idle_cpu idle_cpu_ivb = {
@@ -1677,14 +1674,11 @@ static int __init mwait_idle_probe(void)
 	return 0;
 }
 
-static void mwait_idle_cpu_tweak(unsigned int cpu)
+static void mwait_idle_cpu_tweak(unsigned int cpu, bool bsp)
 {
 	if (icpu->auto_demotion_disable_flags)
 		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
 
-	if (icpu->byt_auto_demotion_disable_flag)
-		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
-
 	switch (icpu->c1e_promotion) {
 	case C1E_PROMOTION_DISABLE:
 		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
@@ -1697,12 +1691,24 @@ static void mwait_idle_cpu_tweak(unsigned int cpu)
 	case C1E_PROMOTION_PRESERVE:
 		break;
 	}
+
+	/* Pkg-scope MSRs on 1-socket-only systems need writing only once. */
+	if (!bsp)
+		return;
+
+	switch (boot_cpu_data.vfm) {
+	case INTEL_ATOM_SILVERMONT:
+	case INTEL_ATOM_AIRMONT:
+		byt_cht_auto_demotion_disable();
+		break;
+	}
 }
 
 static int cf_check mwait_idle_cpu_init(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
 	unsigned int cpu = (unsigned long)hcpu, cstate;
+	static bool first = true;
 	struct acpi_processor_power *dev = processor_powers[cpu];
 
 	switch (action) {
@@ -1781,7 +1787,8 @@ static int cf_check mwait_idle_cpu_init(
 		dev->count++;
 	}
 
-	mwait_idle_cpu_tweak(cpu);
+	mwait_idle_cpu_tweak(cpu, first);
+	first = false;
 
 	return NOTIFY_DONE;
 }
@@ -1818,7 +1825,7 @@ void mwait_idle_resume(void)
 	if (!icpu)
 		return;
 
-	mwait_idle_cpu_tweak(smp_processor_id());
+	mwait_idle_cpu_tweak(smp_processor_id(), true);
 }
 
 /* Helper function for HPET. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311684.1581784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPf-0006Vb-Ts; Mon, 18 May 2026 08:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311684.1581784; Mon, 18 May 2026 08:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPf-0006VR-Qc; Mon, 18 May 2026 08:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1311684;
 Mon, 18 May 2026 08:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtPe-0006VD-J0
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPe-00BP1j-1n
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPe-00AfNP-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dqdU08PueGJnzXCAuMmbJBn5T2rFMHxpE5XAVVWH2Xk=; b=ZaU/OFxET7Lsa3UwWiU21ih6MS
	a0H0RjDacjI7Qg6+9b8HNwmkVpw97dWbeLxZLPA54W6u3bBbY2+uTSSOyXBvs43U0mAyJuZpXIY9V
	TcFNFaetS1PDNW9JQZ3q0vtTa2OrC6KfBazlzgWjtsPXn/ChLWv+ci0MFjt0CGWaQ3GM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: latch struct idle_cpu contents
Message-Id: <E1wOtPe-00AfNP-1a@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:22 +0000

commit 5d834933ca815bdf015de66691f1acee7b87f8b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:29 2026 +0200

    x86/mwait-idle: latch struct idle_cpu contents
    
    Rather than storing a pointer (and needing to keep all struct instances in
    memory post-init), and rather than (like the Linux counterpart has it)
    keeping individual variables, simply copy the respective structure
    instance. By implication, subsequent updates now need doing to the copy.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 49 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8982b28543..82d2af9701 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -106,14 +106,14 @@ struct idle_cpu {
 	enum c1e_promotion c1e_promotion;
 };
 
-static const struct idle_cpu *__ro_after_init icpu;
+static struct idle_cpu __ro_after_init icpu;
 
-static const struct cpuidle_state {
+struct cpuidle_state {
 	char		name[16];
 	unsigned int	flags;
 	unsigned int	exit_latency; /* in US */
 	unsigned int	target_residency; /* in US */
-} *__ro_after_init cpuidle_state_table;
+};
 
 #define CPUIDLE_FLAG_DISABLED		0x1
 /*
@@ -1097,7 +1097,7 @@ static void cf_check mwait_idle(void)
 	 * leave_mm() to avoid costly and often unnecessary wakeups
 	 * for flushing the user TLB's associated with the active mm.
 	 */
-	if (cpuidle_state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
+	if (icpu.state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
 		leave_mm(cpu);
 #endif
 
@@ -1139,7 +1139,7 @@ static void cf_check auto_demotion_disable(void *dummy)
 	u64 msr_bits;
 
 	rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
-	msr_bits &= ~(icpu->auto_demotion_disable_flags);
+	msr_bits &= ~icpu.auto_demotion_disable_flags;
 	wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
 }
 
@@ -1371,10 +1371,10 @@ static void __init ivt_idle_state_table_update(void)
 		/* 1 and 2 socket systems use default ivt_cstates */
 		break;
 	case 2: case 3:
-		cpuidle_state_table = ivt_cstates_4s;
+		icpu.state_table = ivt_cstates_4s;
 		break;
 	default:
-		cpuidle_state_table = ivt_cstates_8s;
+		icpu.state_table = ivt_cstates_8s;
 		break;
 	}
 }
@@ -1525,14 +1525,12 @@ static void __init adl_idle_state_table_update(void)
 		adl_l_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
 
 		/* Disable C1E by clearing the "C1E promotion" bit. */
-		idle_cpu_adl.c1e_promotion = C1E_PROMOTION_DISABLE;
-		idle_cpu_adl_l.c1e_promotion = C1E_PROMOTION_DISABLE;
+		icpu.c1e_promotion = C1E_PROMOTION_DISABLE;
 		return;
 	}
 
 	/* Make sure C1E is enabled by default */
-	idle_cpu_adl.c1e_promotion = C1E_PROMOTION_ENABLE;
-	idle_cpu_adl_l.c1e_promotion = C1E_PROMOTION_ENABLE;
+	icpu.c1e_promotion = C1E_PROMOTION_ENABLE;
 }
 
 /*
@@ -1593,6 +1591,7 @@ static int __init mwait_idle_probe(void)
 {
 	unsigned int eax, ebx, ecx;
 	const struct x86_cpu_id *id;
+	const struct idle_cpu *idle_cpu;
 	const char *str;
 
 	if (boot_cpu_data.vendor != X86_VENDOR_INTEL)
@@ -1627,8 +1626,8 @@ static int __init mwait_idle_probe(void)
 
 	pr_debug(PREFIX "MWAIT substates: %#x\n", mwait_substates);
 
-	icpu = id->driver_data;
-	cpuidle_state_table = icpu->state_table;
+	idle_cpu = id->driver_data;
+	icpu = *idle_cpu;
 
 	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
@@ -1644,7 +1643,7 @@ static int __init mwait_idle_probe(void)
 		const char *ss;
 
 		do {
-			const struct cpuidle_state *state = icpu->state_table;
+			const struct cpuidle_state *state = idle_cpu->state_table;
 			unsigned int bit = 1;
 
 			ss = strchr(str, ',');
@@ -1676,10 +1675,10 @@ static int __init mwait_idle_probe(void)
 
 static void mwait_idle_cpu_tweak(unsigned int cpu, bool bsp)
 {
-	if (icpu->auto_demotion_disable_flags)
+	if (icpu.auto_demotion_disable_flags)
 		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
 
-	switch (icpu->c1e_promotion) {
+	switch (icpu.c1e_promotion) {
 	case C1E_PROMOTION_DISABLE:
 		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
 		break;
@@ -1732,11 +1731,11 @@ static int cf_check mwait_idle_cpu_init(
 
 	dev->count = 1;
 
-	for (cstate = 0; cpuidle_state_table[cstate].target_residency; ++cstate) {
+	for (cstate = 0; icpu.state_table[cstate].target_residency; ++cstate) {
 		unsigned int num_substates, hint, state;
 		struct acpi_processor_cx *cx;
 
-		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
+		hint = flg2MWAIT(icpu.state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
 		if (state > max_cstate()) {
@@ -1752,10 +1751,10 @@ static int cf_check mwait_idle_cpu_init(
 			continue;
 
 		/* if state marked as disabled, skip it */
-		if (cpuidle_state_table[cstate].flags &
+		if (icpu.state_table[cstate].flags &
 		    CPUIDLE_FLAG_DISABLED) {
 			printk(XENLOG_DEBUG PREFIX "state %s is disabled\n",
-			       cpuidle_state_table[cstate].name);
+			       icpu.state_table[cstate].name);
 			continue;
 		}
 
@@ -1773,15 +1772,15 @@ static int cf_check mwait_idle_cpu_init(
 		cx->type = state;
 		cx->address = hint;
 		cx->entry_method = ACPI_CSTATE_EM_FFH;
-		cx->latency = cpuidle_state_table[cstate].exit_latency;
+		cx->latency = icpu.state_table[cstate].exit_latency;
 		cx->target_residency =
-			cpuidle_state_table[cstate].target_residency;
-		if ((cpuidle_state_table[cstate].flags &
+			icpu.state_table[cstate].target_residency;
+		if ((icpu.state_table[cstate].flags &
 		     CPUIDLE_FLAG_IRQ_ENABLE) &&
 		    /* cstate_restore_tsc() needs to be a no-op */
 		    boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
 			cx->irq_enable_early = true;
-		if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IBRS)
+		if (icpu.state_table[cstate].flags & CPUIDLE_FLAG_IBRS)
 			cx->ibrs_disable = true;
 
 		dev->count++;
@@ -1822,7 +1821,7 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 
 void mwait_idle_resume(void)
 {
-	if (!icpu)
+	if (!icpu.state_table)
 		return;
 
 	mwait_idle_cpu_tweak(smp_processor_id(), true);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311685.1581788 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPp-0006YC-Uj; Mon, 18 May 2026 08:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311685.1581788; Mon, 18 May 2026 08:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPp-0006Y4-S4; Mon, 18 May 2026 08:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1311685;
 Mon, 18 May 2026 08:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtPo-0006Xu-Lh
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPo-00BP1n-24
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPo-00AfSJ-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ohwuWl6X7B0naF2B3E1z/DEYZZZ38Mn6cf5qxPIsKHg=; b=aM6DUQsLM0m3XwCxLV6/N3lFdi
	eC4nXtxCE0D3jgDHzD621oAVgbhm19Xor3yfg0GGf8cbZ65g13PK5bYjFz46z9K1jNx9RtSWjBked
	QQRupV73dHI6lMd5bkd4RJSzsfqM+2q9UugLoxaf8TcM++irhOGzBvexJdvNHBwAdKDk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: move pre-initialized struct idle_cpu instances
Message-Id: <E1wOtPo-00AfSJ-1y@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:32 +0000

commit 598f1aa5e82791ccba1550c59888dbe6b8c0dc7a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:48 2026 +0200

    x86/mwait-idle: move pre-initialized struct idle_cpu instances
    
    Now that they're not referenced anymore post-init, they can themselves
    move into .init.rodata. (idle_cpu_adl{,_l} can also become const in the
    first place.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 54 +++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 82d2af9701..8469d45db0 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1167,132 +1167,132 @@ static void cf_check c1e_promotion_disable(void *dummy)
 	wrmsrl(MSR_IA32_POWER_CTL, msr_bits);
 }
 
-static const struct idle_cpu idle_cpu_nehalem = {
+static const struct idle_cpu __initconstrel idle_cpu_nehalem = {
 	.state_table = nehalem_cstates,
 	.auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_atom = {
+static const struct idle_cpu __initconstrel idle_cpu_atom = {
 	.state_table = atom_cstates,
 };
 
-static const struct idle_cpu idle_cpu_tangier = {
+static const struct idle_cpu __initconstrel idle_cpu_tangier = {
 	.state_table = tangier_cstates,
 };
 
-static const struct idle_cpu idle_cpu_lincroft = {
+static const struct idle_cpu __initconstrel idle_cpu_lincroft = {
 	.state_table = atom_cstates,
 	.auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE,
 };
 
-static const struct idle_cpu idle_cpu_snb = {
+static const struct idle_cpu __initconstrel idle_cpu_snb = {
 	.state_table = snb_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_byt = {
+static const struct idle_cpu __initconstrel idle_cpu_byt = {
 	.state_table = byt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_cht = {
+static const struct idle_cpu __initconstrel idle_cpu_cht = {
 	.state_table = cht_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_ivb = {
+static const struct idle_cpu __initconstrel idle_cpu_ivb = {
 	.state_table = ivb_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_ivt = {
+static const struct idle_cpu __initconstrel idle_cpu_ivt = {
 	.state_table = ivt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_hsw = {
+static const struct idle_cpu __initconstrel idle_cpu_hsw = {
 	.state_table = hsw_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_bdw = {
+static const struct idle_cpu __initconstrel idle_cpu_bdw = {
 	.state_table = bdw_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_skl = {
+static const struct idle_cpu __initconstrel idle_cpu_skl = {
 	.state_table = skl_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_skx = {
+static const struct idle_cpu __initconstrel idle_cpu_skx = {
 	.state_table = skx_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_icx = {
+static const struct idle_cpu __initconstrel idle_cpu_icx = {
 	.state_table = icx_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static struct idle_cpu __ro_after_init idle_cpu_adl = {
+static const struct idle_cpu __initconstrel idle_cpu_adl = {
 	.state_table = adl_cstates,
 };
 
-static struct idle_cpu __ro_after_init idle_cpu_adl_l = {
+static const struct idle_cpu __initconstrel idle_cpu_adl_l = {
 	.state_table = adl_l_cstates,
 };
 
-static const struct idle_cpu idle_cpu_mtl_l = {
+static const struct idle_cpu __initconstrel idle_cpu_mtl_l = {
 	.state_table = mtl_l_cstates,
 };
 
-static const struct idle_cpu idle_cpu_gmt = {
+static const struct idle_cpu __initconstrel idle_cpu_gmt = {
 	.state_table = gmt_cstates,
 };
 
-static const struct idle_cpu idle_cpu_spr = {
+static const struct idle_cpu __initconstrel idle_cpu_spr = {
 	.state_table = spr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_gnr = {
+static const struct idle_cpu __initconstrel idle_cpu_gnr = {
 	.state_table = gnr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_gnrd = {
+static const struct idle_cpu __initconstrel idle_cpu_gnrd = {
 	.state_table = gnrd_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_avn = {
+static const struct idle_cpu __initconstrel idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_bxt = {
+static const struct idle_cpu __initconstrel idle_cpu_bxt = {
 	.state_table = bxt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_dnv = {
+static const struct idle_cpu __initconstrel idle_cpu_dnv = {
 	.state_table = dnv_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_snr = {
+static const struct idle_cpu __initconstrel idle_cpu_snr = {
 	.state_table = snr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_grr = {
+static const struct idle_cpu __initconstrel idle_cpu_grr = {
 	.state_table = grr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_srf = {
+static const struct idle_cpu __initconstrel idle_cpu_srf = {
 	.state_table = srf_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311686.1581792 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQ0-0006aM-0G; Mon, 18 May 2026 08:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311686.1581792; Mon, 18 May 2026 08:33:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtPz-0006aE-TS; Mon, 18 May 2026 08:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1311686;
 Mon, 18 May 2026 08:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtPy-0006a5-Oy
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPy-00BP1r-2O
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtPy-00AfXS-2G
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SRVFPZzCciDwG2crIvXfzZ1/87tifkip2WLUatyekcs=; b=cVaqY0hV7RImYdjLh5g18GwI7t
	yIEno9OE7o+KS/YzByCrdGUJSM94mtKg1I/xdlvKXVF1yyC+3wDjVV+Q0QVh26HrxI+jbFRmkTAkw
	S3oef8AKDrmX/s0/hx5d033usCctINRkA4PnlLRKj/S7gDkMlL6/a6cOhUppCSXoFi80=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: Remove the 'preferred_cstates' parameter
Message-Id: <E1wOtPy-00AfXS-2G@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:42 +0000

commit 217db3fe62db3f4ad4f3600e0ddc4484b6d08918
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:56:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:56:42 2026 +0200

    x86/mwait-idle: Remove the 'preferred_cstates' parameter
    
    Remove the 'preferred_cstates' module parameter as it is not really useful.
    
    The parameter currently only affects Alder Lake, where it controls C1/C1E
    preference, with C1E being the default. The parameter does not support any
    other platform. For example, Meteor Lake has a similar C1/C1E limitation,
    but the parameter does not support Meteor Lake. This indicates that the
    parameter is not very useful.
    
    Generally, independent C1 and C1E are important for server platforms where
    low latency is key. However, they are not as important for client platforms,
    like Alder Lake, where C1E providing better energy savings is generally
    preferred.
    
    The parameter was originally introduced for Sapphire Rapids Xeon:
    da0e58c038e6 intel_idle: add 'preferred_cstates' module argument
    
    Later it was added to Alder Lake:
    d1cf8bbfed1ed ("intel_idle: Add AlderLake support")
    
    But it was removed from Sapphire Rapids when firmware fixed the C1/C1E
    limitation:
    1548fac47a114 ("intel_idle: make SPR C1 and C1E be independent")
    
    So Alder Lake is the only platform left where this parameter has any effect.
    Remove this parameter to simplify the driver and reduce maintenance burden.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251215111300.132803-1-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a36dc37b5672
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc |  6 ----
 xen/arch/x86/cpu/mwait-idle.c     | 74 ---------------------------------------
 2 files changed, 80 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 2da90548d8..72da2f2584 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2075,12 +2075,6 @@ compression is selected at build time from Kconfig.
 ### ple_window (Intel)
 > `= <integer>`
 
-### preferred-cstates (x86)
-> `= ( <integer> | List of ( C1 | C1E | C2 | ... )`
-
-This is a mask of C-states which are to be used preferably.  This option is
-applicable only on hardware were certain C-states are exclusive of one another.
-
 ### probe-port-aliases (x86)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8469d45db0..2835cf56d3 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -72,19 +72,6 @@ boolean_param("mwait-idle", opt_mwait_idle);
 
 static unsigned int mwait_substates;
 
-/*
- * Some platforms come with mutually exclusive C-states, so that if one is
- * enabled, the other C-states must not be used. Example: C1 and C1E on
- * Sapphire Rapids platform. This parameter allows for selecting the
- * preferred C-states among the groups of mutually exclusive C-states - the
- * selected C-states will be registered, the other C-states from the mutually
- * exclusive group won't be registered. If the platform has no mutually
- * exclusive C-states, this parameter has no effect.
- */
-static unsigned int __ro_after_init preferred_states_mask;
-static char __initdata preferred_states[64];
-string_param("preferred-cstates", preferred_states);
-
 #define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
 /* Reliable LAPIC Timer States, bit 1 for C1 etc. Default to only C1. */
 static unsigned int lapic_timer_reliable_states = (1 << 1);
@@ -1511,28 +1498,6 @@ static void __init skx_idle_state_table_update(void)
 	}
 }
 
-/*
- * adl_idle_state_table_update - Adjust AlderLake idle states table.
- */
-static void __init adl_idle_state_table_update(void)
-{
-	/* Check if user prefers C1 over C1E. */
-	if ((preferred_states_mask & BIT(1, U)) &&
-	    !(preferred_states_mask & BIT(2, U))) {
-		adl_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
-		adl_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
-		adl_l_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
-		adl_l_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
-
-		/* Disable C1E by clearing the "C1E promotion" bit. */
-		icpu.c1e_promotion = C1E_PROMOTION_DISABLE;
-		return;
-	}
-
-	/* Make sure C1E is enabled by default */
-	icpu.c1e_promotion = C1E_PROMOTION_ENABLE;
-}
-
 /*
  * spr_idle_state_table_update - Adjust Sapphire Rapids idle states table.
  */
@@ -1579,11 +1544,6 @@ static void __init mwait_idle_state_table_update(void)
 	case INTEL_EMERALDRAPIDS_X:
 		spr_idle_state_table_update();
 		break;
-	case INTEL_ALDERLAKE:
-	case INTEL_ALDERLAKE_L:
-	case INTEL_ATOM_GRACEMONT:
-		adl_idle_state_table_update();
-		break;
 	}
 }
 
@@ -1592,7 +1552,6 @@ static int __init mwait_idle_probe(void)
 	unsigned int eax, ebx, ecx;
 	const struct x86_cpu_id *id;
 	const struct idle_cpu *idle_cpu;
-	const char *str;
 
 	if (boot_cpu_data.vendor != X86_VENDOR_INTEL)
 		return -ENODEV;
@@ -1635,39 +1594,6 @@ static int __init mwait_idle_probe(void)
 	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
 		 lapic_timer_reliable_states);
 
-	str = preferred_states;
-	if (isdigit(str[0]))
-		preferred_states_mask = simple_strtoul(str, &str, 0);
-	else if (str[0])
-	{
-		const char *ss;
-
-		do {
-			const struct cpuidle_state *state = idle_cpu->state_table;
-			unsigned int bit = 1;
-
-			ss = strchr(str, ',');
-			if (!ss)
-				ss = strchr(str, '\0');
-
-			for (; state->name[0]; ++state) {
-				bit <<= 1;
-				if (!cmdline_strcmp(str, state->name)) {
-					preferred_states_mask |= bit;
-					break;
-				}
-			}
-			if (!state->name[0])
-				break;
-
-			str = ss + 1;
-		} while (*ss);
-
-		str -= str == ss + 1;
-	}
-	if (str[0])
-		printk("unrecognized \"preferred-cstates=%s\"\n", str);
-
 	mwait_idle_state_table_update();
 
 	return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311687.1581796 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQA-0006d7-2i; Mon, 18 May 2026 08:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311687.1581796; Mon, 18 May 2026 08:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQA-0006cz-04; Mon, 18 May 2026 08:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1311687;
 Mon, 18 May 2026 08:33:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQ8-0006cq-S8
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:33:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQ8-00BP2L-2i
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQ8-00Afdn-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5QLveeXOq8hWPrOIcTuB9zZiE1Pk6WKv/q/zMihLbjk=; b=zIRq/op0tYjtsXHU0xDJ8QpFi2
	GQR97AJlE9A9hQbuf8uCu5VGbAlQkmDcSc+H9/agU9sYB4VlXo0N9hEOAsBdey7NKcQU60Y/h2Rhn
	CeEbkbUuBQb2k7LhCbExncUqNbqbm+axX7AUdc2+SG6Uc1rJbek4rtgimadfrDpnYJdo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: drop const from struct cpuidle_state arrays
Message-Id: <E1wOtQ8-00Afdn-2a@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:33:52 +0000

commit 6c22f00984923076a1c1ce2827c9cbf80a9abae9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:57:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:57:09 2026 +0200

    x86/mwait-idle: drop const from struct cpuidle_state arrays
    
    A subsequent change will want to be able to alter them based on a new
    command line option. (Note that some were __ro_after_init already.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 46 +++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 2835cf56d3..c8d15faf40 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -83,7 +83,7 @@ enum c1e_promotion {
 };
 
 struct idle_cpu {
-	const struct cpuidle_state *state_table;
+	struct cpuidle_state *state_table;
 
 	/*
 	 * Hardware C-state auto-demotion may not always be optimal.
@@ -139,7 +139,7 @@ struct cpuidle_state {
  * which is also the index into the MWAIT hint array.
  * Thus C0 is a dummy.
  */
-static const struct cpuidle_state nehalem_cstates[] = {
+static struct cpuidle_state __ro_after_init nehalem_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -167,7 +167,7 @@ static const struct cpuidle_state nehalem_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state snb_cstates[] = {
+static struct cpuidle_state __ro_after_init snb_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -201,7 +201,7 @@ static const struct cpuidle_state snb_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state byt_cstates[] = {
+static struct cpuidle_state __ro_after_init byt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -235,7 +235,7 @@ static const struct cpuidle_state byt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state cht_cstates[] = {
+static struct cpuidle_state __ro_after_init cht_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -269,7 +269,7 @@ static const struct cpuidle_state cht_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivb_cstates[] = {
+static struct cpuidle_state __ro_after_init ivb_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -303,7 +303,7 @@ static const struct cpuidle_state ivb_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -331,7 +331,7 @@ static const struct cpuidle_state ivt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates_4s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_4s[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -359,7 +359,7 @@ static const struct cpuidle_state ivt_cstates_4s[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates_8s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_8s[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -387,7 +387,7 @@ static const struct cpuidle_state ivt_cstates_8s[] = {
 	{}
 };
 
-static const struct cpuidle_state hsw_cstates[] = {
+static struct cpuidle_state __ro_after_init hsw_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -439,7 +439,7 @@ static const struct cpuidle_state hsw_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state bdw_cstates[] = {
+static struct cpuidle_state __ro_after_init bdw_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -565,7 +565,7 @@ static struct cpuidle_state __ro_after_init skx_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state icx_cstates[] = {
+static struct cpuidle_state __ro_after_init icx_cstates[] = {
        {
                .name = "C1",
                .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_IRQ_ENABLE,
@@ -665,7 +665,7 @@ static struct cpuidle_state __ro_after_init adl_l_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state mtl_l_cstates[] = {
+static struct cpuidle_state __ro_after_init mtl_l_cstates[] = {
 	{
 		.name = "C1E",
 		.flags = MWAIT2flg(0x01),
@@ -687,7 +687,7 @@ static const struct cpuidle_state mtl_l_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gmt_cstates[] = {
+static struct cpuidle_state __ro_after_init gmt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_DISABLED,
@@ -743,7 +743,7 @@ static struct cpuidle_state __ro_after_init spr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gnr_cstates[] = {
+static struct cpuidle_state __ro_after_init gnr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -771,7 +771,7 @@ static const struct cpuidle_state gnr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gnrd_cstates[] = {
+static struct cpuidle_state __ro_after_init gnrd_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -799,7 +799,7 @@ static const struct cpuidle_state gnrd_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state atom_cstates[] = {
+static struct cpuidle_state __ro_after_init atom_cstates[] = {
 	{
 		.name = "C1E",
 		.flags = MWAIT2flg(0x00),
@@ -827,7 +827,7 @@ static const struct cpuidle_state atom_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state tangier_cstates[] = {
+static struct cpuidle_state __ro_after_init tangier_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -861,7 +861,7 @@ static const struct cpuidle_state tangier_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state avn_cstates[] = {
+static struct cpuidle_state __ro_after_init avn_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -923,7 +923,7 @@ static struct cpuidle_state __ro_after_init bxt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state dnv_cstates[] = {
+static struct cpuidle_state __ro_after_init dnv_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -949,7 +949,7 @@ static const struct cpuidle_state dnv_cstates[] = {
  * Note, depending on HW and FW revision, SnowRidge SoC may or may not support
  * C6, and this is indicated in the CPUID mwait leaf.
  */
-static const struct cpuidle_state snr_cstates[] = {
+static struct cpuidle_state __ro_after_init snr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -971,7 +971,7 @@ static const struct cpuidle_state snr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state grr_cstates[] = {
+static struct cpuidle_state __ro_after_init grr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -993,7 +993,7 @@ static const struct cpuidle_state grr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state srf_cstates[] = {
+static struct cpuidle_state __ro_after_init srf_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311688.1581800 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQK-0006fP-47; Mon, 18 May 2026 08:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311688.1581800; Mon, 18 May 2026 08:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQK-0006fI-1d; Mon, 18 May 2026 08:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1311688;
 Mon, 18 May 2026 08:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQI-0006fA-VF
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQI-00BP2a-31
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQI-00Aflu-2v
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zmmHD0g3AjNjdEYWA+BtwNo9X2smWXuRpuR0MAevAVg=; b=VHyJoKIR6uawj8iasGISfz8eLq
	z6467FIX82aVvOGbaWx8OAVGHfkfWVvPVBNI0VwcBOElyTHJMadPfjlZi1msY73c3KAXuz0gkuXwp
	8G2U4oWK9hay45R+0L54ifjUDJpcUdBys7GHPtZH+tqxGNjvNrEQKhdYDKwafH9bLIH0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: Add cmdline option to adjust C-states table
Message-Id: <E1wOtQI-00Aflu-2v@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:02 +0000

commit 78c159bdf631c1270ca4feb813e7a82a5af3cc67
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:57:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:57:36 2026 +0200

    x86/mwait-idle: Add cmdline option to adjust C-states table
    
    Add a new module parameter that allows adjusting the C-states table used by
    the driver.
    
    Currently, the C-states table is hardcoded in the driver based on the CPU
    model. The goal is to have good enough defaults for most users.
    
    However, C-state characteristics, such as exit latency and residency, can
    vary between different variants of the same CPU model and BIOS settings.
    Moreover, different platform usage models and user preferences may benefit
    from different C-state target_residency values.
    
    Provide a way for users to adjust the C-states table via a module parameter
    "table". The general format is:
    "state1:latency1:target_residency1,state2:latency2:target_residency2,..."
    
    In other words, represent each C-state by its name, exit latency (in
    microseconds), and target residency (in microseconds), separated by colons.
    Separate multiple C-states by commas.
    
    For example, suppose a CPU has 3 C-states with the following
    characteristics:
      C1:  exit_latency=1, target_residency=2
      C1E: exit_latency=10, target_residency=10
      C6:  exit_latency=100, target_residency=500
    
    Users can specify a custom C-states table as follows:
    
    1. intel_idle.table="C1:2:2,C1E:5:20,C6:150:600"
       Result: C1:  exit_latency=2, target_residency=2
               C1E: exit_latency=5, target_residency=20
               C6:  exit_latency=150, target_residency=600
    2. intel_idle.table="C6::400"
       Result: C1:  exit_latency=1, target_residency=2 (unchanged)
               C1E: exit_latency=10, target_residency=10 (unchanged)
               C6:  exit_latency=100, target_residency=400
                    (only target_residency changed)
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251216080402.156988-3-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 111f77a23348
    
    Add __init to get_cmdline_field(). Put cmdline_table_str[] in .init.data.
    Other adjustments to fit our env.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc |  17 ++++
 xen/arch/x86/cpu/mwait-idle.c     | 165 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 182 insertions(+)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 72da2f2584..52d4ca0f2f 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1920,6 +1920,23 @@ Print boot time MTRR state.
 Use the MWAIT idle driver (with model specific C-state knowledge) instead
 of the ACPI based one.
 
+### mwait-idle.table (x86)
+> `= <string>`
+
+ Define the C-states table from a user input string. Expected format is
+ 'name:latency:residency', where:
+ - name: The C-state name.
+ - latency: The C-state exit latency in us.
+ - residency: The C-state target residency in us.
+
+ Multiple C-states can be defined by separating them with commas:
+ 'name1:latency1:residency1,name2:latency2:residency2'
+
+ Example: mwait-idle.table=C1:1:1,C1E:5:10,C6:100:600
+
+ To leave latency or residency unchanged, use an empty field, for example:
+ 'C1:1:1,C1E::10' - leaves C1E latency unchanged.
+
 ### nmi (x86)
 > `= ignore | dom0 | fatal`
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index c8d15faf40..4d5223d9d5 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -70,6 +70,11 @@
 static __initdata bool opt_mwait_idle = true;
 boolean_param("mwait-idle", opt_mwait_idle);
 
+/* The maximum allowed length for the 'table' module parameter  */
+#define MAX_CMDLINE_TABLE_LEN 256
+static char cmdline_table_str[MAX_CMDLINE_TABLE_LEN] __initdata;
+string_param("mwait-idle.table", cmdline_table_str);
+
 static unsigned int mwait_substates;
 
 #define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
@@ -122,6 +127,9 @@ struct cpuidle_state {
  */
 #define CPUIDLE_FLAG_IBRS		0x20000
 
+/* C-states data from the 'mwait-idle.table' cmdline parameter */
+static struct cpuidle_state cmdline_states[ACPI_PROCESSOR_MAX_POWER] __initdata;
+
 /*
  * MWAIT takes an 8-bit "hint" in EAX "suggesting"
  * the C-state (top nibble) and sub-state (bottom nibble)
@@ -1547,6 +1555,161 @@ static void __init mwait_idle_state_table_update(void)
 	}
 }
 
+ /**
+  * get_cmdline_field - Get the current field from a cmdline string.
+  * @args: The cmdline string to get the current field from.
+  * @field: Pointer to the current field upon return.
+  * @sep: The fields separator character.
+  *
+  * Examples:
+  *   Input: args="C1:1:1,C1E:2:10", sep=':'
+  *   Output: field="C1", return "1:1,C1E:2:10"
+  *   Input: args="C1:1:1,C1E:2:10", sep=','
+  *   Output: field="C1:1:1", return "C1E:2:10"
+  *   Ipnut: args="::", sep=':'
+  *   Output: field="", return ":"
+  *
+  * Return: The continuation of the cmdline string after the field or NULL.
+  */
+static char *__init get_cmdline_field(char *args, char **field, char sep)
+{
+	unsigned int i;
+
+	for (i = 0; args[i] && !isspace(args[i]); i++) {
+		if (args[i] == sep)
+			break;
+	}
+
+	*field = args;
+
+	if (args[i] != sep)
+		return NULL;
+
+	args[i] = '\0';
+	return args + i + 1;
+}
+
+/**
+ * cmdline_table_adjust - Adjust the C-states table with data from cmdline.
+ *
+ * Adjust the C-states table with data from the 'mwait-idle.table' parameter
+ * (if specified).
+ */
+static void __init cmdline_table_adjust(void)
+{
+	char *args = cmdline_table_str;
+	struct cpuidle_state *state;
+	unsigned int i, state_count;
+
+	if (args[0] == '\0')
+		/* The 'mwait-idle.table' module parameter was not specified */
+		return;
+
+	/* Create a copy of the C-states table */
+	for (i = 0;
+	     i < ARRAY_SIZE(cmdline_states) && icpu.state_table[i].name[0];
+	     i++)
+		cmdline_states[i] = icpu.state_table[i];
+
+	state_count = i;
+
+	/*
+	 * Adjust the C-states table copy with data from the 'mwait-idle.table'
+	 * module parameter.
+	 */
+	while (args) {
+		char *fields, *name, *val;
+
+		/*
+		 * Get the next C-state definition, which is expected to be
+		 * '<name>:<latency_us>:<target_residency_us>'. Treat "empty"
+		 * fields as unchanged. For example,
+		 * '<name>::<target_residency_us>' leaves the latency unchanged.
+		 */
+		args = get_cmdline_field(args, &fields, ',');
+
+		/* name */
+		fields = get_cmdline_field(fields, &name, ':');
+		if (!fields)
+			goto error;
+
+		/* Find the C-state by its name */
+		state = NULL;
+		for (i = 0; i < state_count; i++) {
+			if (!strcmp(name, cmdline_states[i].name)) {
+				state = &cmdline_states[i];
+				break;
+			}
+		}
+
+		if (!state) {
+			printk(XENLOG_ERR PREFIX "C-state '%s' was not found\n",
+			       name);
+			continue;
+		}
+
+		/* Latency */
+		fields = get_cmdline_field(fields, &val, ':');
+		if (!fields)
+			goto error;
+
+		if (*val) {
+			const char *end;
+			unsigned long n = simple_strtoul(val, &end, 0);
+
+			state->exit_latency = n;
+			if (*end || state->exit_latency != n)
+				goto error;
+		}
+
+		/* Target residency */
+		fields = get_cmdline_field(fields, &val, ':');
+
+		if (*val) {
+			const char *end;
+			unsigned long n = simple_strtoul(val, &end, 0);
+
+			state->target_residency = n;
+			if (*end || state->target_residency != n)
+				goto error;
+		}
+
+		/*
+		 * Allow for 3 more fields, but ignore them. Helps to make
+		 * possible future extensions of the cmdline format backward
+		 * compatible.
+		 */
+		for (i = 0; fields && i < 3; i++) {
+			fields = get_cmdline_field(fields, &val, ':');
+			if (!fields)
+				break;
+		}
+
+		if (fields) {
+			printk(XENLOG_ERR PREFIX
+			       "Too many fields for C-state '%s'\n",
+			       state->name);
+			goto error;
+		}
+
+		printk(XENLOG_INFO PREFIX
+		       "C-state from cmdline: name=%s, latency=%u, residency=%u\n",
+		       state->name, state->exit_latency, state->target_residency);
+	}
+
+	/* Copy the adjusted C-states table back */
+	for (i = 0; i < state_count; i++)
+		icpu.state_table[i] = cmdline_states[i];
+
+	printk(XENLOG_INFO PREFIX
+	       "Adjusted C-states with data from 'mwait-idle.table'\n");
+	return;
+
+ error:
+	printk(XENLOG_WARNING PREFIX
+	       "Failed to adjust C-states with data from 'mwait-idle.table'\n");
+}
+
 static int __init mwait_idle_probe(void)
 {
 	unsigned int eax, ebx, ecx;
@@ -1596,6 +1759,8 @@ static int __init mwait_idle_probe(void)
 
 	mwait_idle_state_table_update();
 
+	cmdline_table_adjust();
+
 	return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311689.1581804 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQV-0006hj-5e; Mon, 18 May 2026 08:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311689.1581804; Mon, 18 May 2026 08:34:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQV-0006hb-34; Mon, 18 May 2026 08:34:15 +0000
Received: by outflank-mailman (input) for mailman id 1311689;
 Mon, 18 May 2026 08:34:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQT-0006hL-1l
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQT-00BP2g-05
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQS-00AfqQ-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y6acdDAjctm1VAn+EqdM47Fh8MAbHgdqFP5N3/p54LQ=; b=YyT/Y7nXFhCt6IspyFgkfZRDD6
	sQ6rvy+gAaD9SZkP/bZoJtzGvfAL4qfQnD0fzeZezKHIBvsK+SQbtMQdkhFs/hajbVjb7Rdvy0kQ4
	QSF+uKESOC9qgtxHkmKJx3akpAXNrmbgcLOp3kLsdtNXcHWzklGaYJ/ftJmRJlE57qWY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mwait-idle: Add C-states validation
Message-Id: <E1wOtQS-00AfqQ-3C@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:12 +0000

commit 77ce01fb93219990b4229ab20ddc010d93b18ce3
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:58:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:58:09 2026 +0200

    x86/mwait-idle: Add C-states validation
    
    Add validation for C-states specified via the "table=" module parameter.
    Treat this module parameter as untrusted input and validate it thoroughly.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251216080402.156988-4-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git be6a150829b3
    
    Add __init to validate_cmdline_cstate(). Other adjustments to fit our env.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 55 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 4d5223d9d5..735ba961a9 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -72,6 +72,11 @@ boolean_param("mwait-idle", opt_mwait_idle);
 
 /* The maximum allowed length for the 'table' module parameter  */
 #define MAX_CMDLINE_TABLE_LEN 256
+/* Maximum allowed C-state latency */
+#define MAX_CMDLINE_LATENCY_US (5 * 1000 /* USEC_PER_MSEC */)
+/* Maximum allowed C-state target residency */
+#define MAX_CMDLINE_RESIDENCY_US (100 * 1000 /* USEC_PER_MSEC */)
+
 static char cmdline_table_str[MAX_CMDLINE_TABLE_LEN] __initdata;
 string_param("mwait-idle.table", cmdline_table_str);
 
@@ -1589,6 +1594,41 @@ static char *__init get_cmdline_field(char *args, char **field, char sep)
 	return args + i + 1;
 }
 
+/**
+ * validate_cmdline_cstate - Validate a C-state from cmdline.
+ * @state: The C-state to validate.
+ * @prev_state: The previous C-state in the table or NULL.
+ *
+ * Return: 0 if the C-state is valid or -EINVAL otherwise.
+ */
+static int __init validate_cmdline_cstate(const struct cpuidle_state *state,
+					  const struct cpuidle_state *prev_state)
+{
+	if (state->exit_latency == 0)
+		/* Exit latency 0 can only be used for the POLL state */
+		return -EINVAL;
+
+	if (state->exit_latency > MAX_CMDLINE_LATENCY_US)
+		return -EINVAL;
+
+	if (state->target_residency > MAX_CMDLINE_RESIDENCY_US)
+		return -EINVAL;
+
+	if (state->target_residency < state->exit_latency)
+		return -EINVAL;
+
+	if (!prev_state)
+		return 0;
+
+	if (state->exit_latency <= prev_state->exit_latency)
+		return -EINVAL;
+
+	if (state->target_residency <= prev_state->target_residency)
+		return -EINVAL;
+
+	return 0;
+}
+
 /**
  * cmdline_table_adjust - Adjust the C-states table with data from cmdline.
  *
@@ -1697,6 +1737,21 @@ static void __init cmdline_table_adjust(void)
 		       state->name, state->exit_latency, state->target_residency);
 	}
 
+	/* Validate the adjusted C-states */
+	for (i = 0; i < state_count; i++) {
+		const struct cpuidle_state *prev_state;
+
+		state = &cmdline_states[i];
+		prev_state = i ? &cmdline_states[i - 1] : NULL;
+
+		if (validate_cmdline_cstate(state, prev_state)) {
+			printk(XENLOG_ERR PREFIX
+			       "C-state '%s' validation failed\n",
+			       state->name);
+			goto error;
+		}
+	}
+
 	/* Copy the adjusted C-states table back */
 	for (i = 0; i < state_count; i++)
 		icpu.state_table[i] = cmdline_states[i];
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311690.1581808 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQf-0006jx-7L; Mon, 18 May 2026 08:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311690.1581808; Mon, 18 May 2026 08:34:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQf-0006jp-4O; Mon, 18 May 2026 08:34:25 +0000
Received: by outflank-mailman (input) for mailman id 1311690;
 Mon, 18 May 2026 08:34:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQd-0006je-4d
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQd-00BP2o-0N
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQd-00Afuu-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mpyyIi9AtCgiqsfQOZ3P+GqMjle8D5SovLdMKacDnTI=; b=pJDswkOuuc4Qd3aABAFxfuYbW1
	WrDUHhS+Fxp/YxS7NsF9p+DlGNm/kLJR5IyL1XgDHyF/VJyZBnqBH9T/uJ/pKpzYhT9x7XkeD2V5w
	evfIEn0mntw2/ruWhNSWtdCAtGdQG63lQlWBrKUIkA0LZUqH3OHhemUCGh6ib940pee0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: use RTC century byte when available
Message-Id: <E1wOtQd-00Afuu-0G@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:23 +0000

commit 7cf331d913109dd1634ba2571bd080a6e5cbdeda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:59:02 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:59:02 2026 +0200

    x86/time: use RTC century byte when available
    
    Without this the present logic will misbehave from 2070 onwards.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/time.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 98e8ef19e4..6582235dcc 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1257,6 +1257,7 @@ struct rtc_time {
 static bool __get_cmos_time(struct rtc_time *rtc)
 {
     s_time_t start, t1, t2;
+    unsigned int century = 0;
     unsigned long flags;
 
     spin_lock_irqsave(&rtc_lock, flags);
@@ -1280,6 +1281,8 @@ static bool __get_cmos_time(struct rtc_time *rtc)
     rtc->day  = CMOS_READ(RTC_DAY_OF_MONTH);
     rtc->mon  = CMOS_READ(RTC_MONTH);
     rtc->year = CMOS_READ(RTC_YEAR);
+    if ( acpi_gbl_FADT.century && acpi_gbl_FADT.century < 0x80 )
+        century = CMOS_READ(acpi_gbl_FADT.century);
     
     if ( RTC_ALWAYS_BCD || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) )
     {
@@ -1293,7 +1296,12 @@ static bool __get_cmos_time(struct rtc_time *rtc)
 
     spin_unlock_irqrestore(&rtc_lock, flags);
 
-    if ( (rtc->year += 1900) < 1970 )
+    if ( century )
+    {
+        BCD_TO_BIN(century);
+        rtc->year += century * 100;
+    }
+    else if ( (rtc->year += 1900) < 1970 )
         rtc->year += 100;
 
     return t1 <= SECONDS(1) && t2 < MILLISECS(3);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311691.1581812 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQp-0006mX-8O; Mon, 18 May 2026 08:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311691.1581812; Mon, 18 May 2026 08:34:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQp-0006mP-5p; Mon, 18 May 2026 08:34:35 +0000
Received: by outflank-mailman (input) for mailman id 1311691;
 Mon, 18 May 2026 08:34:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQn-0006mB-7d
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQn-00BP2t-0f
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQn-00Ag4Q-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C52GnGwr364lkA/0bipq3H+9auGnjBPG09gg/F/VjEM=; b=o0MI5Sg85vtPjoXywpPhFNTm6g
	BhDee1hfqUgikysedC1hq8orM+twNkjJYx+lLxmnG+QRm+lEyUdjLFlPqevpXNY/B9kMUCev4AnkO
	pUVmM4o7uCvzRMxbrtHP72of4EmsqMasPxif3KZjkXIIzTHFCGORyp5qlASUX+oeQNJg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xl/parse: mark as GNU source
Message-Id: <E1wOtQn-00Ag4Q-0Y@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:33 +0000

commit c7e442938e0237e5af17bcc87c81bcbf41e4631a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:59:40 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:59:40 2026 +0200

    xl/parse: mark as GNU source
    
    Very old glibc (2.4 in the observed case) declares strndup() only when
    _GNU_SOURCE is defined.
    
    Fixes: ad860c6454ba ("tools/xl: add xl commands for xenstore quota operations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/xl/xl_parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 48c72dce9c..0ccece3e8a 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#define _GNU_SOURCE
+
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311692.1581816 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQy-0006pC-B6; Mon, 18 May 2026 08:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311692.1581816; Mon, 18 May 2026 08:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtQy-0006p4-8X; Mon, 18 May 2026 08:34:44 +0000
Received: by outflank-mailman (input) for mailman id 1311692;
 Mon, 18 May 2026 08:34:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtQx-0006ov-A5
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQx-00BP3G-0v
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtQx-00AgBz-0p
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=obcwshqHZ459r6LZJPJKrdLp7aBB7LAbposrtWoSCpk=; b=ULL1WiXMuUHivEkuRRnf1OP94k
	90HPTXS8brlrtu/rVRtCWERo7hbwPpfMCXLt2vg4asilTRPVmpRqaxhTI5t3r04EGTn438OGX2DYj
	2nboqt6Lpauxov5wUVgEXpG2eqZtqBI8ZyPRnO/d+pv6/+sEk3JjYXB/HkBqbzw2uVRs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/guest: rename a local variable
Message-Id: <E1wOtQx-00AgBz-0p@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:43 +0000

commit 920985c3136dc1510f8a3379b01b3fc42bbbc309
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:00:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:00:23 2026 +0200

    x86/guest: rename a local variable
    
    ... shadowing a file scope one, thuis violating Misra C:2012 rule 5.3
    ("An identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope"). No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/guest/xen/xen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 315e5ded05..a184c51ef1 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -203,11 +203,11 @@ static void __init init_memmap(void)
 
 static void cf_check xen_evtchn_upcall(void)
 {
-    struct vcpu_info *vcpu_info = this_cpu(vcpu_info);
+    struct vcpu_info *vi = this_cpu(vcpu_info);
     unsigned long pending;
 
-    vcpu_info->evtchn_upcall_pending = 0;
-    pending = xchg(&vcpu_info->evtchn_pending_sel, 0);
+    vi->evtchn_upcall_pending = 0;
+    pending = xchg(&vi->evtchn_pending_sel, 0);
 
     while ( pending )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:34:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311693.1581820 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtR8-0006rd-Cd; Mon, 18 May 2026 08:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311693.1581820; Mon, 18 May 2026 08:34:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtR8-0006rV-9r; Mon, 18 May 2026 08:34:54 +0000
Received: by outflank-mailman (input) for mailman id 1311693;
 Mon, 18 May 2026 08:34:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtR7-0006rM-D9
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:34:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtR7-00BP3R-1D
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtR7-00AgGq-16
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:34:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=J8C3eAzkTxhwzIONQjHjDumqOislRYpEwviT2a4BJgE=; b=CuiJC6KXR6GQVVbUhed07ud1qX
	beCmf8nzV3RqKrKumrRWJ9B+K+NVlS53ottJqljhMEzuUJsXF59RFWN3FGID42CQKq2vhPypuVq6C
	8/U4aPD3utO+pdU/6y8v1EOvHX4e9+IeQs6iPKZHjWnOcJZYCSA3GmXldU0D9G1mYOTU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: split a nested max() invocation
Message-Id: <E1wOtR7-00AgGq-16@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:34:53 +0000

commit 193c28c4653167f7e79bd0566c658d96757ae066
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:01:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:01:23 2026 +0200

    x86/shadow: split a nested max() invocation
    
    Such nesting causes the inner instance to shadow the outer instance's
    macro-local variables, thus violating Misra C:2012 rule 5.3 ("An
    identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope"). Use an intermediate variable for the
    inner invocation. No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/mm/shadow/common.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index dd2d04d049..ed698fa90b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -767,11 +767,12 @@ static unsigned int sh_min_allocation(const struct domain *d)
      * megabyte of RAM (for the p2m table, minimally enough for HVM's setting
      * up of slot zero and an LAPIC page), plus one for HVM's 1-to-1 pagetable.
      */
+    unsigned int extra = max(domain_tot_pages(d) / 256,
+                             is_hvm_domain(d) ? CONFIG_PAGING_LEVELS + 2 : 0U) +
+                         is_hvm_domain(d);
+
     return shadow_min_acceptable_pages(d) +
-           max(max(domain_tot_pages(d) / 256,
-                   is_hvm_domain(d) ? CONFIG_PAGING_LEVELS + 2 : 0U) +
-               is_hvm_domain(d),
-               d->arch.paging.p2m_pages);
+           max(extra, d->arch.paging.p2m_pages);
 }
 
 int shadow_set_allocation(struct domain *d, unsigned int pages, bool *preempted)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:35:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:35:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311694.1581824 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtRI-0006tt-Dj; Mon, 18 May 2026 08:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311694.1581824; Mon, 18 May 2026 08:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtRI-0006tl-BG; Mon, 18 May 2026 08:35:04 +0000
Received: by outflank-mailman (input) for mailman id 1311694;
 Mon, 18 May 2026 08:35:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtRH-0006td-Fg
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:35:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtRH-00BP3g-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:35:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtRH-00AgQE-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:35:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0UdzOKnEbpXKHBXhKHBswjpfF6vbL7STczevlpEROr8=; b=k7PgDSMkjGvNSebLmeqRzRoaHh
	cwEcU/q8EdyqVxPqmiRladFDfYfQGPelqiaquBrK8K5uYqfd92ip/It4MKGCzx67FaBCj3B8Z73uq
	sMYD2Ou+rLP0ffBx5O8bHu8ElL9RceKcrLnZUolkuUwMjNZ57YxR3oll9Js/QD7sSZbg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: deviate guest_va_t wrt Misra C:2012 rule 5.6
Message-Id: <E1wOtRH-00AgQE-1N@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:35:03 +0000

commit fa2544bbe487a552b0e8e2a2d90f6b8616572583
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:01:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:01:56 2026 +0200

    x86/shadow: deviate guest_va_t wrt Misra C:2012 rule 5.6
    
    ... ("A `typedef' name shall be a unique identifier"). Much like already
    done for guest_intpte_t and guest_l[12]e_t, but limited to shadow/multi.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 1ceb65819e..a187270c84 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -143,6 +143,11 @@ number of guest paging levels."
 -config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/include/asm/guest_pt\\.h$)))&&any_area(any_loc(text(^.*(guest_intpte_t|guest_l[12]e_t).*$)))"}
 -doc_end
 
+-doc_begin="In x86 shadow code, the type \"guest_va_t\" is deliberately defined
+multiple times, depending on the number of guest paging levels."
+-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/mm/shadow/multi\\.c$)))&&any_area(any_loc(text(^.*guest_va_t.*$)))"}
+-doc_end
+
 -doc_begin="The following files are imported from the gnu-efi package."
 -file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
 -file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 08:35:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 08:35:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311695.1581828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtRS-0006wA-F4; Mon, 18 May 2026 08:35:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311695.1581828; Mon, 18 May 2026 08:35:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOtRS-0006w2-Ca; Mon, 18 May 2026 08:35:14 +0000
Received: by outflank-mailman (input) for mailman id 1311695;
 Mon, 18 May 2026 08:35:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOtRR-0006vt-KL
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 08:35:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtRR-00BP69-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:35:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOtRR-00Aga1-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 08:35:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=p2+/QHSTrB6bwA+JW82uZ8aAnsw5wa2KLMGU8hMg4x4=; b=MaVm5X6+KBC2WZmqeB/0Si1F/l
	rIvWh/vJwCwlf33kkTT1ypYFh0RR6r0q5uXnsjkasZRq5zIDoMDZzv3elaYW8he/7LrG/1MD152j8
	UE10wqGb5qLDd28aindL4FXZgQ1HMAuYA/6j2t1Ol+W0JNXGYVg3Wz81LaC/xwdxFA1o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: address Misra C:2012 rule 8.4
Message-Id: <E1wOtRR-00Aga1-1e@xenbits.xenproject.org>
Date: Mon, 18 May 2026 08:35:13 +0000

commit 6d2fa82c2680acc87dc379242518bb180e37b993
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:02:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:02:32 2026 +0200

    x86: address Misra C:2012 rule 8.4
    
    ... ("A compatible declaration shall be visible when an object or function
    with external linkage is defined"). Three variables lack asmlinkage
    annotations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/guest/xen/pvh-boot.c | 2 +-
 xen/arch/x86/guest/xen/xen.c      | 2 +-
 xen/arch/x86/pv/hypercall.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index e14d7e20e9..a0fef0e9ab 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -22,7 +22,7 @@
 
 /* Initialised in head.S, before .bss is zeroed. */
 bool __initdata pvh_boot;
-uint32_t __initdata pvh_start_info_pa;
+uint32_t asmlinkage __initdata pvh_start_info_pa;
 
 static multiboot_info_t __initdata pvh_mbi;
 static module_t __initdata pvh_mbi_mods[8];
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index a184c51ef1..e4b936ec9c 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -40,7 +40,7 @@ DEFINE_PER_CPU(struct vcpu_info *, vcpu_info);
  *     0 vmcall
  *   > 0 vmmcall
  */
-int8_t __initdata early_hypercall_insn = -1;
+int8_t asmlinkage __initdata early_hypercall_insn = -1;
 
 /*
  * Called once during the first hypercall to figure out which instruction to
diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c
index 17581d232e..b3b9a32555 100644
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -180,7 +180,7 @@ void pv_ring1_init_hypercall_page(void *p)
     }
 }
 
-void do_entry_int82(struct cpu_user_regs *regs)
+void asmlinkage do_entry_int82(struct cpu_user_regs *regs)
 {
     if ( unlikely(untrusted_msi) )
         check_for_unexpected_msi((uint8_t)regs->entry_vector);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311966.1582091 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCN-0002Az-UJ; Mon, 18 May 2026 14:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311966.1582091; Mon, 18 May 2026 14:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCN-0002Ap-Ri; Mon, 18 May 2026 14:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1311966;
 Mon, 18 May 2026 14:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzCM-0002Aj-MP
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCM-00BXPs-1l
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCM-00CfVx-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UOf353CLwax83il06WRMTaigwcmJ5+lq5QfSofTjkdw=; b=qH0sA57dNzyilsbrpSl5bSBSl3
	zc5WbCTfiW3cKllqkdeQLxJIvHZjDOtq3Xqzue6GJp7vcc9f4DtntvYBoSGFkF17QP71jtvaAeb0b
	m4Wb9p5BbuMoJPuRd/LjXwleo0Z3rt5777TVQ7wvbIdhv5/CUTZdWkOGmTgqWSPb0jH0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume
Message-Id: <E1wOzCM-00CfVx-1a@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:02 +0000

commit c6627327af2a5438adc74f77aafea6ffd16e74ac
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:54:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:54:36 2026 +0200

    x86/mwait-idle: arrange for BSP MSR adjustments during S3 resume
    
    mwait_idle_cpu_init() is only called for APs, yet MSR writes will
    typically need re-doing post-S3 even for the BSP. When multiple cores /
    threads are present (and to come back online) in a package, for package
    scope MSRs this may be covered by APs doing the writes, but we can't rely
    on that.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/acpi/power.c        |  2 ++
 xen/arch/x86/cpu/mwait-idle.c    | 49 +++++++++++++++++++++++++---------------
 xen/arch/x86/include/asm/mwait.h |  3 +++
 3 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c
index 27d672ad5d..3452650a61 100644
--- a/xen/arch/x86/acpi/power.c
+++ b/xen/arch/x86/acpi/power.c
@@ -28,6 +28,7 @@
 #include <asm/io_apic.h>
 #include <asm/irq.h>
 #include <asm/microcode.h>
+#include <asm/mwait.h>
 #include <asm/prot-key.h>
 #include <asm/spec_ctrl.h>
 #include <asm/tboot.h>
@@ -299,6 +300,7 @@ static int enter_state(u32 state)
     acpi_sleep_post(state);
     if ( hvm_cpu_up() )
         BUG();
+    mwait_idle_resume();
     cpufreq_add_cpu(0);
 
  enable_cpu:
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index c0d5767f87..d575a256a4 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1677,6 +1677,28 @@ static int __init mwait_idle_probe(void)
 	return 0;
 }
 
+static void mwait_idle_cpu_tweak(unsigned int cpu)
+{
+	if (icpu->auto_demotion_disable_flags)
+		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
+
+	if (icpu->byt_auto_demotion_disable_flag)
+		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
+
+	switch (icpu->c1e_promotion) {
+	case C1E_PROMOTION_DISABLE:
+		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
+		break;
+
+	case C1E_PROMOTION_ENABLE:
+		on_selected_cpus(cpumask_of(cpu), c1e_promotion_enable, NULL, 1);
+		break;
+
+	case C1E_PROMOTION_PRESERVE:
+		break;
+	}
+}
+
 static int cf_check mwait_idle_cpu_init(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
@@ -1759,24 +1781,7 @@ static int cf_check mwait_idle_cpu_init(
 		dev->count++;
 	}
 
-	if (icpu->auto_demotion_disable_flags)
-		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
-
-	if (icpu->byt_auto_demotion_disable_flag)
-		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
-
-	switch (icpu->c1e_promotion) {
-	case C1E_PROMOTION_DISABLE:
-		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
-		break;
-
-	case C1E_PROMOTION_ENABLE:
-		on_selected_cpus(cpumask_of(cpu), c1e_promotion_enable, NULL, 1);
-		break;
-
-	case C1E_PROMOTION_PRESERVE:
-		break;
-	}
+	mwait_idle_cpu_tweak(cpu);
 
 	return NOTIFY_DONE;
 }
@@ -1808,6 +1813,14 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 	return err;
 }
 
+void mwait_idle_resume(void)
+{
+	if (!icpu)
+		return;
+
+	mwait_idle_cpu_tweak(smp_processor_id());
+}
+
 /* Helper function for HPET. */
 bool __init mwait_pc10_supported(void)
 {
diff --git a/xen/arch/x86/include/asm/mwait.h b/xen/arch/x86/include/asm/mwait.h
index 000a692f6d..8f547d330d 100644
--- a/xen/arch/x86/include/asm/mwait.h
+++ b/xen/arch/x86/include/asm/mwait.h
@@ -14,9 +14,12 @@
 #define MWAIT_ECX_INTERRUPT_BREAK	0x1
 
 void mwait_idle_with_hints(unsigned int eax, unsigned int ecx);
+
 #ifdef CONFIG_INTEL
+void mwait_idle_resume(void);
 bool mwait_pc10_supported(void);
 #else
+static inline void mwait_idle_resume(void) {}
 static inline bool mwait_pc10_supported(void)
 {
     return false;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311967.1582096 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCY-0002Ce-0e; Mon, 18 May 2026 14:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311967.1582096; Mon, 18 May 2026 14:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCX-0002CW-T5; Mon, 18 May 2026 14:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1311967;
 Mon, 18 May 2026 14:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzCW-0002CO-MX
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCW-00BXPy-26
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCW-00CfXB-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aE+mCT1d79m31sjK47Q9H4GKRFCunnnB5j/owPU+6mQ=; b=q30x/WVvv6XKLh5tsQkIkF1Cwf
	QbUkuASNgfS5kbFgVnVh/Y2XrF69eiMBsq3e/cRhc+PC1ZqHb4WuBhpjgd9oR8uduNEzCzUpw+Rpe
	WWaOB+6AHfQJbJCy9QmH8DOEptQR6KVMBEW3UUSIsrJFlf8l1egA9IOBnPMi4dqS4iH8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: clean up BYT/CHT auto demotion disable
Message-Id: <E1wOzCW-00CfXB-1w@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:12 +0000

commit 68b307f90a5739ed512946f42f716383a58dc4c0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:06 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:06 2026 +0200

    x86/mwait-idle: clean up BYT/CHT auto demotion disable
    
    Bay Trail (BYT) and Cherry Trail (CHT) platforms have a very specific way
    of disabling auto-demotion via specific MSR bits. Clean up the code so that
    BYT/CHT-specifics do not show up in the common 'struct idle_cpu' data
    structure.
    
    Remove the 'byt_auto_demotion_disable_flag' flag from 'struct idle_cpu',
    because a better coding pattern is to avoid very case-specific fields like
    'bool byt_auto_demotion_disable_flag' in a common data structure, which is
    used for all platforms, not only BYT/CHT. The code is just more readable
    when common data structures contain only commonly used fields.
    
    Instead, match BYT/CHT in the 'intel_idle_init_cstates_icpu()' function,
    and introduce a small helper to take care of BYT/CHT auto-demotion. This
    is consistent with how platform-specific things are done for other
    platforms.
    
    No intended functional changes.
    
    Inspired by (and description largely taken from) Linux'es c93d13b661a6
    ("intel_idle: clean up BYT/CHT auto demotion disable").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d575a256a4..8982b28543 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -103,7 +103,6 @@ struct idle_cpu {
 	 * Indicate which enable bits to clear here.
 	 */
 	unsigned long auto_demotion_disable_flags;
-	bool byt_auto_demotion_disable_flag;
 	enum c1e_promotion c1e_promotion;
 };
 
@@ -1144,7 +1143,7 @@ static void cf_check auto_demotion_disable(void *dummy)
 	wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
 }
 
-static void cf_check byt_auto_demotion_disable(void *dummy)
+static void byt_cht_auto_demotion_disable(void)
 {
 	wrmsrl(MSR_CC6_DEMOTION_POLICY_CONFIG, 0);
 	wrmsrl(MSR_MC6_DEMOTION_POLICY_CONFIG, 0);
@@ -1195,13 +1194,11 @@ static const struct idle_cpu idle_cpu_snb = {
 static const struct idle_cpu idle_cpu_byt = {
 	.state_table = byt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
-	.byt_auto_demotion_disable_flag = true,
 };
 
 static const struct idle_cpu idle_cpu_cht = {
 	.state_table = cht_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
-	.byt_auto_demotion_disable_flag = true,
 };
 
 static const struct idle_cpu idle_cpu_ivb = {
@@ -1677,14 +1674,11 @@ static int __init mwait_idle_probe(void)
 	return 0;
 }
 
-static void mwait_idle_cpu_tweak(unsigned int cpu)
+static void mwait_idle_cpu_tweak(unsigned int cpu, bool bsp)
 {
 	if (icpu->auto_demotion_disable_flags)
 		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
 
-	if (icpu->byt_auto_demotion_disable_flag)
-		on_selected_cpus(cpumask_of(cpu), byt_auto_demotion_disable, NULL, 1);
-
 	switch (icpu->c1e_promotion) {
 	case C1E_PROMOTION_DISABLE:
 		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
@@ -1697,12 +1691,24 @@ static void mwait_idle_cpu_tweak(unsigned int cpu)
 	case C1E_PROMOTION_PRESERVE:
 		break;
 	}
+
+	/* Pkg-scope MSRs on 1-socket-only systems need writing only once. */
+	if (!bsp)
+		return;
+
+	switch (boot_cpu_data.vfm) {
+	case INTEL_ATOM_SILVERMONT:
+	case INTEL_ATOM_AIRMONT:
+		byt_cht_auto_demotion_disable();
+		break;
+	}
 }
 
 static int cf_check mwait_idle_cpu_init(
     struct notifier_block *nfb, unsigned long action, void *hcpu)
 {
 	unsigned int cpu = (unsigned long)hcpu, cstate;
+	static bool first = true;
 	struct acpi_processor_power *dev = processor_powers[cpu];
 
 	switch (action) {
@@ -1781,7 +1787,8 @@ static int cf_check mwait_idle_cpu_init(
 		dev->count++;
 	}
 
-	mwait_idle_cpu_tweak(cpu);
+	mwait_idle_cpu_tweak(cpu, first);
+	first = false;
 
 	return NOTIFY_DONE;
 }
@@ -1818,7 +1825,7 @@ void mwait_idle_resume(void)
 	if (!icpu)
 		return;
 
-	mwait_idle_cpu_tweak(smp_processor_id());
+	mwait_idle_cpu_tweak(smp_processor_id(), true);
 }
 
 /* Helper function for HPET. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311968.1582099 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCi-0002Es-16; Mon, 18 May 2026 14:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311968.1582099; Mon, 18 May 2026 14:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCh-0002Ek-Ub; Mon, 18 May 2026 14:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1311968;
 Mon, 18 May 2026 14:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzCg-0002Eb-PL
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCg-00BXQ4-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCg-00CfaJ-2I
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V5TDTxYSo2t2fPRePZxA0woUg3y0tKOIU5ihLPwALwE=; b=bvmZTkBw9Ct6BGSaPKosF96IRn
	BkxosKujp3HkNei2PhpEiPmMsh3kOqsiHfCFby4XWe+as0+OVASJEn4Gi+wXqH7X0E3x6/lYTKvj7
	N3qLtPYPBD0CClt/6urTTgqzAjuz45b2JkKkqcSW4skN40Jm0upwQSCdOe0uKlSrXzmU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: latch struct idle_cpu contents
Message-Id: <E1wOzCg-00CfaJ-2I@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:22 +0000

commit 5d834933ca815bdf015de66691f1acee7b87f8b3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:29 2026 +0200

    x86/mwait-idle: latch struct idle_cpu contents
    
    Rather than storing a pointer (and needing to keep all struct instances in
    memory post-init), and rather than (like the Linux counterpart has it)
    keeping individual variables, simply copy the respective structure
    instance. By implication, subsequent updates now need doing to the copy.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 49 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8982b28543..82d2af9701 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -106,14 +106,14 @@ struct idle_cpu {
 	enum c1e_promotion c1e_promotion;
 };
 
-static const struct idle_cpu *__ro_after_init icpu;
+static struct idle_cpu __ro_after_init icpu;
 
-static const struct cpuidle_state {
+struct cpuidle_state {
 	char		name[16];
 	unsigned int	flags;
 	unsigned int	exit_latency; /* in US */
 	unsigned int	target_residency; /* in US */
-} *__ro_after_init cpuidle_state_table;
+};
 
 #define CPUIDLE_FLAG_DISABLED		0x1
 /*
@@ -1097,7 +1097,7 @@ static void cf_check mwait_idle(void)
 	 * leave_mm() to avoid costly and often unnecessary wakeups
 	 * for flushing the user TLB's associated with the active mm.
 	 */
-	if (cpuidle_state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
+	if (icpu.state_table[].flags & CPUIDLE_FLAG_TLB_FLUSHED)
 		leave_mm(cpu);
 #endif
 
@@ -1139,7 +1139,7 @@ static void cf_check auto_demotion_disable(void *dummy)
 	u64 msr_bits;
 
 	rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
-	msr_bits &= ~(icpu->auto_demotion_disable_flags);
+	msr_bits &= ~icpu.auto_demotion_disable_flags;
 	wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, msr_bits);
 }
 
@@ -1371,10 +1371,10 @@ static void __init ivt_idle_state_table_update(void)
 		/* 1 and 2 socket systems use default ivt_cstates */
 		break;
 	case 2: case 3:
-		cpuidle_state_table = ivt_cstates_4s;
+		icpu.state_table = ivt_cstates_4s;
 		break;
 	default:
-		cpuidle_state_table = ivt_cstates_8s;
+		icpu.state_table = ivt_cstates_8s;
 		break;
 	}
 }
@@ -1525,14 +1525,12 @@ static void __init adl_idle_state_table_update(void)
 		adl_l_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
 
 		/* Disable C1E by clearing the "C1E promotion" bit. */
-		idle_cpu_adl.c1e_promotion = C1E_PROMOTION_DISABLE;
-		idle_cpu_adl_l.c1e_promotion = C1E_PROMOTION_DISABLE;
+		icpu.c1e_promotion = C1E_PROMOTION_DISABLE;
 		return;
 	}
 
 	/* Make sure C1E is enabled by default */
-	idle_cpu_adl.c1e_promotion = C1E_PROMOTION_ENABLE;
-	idle_cpu_adl_l.c1e_promotion = C1E_PROMOTION_ENABLE;
+	icpu.c1e_promotion = C1E_PROMOTION_ENABLE;
 }
 
 /*
@@ -1593,6 +1591,7 @@ static int __init mwait_idle_probe(void)
 {
 	unsigned int eax, ebx, ecx;
 	const struct x86_cpu_id *id;
+	const struct idle_cpu *idle_cpu;
 	const char *str;
 
 	if (boot_cpu_data.vendor != X86_VENDOR_INTEL)
@@ -1627,8 +1626,8 @@ static int __init mwait_idle_probe(void)
 
 	pr_debug(PREFIX "MWAIT substates: %#x\n", mwait_substates);
 
-	icpu = id->driver_data;
-	cpuidle_state_table = icpu->state_table;
+	idle_cpu = id->driver_data;
+	icpu = *idle_cpu;
 
 	if (boot_cpu_has(X86_FEATURE_XEN_ARAT))
 		lapic_timer_reliable_states = LAPIC_TIMER_ALWAYS_RELIABLE;
@@ -1644,7 +1643,7 @@ static int __init mwait_idle_probe(void)
 		const char *ss;
 
 		do {
-			const struct cpuidle_state *state = icpu->state_table;
+			const struct cpuidle_state *state = idle_cpu->state_table;
 			unsigned int bit = 1;
 
 			ss = strchr(str, ',');
@@ -1676,10 +1675,10 @@ static int __init mwait_idle_probe(void)
 
 static void mwait_idle_cpu_tweak(unsigned int cpu, bool bsp)
 {
-	if (icpu->auto_demotion_disable_flags)
+	if (icpu.auto_demotion_disable_flags)
 		on_selected_cpus(cpumask_of(cpu), auto_demotion_disable, NULL, 1);
 
-	switch (icpu->c1e_promotion) {
+	switch (icpu.c1e_promotion) {
 	case C1E_PROMOTION_DISABLE:
 		on_selected_cpus(cpumask_of(cpu), c1e_promotion_disable, NULL, 1);
 		break;
@@ -1732,11 +1731,11 @@ static int cf_check mwait_idle_cpu_init(
 
 	dev->count = 1;
 
-	for (cstate = 0; cpuidle_state_table[cstate].target_residency; ++cstate) {
+	for (cstate = 0; icpu.state_table[cstate].target_residency; ++cstate) {
 		unsigned int num_substates, hint, state;
 		struct acpi_processor_cx *cx;
 
-		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
+		hint = flg2MWAIT(icpu.state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
 		if (state > max_cstate()) {
@@ -1752,10 +1751,10 @@ static int cf_check mwait_idle_cpu_init(
 			continue;
 
 		/* if state marked as disabled, skip it */
-		if (cpuidle_state_table[cstate].flags &
+		if (icpu.state_table[cstate].flags &
 		    CPUIDLE_FLAG_DISABLED) {
 			printk(XENLOG_DEBUG PREFIX "state %s is disabled\n",
-			       cpuidle_state_table[cstate].name);
+			       icpu.state_table[cstate].name);
 			continue;
 		}
 
@@ -1773,15 +1772,15 @@ static int cf_check mwait_idle_cpu_init(
 		cx->type = state;
 		cx->address = hint;
 		cx->entry_method = ACPI_CSTATE_EM_FFH;
-		cx->latency = cpuidle_state_table[cstate].exit_latency;
+		cx->latency = icpu.state_table[cstate].exit_latency;
 		cx->target_residency =
-			cpuidle_state_table[cstate].target_residency;
-		if ((cpuidle_state_table[cstate].flags &
+			icpu.state_table[cstate].target_residency;
+		if ((icpu.state_table[cstate].flags &
 		     CPUIDLE_FLAG_IRQ_ENABLE) &&
 		    /* cstate_restore_tsc() needs to be a no-op */
 		    boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
 			cx->irq_enable_early = true;
-		if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_IBRS)
+		if (icpu.state_table[cstate].flags & CPUIDLE_FLAG_IBRS)
 			cx->ibrs_disable = true;
 
 		dev->count++;
@@ -1822,7 +1821,7 @@ int __init mwait_idle_init(struct notifier_block *nfb)
 
 void mwait_idle_resume(void)
 {
-	if (!icpu)
+	if (!icpu.state_table)
 		return;
 
 	mwait_idle_cpu_tweak(smp_processor_id(), true);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311969.1582103 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCs-0002H7-2f; Mon, 18 May 2026 14:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311969.1582103; Mon, 18 May 2026 14:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzCr-0002Gz-W1; Mon, 18 May 2026 14:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1311969;
 Mon, 18 May 2026 14:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzCq-0002Gd-S1
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCq-00BXQA-2h
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzCq-00CfdW-2a
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JtokP/Cs7k2pAwMTzQ/MbLD5y96+lKht8JAGbJzUtRw=; b=dPMq4dKiCFlGTr+vcxSaNxaJ7P
	Boelp3gLWptTsLOxcnIjgjIY1+UXNwJbmcp4U+00KjCzN0ROyeWZtfq+rpc+iD9awUL/j4BiY6pkX
	mQzTXmw7Z/TZflnnnO4Zu0C8WilDhpKG8FF88XWE3Epk+1e2QlpEbTT97HQGbRfjl5FY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: move pre-initialized struct idle_cpu instances
Message-Id: <E1wOzCq-00CfdW-2a@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:32 +0000

commit 598f1aa5e82791ccba1550c59888dbe6b8c0dc7a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:55:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:55:48 2026 +0200

    x86/mwait-idle: move pre-initialized struct idle_cpu instances
    
    Now that they're not referenced anymore post-init, they can themselves
    move into .init.rodata. (idle_cpu_adl{,_l} can also become const in the
    first place.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 54 +++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 82d2af9701..8469d45db0 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1167,132 +1167,132 @@ static void cf_check c1e_promotion_disable(void *dummy)
 	wrmsrl(MSR_IA32_POWER_CTL, msr_bits);
 }
 
-static const struct idle_cpu idle_cpu_nehalem = {
+static const struct idle_cpu __initconstrel idle_cpu_nehalem = {
 	.state_table = nehalem_cstates,
 	.auto_demotion_disable_flags = NHM_C1_AUTO_DEMOTE | NHM_C3_AUTO_DEMOTE,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_atom = {
+static const struct idle_cpu __initconstrel idle_cpu_atom = {
 	.state_table = atom_cstates,
 };
 
-static const struct idle_cpu idle_cpu_tangier = {
+static const struct idle_cpu __initconstrel idle_cpu_tangier = {
 	.state_table = tangier_cstates,
 };
 
-static const struct idle_cpu idle_cpu_lincroft = {
+static const struct idle_cpu __initconstrel idle_cpu_lincroft = {
 	.state_table = atom_cstates,
 	.auto_demotion_disable_flags = ATM_LNC_C6_AUTO_DEMOTE,
 };
 
-static const struct idle_cpu idle_cpu_snb = {
+static const struct idle_cpu __initconstrel idle_cpu_snb = {
 	.state_table = snb_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_byt = {
+static const struct idle_cpu __initconstrel idle_cpu_byt = {
 	.state_table = byt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_cht = {
+static const struct idle_cpu __initconstrel idle_cpu_cht = {
 	.state_table = cht_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_ivb = {
+static const struct idle_cpu __initconstrel idle_cpu_ivb = {
 	.state_table = ivb_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_ivt = {
+static const struct idle_cpu __initconstrel idle_cpu_ivt = {
 	.state_table = ivt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_hsw = {
+static const struct idle_cpu __initconstrel idle_cpu_hsw = {
 	.state_table = hsw_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_bdw = {
+static const struct idle_cpu __initconstrel idle_cpu_bdw = {
 	.state_table = bdw_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_skl = {
+static const struct idle_cpu __initconstrel idle_cpu_skl = {
 	.state_table = skl_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_skx = {
+static const struct idle_cpu __initconstrel idle_cpu_skx = {
 	.state_table = skx_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_icx = {
+static const struct idle_cpu __initconstrel idle_cpu_icx = {
 	.state_table = icx_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static struct idle_cpu __ro_after_init idle_cpu_adl = {
+static const struct idle_cpu __initconstrel idle_cpu_adl = {
 	.state_table = adl_cstates,
 };
 
-static struct idle_cpu __ro_after_init idle_cpu_adl_l = {
+static const struct idle_cpu __initconstrel idle_cpu_adl_l = {
 	.state_table = adl_l_cstates,
 };
 
-static const struct idle_cpu idle_cpu_mtl_l = {
+static const struct idle_cpu __initconstrel idle_cpu_mtl_l = {
 	.state_table = mtl_l_cstates,
 };
 
-static const struct idle_cpu idle_cpu_gmt = {
+static const struct idle_cpu __initconstrel idle_cpu_gmt = {
 	.state_table = gmt_cstates,
 };
 
-static const struct idle_cpu idle_cpu_spr = {
+static const struct idle_cpu __initconstrel idle_cpu_spr = {
 	.state_table = spr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_gnr = {
+static const struct idle_cpu __initconstrel idle_cpu_gnr = {
 	.state_table = gnr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_gnrd = {
+static const struct idle_cpu __initconstrel idle_cpu_gnrd = {
 	.state_table = gnrd_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_avn = {
+static const struct idle_cpu __initconstrel idle_cpu_avn = {
 	.state_table = avn_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_bxt = {
+static const struct idle_cpu __initconstrel idle_cpu_bxt = {
 	.state_table = bxt_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_dnv = {
+static const struct idle_cpu __initconstrel idle_cpu_dnv = {
 	.state_table = dnv_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_snr = {
+static const struct idle_cpu __initconstrel idle_cpu_snr = {
 	.state_table = snr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_grr = {
+static const struct idle_cpu __initconstrel idle_cpu_grr = {
 	.state_table = grr_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
 
-static const struct idle_cpu idle_cpu_srf = {
+static const struct idle_cpu __initconstrel idle_cpu_srf = {
 	.state_table = srf_cstates,
 	.c1e_promotion = C1E_PROMOTION_DISABLE,
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311970.1582108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzD2-0002J4-3w; Mon, 18 May 2026 14:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311970.1582108; Mon, 18 May 2026 14:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzD2-0002Iw-12; Mon, 18 May 2026 14:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1311970;
 Mon, 18 May 2026 14:44:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzD1-0002Ip-0w
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzD0-00BXQG-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzD0-00Cfea-2u
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Gku28yQb5gTANX7rZMFBgLvfRbE0/I8gCFlMoHHOOiY=; b=hHMNrwHhsZCwaqfotKRmfs61SL
	f+chU3LF0SrHDLFgQ3/MF8SiAQEqyvx3bMfjEAnVqiPR1vj1dMK2UQClH+FctN+0tGHprhF1+WF3v
	qNEGxDBes8/P/zaw2NezTvPnYfPgS2AUH4agSHbS7Rxc6ZT43ZyMQJ8fpJgzFtbOhmIU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: Remove the 'preferred_cstates' parameter
Message-Id: <E1wOzD0-00Cfea-2u@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:42 +0000

commit 217db3fe62db3f4ad4f3600e0ddc4484b6d08918
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:56:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:56:42 2026 +0200

    x86/mwait-idle: Remove the 'preferred_cstates' parameter
    
    Remove the 'preferred_cstates' module parameter as it is not really useful.
    
    The parameter currently only affects Alder Lake, where it controls C1/C1E
    preference, with C1E being the default. The parameter does not support any
    other platform. For example, Meteor Lake has a similar C1/C1E limitation,
    but the parameter does not support Meteor Lake. This indicates that the
    parameter is not very useful.
    
    Generally, independent C1 and C1E are important for server platforms where
    low latency is key. However, they are not as important for client platforms,
    like Alder Lake, where C1E providing better energy savings is generally
    preferred.
    
    The parameter was originally introduced for Sapphire Rapids Xeon:
    da0e58c038e6 intel_idle: add 'preferred_cstates' module argument
    
    Later it was added to Alder Lake:
    d1cf8bbfed1ed ("intel_idle: Add AlderLake support")
    
    But it was removed from Sapphire Rapids when firmware fixed the C1/C1E
    limitation:
    1548fac47a114 ("intel_idle: make SPR C1 and C1E be independent")
    
    So Alder Lake is the only platform left where this parameter has any effect.
    Remove this parameter to simplify the driver and reduce maintenance burden.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251215111300.132803-1-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git a36dc37b5672
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc |  6 ----
 xen/arch/x86/cpu/mwait-idle.c     | 74 ---------------------------------------
 2 files changed, 80 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 2da90548d8..72da2f2584 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2075,12 +2075,6 @@ compression is selected at build time from Kconfig.
 ### ple_window (Intel)
 > `= <integer>`
 
-### preferred-cstates (x86)
-> `= ( <integer> | List of ( C1 | C1E | C2 | ... )`
-
-This is a mask of C-states which are to be used preferably.  This option is
-applicable only on hardware were certain C-states are exclusive of one another.
-
 ### probe-port-aliases (x86)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 8469d45db0..2835cf56d3 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -72,19 +72,6 @@ boolean_param("mwait-idle", opt_mwait_idle);
 
 static unsigned int mwait_substates;
 
-/*
- * Some platforms come with mutually exclusive C-states, so that if one is
- * enabled, the other C-states must not be used. Example: C1 and C1E on
- * Sapphire Rapids platform. This parameter allows for selecting the
- * preferred C-states among the groups of mutually exclusive C-states - the
- * selected C-states will be registered, the other C-states from the mutually
- * exclusive group won't be registered. If the platform has no mutually
- * exclusive C-states, this parameter has no effect.
- */
-static unsigned int __ro_after_init preferred_states_mask;
-static char __initdata preferred_states[64];
-string_param("preferred-cstates", preferred_states);
-
 #define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
 /* Reliable LAPIC Timer States, bit 1 for C1 etc. Default to only C1. */
 static unsigned int lapic_timer_reliable_states = (1 << 1);
@@ -1511,28 +1498,6 @@ static void __init skx_idle_state_table_update(void)
 	}
 }
 
-/*
- * adl_idle_state_table_update - Adjust AlderLake idle states table.
- */
-static void __init adl_idle_state_table_update(void)
-{
-	/* Check if user prefers C1 over C1E. */
-	if ((preferred_states_mask & BIT(1, U)) &&
-	    !(preferred_states_mask & BIT(2, U))) {
-		adl_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
-		adl_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
-		adl_l_cstates[0].flags &= ~CPUIDLE_FLAG_DISABLED;
-		adl_l_cstates[1].flags |= CPUIDLE_FLAG_DISABLED;
-
-		/* Disable C1E by clearing the "C1E promotion" bit. */
-		icpu.c1e_promotion = C1E_PROMOTION_DISABLE;
-		return;
-	}
-
-	/* Make sure C1E is enabled by default */
-	icpu.c1e_promotion = C1E_PROMOTION_ENABLE;
-}
-
 /*
  * spr_idle_state_table_update - Adjust Sapphire Rapids idle states table.
  */
@@ -1579,11 +1544,6 @@ static void __init mwait_idle_state_table_update(void)
 	case INTEL_EMERALDRAPIDS_X:
 		spr_idle_state_table_update();
 		break;
-	case INTEL_ALDERLAKE:
-	case INTEL_ALDERLAKE_L:
-	case INTEL_ATOM_GRACEMONT:
-		adl_idle_state_table_update();
-		break;
 	}
 }
 
@@ -1592,7 +1552,6 @@ static int __init mwait_idle_probe(void)
 	unsigned int eax, ebx, ecx;
 	const struct x86_cpu_id *id;
 	const struct idle_cpu *idle_cpu;
-	const char *str;
 
 	if (boot_cpu_data.vendor != X86_VENDOR_INTEL)
 		return -ENODEV;
@@ -1635,39 +1594,6 @@ static int __init mwait_idle_probe(void)
 	pr_debug(PREFIX "lapic_timer_reliable_states %#x\n",
 		 lapic_timer_reliable_states);
 
-	str = preferred_states;
-	if (isdigit(str[0]))
-		preferred_states_mask = simple_strtoul(str, &str, 0);
-	else if (str[0])
-	{
-		const char *ss;
-
-		do {
-			const struct cpuidle_state *state = idle_cpu->state_table;
-			unsigned int bit = 1;
-
-			ss = strchr(str, ',');
-			if (!ss)
-				ss = strchr(str, '\0');
-
-			for (; state->name[0]; ++state) {
-				bit <<= 1;
-				if (!cmdline_strcmp(str, state->name)) {
-					preferred_states_mask |= bit;
-					break;
-				}
-			}
-			if (!state->name[0])
-				break;
-
-			str = ss + 1;
-		} while (*ss);
-
-		str -= str == ss + 1;
-	}
-	if (str[0])
-		printk("unrecognized \"preferred-cstates=%s\"\n", str);
-
 	mwait_idle_state_table_update();
 
 	return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311971.1582111 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDC-0002LX-6T; Mon, 18 May 2026 14:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311971.1582111; Mon, 18 May 2026 14:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDC-0002LP-3t; Mon, 18 May 2026 14:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1311971;
 Mon, 18 May 2026 14:44:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDB-0002LJ-3Z
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:44:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDB-00BXQi-0G
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDB-00Cffi-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:44:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1QQd4dtZ+8+eReDEVWeATW3JNaCoEs7K1wmQZjhbe0E=; b=lNMSQszfKVx9m0e/Sm1Mx3q2JY
	/Ovf3DdcpMYMdYEwxYEp0VqAcAKFO1pEMoHkc/aoLPHXzlJq4bF4du1YSj/vshfOhshfk57uYcpPm
	t2NgfcgWtGotHrZW2GUIlDXMOy/GF+Az7z2wRkVl7US5lsTyEvUbTDAHs1wbKuaMVpVI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: drop const from struct cpuidle_state arrays
Message-Id: <E1wOzDB-00Cffi-0A@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:44:53 +0000

commit 6c22f00984923076a1c1ce2827c9cbf80a9abae9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:57:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:57:09 2026 +0200

    x86/mwait-idle: drop const from struct cpuidle_state arrays
    
    A subsequent change will want to be able to alter them based on a new
    command line option. (Note that some were __ro_after_init already.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 46 +++++++++++++++++++++----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 2835cf56d3..c8d15faf40 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -83,7 +83,7 @@ enum c1e_promotion {
 };
 
 struct idle_cpu {
-	const struct cpuidle_state *state_table;
+	struct cpuidle_state *state_table;
 
 	/*
 	 * Hardware C-state auto-demotion may not always be optimal.
@@ -139,7 +139,7 @@ struct cpuidle_state {
  * which is also the index into the MWAIT hint array.
  * Thus C0 is a dummy.
  */
-static const struct cpuidle_state nehalem_cstates[] = {
+static struct cpuidle_state __ro_after_init nehalem_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -167,7 +167,7 @@ static const struct cpuidle_state nehalem_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state snb_cstates[] = {
+static struct cpuidle_state __ro_after_init snb_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -201,7 +201,7 @@ static const struct cpuidle_state snb_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state byt_cstates[] = {
+static struct cpuidle_state __ro_after_init byt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -235,7 +235,7 @@ static const struct cpuidle_state byt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state cht_cstates[] = {
+static struct cpuidle_state __ro_after_init cht_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -269,7 +269,7 @@ static const struct cpuidle_state cht_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivb_cstates[] = {
+static struct cpuidle_state __ro_after_init ivb_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -303,7 +303,7 @@ static const struct cpuidle_state ivb_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -331,7 +331,7 @@ static const struct cpuidle_state ivt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates_4s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_4s[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -359,7 +359,7 @@ static const struct cpuidle_state ivt_cstates_4s[] = {
 	{}
 };
 
-static const struct cpuidle_state ivt_cstates_8s[] = {
+static struct cpuidle_state __ro_after_init ivt_cstates_8s[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -387,7 +387,7 @@ static const struct cpuidle_state ivt_cstates_8s[] = {
 	{}
 };
 
-static const struct cpuidle_state hsw_cstates[] = {
+static struct cpuidle_state __ro_after_init hsw_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -439,7 +439,7 @@ static const struct cpuidle_state hsw_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state bdw_cstates[] = {
+static struct cpuidle_state __ro_after_init bdw_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -565,7 +565,7 @@ static struct cpuidle_state __ro_after_init skx_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state icx_cstates[] = {
+static struct cpuidle_state __ro_after_init icx_cstates[] = {
        {
                .name = "C1",
                .flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_IRQ_ENABLE,
@@ -665,7 +665,7 @@ static struct cpuidle_state __ro_after_init adl_l_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state mtl_l_cstates[] = {
+static struct cpuidle_state __ro_after_init mtl_l_cstates[] = {
 	{
 		.name = "C1E",
 		.flags = MWAIT2flg(0x01),
@@ -687,7 +687,7 @@ static const struct cpuidle_state mtl_l_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gmt_cstates[] = {
+static struct cpuidle_state __ro_after_init gmt_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00) | CPUIDLE_FLAG_DISABLED,
@@ -743,7 +743,7 @@ static struct cpuidle_state __ro_after_init spr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gnr_cstates[] = {
+static struct cpuidle_state __ro_after_init gnr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -771,7 +771,7 @@ static const struct cpuidle_state gnr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state gnrd_cstates[] = {
+static struct cpuidle_state __ro_after_init gnrd_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -799,7 +799,7 @@ static const struct cpuidle_state gnrd_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state atom_cstates[] = {
+static struct cpuidle_state __ro_after_init atom_cstates[] = {
 	{
 		.name = "C1E",
 		.flags = MWAIT2flg(0x00),
@@ -827,7 +827,7 @@ static const struct cpuidle_state atom_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state tangier_cstates[] = {
+static struct cpuidle_state __ro_after_init tangier_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -861,7 +861,7 @@ static const struct cpuidle_state tangier_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state avn_cstates[] = {
+static struct cpuidle_state __ro_after_init avn_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -923,7 +923,7 @@ static struct cpuidle_state __ro_after_init bxt_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state dnv_cstates[] = {
+static struct cpuidle_state __ro_after_init dnv_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -949,7 +949,7 @@ static const struct cpuidle_state dnv_cstates[] = {
  * Note, depending on HW and FW revision, SnowRidge SoC may or may not support
  * C6, and this is indicated in the CPUID mwait leaf.
  */
-static const struct cpuidle_state snr_cstates[] = {
+static struct cpuidle_state __ro_after_init snr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -971,7 +971,7 @@ static const struct cpuidle_state snr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state grr_cstates[] = {
+static struct cpuidle_state __ro_after_init grr_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
@@ -993,7 +993,7 @@ static const struct cpuidle_state grr_cstates[] = {
 	{}
 };
 
-static const struct cpuidle_state srf_cstates[] = {
+static struct cpuidle_state __ro_after_init srf_cstates[] = {
 	{
 		.name = "C1",
 		.flags = MWAIT2flg(0x00),
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311972.1582115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDM-0002NX-7s; Mon, 18 May 2026 14:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311972.1582115; Mon, 18 May 2026 14:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDM-0002NP-5B; Mon, 18 May 2026 14:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1311972;
 Mon, 18 May 2026 14:45:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDL-0002NH-6l
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDL-00BXR8-0Y
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDL-00Cfgm-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=K7O85e4UxR0QfkO1ZWUo2EBuxoM8/YRCamnREk01ZtQ=; b=FA7KXyyFHk3DXp2psPi3RWIE4m
	OjJB6YaMNrOgNtmVzlVcdFjvHCQCfMBtnt1y4O4PLr0VDlc/w+wOLUng9pyJ+CvDNVgheoDiQ8CPc
	M7HKoojzVKv/nu2XRJ5Kv6FpKWJ3X20dAymwB8oUzlm/ewHmKApwNqMnzJZTgy0mBr7U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: Add cmdline option to adjust C-states table
Message-Id: <E1wOzDL-00Cfgm-0R@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:03 +0000

commit 78c159bdf631c1270ca4feb813e7a82a5af3cc67
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:57:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:57:36 2026 +0200

    x86/mwait-idle: Add cmdline option to adjust C-states table
    
    Add a new module parameter that allows adjusting the C-states table used by
    the driver.
    
    Currently, the C-states table is hardcoded in the driver based on the CPU
    model. The goal is to have good enough defaults for most users.
    
    However, C-state characteristics, such as exit latency and residency, can
    vary between different variants of the same CPU model and BIOS settings.
    Moreover, different platform usage models and user preferences may benefit
    from different C-state target_residency values.
    
    Provide a way for users to adjust the C-states table via a module parameter
    "table". The general format is:
    "state1:latency1:target_residency1,state2:latency2:target_residency2,..."
    
    In other words, represent each C-state by its name, exit latency (in
    microseconds), and target residency (in microseconds), separated by colons.
    Separate multiple C-states by commas.
    
    For example, suppose a CPU has 3 C-states with the following
    characteristics:
      C1:  exit_latency=1, target_residency=2
      C1E: exit_latency=10, target_residency=10
      C6:  exit_latency=100, target_residency=500
    
    Users can specify a custom C-states table as follows:
    
    1. intel_idle.table="C1:2:2,C1E:5:20,C6:150:600"
       Result: C1:  exit_latency=2, target_residency=2
               C1E: exit_latency=5, target_residency=20
               C6:  exit_latency=150, target_residency=600
    2. intel_idle.table="C6::400"
       Result: C1:  exit_latency=1, target_residency=2 (unchanged)
               C1E: exit_latency=10, target_residency=10 (unchanged)
               C6:  exit_latency=100, target_residency=400
                    (only target_residency changed)
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251216080402.156988-3-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 111f77a23348
    
    Add __init to get_cmdline_field(). Put cmdline_table_str[] in .init.data.
    Other adjustments to fit our env.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/misc/xen-command-line.pandoc |  17 ++++
 xen/arch/x86/cpu/mwait-idle.c     | 165 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 182 insertions(+)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 72da2f2584..52d4ca0f2f 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1920,6 +1920,23 @@ Print boot time MTRR state.
 Use the MWAIT idle driver (with model specific C-state knowledge) instead
 of the ACPI based one.
 
+### mwait-idle.table (x86)
+> `= <string>`
+
+ Define the C-states table from a user input string. Expected format is
+ 'name:latency:residency', where:
+ - name: The C-state name.
+ - latency: The C-state exit latency in us.
+ - residency: The C-state target residency in us.
+
+ Multiple C-states can be defined by separating them with commas:
+ 'name1:latency1:residency1,name2:latency2:residency2'
+
+ Example: mwait-idle.table=C1:1:1,C1E:5:10,C6:100:600
+
+ To leave latency or residency unchanged, use an empty field, for example:
+ 'C1:1:1,C1E::10' - leaves C1E latency unchanged.
+
 ### nmi (x86)
 > `= ignore | dom0 | fatal`
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index c8d15faf40..4d5223d9d5 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -70,6 +70,11 @@
 static __initdata bool opt_mwait_idle = true;
 boolean_param("mwait-idle", opt_mwait_idle);
 
+/* The maximum allowed length for the 'table' module parameter  */
+#define MAX_CMDLINE_TABLE_LEN 256
+static char cmdline_table_str[MAX_CMDLINE_TABLE_LEN] __initdata;
+string_param("mwait-idle.table", cmdline_table_str);
+
 static unsigned int mwait_substates;
 
 #define LAPIC_TIMER_ALWAYS_RELIABLE 0xFFFFFFFF
@@ -122,6 +127,9 @@ struct cpuidle_state {
  */
 #define CPUIDLE_FLAG_IBRS		0x20000
 
+/* C-states data from the 'mwait-idle.table' cmdline parameter */
+static struct cpuidle_state cmdline_states[ACPI_PROCESSOR_MAX_POWER] __initdata;
+
 /*
  * MWAIT takes an 8-bit "hint" in EAX "suggesting"
  * the C-state (top nibble) and sub-state (bottom nibble)
@@ -1547,6 +1555,161 @@ static void __init mwait_idle_state_table_update(void)
 	}
 }
 
+ /**
+  * get_cmdline_field - Get the current field from a cmdline string.
+  * @args: The cmdline string to get the current field from.
+  * @field: Pointer to the current field upon return.
+  * @sep: The fields separator character.
+  *
+  * Examples:
+  *   Input: args="C1:1:1,C1E:2:10", sep=':'
+  *   Output: field="C1", return "1:1,C1E:2:10"
+  *   Input: args="C1:1:1,C1E:2:10", sep=','
+  *   Output: field="C1:1:1", return "C1E:2:10"
+  *   Ipnut: args="::", sep=':'
+  *   Output: field="", return ":"
+  *
+  * Return: The continuation of the cmdline string after the field or NULL.
+  */
+static char *__init get_cmdline_field(char *args, char **field, char sep)
+{
+	unsigned int i;
+
+	for (i = 0; args[i] && !isspace(args[i]); i++) {
+		if (args[i] == sep)
+			break;
+	}
+
+	*field = args;
+
+	if (args[i] != sep)
+		return NULL;
+
+	args[i] = '\0';
+	return args + i + 1;
+}
+
+/**
+ * cmdline_table_adjust - Adjust the C-states table with data from cmdline.
+ *
+ * Adjust the C-states table with data from the 'mwait-idle.table' parameter
+ * (if specified).
+ */
+static void __init cmdline_table_adjust(void)
+{
+	char *args = cmdline_table_str;
+	struct cpuidle_state *state;
+	unsigned int i, state_count;
+
+	if (args[0] == '\0')
+		/* The 'mwait-idle.table' module parameter was not specified */
+		return;
+
+	/* Create a copy of the C-states table */
+	for (i = 0;
+	     i < ARRAY_SIZE(cmdline_states) && icpu.state_table[i].name[0];
+	     i++)
+		cmdline_states[i] = icpu.state_table[i];
+
+	state_count = i;
+
+	/*
+	 * Adjust the C-states table copy with data from the 'mwait-idle.table'
+	 * module parameter.
+	 */
+	while (args) {
+		char *fields, *name, *val;
+
+		/*
+		 * Get the next C-state definition, which is expected to be
+		 * '<name>:<latency_us>:<target_residency_us>'. Treat "empty"
+		 * fields as unchanged. For example,
+		 * '<name>::<target_residency_us>' leaves the latency unchanged.
+		 */
+		args = get_cmdline_field(args, &fields, ',');
+
+		/* name */
+		fields = get_cmdline_field(fields, &name, ':');
+		if (!fields)
+			goto error;
+
+		/* Find the C-state by its name */
+		state = NULL;
+		for (i = 0; i < state_count; i++) {
+			if (!strcmp(name, cmdline_states[i].name)) {
+				state = &cmdline_states[i];
+				break;
+			}
+		}
+
+		if (!state) {
+			printk(XENLOG_ERR PREFIX "C-state '%s' was not found\n",
+			       name);
+			continue;
+		}
+
+		/* Latency */
+		fields = get_cmdline_field(fields, &val, ':');
+		if (!fields)
+			goto error;
+
+		if (*val) {
+			const char *end;
+			unsigned long n = simple_strtoul(val, &end, 0);
+
+			state->exit_latency = n;
+			if (*end || state->exit_latency != n)
+				goto error;
+		}
+
+		/* Target residency */
+		fields = get_cmdline_field(fields, &val, ':');
+
+		if (*val) {
+			const char *end;
+			unsigned long n = simple_strtoul(val, &end, 0);
+
+			state->target_residency = n;
+			if (*end || state->target_residency != n)
+				goto error;
+		}
+
+		/*
+		 * Allow for 3 more fields, but ignore them. Helps to make
+		 * possible future extensions of the cmdline format backward
+		 * compatible.
+		 */
+		for (i = 0; fields && i < 3; i++) {
+			fields = get_cmdline_field(fields, &val, ':');
+			if (!fields)
+				break;
+		}
+
+		if (fields) {
+			printk(XENLOG_ERR PREFIX
+			       "Too many fields for C-state '%s'\n",
+			       state->name);
+			goto error;
+		}
+
+		printk(XENLOG_INFO PREFIX
+		       "C-state from cmdline: name=%s, latency=%u, residency=%u\n",
+		       state->name, state->exit_latency, state->target_residency);
+	}
+
+	/* Copy the adjusted C-states table back */
+	for (i = 0; i < state_count; i++)
+		icpu.state_table[i] = cmdline_states[i];
+
+	printk(XENLOG_INFO PREFIX
+	       "Adjusted C-states with data from 'mwait-idle.table'\n");
+	return;
+
+ error:
+	printk(XENLOG_WARNING PREFIX
+	       "Failed to adjust C-states with data from 'mwait-idle.table'\n");
+}
+
 static int __init mwait_idle_probe(void)
 {
 	unsigned int eax, ebx, ecx;
@@ -1596,6 +1759,8 @@ static int __init mwait_idle_probe(void)
 
 	mwait_idle_state_table_update();
 
+	cmdline_table_adjust();
+
 	return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311973.1582119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDW-0002PV-9E; Mon, 18 May 2026 14:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311973.1582119; Mon, 18 May 2026 14:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDW-0002PM-6W; Mon, 18 May 2026 14:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1311973;
 Mon, 18 May 2026 14:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDV-0002PG-9V
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDV-00BXTZ-0p
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDV-00CfhA-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=W6eM5fIUMIphCzOX90klMG11a82MdXT5cl+gFZ7t5dw=; b=QtiiMMgyTXmhLyRjNSJd7Gae1c
	ftdXQatHJzD9mhkgpom9kcwrpWgt2/ZEMqs7chLicRLo6IFMpyjtb2ngNacnyjL/wgZTfy7qUoSSX
	mm4FQ5nzKuL7glP+a75EG4+wBJMWSZrlW7A15Up0qKUy1H0z7fMRC8CqWhrKiEjZ7xsQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mwait-idle: Add C-states validation
Message-Id: <E1wOzDV-00CfhA-0j@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:13 +0000

commit 77ce01fb93219990b4229ab20ddc010d93b18ce3
Author:     Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
AuthorDate: Mon May 18 08:58:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:58:09 2026 +0200

    x86/mwait-idle: Add C-states validation
    
    Add validation for C-states specified via the "table=" module parameter.
    Treat this module parameter as untrusted input and validate it thoroughly.
    
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Link: https://patch.msgid.link/20251216080402.156988-4-dedekind1@gmail.com
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git be6a150829b3
    
    Add __init to validate_cmdline_cstate(). Other adjustments to fit our env.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/cpu/mwait-idle.c | 55 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 4d5223d9d5..735ba961a9 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -72,6 +72,11 @@ boolean_param("mwait-idle", opt_mwait_idle);
 
 /* The maximum allowed length for the 'table' module parameter  */
 #define MAX_CMDLINE_TABLE_LEN 256
+/* Maximum allowed C-state latency */
+#define MAX_CMDLINE_LATENCY_US (5 * 1000 /* USEC_PER_MSEC */)
+/* Maximum allowed C-state target residency */
+#define MAX_CMDLINE_RESIDENCY_US (100 * 1000 /* USEC_PER_MSEC */)
+
 static char cmdline_table_str[MAX_CMDLINE_TABLE_LEN] __initdata;
 string_param("mwait-idle.table", cmdline_table_str);
 
@@ -1589,6 +1594,41 @@ static char *__init get_cmdline_field(char *args, char **field, char sep)
 	return args + i + 1;
 }
 
+/**
+ * validate_cmdline_cstate - Validate a C-state from cmdline.
+ * @state: The C-state to validate.
+ * @prev_state: The previous C-state in the table or NULL.
+ *
+ * Return: 0 if the C-state is valid or -EINVAL otherwise.
+ */
+static int __init validate_cmdline_cstate(const struct cpuidle_state *state,
+					  const struct cpuidle_state *prev_state)
+{
+	if (state->exit_latency == 0)
+		/* Exit latency 0 can only be used for the POLL state */
+		return -EINVAL;
+
+	if (state->exit_latency > MAX_CMDLINE_LATENCY_US)
+		return -EINVAL;
+
+	if (state->target_residency > MAX_CMDLINE_RESIDENCY_US)
+		return -EINVAL;
+
+	if (state->target_residency < state->exit_latency)
+		return -EINVAL;
+
+	if (!prev_state)
+		return 0;
+
+	if (state->exit_latency <= prev_state->exit_latency)
+		return -EINVAL;
+
+	if (state->target_residency <= prev_state->target_residency)
+		return -EINVAL;
+
+	return 0;
+}
+
 /**
  * cmdline_table_adjust - Adjust the C-states table with data from cmdline.
  *
@@ -1697,6 +1737,21 @@ static void __init cmdline_table_adjust(void)
 		       state->name, state->exit_latency, state->target_residency);
 	}
 
+	/* Validate the adjusted C-states */
+	for (i = 0; i < state_count; i++) {
+		const struct cpuidle_state *prev_state;
+
+		state = &cmdline_states[i];
+		prev_state = i ? &cmdline_states[i - 1] : NULL;
+
+		if (validate_cmdline_cstate(state, prev_state)) {
+			printk(XENLOG_ERR PREFIX
+			       "C-state '%s' validation failed\n",
+			       state->name);
+			goto error;
+		}
+	}
+
 	/* Copy the adjusted C-states table back */
 	for (i = 0; i < state_count; i++)
 		icpu.state_table[i] = cmdline_states[i];
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311974.1582124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDg-0002RQ-Ag; Mon, 18 May 2026 14:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311974.1582124; Mon, 18 May 2026 14:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDg-0002RI-7m; Mon, 18 May 2026 14:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1311974;
 Mon, 18 May 2026 14:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDf-0002R9-Bx
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDf-00BXTg-16
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDf-00Cfht-10
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vIdspz7cOuMAQ5dkC60YZBXzSJs02B39fEQjysmER/4=; b=YjcL74Gt5jvIfYicVc5HCIsMyy
	pOQ5BhkG+r+USD/h7UOBOVt7QgYM+TyLgD7+Vlvd6FEqPrAYNuAPdfuLbr2skNWoda+iYVIho1WkR
	G+FI1UFhOBhdScY0F4J0Mikg3rR39I0r3Q/Sn4zyEbZ0vc/UKrYHDCWobIbKYAJf+uLo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: use RTC century byte when available
Message-Id: <E1wOzDf-00Cfht-10@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:23 +0000

commit 7cf331d913109dd1634ba2571bd080a6e5cbdeda
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:59:02 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:59:02 2026 +0200

    x86/time: use RTC century byte when available
    
    Without this the present logic will misbehave from 2070 onwards.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/time.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 98e8ef19e4..6582235dcc 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1257,6 +1257,7 @@ struct rtc_time {
 static bool __get_cmos_time(struct rtc_time *rtc)
 {
     s_time_t start, t1, t2;
+    unsigned int century = 0;
     unsigned long flags;
 
     spin_lock_irqsave(&rtc_lock, flags);
@@ -1280,6 +1281,8 @@ static bool __get_cmos_time(struct rtc_time *rtc)
     rtc->day  = CMOS_READ(RTC_DAY_OF_MONTH);
     rtc->mon  = CMOS_READ(RTC_MONTH);
     rtc->year = CMOS_READ(RTC_YEAR);
+    if ( acpi_gbl_FADT.century && acpi_gbl_FADT.century < 0x80 )
+        century = CMOS_READ(acpi_gbl_FADT.century);
     
     if ( RTC_ALWAYS_BCD || !(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) )
     {
@@ -1293,7 +1296,12 @@ static bool __get_cmos_time(struct rtc_time *rtc)
 
     spin_unlock_irqrestore(&rtc_lock, flags);
 
-    if ( (rtc->year += 1900) < 1970 )
+    if ( century )
+    {
+        BCD_TO_BIN(century);
+        rtc->year += century * 100;
+    }
+    else if ( (rtc->year += 1900) < 1970 )
         rtc->year += 100;
 
     return t1 <= SECONDS(1) && t2 < MILLISECS(3);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311975.1582127 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDq-0002Tk-Bd; Mon, 18 May 2026 14:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311975.1582127; Mon, 18 May 2026 14:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzDq-0002Tc-95; Mon, 18 May 2026 14:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1311975;
 Mon, 18 May 2026 14:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDp-0002TW-Ej
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDp-00BXTm-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDp-00CfiH-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HdV5ALnqFbKAPxFn//3K5UVVM5gECzd3WJTJKCDdw4k=; b=1RRjTcqrGNKvGZQxcpKM6Ba454
	lJ6rDWLTjn5NNqkXGJUM/54cgnEGQcnKK8pq2CVzk56CFKknsbxw1TK0wS3+34NudZ8MMtSA4zG0Y
	1PZVeIHUepVXDnZzSDsz5ayT6kjWFgAcrkBtQRsxPgXSQ6Brfl88m7yRr23alN1UoReo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xl/parse: mark as GNU source
Message-Id: <E1wOzDp-00CfiH-1H@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:33 +0000

commit c7e442938e0237e5af17bcc87c81bcbf41e4631a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 08:59:40 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 08:59:40 2026 +0200

    xl/parse: mark as GNU source
    
    Very old glibc (2.4 in the observed case) declares strndup() only when
    _GNU_SOURCE is defined.
    
    Fixes: ad860c6454ba ("tools/xl: add xl commands for xenstore quota operations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/xl/xl_parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c
index 48c72dce9c..0ccece3e8a 100644
--- a/tools/xl/xl_parse.c
+++ b/tools/xl/xl_parse.c
@@ -12,6 +12,8 @@
  * GNU Lesser General Public License for more details.
  */
 
+#define _GNU_SOURCE
+
 #include <ctype.h>
 #include <inttypes.h>
 #include <limits.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311976.1582131 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzE0-0002WD-Ed; Mon, 18 May 2026 14:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311976.1582131; Mon, 18 May 2026 14:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzE0-0002W3-Bf; Mon, 18 May 2026 14:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1311976;
 Mon, 18 May 2026 14:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzDz-0002Vx-HE
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDz-00BXTs-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzDz-00Cfiv-1Y
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZKgzcScrMOsImgY1EoNK5icJ4ibuiSsc6G4eaUvB2oU=; b=iw+KL6JiCP7PrEXNcyIpDPVAuf
	zf/WbdUUdcpu8ntaBbUBCRfBmpDcTemTP1R0vz4iSbnPoOUGKBERu2+hvt2xSh7aARSSh0wI912g8
	mJLPPt4PRBRPlqAyPnHNKS2PnCt2T4YulgvomhF+oGgjp29rLjYmeYZRj6m5niUyQf0c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/guest: rename a local variable
Message-Id: <E1wOzDz-00Cfiv-1Y@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:43 +0000

commit 920985c3136dc1510f8a3379b01b3fc42bbbc309
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:00:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:00:23 2026 +0200

    x86/guest: rename a local variable
    
    ... shadowing a file scope one, thuis violating Misra C:2012 rule 5.3
    ("An identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope"). No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/guest/xen/xen.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 315e5ded05..a184c51ef1 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -203,11 +203,11 @@ static void __init init_memmap(void)
 
 static void cf_check xen_evtchn_upcall(void)
 {
-    struct vcpu_info *vcpu_info = this_cpu(vcpu_info);
+    struct vcpu_info *vi = this_cpu(vcpu_info);
     unsigned long pending;
 
-    vcpu_info->evtchn_upcall_pending = 0;
-    pending = xchg(&vcpu_info->evtchn_pending_sel, 0);
+    vi->evtchn_upcall_pending = 0;
+    pending = xchg(&vi->evtchn_pending_sel, 0);
 
     while ( pending )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:45:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311977.1582135 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEA-0002Y7-Fc; Mon, 18 May 2026 14:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311977.1582135; Mon, 18 May 2026 14:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEA-0002Y0-Cz; Mon, 18 May 2026 14:45:54 +0000
Received: by outflank-mailman (input) for mailman id 1311977;
 Mon, 18 May 2026 14:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzE9-0002Xu-K1
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzE9-00BXUG-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzE9-00CfjK-1o
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rEaOMoX6dsFerdCGQd29L0vQ4wEouG74xoQt4TqKMf8=; b=MtH3sPT52KAMSAGq6KQaG5l0O8
	FZLHQ6DC+Lzt4F18+9d4Cqz0I1WV0w4q0TFsB3PjGK4UwN8yCnFX+8bE2yH3mx2HbTDFG5gTrRozS
	YIPCikpStVlAkuA765Jfb/z8iQGVwGwuavd6FZm8osXAgxr3daFtfKhjEFEHf+iHooME=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: split a nested max() invocation
Message-Id: <E1wOzE9-00CfjK-1o@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:45:53 +0000

commit 193c28c4653167f7e79bd0566c658d96757ae066
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:01:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:01:23 2026 +0200

    x86/shadow: split a nested max() invocation
    
    Such nesting causes the inner instance to shadow the outer instance's
    macro-local variables, thus violating Misra C:2012 rule 5.3 ("An
    identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope"). Use an intermediate variable for the
    inner invocation. No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/mm/shadow/common.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index dd2d04d049..ed698fa90b 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -767,11 +767,12 @@ static unsigned int sh_min_allocation(const struct domain *d)
      * megabyte of RAM (for the p2m table, minimally enough for HVM's setting
      * up of slot zero and an LAPIC page), plus one for HVM's 1-to-1 pagetable.
      */
+    unsigned int extra = max(domain_tot_pages(d) / 256,
+                             is_hvm_domain(d) ? CONFIG_PAGING_LEVELS + 2 : 0U) +
+                         is_hvm_domain(d);
+
     return shadow_min_acceptable_pages(d) +
-           max(max(domain_tot_pages(d) / 256,
-                   is_hvm_domain(d) ? CONFIG_PAGING_LEVELS + 2 : 0U) +
-               is_hvm_domain(d),
-               d->arch.paging.p2m_pages);
+           max(extra, d->arch.paging.p2m_pages);
 }
 
 int shadow_set_allocation(struct domain *d, unsigned int pages, bool *preempted)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:46:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311978.1582138 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEK-0002aB-HQ; Mon, 18 May 2026 14:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311978.1582138; Mon, 18 May 2026 14:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEK-0002a3-Ep; Mon, 18 May 2026 14:46:04 +0000
Received: by outflank-mailman (input) for mailman id 1311978;
 Mon, 18 May 2026 14:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzEJ-0002Zv-Mc
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzEJ-00BXUa-2B
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzEJ-00Cfnm-24
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fryRIN2kPcZS+gq65odb9Pgz/rW++34scnx76TWByNo=; b=l3NHyLZJFw5Ul0AG/D3Xtm/KG+
	FEQbi4mxFkudNtdvLzLEfaGVHCXftb0VITCibkf/8qU5tDWpwlO+bk4sGDzElGRIl84bBmZvqtU5V
	5AWG7lEoG3wJrploaEgT2xpNNXAQ7X5FLdeLWTTvVInMroQOh4GubwmKb7KhKxrS1O0s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: deviate guest_va_t wrt Misra C:2012 rule 5.6
Message-Id: <E1wOzEJ-00Cfnm-24@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:46:03 +0000

commit fa2544bbe487a552b0e8e2a2d90f6b8616572583
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:01:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:01:56 2026 +0200

    x86/shadow: deviate guest_va_t wrt Misra C:2012 rule 5.6
    
    ... ("A `typedef' name shall be a unique identifier"). Much like already
    done for guest_intpte_t and guest_l[12]e_t, but limited to shadow/multi.c.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 1ceb65819e..a187270c84 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -143,6 +143,11 @@ number of guest paging levels."
 -config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/include/asm/guest_pt\\.h$)))&&any_area(any_loc(text(^.*(guest_intpte_t|guest_l[12]e_t).*$)))"}
 -doc_end
 
+-doc_begin="In x86 shadow code, the type \"guest_va_t\" is deliberately defined
+multiple times, depending on the number of guest paging levels."
+-config=MC3A2.R5.6,reports+={deliberate,"any_area(any_loc(file(^xen/arch/x86/mm/shadow/multi\\.c$)))&&any_area(any_loc(text(^.*guest_va_t.*$)))"}
+-doc_end
+
 -doc_begin="The following files are imported from the gnu-efi package."
 -file_tag+={adopted_r5_6,"^xen/include/efi/.*$"}
 -file_tag+={adopted_r5_6,"^xen/arch/.*/include/asm/.*/efibind\\.h$"}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 18 14:46:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 18 May 2026 14:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1311979.1582143 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEU-0002cA-Il; Mon, 18 May 2026 14:46:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1311979.1582143; Mon, 18 May 2026 14:46:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wOzEU-0002c0-GB; Mon, 18 May 2026 14:46:14 +0000
Received: by outflank-mailman (input) for mailman id 1311979;
 Mon, 18 May 2026 14:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wOzET-0002bu-PL
 for xen-changelog@lists.xenproject.org; Mon, 18 May 2026 14:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzET-00BXUg-2R
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wOzET-00CfoA-2L
 for xen-changelog@lists.xenproject.org;
 Mon, 18 May 2026 14:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9muWMFX4BadM7GFvm2nUmI3a1Gu0NwjvzXlFAbNvISo=; b=Ih7c6YndQBrQ5B7EtT3xxy39Nw
	pXl/kgd32MQjJKbDE3Hd8DMeVGxDyCplZo4ocUyZPVNHg+aWybpk9tREpbBMV80rwZhn5vHWiVQCt
	Zt70+FYtGloEopdL61OZ3oQUZaZFiPotJDAwAUzxBQ9L+hQDKvGIGvY1cs9lO3WwqUKk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: address Misra C:2012 rule 8.4
Message-Id: <E1wOzET-00CfoA-2L@xenbits.xenproject.org>
Date: Mon, 18 May 2026 14:46:13 +0000

commit 6d2fa82c2680acc87dc379242518bb180e37b993
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 18 09:02:32 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 18 09:02:32 2026 +0200

    x86: address Misra C:2012 rule 8.4
    
    ... ("A compatible declaration shall be visible when an object or function
    with external linkage is defined"). Three variables lack asmlinkage
    annotations.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/guest/xen/pvh-boot.c | 2 +-
 xen/arch/x86/guest/xen/xen.c      | 2 +-
 xen/arch/x86/pv/hypercall.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/guest/xen/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c
index e14d7e20e9..a0fef0e9ab 100644
--- a/xen/arch/x86/guest/xen/pvh-boot.c
+++ b/xen/arch/x86/guest/xen/pvh-boot.c
@@ -22,7 +22,7 @@
 
 /* Initialised in head.S, before .bss is zeroed. */
 bool __initdata pvh_boot;
-uint32_t __initdata pvh_start_info_pa;
+uint32_t asmlinkage __initdata pvh_start_info_pa;
 
 static multiboot_info_t __initdata pvh_mbi;
 static module_t __initdata pvh_mbi_mods[8];
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index a184c51ef1..e4b936ec9c 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -40,7 +40,7 @@ DEFINE_PER_CPU(struct vcpu_info *, vcpu_info);
  *     0 vmcall
  *   > 0 vmmcall
  */
-int8_t __initdata early_hypercall_insn = -1;
+int8_t asmlinkage __initdata early_hypercall_insn = -1;
 
 /*
  * Called once during the first hypercall to figure out which instruction to
diff --git a/xen/arch/x86/pv/hypercall.c b/xen/arch/x86/pv/hypercall.c
index 17581d232e..b3b9a32555 100644
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -180,7 +180,7 @@ void pv_ring1_init_hypercall_page(void *p)
     }
 }
 
-void do_entry_int82(struct cpu_user_regs *regs)
+void asmlinkage do_entry_int82(struct cpu_user_regs *regs)
 {
     if ( unlikely(untrusted_msi) )
         check_for_unexpected_msi((uint8_t)regs->entry_vector);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312720.1582786 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHaN-0007NB-5P; Tue, 19 May 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312720.1582786; Tue, 19 May 2026 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHaN-0007N3-2v; Tue, 19 May 2026 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1312720;
 Tue, 19 May 2026 10:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHaL-0007Mx-Vw
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaL-00D7gR-30
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaL-00DqkM-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E4y734kUcG1P7p/kTvRr0/hKe6oE97meMA1T/YU+XN0=; b=USWcG8HMpW2hxqdksQEExOpe6J
	aRr1zBdd9nFA5Y4hWHTMslEKlmwY6aBAl5hz2Y1TtccE+fuu06MHOvwtnQsGoTbK6Sa2wsMBOuq8n
	VcttfuE+RiCcn27HXMF2zNlWK358+GV9mUexw62t2iKn7OCDhTj4pl6512qV/BTzr2T0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: implement copy_to_guest_phys()
Message-Id: <E1wPHaL-00DqkM-2r@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:01 +0000

commit e74b6fc4730570585703e26d7ef4fe5e8823e246
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:31:32 2026 +0200

    xen/riscv: implement copy_to_guest_phys()
    
    Introduce copy_to_guest_phys() for RISC-V, based on the Arm implementation.
    
    Add a generic copy_guest() helper for copying to and from guest physical
    (and potentially virtual addresses in the future), and implement
    translate_get_page() to translate a guest physical address into a struct
    page_info via the domain p2m.
    
    Compared to the Arm code:
    - Drop COPY_flush_dcache(), as no such use cases exist on RISC-V.
    - Do not implement the linear mapping case, which is currently unused.
    - Use PAGE_OFFSET() to initialize the local offset variable in copy_guest().
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile                   |   1 +
 xen/arch/riscv/guestcopy.c                | 116 ++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest_access.h |   7 ++
 3 files changed, 124 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 04f02ad89c..cfc3fdf7d2 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -4,6 +4,7 @@ obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += extable.o
+obj-y += guestcopy.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
diff --git a/xen/arch/riscv/guestcopy.c b/xen/arch/riscv/guestcopy.c
new file mode 100644
index 0000000000..8a89212e0b
--- /dev/null
+++ b/xen/arch/riscv/guestcopy.c
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/domain_page.h>
+#include <xen/page-size.h>
+#include <xen/sched.h>
+#include <xen/string.h>
+
+#include <asm/guest_access.h>
+
+#define COPY_from_guest     0U
+#define COPY_to_guest       BIT(0, U)
+#define COPY_gpa            0U
+#define COPY_gva            BIT(1, U)
+
+typedef union
+{
+    struct
+    {
+        struct vcpu *v;
+    } gva;
+
+    struct
+    {
+        struct domain *d;
+    } gpa;
+} copy_info_t;
+
+#define GVA_INFO(vcpu) ((copy_info_t) { .gva = { vcpu } })
+#define GPA_INFO(domain) ((copy_info_t) { .gpa = { domain } })
+
+static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
+                                            bool gva, bool write)
+{
+    p2m_type_t p2mt;
+    struct page_info *page;
+
+    /*
+     * Not implemented yet.
+     *
+     * If gva == true, the operation will likely require a struct vcpu
+     * rather than just a struct domain. For this reason copy_info_t is
+     * already passed here instead of only struct domain.
+     */
+    BUG_ON(gva);
+
+    page = get_page_from_gfn(info.gpa.d, paddr_to_pfn(addr), &p2mt, P2M_ALLOC);
+
+    if ( !page )
+        return NULL;
+
+    if ( write ? p2mt != p2m_ram_rw : !p2m_is_ram(p2mt) )
+    {
+        put_page(page);
+        return NULL;
+    }
+
+    return page;
+}
+
+static unsigned long copy_guest(void *buf, uint64_t addr, unsigned long len,
+                                copy_info_t info, unsigned int flags)
+{
+    unsigned int offset = PAGE_OFFSET(addr);
+
+    BUILD_BUG_ON((sizeof(addr)) < sizeof(vaddr_t));
+    BUILD_BUG_ON((sizeof(addr)) < sizeof(paddr_t));
+
+    while ( len )
+    {
+        void *p;
+        unsigned long size = min(len, PAGE_SIZE + 0UL - offset);
+        struct page_info *page;
+
+        page = translate_get_page(info, addr, flags & COPY_gva,
+                                  flags & COPY_to_guest);
+        if ( !page )
+            return len;
+
+        p = __map_domain_page(page);
+        p += offset;
+        if ( flags & COPY_to_guest )
+        {
+            /*
+             * buf will be NULL when the caller request to zero the
+             * guest memory.
+             */
+            if ( buf )
+                memcpy(p, buf, size);
+            else
+                memset(p, 0, size);
+        }
+        else
+            memcpy(buf, p, size);
+
+        unmap_domain_page(p);
+        put_page(page);
+        len -= size;
+        buf += size;
+        addr += size;
+
+        /*
+         * After the first iteration, guest virtual address is correctly
+         * aligned to PAGE_SIZE.
+         */
+        offset = 0;
+    }
+
+    return 0;
+}
+
+unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
+                                 unsigned long len)
+{
+    return copy_guest(buf, gpa, len, GPA_INFO(d),
+                      COPY_to_guest | COPY_gpa);
+}
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 7cd51fbbde..8d679319de 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -2,6 +2,10 @@
 #ifndef ASM__RISCV__GUEST_ACCESS_H
 #define ASM__RISCV__GUEST_ACCESS_H
 
+#include <xen/types.h>
+
+struct domain;
+
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned int len);
@@ -18,6 +22,9 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 #define guest_handle_okay(hnd, nr) (1)
 #define guest_handle_subrange_okay(hnd, first, last) (1)
 
+unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
+                                 unsigned long len);
+
 #endif /* ASM__RISCV__GUEST_ACCESS_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312721.1582791 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHaX-0007QN-8U; Tue, 19 May 2026 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312721.1582791; Tue, 19 May 2026 10:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHaX-0007QF-4D; Tue, 19 May 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1312721;
 Tue, 19 May 2026 10:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHaW-0007PJ-2M
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaW-00D7gl-05
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaV-00DqlV-3B
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vmI6obkTTpCyRM8CbiNZaAzQrm6BFF/WZ56KCpVpork=; b=zI4b91V9yo4ujB0a/NapuzNXvw
	R2OYC8N891dITmJZOdEAKFJHNby85HcqCacRLJljtdap11ZB7XM4jZ3ywjWEyBDautbcQnzBoaxgK
	6mX9hcZqDbuhzXEakL+tiyNF/pmfemsVp/UxHXVh93VNeNoL+/asEICjlRlhKZxeJwLA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add Linux kernel loading support
Message-Id: <E1wPHaV-00DqlV-3B@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:11 +0000

commit f6a20eda9212d1bbbb846cb58017b32fd2ce7180
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:02 2026 +0200

    xen/riscv: add Linux kernel loading support
    
    Introduce support for loading a Linux kernel Image which is got by
    uncompressing of Image.gz on RISC-V.
    
    kernel_image_load() and place_modules() currently call panic() on
    failure rather than returning an error. This is because the common
    kernel_load() in common/device-tree/kernel.c does not expect a
    return code. Handling errors gracefully would require a separate
    refactor.
    
    The implementation is based on the Xen Arm kernel loading code.
    
    text_offset is available for both 32-bit and 64-bit Image, so fix
    that.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile             |   1 +
 xen/arch/riscv/include/asm/config.h |  13 ++
 xen/arch/riscv/kernel.c             | 249 ++++++++++++++++++++++++++++++++++++
 xen/include/xen/fdt-kernel.h        |  11 +-
 4 files changed, 272 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index cfc3fdf7d2..eecdcbc768 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -8,6 +8,7 @@ obj-y += guestcopy.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
+obj-y += kernel.init.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += paging.o
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 0613de008b..fd69057826 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -151,6 +151,19 @@
 extern unsigned long phys_offset; /* = load_start - XEN_VIRT_START */
 #endif
 
+/*
+ * KERNEL_LOAD_ADDR_ALIGNMENT is defined based on paragraph of
+ * "Kernel location" of boot.rst:
+ * https://docs.kernel.org/arch/riscv/boot.html#kernel-location
+ */
+#if defined(CONFIG_RISCV_32)
+#define KERNEL_LOAD_ADDR_ALIGNMENT MB(4)
+#elif defined(CONFIG_RISCV_64)
+#define KERNEL_LOAD_ADDR_ALIGNMENT MB(2)
+#else
+#error "Define KERNEL_LOAD_ADDR_ALIGNMENT"
+#endif
+
 #endif /* ASM__RISCV__CONFIG_H */
 /*
  * Local variables:
diff --git a/xen/arch/riscv/kernel.c b/xen/arch/riscv/kernel.c
new file mode 100644
index 0000000000..8580cdb32d
--- /dev/null
+++ b/xen/arch/riscv/kernel.c
@@ -0,0 +1,249 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/compiler.h>
+#include <xen/errno.h>
+#include <xen/fdt-kernel.h>
+#include <xen/guest_access.h>
+#include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/mm.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+#include <asm/setup.h>
+
+#define IMAGE64_MAGIC_V2 0x05435352 /* Magic number 2, le, "RSC\x05" */
+
+/*
+ * Machine word alignment could be useful for copying to be more efficient.
+ * There is no reason for now to have bigger module alignment.
+ */
+#define MODULES_ALIGNMENT sizeof(unsigned long)
+
+static void __init place_modules(struct kernel_info *info, paddr_t kernbase,
+                                 paddr_t kernend)
+{
+    const struct boot_module *mod = info->bd.initrd;
+    const struct membanks *banks = kernel_info_get_mem_const(info);
+    const paddr_t initrd_len = ROUNDUP(mod ? mod->size : 0,
+                                       MODULES_ALIGNMENT);
+    const paddr_t dtb_len = ROUNDUP(fdt_totalsize(info->fdt),
+                                    MODULES_ALIGNMENT);
+    const paddr_t modsize = initrd_len + dtb_len;
+    unsigned int bi = banks->nr_banks;
+
+    if ( modsize < initrd_len )
+        panic("Module size overflow: initrd + dtb size wraps paddr_t\n");
+
+    /*
+     * Place modules as high in RAM as possible, scanning banks from
+     * last to first so that the end of the last bank is preferred.
+     */
+    while ( bi-- > 0 )
+    {
+        const struct membank *bank = &banks->bank[bi];
+        const paddr_t bank_end = bank->start + bank->size;
+        paddr_t modbase;
+
+        if ( modsize > bank->size )
+            continue;
+
+        modbase = ROUNDDOWN(bank_end - modsize, MODULES_ALIGNMENT);
+
+        if ( modbase < bank->start )
+            continue;
+
+        /*
+         * If modules would overlap the kernel, try placing them below it.
+         */
+        if ( (modbase < ROUNDUP(kernend, MODULES_ALIGNMENT)) &&
+             (modbase + modsize > kernbase) )
+        {
+            /* Avoid underflow below */
+            if ( kernbase < modsize )
+                continue;
+
+            modbase = ROUNDDOWN(kernbase - modsize, MODULES_ALIGNMENT);
+            if ( modbase < bank->start )
+                continue;
+        }
+
+        info->dtb_paddr = modbase;
+        info->initrd_paddr = modbase + dtb_len;
+
+        return;
+    }
+
+    panic("Unable to find suitable location for dtb+initrd\n");
+}
+
+static paddr_t __init kernel_image_place(struct kernel_info *info)
+{
+    paddr_t load_addr = INVALID_PADDR;
+    uint64_t image_size = info->image.image_size ?: info->image.len;
+    const struct membanks *banks = kernel_info_get_mem_const(info);
+    unsigned int nr_banks = banks->nr_banks;
+    unsigned int bi;
+
+    /*
+     * At the moment, RISC-V's Linux kernel should be always position
+     * independent based on "Per-MMU execution" of boot.rst:
+     *   https://docs.kernel.org/arch/riscv/boot.html#pre-mmu-execution
+     *
+     * But just for the case when RISC-V's Linux kernel isn't position
+     * independent it is needed to take load address from
+     * info->image.start.
+     *
+     * If `start` is zero, the Image is position independent.
+     */
+    if ( likely(!info->image.start) )
+    {
+        for ( bi = 0; bi != nr_banks; bi++ )
+        {
+            const struct membank *bank = &banks->bank[bi];
+            paddr_t bank_start = bank->start;
+            /*
+             * According to boot.rst kernel load address should be properly
+             * aligned:
+             *   https://docs.kernel.org/arch/riscv/boot.html#kernel-location
+             *
+             * As Image in this case is PIC we can ignore
+             * info->image.text_offset.
+             */
+            paddr_t aligned_start = ROUNDUP(bank_start, KERNEL_LOAD_ADDR_ALIGNMENT);
+            paddr_t bank_end = bank_start + bank->size;
+            paddr_t bank_size;
+
+            if ( aligned_start > bank_end )
+                continue;
+
+            bank_size = bank_end - aligned_start;
+
+            if ( image_size <= bank_size )
+            {
+                load_addr = aligned_start;
+                break;
+            }
+        }
+    }
+    else
+    {
+        load_addr = info->image.start + info->image.text_offset;
+
+        WARN_ON(!IS_ALIGNED(load_addr, KERNEL_LOAD_ADDR_ALIGNMENT));
+
+        /*
+         * Reject a malformed image before the loop to avoid wrapping
+         * load_addr + image_size in the per-bank check below by setting
+         * bi = nr_banks.
+         *
+         * image_size covers the kernel from _start (placed at load_addr =
+         * start + text_offset) through _end.  The alignment gap
+         * [start, load_addr) is padding and need not lie within a bank.
+         */
+        bi = image_size <= (paddr_t)-1 - load_addr ? 0 : nr_banks;
+        for ( ; bi != nr_banks; bi++ )
+        {
+            const struct membank *bank = &banks->bank[bi];
+            paddr_t bank_start = bank->start;
+            paddr_t bank_end = bank_start + bank->size;
+
+            if ( (load_addr >= bank_start) &&
+                 (load_addr + image_size <= bank_end) )
+                break;
+        }
+    }
+
+    if ( bi == nr_banks )
+        panic("Failed to place kernel image in any memory bank\n");
+
+    info->entry = load_addr;
+
+    return load_addr;
+}
+
+static void __init kernel_image_load(struct kernel_info *info)
+{
+    int rc;
+    paddr_t load_addr = kernel_image_place(info);
+    paddr_t paddr = info->image.kernel_addr;
+    paddr_t len = info->image.len;
+    paddr_t effective_size = info->image.image_size ?: len;
+    void *kernel;
+
+    place_modules(info, load_addr, load_addr + effective_size);
+
+    printk("Loading Image from %"PRIpaddr" to [%"PRIpaddr",%"PRIpaddr")\n",
+            paddr, load_addr, load_addr + effective_size);
+
+    kernel = ioremap_cache(paddr, len);
+
+    if ( !kernel )
+        panic("Unable to map kernel\n");
+
+    /* Move kernel to proper location in guest phys map */
+    rc = copy_to_guest_phys(info->bd.d, load_addr, kernel, len);
+
+    if ( rc )
+        panic("Unable to copy kernel to proper guest location\n");
+
+    iounmap(kernel);
+}
+
+/* Check if the image is a 64-bit Image */
+static int __init kernel_image64_probe(struct kernel_info *info,
+                                       paddr_t addr, paddr_t size)
+{
+    /* https://www.kernel.org/doc/Documentation/riscv/boot-image-header.rst */
+    struct {
+        uint32_t code0;         /* Executable code */
+        uint32_t code1;         /* Executable code */
+        uint64_t text_offset;   /* Image load offset, little endian */
+        uint64_t image_size;    /* Effective Image size, little endian */
+        uint64_t flags;         /* kernel flags, little endian */
+        uint32_t version;       /* Version of this header */
+        uint32_t res1;          /* Reserved */
+        uint64_t res2;          /* Reserved */
+        uint64_t magic;         /* Deprecated: Magic number, little endian, "RISCV" */
+        uint32_t magic2;        /* Magic number 2, little endian, "RSC\x05" */
+        uint32_t res3;          /* Reserved for PE COFF offset */
+    } image;
+    uint64_t effective_size;
+
+    if ( size < sizeof(image) )
+        return -EINVAL;
+
+    copy_from_paddr(&image, addr, sizeof(image));
+
+    /* Magic v1 is deprecated and may be removed.  Only use v2 */
+    if ( le32_to_cpu(image.magic2) != IMAGE64_MAGIC_V2 )
+        return -EINVAL;
+
+    effective_size = le64_to_cpu(image.image_size);
+
+    if ( !effective_size )
+        return -EINVAL;
+
+    info->image.kernel_addr = addr;
+    /* Actual size in the binary file */
+    info->image.len = size;
+    /* Total memory the kernel occupies at runtime */
+    info->image.image_size = effective_size;
+    info->image.text_offset = le64_to_cpu(image.text_offset);
+    info->image.start = 0;
+
+    info->load = kernel_image_load;
+
+    return 0;
+}
+
+int __init kernel_image_probe(struct kernel_info *info, paddr_t addr,
+                              paddr_t size)
+{
+#ifdef CONFIG_RISCV_64
+    return kernel_image64_probe(info, addr, size);
+#else
+#   error "Only 64-bit RISC-V is supported"
+#endif
+}
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 8cd1670c2c..00c37be101 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -59,8 +59,15 @@ struct kernel_info {
         struct {
             paddr_t kernel_addr;
             paddr_t len;
-#if defined(CONFIG_ARM_64) || defined(CONFIG_RISCV_64)
-            paddr_t text_offset; /* 64-bit Image only */
+#if defined(CONFIG_ARM_64) || defined(CONFIG_RISCV)
+            /*
+             * ARM: 64-bit Image only.
+             * RISC-V: both 32-bit and 64-bit Images.
+             */
+            paddr_t text_offset;
+#endif
+#if defined(CONFIG_RISCV)
+            size_t image_size; /* Effective size of Image */
 #endif
             paddr_t start; /* Must be 0 for 64-bit Image */
         } image;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312722.1582793 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHai-0007T7-AE; Tue, 19 May 2026 10:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312722.1582793; Tue, 19 May 2026 10:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHai-0007T0-7k; Tue, 19 May 2026 10:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1312722;
 Tue, 19 May 2026 10:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHag-0007Ss-56
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHag-00D7gp-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHag-00DqmT-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zXlMRlFVtRSBm2JhuAK6O16or9/Fez1hNL4Wf9dq0j0=; b=Z7Iqj8zTa+w00cz6Wp/DGuDJAW
	iQM+TeAOPKCl57fPc+zmkpKunc9iz0rleXslmtJGiC/Oj3ZmdbSFMDbBqi/Gf0MMq/4J10BjgeV+A
	L1OvPWprN+bK+f2Muy+DDrU8/a6QUibNs9NP3i0bH1Xs+/0qj76+xGqRv1CiqGd3cyrc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: rework G-stage mode handling
Message-Id: <E1wPHag-00DqmT-0G@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:22 +0000

commit 551e864360e1e4925e8b488f78eab70cb3c88487
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:15 2026 +0200

    xen/riscv: rework G-stage mode handling
    
    Rework G-stage mode handling to make the selected mode descriptor
    reusable outside of p2m initialization, both for filling CPU nodes in
    the device tree passed to dom0less guests and for per-domain G-stage
    mode selection at domain creation time.
    
    Promote gstage_modes[] from a local __initconst variable inside
    gstage_mode_detect() to a file-scope static const array, and convert
    max_gstage_mode from an embedded struct (assigned by value) to a global
    const pointer into gstage_modes[]. This allows referencing both the mode
    identifier and the mode name after init without copying the descriptor.
    Remove get_max_supported_mode(); its callers now dereference
    max_gstage_mode->mode directly.
    
    Change struct p2m_domain::mode from an embedded gstage_mode_desc to a
    const pointer into gstage_modes[], so each domain shares the descriptor
    rather than carrying its own copy.
    
    Adjust the gstage_modes[] entries in three ways:
     - Use lowercase names without the "x4" suffix (e.g. "sv39" instead of
       "Sv39x4"). The DT mmu-type binding [1] does not include the suffix,
       so the name can now be passed directly to the guest without
       transformation. The suffix is appended only in the diagnostic
       printk, where it remains informative.
     - Use "none" for Bare mode (HGATP_MODE_OFF) to match the DT binding.
     - Change paging_levels to represent the root page-table level index
       (i.e. total paging levels minus one) rather than the total count.
       P2M_ROOT_LEVEL() now returns the correct VPN index directly, without
       requiring callers to subtract one or use hardcoded offsets.
    
    Add gstage_mode to xen_arch_domainconfig so the toolstack can
    request a specific G-stage mode at domain creation time. Introduce
    find_gstage_mode() to resolve a mode descriptor by HGATP_MODE_*,
    capping the result at max_gstage_mode to prevent requesting a mode
    the hardware does not support. Update p2m_init() to accept a
    xen_domctl_createdomain pointer and call find_gstage_mode()
    instead of hardcoding Sv39x4.
    
    Add arch_parse_dom0less_node() in a new dom0less-build.c to read the
    "mmu-type" DT property from a guest domain node and store it in
    boot_domain::create_cfg.arch.gstage_mode, falling back to maximum
    supported mode when the property is absent.
    
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/riscv/cpus.yaml?h=v6.19-rc3#n82
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile          |   1 +
 xen/arch/riscv/dom0less-build.c  |  71 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/p2m.h |  18 ++++--
 xen/arch/riscv/p2m.c             | 121 ++++++++++++++++++++++++++-------------
 xen/arch/riscv/vmid.c            |   2 +-
 xen/include/public/arch-riscv.h  |   5 ++
 6 files changed, 172 insertions(+), 46 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index eecdcbc768..8f7fd625dd 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
+obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += extable.o
diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
new file mode 100644
index 0000000000..a683972e92
--- /dev/null
+++ b/xen/arch/riscv/dom0less-build.c
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bootfdt.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+
+#include <asm/p2m.h>
+
+int __init arch_parse_dom0less_node(struct dt_device_node *node,
+                                    struct boot_domain *bd)
+{
+    const char *mmu_type;
+    unsigned long bits;
+    const char *end;
+
+    if ( dt_property_read_string(node, "mmu-type", &mmu_type) )
+    {
+        dprintk(XENLOG_WARNING, "mmu-type property is missing in guest domain "
+                "node. %s will be used as fallback\n", max_gstage_mode->name);
+
+        bits = P2M_GFN_LEVEL_SHIFT(max_gstage_mode->paging_levels + 1);
+
+        goto out;
+    }
+
+    if ( !strcasecmp(mmu_type, "riscv,none") )
+    {
+        dprintk(XENLOG_ERR, "Bare mode isn't supported by Xen\n");
+
+        return -EOPNOTSUPP;
+    }
+
+    if ( strncasecmp(mmu_type, "riscv,sv", 8) )
+    {
+        dprintk(XENLOG_ERR, "mmu-type value \"%s\" is incorrect\n", mmu_type);
+
+        return -EINVAL;
+    }
+
+    bits = simple_strtoul(mmu_type + 8, &end, 10);
+    if ( (*end != '\0') || (end == mmu_type + 8) )
+    {
+        dprintk(XENLOG_ERR, "mmu-type value \"%s\" is incorrect\n", mmu_type);
+
+        return -EINVAL;
+    }
+
+ out:
+    if ( bits > (UINT8_MAX - P2M_ROOT_EXTRA_BITS) )
+    {
+        dprintk(XENLOG_ERR, "gstage addr bits value overflows uint8\n");
+
+        return -EINVAL;
+    }
+
+    /*
+     * The mmu-type property may specify any riscv,sv<N> string, but only the
+     * following are currently supported:
+     *  - riscv,sv32
+     *  - riscv,sv39
+     *  - riscv,sv48
+     *  - riscv,sv57
+     * Any other value will be rejected by find_gstage_mode().
+     *
+     * P2M_ROOT_EXTRA_BITS is added because for G-stage mode, GPAs are
+     * extended by that many bits.
+     */
+    bd->create_cfg.arch.gaddr_bits = bits + P2M_ROOT_EXTRA_BITS;
+
+    return 0;
+}
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 54ea67990f..638c60ddc2 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -13,7 +13,7 @@
 
 #define P2M_ROOT_ORDER  (ilog2(GSTAGE_ROOT_PAGE_TABLE_SIZE) - PAGE_SHIFT)
 #define P2M_ROOT_PAGES  BIT(P2M_ROOT_ORDER, U)
-#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode.paging_levels)
+#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode->paging_levels)
 
 /*
  * According to the RISC-V spec:
@@ -32,10 +32,13 @@
  */
 #define P2M_LEVEL_ORDER(lvl) XEN_PT_LEVEL_ORDER(lvl)
 
-#define P2M_ROOT_EXTRA_BITS(p2m, lvl) (2 * ((lvl) == P2M_ROOT_LEVEL(p2m)))
+#define P2M_ROOT_EXTRA_BITS 2
+
+#define P2M_LEVEL_EXTRA_BITS(p2m, lvl) \
+    (P2M_ROOT_EXTRA_BITS * ((lvl) == P2M_ROOT_LEVEL(p2m)))
 
 #define P2M_PAGETABLE_ENTRIES(p2m, lvl) \
-    (BIT(PAGETABLE_ORDER + P2M_ROOT_EXTRA_BITS(p2m, lvl), UL))
+    (BIT(PAGETABLE_ORDER + P2M_LEVEL_EXTRA_BITS(p2m, lvl), UL))
 
 #define P2M_TABLE_OFFSET(p2m, lvl) (P2M_PAGETABLE_ENTRIES(p2m, lvl) - 1UL)
 
@@ -55,6 +58,8 @@ struct gstage_mode_desc {
     char name[8];
 };
 
+extern const struct gstage_mode_desc *max_gstage_mode;
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /*
@@ -68,7 +73,7 @@ struct p2m_domain {
     /* The root of the p2m tree. May be concatenated */
     struct page_info *root;
 
-    struct gstage_mode_desc mode;
+    const struct gstage_mode_desc *mode;
 
     /* Back pointer to domain */
     struct domain *domain;
@@ -215,9 +220,10 @@ static inline bool arch_acquire_resource_check(struct domain *d)
 }
 
 void guest_mm_init(void);
-unsigned char get_max_supported_mode(void);
 
-int p2m_init(struct domain *d);
+struct xen_domctl_createdomain;
+
+int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
 {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index adcf292a70..f889978cf7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -45,12 +45,28 @@ struct p2m_pte_ctx {
     unsigned int level;          /* Paging level at which the PTE resides. */
 };
 
-static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
-    .mode = HGATP_MODE_OFF,
-    .paging_levels = 0,
-    .name = "Bare",
+/* Values should be sorted by ->mode in this array */
+static const struct gstage_mode_desc gstage_modes[] = {
+    /*
+     * Based on the RISC-V spec:
+     *   Bare mode is always supported, regardless of SXLEN.
+     *   When SXLEN=32, the only other valid setting for MODE is Sv32.
+     *   When SXLEN=64, three paged virtual-memory schemes are defined:
+     *   Sv39, Sv48, and Sv57.
+     */
+    { HGATP_MODE_OFF,    0, "none" },
+#ifdef CONFIG_RISCV_32
+    { HGATP_MODE_SV32X4, 1, "sv32" },
+#else
+    { HGATP_MODE_SV39X4, 2, "sv39" },
+    { HGATP_MODE_SV48X4, 3, "sv48" },
+    { HGATP_MODE_SV57X4, 4, "sv57" },
+#endif
 };
 
+const struct gstage_mode_desc *__ro_after_init max_gstage_mode =
+    &gstage_modes[0];
+
 static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
 
 static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
@@ -63,11 +79,6 @@ static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
     }
 }
 
-unsigned char get_max_supported_mode(void)
-{
-    return max_gstage_mode.mode;
-}
-
 /*
  * If anything is changed here, it may also require updates to
  * p2m_{get,set}_type().
@@ -148,41 +159,24 @@ static pte_t *p2m_get_root_pointer(struct p2m_domain *p2m, gfn_t gfn)
 
 static void __init gstage_mode_detect(void)
 {
-    static const struct gstage_mode_desc modes[] __initconst = {
-        /*
-         * Based on the RISC-V spec:
-         *   Bare mode is always supported, regardless of SXLEN.
-         *   When SXLEN=32, the only other valid setting for MODE is Sv32.
-         *   When SXLEN=64, three paged virtual-memory schemes are defined:
-         *   Sv39, Sv48, and Sv57.
-         */
-#ifdef CONFIG_RISCV_32
-        { HGATP_MODE_SV32X4, 2, "Sv32x4" }
-#else
-        { HGATP_MODE_SV39X4, 3, "Sv39x4" },
-        { HGATP_MODE_SV48X4, 4, "Sv48x4" },
-        { HGATP_MODE_SV57X4, 5, "Sv57x4" },
-#endif
-    };
-
-    for ( unsigned int mode_idx = ARRAY_SIZE(modes); mode_idx-- > 0; )
+    for ( unsigned int mode_idx = ARRAY_SIZE(gstage_modes); mode_idx-- > 0; )
     {
-        unsigned long mode = modes[mode_idx].mode;
+        unsigned long mode = gstage_modes[mode_idx].mode;
 
         csr_write(CSR_HGATP, MASK_INSR(mode, HGATP_MODE_MASK));
 
         if ( MASK_EXTR(csr_read(CSR_HGATP), HGATP_MODE_MASK) == mode )
         {
-            max_gstage_mode = modes[mode_idx];
+            max_gstage_mode = &gstage_modes[mode_idx];
 
             break;
         }
     }
 
-    if ( max_gstage_mode.mode == HGATP_MODE_OFF )
+    if ( max_gstage_mode->mode == HGATP_MODE_OFF )
         panic("Xen expects that G-stage won't be Bare mode\n");
 
-    printk("Max supported G-stage mode is %s\n", max_gstage_mode.name);
+    printk("Max supported G-stage mode is %sx4\n", max_gstage_mode->name);
 
     csr_write(CSR_HGATP, 0);
 
@@ -283,7 +277,7 @@ static void clear_and_clean_page(struct page_info *page, bool clean_dcache)
 unsigned long construct_hgatp(const struct p2m_domain *p2m, uint16_t vmid)
 {
     return MASK_INSR(mfn_x(page_to_mfn(p2m->root)), HGATP_PPN_MASK) |
-           MASK_INSR(p2m->mode.mode, HGATP_MODE_MASK) |
+           MASK_INSR(p2m->mode->mode, HGATP_MODE_MASK) |
            MASK_INSR(vmid, HGATP_VMID_MASK);
 }
 
@@ -331,8 +325,35 @@ static int p2m_alloc_root_table(struct p2m_domain *p2m)
     return 0;
 }
 
-int p2m_init(struct domain *d)
+static const struct gstage_mode_desc *find_gstage_mode(
+    unsigned char gpa_bits)
+{
+    ASSERT(gstage_modes[0].mode == HGATP_MODE_OFF);
+
+    for ( unsigned int i = 1; i < ARRAY_SIZE(gstage_modes); i++ )
+    {
+        unsigned int lvl = gstage_modes[i].paging_levels + 1;
+        unsigned int bits = P2M_GFN_LEVEL_SHIFT(lvl) + P2M_ROOT_EXTRA_BITS;
+
+        if ( gpa_bits == bits )
+        {
+            if ( gstage_modes[i].mode > max_gstage_mode->mode )
+                return NULL;
+            return &gstage_modes[i];
+        }
+    }
+
+    return NULL;
+}
+
+int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
 {
+    /*
+     * TODO: This static is a temporary constraint: all guests must use the
+     * same MMU mode because p2m_gpa_bits is not yet per-domain.
+     * Drop this once per-domain p2m_gpa_bits is introduced.
+     */
+    static const struct gstage_mode_desc __ro_after_init *m = &gstage_modes[0];
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     /*
@@ -341,6 +362,33 @@ int p2m_init(struct domain *d)
      */
     p2m->domain = d;
 
+    if ( !config )
+    {
+        dprintk(XENLOG_ERR, "NULL config is passed\n");
+        return -EINVAL;
+    }
+
+    p2m->mode = find_gstage_mode(config->arch.gaddr_bits);
+
+    if ( !p2m->mode )
+    {
+        dprintk(XENLOG_ERR,
+                "Unsupported or unavailable gstage addr bits: %u\n",
+                config->arch.gaddr_bits);
+
+        return -EINVAL;
+    }
+
+    if ( m->mode == HGATP_MODE_OFF )
+        m = p2m->mode;
+
+    if ( m != p2m->mode )
+    {
+        dprintk(XENLOG_ERR,
+                "Mode should be the same for all guests at the moment\n");
+        return -EINVAL;
+    }
+
     paging_domain_init(d);
 
     rwlock_init(&p2m->lock);
@@ -362,11 +410,6 @@ int p2m_init(struct domain *d)
 #   error "Add init of p2m->clean_dcache"
 #endif
 
-    /* TODO: don't hardcode used for a domain g-stage mode. */
-    p2m->mode.mode = HGATP_MODE_SV39X4;
-    p2m->mode.paging_levels = 2;
-    safe_strcpy(p2m->mode.name, "Sv39x4");
-
     return 0;
 }
 
@@ -1304,7 +1347,7 @@ static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 {
     unsigned int level = P2M_ROOT_LEVEL(p2m);
     unsigned int gfn_limit_bits =
-        P2M_LEVEL_ORDER(level + 1) + P2M_ROOT_EXTRA_BITS(p2m, level);
+        P2M_LEVEL_ORDER(level + 1) + P2M_LEVEL_EXTRA_BITS(p2m, level);
     pte_t entry, *table;
     int rc;
     mfn_t mfn = INVALID_MFN;
diff --git a/xen/arch/riscv/vmid.c b/xen/arch/riscv/vmid.c
index 8fbcd500f2..11c7e9d6d6 100644
--- a/xen/arch/riscv/vmid.c
+++ b/xen/arch/riscv/vmid.c
@@ -52,7 +52,7 @@ static DEFINE_PER_CPU(struct vmid_data, vmid_data);
 static unsigned int vmidlen_detect(void)
 {
     unsigned int vmid_bits;
-    unsigned char gstage_mode = get_max_supported_mode();
+    unsigned char gstage_mode = max_gstage_mode->mode;
 
     /*
      * According to the RISC-V Privileged Architecture Spec:
diff --git a/xen/include/public/arch-riscv.h b/xen/include/public/arch-riscv.h
index 360d8e6871..1990a1eb74 100644
--- a/xen/include/public/arch-riscv.h
+++ b/xen/include/public/arch-riscv.h
@@ -56,6 +56,11 @@ typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct xen_arch_domainconfig {
+    /*
+     * G-stage GPA address width in bits.
+     * Valid values: 34 (sv32x4), 41 (sv39x4), 50 (sv48x4), 59 (sv57x4).
+     */
+    uint8_t gaddr_bits;
 };
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312723.1582798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHas-0007V6-Bt; Tue, 19 May 2026 10:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312723.1582798; Tue, 19 May 2026 10:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHas-0007Uy-9R; Tue, 19 May 2026 10:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1312723;
 Tue, 19 May 2026 10:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHaq-0007Un-8W
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaq-00D7gt-0k
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHaq-00DqnE-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=QvCxk6reHmH+le9sZX1ctAL+0njnMmQedlUuG+7LBbA=; b=KDBNrkhhLpEdZ89D0+aqv1N8/h
	tjQC95npTssACRYpJ13eQYfEELL5CMSk7BNkqz8d8xjsKLuvq7jHl71M0lFkoBigHNM/IZht8ZNpG
	aYqOSVBOFlhRX5oCDq5rQ0OeTfsV1Z03a47u1MZ7THkJ+cyeSyn3wY4UbX6mpUEOqT1M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: introduce p2m_gpa_bits
Message-Id: <E1wPHaq-00DqnE-0Z@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:32 +0000

commit 7fe550548152905be9209c313f40f1ea6cac0211
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:27 2026 +0200

    xen/riscv: introduce p2m_gpa_bits
    
    common/device-tree/domain-build.c uses p2m_gpa_bits to determine the
    upper bound of the GPA space when searching for unused regions, so it
    must be defined when CONFIG_DOMAIN_BUILD_HELPERS=y.
    
    The variable is initialised to PADDR_BITS and narrowed in p2m_init() to
    the GPA width of the selected G-stage mode, allowing an external entity
    (e.g. an IOMMU) to restrict it further if needed.
    
    p2m_gpa_bits is a global rather than a per-domain value, which is
    acceptable for now because all domains are required to use the same
    G-stage MMU mode, as dom0less common code allocates it per all
    domains.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  3 +++
 xen/arch/riscv/p2m.c             | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 638c60ddc2..0d1dace1a0 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -47,6 +47,9 @@
 #define P2M_LEVEL_MASK(p2m, lvl) \
     (P2M_TABLE_OFFSET(p2m, lvl) << P2M_GFN_LEVEL_SHIFT(lvl))
 
+/* Holds the bit size of GPAs in p2m tables */
+extern unsigned int p2m_gpa_bits;
+
 #define paddr_bits PADDR_BITS
 
 /* Get host p2m table */
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index f889978cf7..703b9f4d25 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -11,6 +11,8 @@
 #include <xen/sections.h>
 #include <xen/xvmalloc.h>
 
+#include <public/domctl.h>
+
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
 #include <asm/flushtlb.h>
@@ -67,6 +69,12 @@ static const struct gstage_mode_desc gstage_modes[] = {
 const struct gstage_mode_desc *__ro_after_init max_gstage_mode =
     &gstage_modes[0];
 
+/*
+ * Set to the maximum configured support for GPA bits, so the number of GPA
+ * bits can be restricted by an external entity (e.g. IOMMU).
+ */
+unsigned int __ro_after_init p2m_gpa_bits = PADDR_BITS;
+
 static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
 
 static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
@@ -355,6 +363,7 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
      */
     static const struct gstage_mode_desc __ro_after_init *m = &gstage_modes[0];
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    unsigned int gpa_bits;
 
     /*
      * "Trivial" initialisation is now complete.  Set the backpointer so the
@@ -410,6 +419,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
 #   error "Add init of p2m->clean_dcache"
 #endif
 
+    gpa_bits = P2M_GFN_LEVEL_SHIFT(p2m->mode->paging_levels + 1) +
+               P2M_ROOT_EXTRA_BITS;
+
+    if ( gpa_bits < p2m_gpa_bits )
+        p2m_gpa_bits = gpa_bits;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312724.1582802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHb2-0007X9-DX; Tue, 19 May 2026 10:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312724.1582802; Tue, 19 May 2026 10:22:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHb2-0007X2-Al; Tue, 19 May 2026 10:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1312724;
 Tue, 19 May 2026 10:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHb0-0007Wv-BH
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHb0-00D7gx-11
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHb0-00Dqnv-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xL9v7Kf8XNPvTWLzAv+xEfowr7ynETSY1QRrnjbBuJc=; b=lixnFasyB637W0SDFK97EM+jWd
	h3uYYSlWEWB8XLQye5kbKyae8R7pho03S7WTH0eRyPCZhfi/M5K+HOhnyiDNQ6WrZgRGYmOYwaJaD
	HS69femrZpMGQrnd4vSdEgCZpQQ/vOzJJzdRwVql60NIXzq2RPFLLY4v8ufvAmeHNlpU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add definition of guest RAM banks
Message-Id: <E1wPHb0-00Dqnv-0u@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:42 +0000

commit 157b67ca642e7dd629d8aca0cd82dfa8005bf5c2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:44 2026 +0200

    xen/riscv: add definition of guest RAM banks
    
    The dom0less solution uses defined RAM banks as compile-time constants,
    so introduce macros to describe guest RAM banks.
    
    The reason for 2 banks is that there is typically always a use case for
    low memory under 4 GB, but the bank under 4 GB ends up being small because
    there are other things under 4 GB it can conflict with (interrupt
    controller, PCI BARs, etc.). So a second bank is added above that MMIO
    region (starting at 8 GiB) to provide the remaining RAM; the gap between
    the two banks also exercises code paths handling discontiguous memory.
    For Sv32 guests (34-bit GPA, 16 GiB addressable), bank0 provides 2 GB
    (2–4 GB) and the first 8 GB of bank1 (8–16 GB) is accessible.
    
    Extended regions are useful for RISC-V: they could be used to provide a
    "space" for Linux to map grant mappings.
    
    Despite the fact that for every guest MMU mode the GPA could be up
    to 56 bits wide (except Sv32 whose GPA is 34 bits), the combined size
    of both banks is limited to 1018 GB as it is more than enough for most
    use cases.
    
    Add inclusion of asm/guest-layout.h to asm/domain.h to make dom0less
    common code build happy.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/domain.h       |  1 +
 xen/arch/riscv/include/asm/guest-layout.h | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 6c48bf1311..6044ce0fee 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -7,6 +7,7 @@
 #include <xen/xmalloc.h>
 #include <public/hvm/params.h>
 
+#include <asm/guest-layout.h>
 #include <asm/p2m.h>
 #include <asm/vtimer.h>
 
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
new file mode 100644
index 0000000000..68d95a0939
--- /dev/null
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -0,0 +1,23 @@
+#ifndef ASM_RISCV_GUEST_LAYOUT_H
+#define ASM_RISCV_GUEST_LAYOUT_H
+
+#include <public/xen.h>
+
+#define GUEST_RAM_BANKS   2
+
+/*
+ * The way to find the extended regions (to be exposed to the guest as unused
+ * address space) relies on the fact that the regions reserved for the RAM
+ * below are big enough to also accommodate such regions.
+ */
+#define GUEST_RAM0_BASE   xen_mk_ullong(0x80000000) /* 2GB of low RAM @ 2GB */
+#define GUEST_RAM0_SIZE   xen_mk_ullong(0x80000000)
+
+#define GUEST_RAM1_BASE   xen_mk_ullong(0x0200000000) /* 1016 GB of RAM @ 8GB */
+#define GUEST_RAM1_SIZE   xen_mk_ullong(0xFE00000000)
+
+/* TODO: allocate these all dynamically */
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
+
+#endif /* ASM_RISCV_GUEST_LAYOUT_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312725.1582807 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbB-0007ZM-FO; Tue, 19 May 2026 10:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312725.1582807; Tue, 19 May 2026 10:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbB-0007ZE-CF; Tue, 19 May 2026 10:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1312725;
 Tue, 19 May 2026 10:22:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHbA-0007Z7-EE
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbA-00D7h2-1K
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbA-00Dqoa-1B
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:22:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=a/b5ERrkiMibhd8+sR4Ag0aQAFHyKHcs6k6JRRVEgjU=; b=PjqhdZ7b7grUV3J1TWRAUH7zdk
	nfRZZsvMN3eir8rrusqM38pVI2qksgFcFsCI5siA6dxmDD/xrz1m1qNLkyjw+bGkszEzpatWAiYni
	d+PscyU1rnYxN/lnqM/sPRytW6nIgFIyqthlctMgz2W/4rBhhfwWSDoBrSn8hdQ8cc1U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: enable DOMAIN_BUILD_HELPERS
Message-Id: <E1wPHbA-00Dqoa-1B@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:22:52 +0000

commit f2c7c9004ad71d34797dbe77de2d496b8bd7133d
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:57 2026 +0200

    xen/riscv: enable DOMAIN_BUILD_HELPERS
    
    Everything is ready to enable DOMAIN_BUILD_HELPER which are necessary
    for dom0less common code. So enable it.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index a5e87c1757..41426c2052 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312726.1582810 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbL-0007br-Hf; Tue, 19 May 2026 10:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312726.1582810; Tue, 19 May 2026 10:23:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbL-0007bg-Ez; Tue, 19 May 2026 10:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1312726;
 Tue, 19 May 2026 10:23:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHbK-0007ba-H0
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:23:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbK-00D7hM-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbK-00DqpG-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:23:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=o7blIspZuE+qr+q0e24RvMmZt7MCE8bgBXJKxs34mU0=; b=j55D3jsBIMKRqAdncWLeliuA+r
	G7o9vcAHsTWrHAfUHgQAUipMj+Xuxmfic2obeKXe+iAB9tLzaxEmHyYqUu4RFYMOeyn7M1IQ9v59y
	GV1rVhAVK7tZE5l2gXcyM5OwWUPz52nFojlqd/XCAIMOe/9vBOblG7+k/L7HZXZRwcyY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2
Message-Id: <E1wPHbK-00DqpG-1U@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:23:02 +0000

commit 5e1f756fb747aa51d763b40abc5d41e598dbdcee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 09:34:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 10:59:46 2026 +0200

    x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2
    
    ... ("Conversions shall not be performed between a pointer to an
    incomplete type and any other type"): Add an intermediate cast to void *.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/cpu/mcheck/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c4b3b687a2..64fa66f026 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1264,7 +1264,8 @@ static void cf_check __maybe_unused x86_mc_mceinject(void *data)
 
 #if BITS_PER_LONG == 64
 
-#define ID2COOKIE(id) ((mctelem_cookie_t)(id))
+/* Two layers of casting to cover Misra C:2012 rule 11.2. */
+#define ID2COOKIE(id) ((mctelem_cookie_t)(void *)(id))
 #define COOKIE2ID(c) ((uint64_t)(c))
 
 #elif defined(BITS_PER_LONG)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 10:23:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 10:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312727.1582814 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbV-0007dn-J6; Tue, 19 May 2026 10:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312727.1582814; Tue, 19 May 2026 10:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPHbV-0007df-GI; Tue, 19 May 2026 10:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1312727;
 Tue, 19 May 2026 10:23:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPHbU-0007dX-Jx
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 10:23:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbU-00D7hm-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPHbU-00Dqph-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 10:23:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JdiTEFSk5Lio3Lkw/1L5Jnxbs8H3VbWwjKFpCcw01Gw=; b=TVsM/awBuPoqf+kROYs5u5riTQ
	2gidKiThUv/O71KjeElDO57hrWYQ3dwOrMTg5objCvwU1mgnVC7oVk5e2kmxFos91gzw4/K+AMhoK
	tj2HIoHft6bvJvnLBDm+nO+YQMy80HdoSPfZ+XvhZ307YJJ6mQMUHkipqIvo4ljEpj3Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shim: annotate for Misra C:2012 rule 20.12
Message-Id: <E1wPHbU-00Dqph-1m@xenbits.xenproject.org>
Date: Tue, 19 May 2026 10:23:12 +0000

commit d6fb54fa71926e2ab44ccd84f968ec9228319d65
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 09:35:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 10:59:46 2026 +0200

    x86/shim: annotate for Misra C:2012 rule 20.12
    
    ... ("A macro parameter used as an operand to the `#' or `##' operators,
    which is itself subject to further macro replacement, shall only be used
    as an operand to these operators"). Leverage the SAF-6 annotation we have
    available.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/pv/shim.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index bd29c53a2d..41000b0523 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -124,8 +124,10 @@ void __init pv_shim_fixup_e820(void)
     ASSERT(i < ARRAY_SIZE(reserved_pages));     \
     reserved_pages[i++].mfn = pfn;              \
 })
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     MARK_PARAM_RAM(HVM_PARAM_STORE_PFN);
     if ( !pv_console )
+        /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
         MARK_PARAM_RAM(HVM_PARAM_CONSOLE_PFN);
 #undef MARK_PARAM_RAM
 }
@@ -207,10 +209,14 @@ void __init pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
         evtchn_reserve(d, param);                                              \
     }                                                                          \
 })
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_STORE_PFN, si->store_mfn, store_va);
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_STORE_EVTCHN, si->store_evtchn, 0);
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_CONSOLE_EVTCHN, si->console.domU.evtchn, 0);
     if ( !pv_console )
+        /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
         SET_AND_MAP_PARAM(HVM_PARAM_CONSOLE_PFN, si->console.domU.mfn,
                           console_va);
 #undef SET_AND_MAP_PARAM
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312822.1582917 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIrj-0007gX-LS; Tue, 19 May 2026 11:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312822.1582917; Tue, 19 May 2026 11:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIrj-0007gP-Ip; Tue, 19 May 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1312822;
 Tue, 19 May 2026 11:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIrh-0007gJ-W0
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIrh-00D9Ho-31
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIrh-00DvXc-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=HZG14rtpfGlSfMHR3qcSl3pS722H7LMuCyJeaFlgAF8=; b=Y92Rtvz8Sc7zuwYMgMc3uB5FpQ
	SrtijATsXC1fFc/G3I3kT6WKdt91stGE7Fxf8fKC8wMBlhFFWwn+lEQ+5+aXYnIA9VGtNnRpWdgZR
	WCOgCmlnhaxSiHHIp0oFDO8N2mMdEE8bc380k2pySEY0RSzvILviZP2teedtMWRNdzEQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/cpu: identify uninitialized CPU data using BAD_APICID
Message-Id: <E1wPIrh-00DvXc-2f@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:01 +0000

commit 032d39ff0e9db7fc4eddbb9741b000005eefb8c2
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue May 19 13:32:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:32:48 2026 +0200

    x86/cpu: identify uninitialized CPU data using BAD_APICID
    
    Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
    not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
    correct condition.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cd0413bfacf262b258029cbccbeadf99a7fef2b4
    master date: 2026-05-01 10:51:19 +0100
---
 xen/arch/x86/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 7339aeaefd..27628800a8 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -961,8 +961,7 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
      * In that case the socket number cannot be relied upon, but the respective
      * socket_cpumask[] slot also wouldn't have been set.
      */
-    if ( c[cpu].apicid != boot_cpu_data.apicid &&
-         cpumask_empty(socket_cpumask[socket]) )
+    if ( c[cpu].apicid != BAD_APICID && cpumask_empty(socket_cpumask[socket]) )
     {
         xfree(socket_cpumask[socket]);
         socket_cpumask[socket] = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312823.1582921 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIrt-0007iM-Mv; Tue, 19 May 2026 11:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312823.1582921; Tue, 19 May 2026 11:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIrt-0007iE-KD; Tue, 19 May 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1312823;
 Tue, 19 May 2026 11:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIrs-0007i3-3O
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIrs-00D9IM-0D
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIrs-00DvZi-00
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=c+VB5jNuvP0jJ9v5eFwDgfgUClCCHXrN845GZwPJYTw=; b=HIU5cRHE6/xOYm4i3CNNLjYVi1
	LvM0UY22jPWkKRHfyjXUMq2ljuOV4lwrs6A2lCQH1sX/rc16JwnK9xZDaWiBgFXc3yEjQpOOX1AL0
	8n4eEYjl4ylSr5AnaV+XaopkryZT1kdEJPzDu65fiGUoDzSeWksZzV4GVP1o3/3B1PAw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wPIrs-00DvZi-00@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:12 +0000

commit 00496ab150e3cb15ac70bc3b83e31842d956aeec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:33:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:33:29 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 93acfeb78b508984aa815d00629cc8b6b90dc047
    master date: 2026-05-05 08:27:29 +0200
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index d60a07bfd5..3e4d9730aa 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -119,7 +119,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -131,12 +131,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -413,10 +416,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -690,18 +694,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1449,7 +1453,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1612,21 +1616,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 863edac4cd..9f9c30dc0a 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -404,12 +404,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index f47fdfb569..08be8caf5b 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1045,15 +1045,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1458,7 +1459,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1623,7 +1624,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1714,8 +1715,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index c35d25abd6..2bfdbabf6e 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bae4ff339..5680d299e7 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -515,7 +515,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2655,7 +2655,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2707,11 +2707,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3014,7 +3009,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 57e710a16d..b001e6deba 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312824.1582925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIs3-0007kW-Om; Tue, 19 May 2026 11:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312824.1582925; Tue, 19 May 2026 11:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIs3-0007kO-Ln; Tue, 19 May 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1312824;
 Tue, 19 May 2026 11:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIs2-0007kG-6u
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIs2-00D9IU-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIs2-00Dvbl-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L5e0dDtoN54285JvlR36NX5tEaiHAo9omKRJacaZHME=; b=zqy5OfF3+ryShWfGabGaVAHcLL
	BpxEM3+jElK2h17IvzjwJYUwHguSjsOEKxACyYdLa4bf3oUygnCfuPPXvC24ZfTUT0SiQfI6Zx2TO
	V5dkOg5okIicHV9J47g6ZFAGeDCVMDlJl7GEPbZ78d2K3GTwllVWTLLbMehnzBFdgzGs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wPIs2-00Dvbl-0P@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:22 +0000

commit 13ca96cdc989c68d338501a5f6dd5bbea27f2d64
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:33:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:33:53 2026 +0200

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: acfd2631b95e29fd68b98d902a1663e07474ed5f
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 14c28ba8e7..7f264debc9 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -908,6 +908,13 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
 
         /*
@@ -932,6 +939,8 @@ static void __init noreturn reinit_bsp_stack(void)
         }
         else
             asm volatile ( "setssbsy" ::: "memory" );
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312825.1582929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsD-0007mx-RJ; Tue, 19 May 2026 11:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312825.1582929; Tue, 19 May 2026 11:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsD-0007mp-Og; Tue, 19 May 2026 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1312825;
 Tue, 19 May 2026 11:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIsC-0007mj-9m
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsC-00D9Ic-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsC-00Dvdi-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=AyYiBgf6gaM0QQhOMt6UuURQnZqoIANvy5K0oJVpOeQ=; b=RX0oXD7JrpDuSfUM0DaFuwJuiv
	gY529T3fX+WvLUNrrLO+PVyVfcLnbBspgaleXP9VM1Ov4FIALN8s76WrR4h4TAi75lhuRAodcF5f8
	aZoWWZiEaHpvgqen3cu8ftQE0ElUsT+BPbECkFdx13widCoE7xjKeMvkN4+8vuMBS+Ig=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wPIsC-00Dvdi-0j@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:32 +0000

commit a8e85414e6ff950932ad625a0c6e7d19db7a8b02
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:34:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:34:12 2026 +0200

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3e6bca616b344aaa62602fcef0021255d467c2fd
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f1128a657d..90bff72687 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2578,6 +2578,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312826.1582933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsN-0007ot-Sm; Tue, 19 May 2026 11:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312826.1582933; Tue, 19 May 2026 11:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsN-0007om-Q8; Tue, 19 May 2026 11:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1312826;
 Tue, 19 May 2026 11:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIsM-0007oe-CL
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsM-00D9Ig-17
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsM-00DvfE-10
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xhmj/DREFxLoeV2Z8agO18RE93/O2oxhVeMmU9P7hhQ=; b=Us7JpQ9kDyTFHNLnzAIzwl7vBR
	c8jOJHDKFU+6I2/LqdKLicUcnPOXGVlZ6do1LyT8D193A7i0fUXL3xVXipJ2rcE/0eJqdEm35+Xd1
	m8wICFCCYxhsF9dXfXv8DJxcjgzh3y3GHnjXQSgolDC5EflORDavDw8DLDKR6ROhud7s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wPIsM-00DvfE-10@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:42 +0000

commit 9358a206cbf9a2bda0d3539cb5f114c4b78608d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:34:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:34:58 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 96ffccef5a5f598ffbd263971b92132391f1606a
    master date: 2026-05-06 15:11:11 +0200
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 110b10e88c..83c9d4dea2 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:44:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:44:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312827.1582936 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsX-0007r9-UX; Tue, 19 May 2026 11:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312827.1582936; Tue, 19 May 2026 11:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsX-0007r1-Rf; Tue, 19 May 2026 11:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1312827;
 Tue, 19 May 2026 11:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIsW-0007qu-FX
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsW-00D9Iq-1P
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsW-00Dvhw-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6G2LPK03ft4Gx1r0AJGkEmdFyPU69VoQhvMenE/SXiI=; b=puktme6evqb1J9B3QwU7A/6aNe
	kkUT9ZG8jIxFBEmiyEmBMU0ouU5PIF1GvLLyu5dO2yMkJRiOVtgMx60798OGzW5YsJeHrA9VBiXAl
	t1sSHbQoVypBI9clBudy8AG+cqalMY9BAFh0FMVt0Mjz5QET5IVeaMXg4EdvnQJiQh8c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] EFI: adjust cfg file buffer freeing
Message-Id: <E1wPIsW-00Dvhw-1J@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:44:52 +0000

commit 1ae7e082173b6fb5630fb7ef4635ca6c9b51c8d9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:35:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:13 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4ff927133ebc32498fd4af49a8025a846cfe1dc6
    master date: 2026-05-06 15:11:11 +0200
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2181cf0b0c..99d507d1f6 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -753,6 +753,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -762,8 +772,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1557,11 +1566,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1631,11 +1636,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         if ( dir_handle )
             dir_handle->Close(dir_handle);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312828.1582942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsh-0007t4-WB; Tue, 19 May 2026 11:45:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312828.1582942; Tue, 19 May 2026 11:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsh-0007sw-T1; Tue, 19 May 2026 11:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1312828;
 Tue, 19 May 2026 11:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIsg-0007sq-Hk
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsg-00D9JI-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsg-00Dvkb-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=v+UyCpIf/qo0F8vzmTGzjT51Z7R7GllQsWpjjMvRU1Q=; b=U4T1ra+P/6WoZO0lIaTtUiM/7u
	UY8BxxlBlrnv6DDhWT7/DfJjrgTSu6XeiiuoCX9C9D/1Whu1YEbf8ZZtm8xpodB9jBiYZF3gBtkHa
	BIDuL785adiuFG8/LjDMsUYxngZu89QuTfdSO2iq3737Tq0N2tJO8eefWM9ipr9v2YCY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wPIsg-00Dvkb-1a@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:02 +0000

commit 3dccad52201bc4550e431bad788e5d70a210db1f
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue May 19 13:35:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:27 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
    master date: 2026-05-06 15:11:18 +0200
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312829.1582946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIss-0007vX-16; Tue, 19 May 2026 11:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312829.1582946; Tue, 19 May 2026 11:45:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIsr-0007vP-UO; Tue, 19 May 2026 11:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1312829;
 Tue, 19 May 2026 11:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIsq-0007vJ-Ka
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsq-00D9M2-1y
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIsq-00Dvlw-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I4KWASFOEZPoEisMOlAeZd+S3D0g6Kf01ukAOueQ0A0=; b=qgOEm1SeYNlQkDjX91pCn0BuRv
	rAPvmTUUW4j6m0fv1k+rZkCKG59LTG0CgGlK7bQs68mci/y5EDyaPnX5gp3JhKZgNC7Dmy74R480m
	vYoWq9nAzVTmpXM4QnmUpTgfrnN+J0QeT0NwN7AU5IyXesxvKZtMWRdsUStFE8TxmVlU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/time: make do_settime() uses more accurate
Message-Id: <E1wPIsq-00Dvlw-1q@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:12 +0000

commit fd2ccd79ab8bd58ac8d0624f4459fffbca192a5a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:35:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:57 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 54ca0aadc8219b19199703038205cd01c2611995
    master date: 2026-05-07 16:10:52 +0200
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5680d299e7..503c43499a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2567,6 +2567,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2584,7 +2586,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2737,6 +2740,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2748,7 +2753,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312830.1582949 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIt2-0007xR-20; Tue, 19 May 2026 11:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312830.1582949; Tue, 19 May 2026 11:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIt1-0007xJ-Vm; Tue, 19 May 2026 11:45:23 +0000
Received: by outflank-mailman (input) for mailman id 1312830;
 Tue, 19 May 2026 11:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIt0-0007xD-O8
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIt0-00D9M9-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIt0-00DvnZ-29
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/KoOl6W7ilp7YKL5mApEitiGzGeoGNN8OzleS9VHm9E=; b=YKMO/LVTGLAUXpBR6VDHNWyNcf
	aVDDfMxh0cTKVGmlLcy29WkS/EMILl46ABOoXoVY1bhEJgOgdCmcToVvVgP8ooxHsolJQVKXun8Gk
	mCdNh+GtWSTMlSBgpm2zVq9h6+qe6zVBkYvN3nE0lHjh0fGcuX+bY4iofl8fg3NbNSvw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wPIt0-00DvnZ-29@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:22 +0000

commit 7372acade2bdbca0782e7fd5040b913b3724bfbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:36:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:20 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
    master date: 2026-05-13 09:59:19 +0200
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 3b53471af0..066498e07e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -569,12 +569,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..3412c7fb4a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -850,7 +850,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -885,8 +885,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -904,8 +921,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -928,7 +945,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -942,13 +962,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312831.1582952 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItC-0007zR-3d; Tue, 19 May 2026 11:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312831.1582952; Tue, 19 May 2026 11:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItC-0007zJ-0r; Tue, 19 May 2026 11:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1312831;
 Tue, 19 May 2026 11:45:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItA-0007zD-QT
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItA-00D9MD-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItA-00DvoX-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5hMGIZdAQAeVzIMu82Te7E4AXqI6KMe4SMPLsfie/Sk=; b=JzfKkzZlILkl6gJNFtmp2mIARR
	nY/lSIg1l64xOvN8qw28Wo0cv91nhwX5L9/9Pft92amdOFWAn2Ks3LRghywh7wvp/x3rMvkecPVCE
	vRAKjb+lS9c24VrYVhOm6GlXyGqA1hVM7e2lIQLw2s1tZd6Cn4H8PRE4C9J90gO9v2H8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] symbols: explicitly specify source file name for symtab
Message-Id: <E1wPItA-00DvoX-2S@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:32 +0000

commit 3db23dfdc645385e9d5961d7b9bbdaa692684eae
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:36:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:36 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c5d554edff679302b94aecb67bfe9792a2c33aa6
    master date: 2026-05-13 10:00:52 +0200
---
 xen/arch/x86/Makefile | 5 ++++-
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 9d07a0a0d6..269a1a3acb 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -208,7 +208,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
-	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
+	$(objtree)/tools/symbols $(all_symbols) --source-name=$(@F).S --empty \
+		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
@@ -218,6 +219,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -228,6 +230,7 @@ endif
 		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).2s.S
 	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 509394d5a4..bc50b1a576 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -66,6 +66,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -347,6 +348,7 @@ static void write_src(void)
 	printf("#define ALGN .balign 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -682,6 +684,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312832.1582957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItM-00081r-67; Tue, 19 May 2026 11:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312832.1582957; Tue, 19 May 2026 11:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItM-00081j-3e; Tue, 19 May 2026 11:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1312832;
 Tue, 19 May 2026 11:45:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItK-00081d-Ts
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItK-00D9MJ-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItK-00Dvro-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3dch5EVzKimAIZWBUdPLRqfkoCefXo6rD0374WY4spc=; b=aa6dpCaZ2+13mvyb6hslPz/7mE
	Bq15z7LdXQlkdXFIn0RA2KkR5oi69wNaSZ6UHXoKq3ke8kbzfmqDi7x2dnaisO0TVIDtG02iWzH/f
	EvTXfar2HOPZZlN0iLimKb4aArFvkh7703xY6aN/hGrk9F7cCFREHHcrMM6PMBXkigEw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wPItK-00Dvro-2i@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:42 +0000

commit ed13b648828a3b334f01389aa610b4cafc434294
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue May 19 13:36:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:56 2026 +0200

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 79e060ea03583cd83ddc7e520dcd7c5c418841f3
    master date: 2026-05-14 13:38:04 +0100
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:45:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:45:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312833.1582961 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItX-000848-7o; Tue, 19 May 2026 11:45:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312833.1582961; Tue, 19 May 2026 11:45:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItX-000840-55; Tue, 19 May 2026 11:45:55 +0000
Received: by outflank-mailman (input) for mailman id 1312833;
 Tue, 19 May 2026 11:45:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItV-00083u-DO
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:45:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItV-00D9MN-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItV-00Dvtx-18
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:45:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7ZL1ApjNzU539S//o/SMBsjHJIFX86NPG6DrN5uPJ/w=; b=Ts1hhYgw3OgqKzTmTjAWQt6reL
	m7RpRlI4eqWvjPZwDTksCme4xCWBufDa64C12OOgKP5VndyfaZnSNQI/fTKZjDZTdxHTGa0BaWMAS
	3j/Gu4L/rn50Uv4oZVst+pw1ja4zxUUcQhLXmmvrv6qHxO2x4us6MtOqpFV0ltgGSWK4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wPItV-00Dvtx-18@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:45:53 +0000

commit 937d1c7368d83af809d05f9ce4afd454aa9ecd81
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:37:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:37:41 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 93acfeb78b508984aa815d00629cc8b6b90dc047
    master date: 2026-05-05 08:27:29 +0200
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 914661312d..3908644e55 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -118,7 +118,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -130,12 +130,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -412,10 +415,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -697,18 +701,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1456,7 +1460,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1617,21 +1621,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 98f1db2349..79754353c8 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -399,12 +399,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d6221802bf..a3d982ce6e 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1043,15 +1043,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1457,7 +1458,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1618,7 +1619,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1709,8 +1710,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 3dfbb5297a..0dbeccec21 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bae4ff339..5680d299e7 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -515,7 +515,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2655,7 +2655,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2707,11 +2707,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3014,7 +3009,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index bc4818c943..cc41326208 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312834.1582966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIth-000869-9w; Tue, 19 May 2026 11:46:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312834.1582966; Tue, 19 May 2026 11:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIth-000861-6T; Tue, 19 May 2026 11:46:05 +0000
Received: by outflank-mailman (input) for mailman id 1312834;
 Tue, 19 May 2026 11:46:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItf-00085u-Fj
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItf-00D9Mg-1U
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItf-00Dvvj-1O
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ii3SP1xRR47MYv59bS1Gt+J+QYetPSfDAqnZmyeS468=; b=my/dgLOtpA6nehE7jARWhe57JO
	GxGmXEFfgIwy+NbMgo/oN9wZ5MciIvzD/AMtKq1eZiQ0nVgIOsvyMcNjTTC4U25Ce4crm7v9ZaHMv
	cHT9B9E57QaZx1sLq/spEpqakW8trb7IW4aVO7u5/3CkJgkEyG7MeHiiQ2h+VZ0G4DTE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wPItf-00Dvvj-1O@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:03 +0000

commit 869ef9bbf5ebef87e857e2206831f066081c7782
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:38:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:18 2026 +0200

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: acfd2631b95e29fd68b98d902a1663e07474ed5f
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3dc8de3114..e0c320e165 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -904,10 +904,19 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_PL0_SSP,
                (unsigned long)stack + (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8);
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
         asm volatile ("setssbsy" ::: "memory");
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312835.1582968 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItr-000888-AW; Tue, 19 May 2026 11:46:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312835.1582968; Tue, 19 May 2026 11:46:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPItr-000880-7x; Tue, 19 May 2026 11:46:15 +0000
Received: by outflank-mailman (input) for mailman id 1312835;
 Tue, 19 May 2026 11:46:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItp-00087u-IS
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItp-00D9N6-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItp-00Dvwg-1f
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MxEu/P7pqSbWFiFQ+jAIUi6LBtIhtut6tLBt4qpLLKA=; b=mXbxfcDgKyImyYop7GogPG2CIF
	45FjkTVgxX0r1uEN4KVMCjIT/vrlh6fjtv+vJYqNwVmWfakwRYen60PIf/YlR/Ezqnebgwn6NCYPp
	RK3l7RUSoRBuiedOIEenm71qlIdTUOJXy9NsJMycgpr9f73E/XUdLNV6qw3oPdwkLLtE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wPItp-00Dvwg-1f@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:13 +0000

commit d006fa109f65f8141cb77888980f85cb65493bab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:38:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:37 2026 +0200

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3e6bca616b344aaa62602fcef0021255d467c2fd
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 62905c2c7a..8bb829a13d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2549,6 +2549,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312836.1582973 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIu1-0008A4-CD; Tue, 19 May 2026 11:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312836.1582973; Tue, 19 May 2026 11:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIu1-00089w-9K; Tue, 19 May 2026 11:46:25 +0000
Received: by outflank-mailman (input) for mailman id 1312836;
 Tue, 19 May 2026 11:46:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPItz-00089q-LP
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItz-00D9NA-22
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPItz-00DvyF-1v
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LfhhI14RgoR/AtnBgggJSu299GML2ZLGvJX834nYtCs=; b=xb513AvplBDInWv/a6T7Cxajlm
	q2wC2sL0Sok1AAoZ9Wk4zlJ4m8aEP3W04dRGpU+5FdUWQUxjaHIXbb1kfls3k0WQYEDqfM8kLIpCI
	3noyy8A/0jtaGE4XAYcIgSqwSsOqxIlV7F7OxHI+r+CJQAVUr+Gn8ny6GMGyCL1bWXlY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wPItz-00DvyF-1v@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:23 +0000

commit a99d16079d9bd570a7c6487ed491a1edc4960e49
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:38:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:55 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 96ffccef5a5f598ffbd263971b92132391f1606a
    master date: 2026-05-06 15:11:11 +0200
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 7686d49f81..e0b8368273 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -61,8 +61,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312837.1582977 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuB-0008Ca-FI; Tue, 19 May 2026 11:46:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312837.1582977; Tue, 19 May 2026 11:46:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuB-0008CS-CQ; Tue, 19 May 2026 11:46:35 +0000
Received: by outflank-mailman (input) for mailman id 1312837;
 Tue, 19 May 2026 11:46:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIu9-0008CK-Nu
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIu9-00D9NE-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIu9-00DvzG-2D
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eEDRpK5onHZfjN6009CtyjN0rH8FzSccKFRTBLoXcwA=; b=NnE/TxGzq+8majg7TNjhKF1gES
	ua+cCAik0x9I5QRUKihAjWC/xbhaCiGCo/3g02cJ3saU77GNR8NYvFkQfl6O78mUT7g8GiP3KUBf5
	V1CRzY1xHCAAW30/pdPbkDVECfOG8e6l9Q9MiEPX6UWSzKJ5FGJ1EUpVSFGqZuH31qeQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] EFI: adjust cfg file buffer freeing
Message-Id: <E1wPIu9-00DvzG-2D@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:33 +0000

commit 4563f9c1476bfc9d8a4e618797499a696e82bf20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:39:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:09 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4ff927133ebc32498fd4af49a8025a846cfe1dc6
    master date: 2026-05-06 15:11:11 +0200
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c2db9afd63..5082a23a7f 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -702,6 +702,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -711,8 +721,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1435,11 +1444,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1504,11 +1509,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         dir_handle->Close(dir_handle);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312838.1582981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuL-0008Ed-Gg; Tue, 19 May 2026 11:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312838.1582981; Tue, 19 May 2026 11:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuL-0008EW-Dm; Tue, 19 May 2026 11:46:45 +0000
Received: by outflank-mailman (input) for mailman id 1312838;
 Tue, 19 May 2026 11:46:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIuJ-0008EN-QK
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuJ-00D9NI-2Y
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuJ-00Dvzh-2T
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Uqvr6Dt3/y3km8TwWbFQO+oZcTB0lg1bFGpOBFJaL4w=; b=fVUWuDwfuFNDCsoKwlbav5oNjm
	sSrXXkgmkwZpZCS6wC29Q+v/lofpd4xQfLsw6aT79E6OGSqOI61S9Sc1B5kMmlIJr3XfF1ogRRDw8
	qtSwZbBn6kuFnRZs/p1+6cvhHnmkCQS8L4dBDQG/YoS7MMwbkPnS39Ys3z8JlWUoKhzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wPIuJ-00Dvzh-2T@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:43 +0000

commit 152183d9690d32527201524fceef017a1716f17d
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue May 19 13:39:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:28 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
    master date: 2026-05-06 15:11:18 +0200
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:46:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:46:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312839.1582984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuU-0008Gw-Hx; Tue, 19 May 2026 11:46:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312839.1582984; Tue, 19 May 2026 11:46:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuU-0008Gm-FI; Tue, 19 May 2026 11:46:54 +0000
Received: by outflank-mailman (input) for mailman id 1312839;
 Tue, 19 May 2026 11:46:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIuT-0008Gg-St
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:46:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuT-00D9NO-2o
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuT-00Dw0P-2j
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:46:53 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=IfLelmo3+GbG+wLumf/xNJF53xcISKdOeingbyjotpo=; b=l8NFPF9mr9LO8DbA0xTUVl4YTb
	lWTKUOf90AmvLTDVIeFyRo8kMr7q4TLLy92GgRxMcsVsGSgkQ4iF5s+T69kbkgdcK+srz6vZcxLaL
	ZWnorh4rp4YxqP11SctJlbukxdJTecVtUNvUhQy210AJD78MV6K0Wrrnb4rBjYhW4U78=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/time: make do_settime() uses more accurate
Message-Id: <E1wPIuT-00Dw0P-2j@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:46:53 +0000

commit 8f981abea3e35710dea067d8a8198c16738b068b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:39:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:46 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 54ca0aadc8219b19199703038205cd01c2611995
    master date: 2026-05-07 16:10:52 +0200
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5680d299e7..503c43499a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2567,6 +2567,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2584,7 +2586,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2737,6 +2740,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2748,7 +2753,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:47:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:47:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312840.1582989 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIue-0008Io-JE; Tue, 19 May 2026 11:47:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312840.1582989; Tue, 19 May 2026 11:47:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIue-0008Ih-Gd; Tue, 19 May 2026 11:47:04 +0000
Received: by outflank-mailman (input) for mailman id 1312840;
 Tue, 19 May 2026 11:47:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIud-0008Ib-Vb
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:47:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIud-00D9Ng-34
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIud-00Dw0u-2z
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ajsvstCmscbB3IR/lZwp7RnsGF7uzKJfv4CWaKEIP2I=; b=rXjj5kPxPrdY0D/OSffERB/5pX
	JXg3WamwexRe5B9QMr2B/xQp5/eFAVbpHzpNdzVzAZIeh3N/1OUvB1zBmeomYVfJ92HW7KDO1TKW+
	TnAGle9bQOKP1aRKALE7t+PMToVQabkTrn8UOLF6YYVKhPoxh14hi2Pb2KEiBiod3AlA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wPIud-00Dw0u-2z@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:47:03 +0000

commit 04747ce00cbe788ec751c0446ba59a5fbf05d6f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:40:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:09 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
    master date: 2026-05-13 09:59:19 +0200
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 462691f91d..b0d3082409 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -568,12 +568,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c78f0dcd0a..23bb159d9b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -848,7 +848,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -883,8 +883,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -902,8 +919,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -926,7 +943,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -940,13 +960,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:47:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:47:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312841.1582993 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuo-0008MO-L3; Tue, 19 May 2026 11:47:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312841.1582993; Tue, 19 May 2026 11:47:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuo-0008MG-II; Tue, 19 May 2026 11:47:14 +0000
Received: by outflank-mailman (input) for mailman id 1312841;
 Tue, 19 May 2026 11:47:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIuo-0008MA-1s
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:47:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuo-00D9O3-06
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuo-00Dw1V-01
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:14 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aktZoYzSfhFJVHpFAjW0hfuUHOdK4LcLV9SLrUq4dyg=; b=1wzjhfxewq6PEQ9nvlCG5pWN66
	HOFQXdbk6Q3Wr41ZajMK5gEUbyWOG/TqUsZCFuP5AgvQ/ttmusd8cZih6dsnTzChXBc8UkV4lOV1C
	uMAMhw05IU7aKb0NUAxC8ri5Bg31dY32mnj6u13Jkgfo8O5u4Rqw5yZncbwPeL4lvp6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] symbols: explicitly specify source file name for symtab
Message-Id: <E1wPIuo-00Dw1V-01@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:47:14 +0000

commit 0bd3ff852d66745aa5e32da760169c56cffaed68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:40:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:23 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c5d554edff679302b94aecb67bfe9792a2c33aa6
    master date: 2026-05-13 10:00:52 +0200
---
 xen/arch/x86/Makefile | 2 ++
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 95b30a888f..a21151b56d 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -216,6 +216,7 @@ endif
 		> $(dot-target).0r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -226,6 +227,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index e532709ba7..b597fa8918 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -63,6 +63,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -320,6 +321,7 @@ static void write_src(void)
 	printf("#define ALGN .align 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -612,6 +614,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:47:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:47:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312842.1582997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuy-0008ON-MS; Tue, 19 May 2026 11:47:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312842.1582997; Tue, 19 May 2026 11:47:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPIuy-0008OG-Jh; Tue, 19 May 2026 11:47:24 +0000
Received: by outflank-mailman (input) for mailman id 1312842;
 Tue, 19 May 2026 11:47:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPIuy-0008O8-4H
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:47:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuy-00D9O9-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPIuy-00Dw2E-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:47:24 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=giLtU4j9Y/frMpTgQZJ+cMeWYQbp+odwCPiXWXmvDBM=; b=Z90NBvgvMbFZyLAIjrx5uaD1TH
	Nof86XcaWve6aeyOG79u/wTi4p+A/wHXOt08Nb6pZw6G4sWxeuskByYCNq06R+ZxVAOCU0KlE4Qha
	KJDZpsDwQovAverYNxIvt2Ezx0qOKuggtIUi9x5cE5HSc8FJfIvEShs7WTkNSp6GPVmE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wPIuy-00Dw2E-0G@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:47:24 +0000

commit ae41936862cc43a1fc1800f536020f984c479185
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue May 19 13:40:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:36 2026 +0200

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 79e060ea03583cd83ddc7e520dcd7c5c418841f3
    master date: 2026-05-14 13:38:04 +0100
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312890.1583055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2N-0004Kg-O6; Tue, 19 May 2026 11:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312890.1583055; Tue, 19 May 2026 11:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2N-0004KY-L4; Tue, 19 May 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1312890;
 Tue, 19 May 2026 11:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ2M-0004KS-Dm
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2M-00D9WE-19
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2M-00DwWE-11
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=hfponPuz9n5KIPnoRo5qv4B0MT6XOZgrtdLkuzWYD8s=; b=UFm01Q/6zUEIbDlFWQ7jgqW5WW
	K3ysvLhUJ5LTIjHeAUMFgIe906dcZj/Oy7vWOnS3k+cvTGiI3+ByPuELpYKcqvCJN7pNpS74FIb0T
	5H3OUGF1GHg0/nUBfquqXnVHVyMcfas5BokxG9RB7fJlIsgblDHLZajqmMWK+iVLPbRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: implement copy_to_guest_phys()
Message-Id: <E1wPJ2M-00DwWE-11@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:02 +0000

commit e74b6fc4730570585703e26d7ef4fe5e8823e246
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:45 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:31:32 2026 +0200

    xen/riscv: implement copy_to_guest_phys()
    
    Introduce copy_to_guest_phys() for RISC-V, based on the Arm implementation.
    
    Add a generic copy_guest() helper for copying to and from guest physical
    (and potentially virtual addresses in the future), and implement
    translate_get_page() to translate a guest physical address into a struct
    page_info via the domain p2m.
    
    Compared to the Arm code:
    - Drop COPY_flush_dcache(), as no such use cases exist on RISC-V.
    - Do not implement the linear mapping case, which is currently unused.
    - Use PAGE_OFFSET() to initialize the local offset variable in copy_guest().
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile                   |   1 +
 xen/arch/riscv/guestcopy.c                | 116 ++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/guest_access.h |   7 ++
 3 files changed, 124 insertions(+)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 04f02ad89c..cfc3fdf7d2 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -4,6 +4,7 @@ obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += extable.o
+obj-y += guestcopy.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
diff --git a/xen/arch/riscv/guestcopy.c b/xen/arch/riscv/guestcopy.c
new file mode 100644
index 0000000000..8a89212e0b
--- /dev/null
+++ b/xen/arch/riscv/guestcopy.c
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/domain_page.h>
+#include <xen/page-size.h>
+#include <xen/sched.h>
+#include <xen/string.h>
+
+#include <asm/guest_access.h>
+
+#define COPY_from_guest     0U
+#define COPY_to_guest       BIT(0, U)
+#define COPY_gpa            0U
+#define COPY_gva            BIT(1, U)
+
+typedef union
+{
+    struct
+    {
+        struct vcpu *v;
+    } gva;
+
+    struct
+    {
+        struct domain *d;
+    } gpa;
+} copy_info_t;
+
+#define GVA_INFO(vcpu) ((copy_info_t) { .gva = { vcpu } })
+#define GPA_INFO(domain) ((copy_info_t) { .gpa = { domain } })
+
+static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
+                                            bool gva, bool write)
+{
+    p2m_type_t p2mt;
+    struct page_info *page;
+
+    /*
+     * Not implemented yet.
+     *
+     * If gva == true, the operation will likely require a struct vcpu
+     * rather than just a struct domain. For this reason copy_info_t is
+     * already passed here instead of only struct domain.
+     */
+    BUG_ON(gva);
+
+    page = get_page_from_gfn(info.gpa.d, paddr_to_pfn(addr), &p2mt, P2M_ALLOC);
+
+    if ( !page )
+        return NULL;
+
+    if ( write ? p2mt != p2m_ram_rw : !p2m_is_ram(p2mt) )
+    {
+        put_page(page);
+        return NULL;
+    }
+
+    return page;
+}
+
+static unsigned long copy_guest(void *buf, uint64_t addr, unsigned long len,
+                                copy_info_t info, unsigned int flags)
+{
+    unsigned int offset = PAGE_OFFSET(addr);
+
+    BUILD_BUG_ON((sizeof(addr)) < sizeof(vaddr_t));
+    BUILD_BUG_ON((sizeof(addr)) < sizeof(paddr_t));
+
+    while ( len )
+    {
+        void *p;
+        unsigned long size = min(len, PAGE_SIZE + 0UL - offset);
+        struct page_info *page;
+
+        page = translate_get_page(info, addr, flags & COPY_gva,
+                                  flags & COPY_to_guest);
+        if ( !page )
+            return len;
+
+        p = __map_domain_page(page);
+        p += offset;
+        if ( flags & COPY_to_guest )
+        {
+            /*
+             * buf will be NULL when the caller request to zero the
+             * guest memory.
+             */
+            if ( buf )
+                memcpy(p, buf, size);
+            else
+                memset(p, 0, size);
+        }
+        else
+            memcpy(buf, p, size);
+
+        unmap_domain_page(p);
+        put_page(page);
+        len -= size;
+        buf += size;
+        addr += size;
+
+        /*
+         * After the first iteration, guest virtual address is correctly
+         * aligned to PAGE_SIZE.
+         */
+        offset = 0;
+    }
+
+    return 0;
+}
+
+unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
+                                 unsigned long len)
+{
+    return copy_guest(buf, gpa, len, GPA_INFO(d),
+                      COPY_to_guest | COPY_gpa);
+}
diff --git a/xen/arch/riscv/include/asm/guest_access.h b/xen/arch/riscv/include/asm/guest_access.h
index 7cd51fbbde..8d679319de 100644
--- a/xen/arch/riscv/include/asm/guest_access.h
+++ b/xen/arch/riscv/include/asm/guest_access.h
@@ -2,6 +2,10 @@
 #ifndef ASM__RISCV__GUEST_ACCESS_H
 #define ASM__RISCV__GUEST_ACCESS_H
 
+#include <xen/types.h>
+
+struct domain;
+
 unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len);
 unsigned long raw_copy_from_guest(void *to, const void *from, unsigned len);
 unsigned long raw_clear_guest(void *to, unsigned int len);
@@ -18,6 +22,9 @@ unsigned long raw_clear_guest(void *to, unsigned int len);
 #define guest_handle_okay(hnd, nr) (1)
 #define guest_handle_subrange_okay(hnd, first, last) (1)
 
+unsigned long copy_to_guest_phys(struct domain *d, paddr_t gpa, void *buf,
+                                 unsigned long len);
+
 #endif /* ASM__RISCV__GUEST_ACCESS_H */
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312891.1583059 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2X-0004Ml-PV; Tue, 19 May 2026 11:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312891.1583059; Tue, 19 May 2026 11:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2X-0004Md-MN; Tue, 19 May 2026 11:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1312891;
 Tue, 19 May 2026 11:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ2W-0004MT-FI
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2W-00D9Z4-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2W-00DwWh-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+ep/WekpU9Qw4X+deXP1lN4t/5yrvfRoTbMqxH1cr6o=; b=GaA2aMc9Q1KR0cAoV4mWV3ac0U
	xV6gKryDH5OYffTfoz0D99F0o2EJ2m2NtDSXmPejYh/+g/IyeZElQpKzRAclaDuEMmfkQH+lJoyrZ
	sWdwQBpkIIQtzV9ArdkSIaQqG+BSFNBbJno31By3fObdB6tM3YW3JJpcw8reYgs7cuVI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add Linux kernel loading support
Message-Id: <E1wPJ2W-00DwWh-1J@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:12 +0000

commit f6a20eda9212d1bbbb846cb58017b32fd2ce7180
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:02 2026 +0200

    xen/riscv: add Linux kernel loading support
    
    Introduce support for loading a Linux kernel Image which is got by
    uncompressing of Image.gz on RISC-V.
    
    kernel_image_load() and place_modules() currently call panic() on
    failure rather than returning an error. This is because the common
    kernel_load() in common/device-tree/kernel.c does not expect a
    return code. Handling errors gracefully would require a separate
    refactor.
    
    The implementation is based on the Xen Arm kernel loading code.
    
    text_offset is available for both 32-bit and 64-bit Image, so fix
    that.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile             |   1 +
 xen/arch/riscv/include/asm/config.h |  13 ++
 xen/arch/riscv/kernel.c             | 249 ++++++++++++++++++++++++++++++++++++
 xen/include/xen/fdt-kernel.h        |  11 +-
 4 files changed, 272 insertions(+), 2 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index cfc3fdf7d2..eecdcbc768 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -8,6 +8,7 @@ obj-y += guestcopy.o
 obj-y += imsic.o
 obj-y += intc.o
 obj-y += irq.o
+obj-y += kernel.init.o
 obj-y += mm.o
 obj-y += p2m.o
 obj-y += paging.o
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 0613de008b..fd69057826 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -151,6 +151,19 @@
 extern unsigned long phys_offset; /* = load_start - XEN_VIRT_START */
 #endif
 
+/*
+ * KERNEL_LOAD_ADDR_ALIGNMENT is defined based on paragraph of
+ * "Kernel location" of boot.rst:
+ * https://docs.kernel.org/arch/riscv/boot.html#kernel-location
+ */
+#if defined(CONFIG_RISCV_32)
+#define KERNEL_LOAD_ADDR_ALIGNMENT MB(4)
+#elif defined(CONFIG_RISCV_64)
+#define KERNEL_LOAD_ADDR_ALIGNMENT MB(2)
+#else
+#error "Define KERNEL_LOAD_ADDR_ALIGNMENT"
+#endif
+
 #endif /* ASM__RISCV__CONFIG_H */
 /*
  * Local variables:
diff --git a/xen/arch/riscv/kernel.c b/xen/arch/riscv/kernel.c
new file mode 100644
index 0000000000..8580cdb32d
--- /dev/null
+++ b/xen/arch/riscv/kernel.c
@@ -0,0 +1,249 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bug.h>
+#include <xen/compiler.h>
+#include <xen/errno.h>
+#include <xen/fdt-kernel.h>
+#include <xen/guest_access.h>
+#include <xen/init.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/mm.h>
+#include <xen/types.h>
+#include <xen/vmap.h>
+
+#include <asm/setup.h>
+
+#define IMAGE64_MAGIC_V2 0x05435352 /* Magic number 2, le, "RSC\x05" */
+
+/*
+ * Machine word alignment could be useful for copying to be more efficient.
+ * There is no reason for now to have bigger module alignment.
+ */
+#define MODULES_ALIGNMENT sizeof(unsigned long)
+
+static void __init place_modules(struct kernel_info *info, paddr_t kernbase,
+                                 paddr_t kernend)
+{
+    const struct boot_module *mod = info->bd.initrd;
+    const struct membanks *banks = kernel_info_get_mem_const(info);
+    const paddr_t initrd_len = ROUNDUP(mod ? mod->size : 0,
+                                       MODULES_ALIGNMENT);
+    const paddr_t dtb_len = ROUNDUP(fdt_totalsize(info->fdt),
+                                    MODULES_ALIGNMENT);
+    const paddr_t modsize = initrd_len + dtb_len;
+    unsigned int bi = banks->nr_banks;
+
+    if ( modsize < initrd_len )
+        panic("Module size overflow: initrd + dtb size wraps paddr_t\n");
+
+    /*
+     * Place modules as high in RAM as possible, scanning banks from
+     * last to first so that the end of the last bank is preferred.
+     */
+    while ( bi-- > 0 )
+    {
+        const struct membank *bank = &banks->bank[bi];
+        const paddr_t bank_end = bank->start + bank->size;
+        paddr_t modbase;
+
+        if ( modsize > bank->size )
+            continue;
+
+        modbase = ROUNDDOWN(bank_end - modsize, MODULES_ALIGNMENT);
+
+        if ( modbase < bank->start )
+            continue;
+
+        /*
+         * If modules would overlap the kernel, try placing them below it.
+         */
+        if ( (modbase < ROUNDUP(kernend, MODULES_ALIGNMENT)) &&
+             (modbase + modsize > kernbase) )
+        {
+            /* Avoid underflow below */
+            if ( kernbase < modsize )
+                continue;
+
+            modbase = ROUNDDOWN(kernbase - modsize, MODULES_ALIGNMENT);
+            if ( modbase < bank->start )
+                continue;
+        }
+
+        info->dtb_paddr = modbase;
+        info->initrd_paddr = modbase + dtb_len;
+
+        return;
+    }
+
+    panic("Unable to find suitable location for dtb+initrd\n");
+}
+
+static paddr_t __init kernel_image_place(struct kernel_info *info)
+{
+    paddr_t load_addr = INVALID_PADDR;
+    uint64_t image_size = info->image.image_size ?: info->image.len;
+    const struct membanks *banks = kernel_info_get_mem_const(info);
+    unsigned int nr_banks = banks->nr_banks;
+    unsigned int bi;
+
+    /*
+     * At the moment, RISC-V's Linux kernel should be always position
+     * independent based on "Per-MMU execution" of boot.rst:
+     *   https://docs.kernel.org/arch/riscv/boot.html#pre-mmu-execution
+     *
+     * But just for the case when RISC-V's Linux kernel isn't position
+     * independent it is needed to take load address from
+     * info->image.start.
+     *
+     * If `start` is zero, the Image is position independent.
+     */
+    if ( likely(!info->image.start) )
+    {
+        for ( bi = 0; bi != nr_banks; bi++ )
+        {
+            const struct membank *bank = &banks->bank[bi];
+            paddr_t bank_start = bank->start;
+            /*
+             * According to boot.rst kernel load address should be properly
+             * aligned:
+             *   https://docs.kernel.org/arch/riscv/boot.html#kernel-location
+             *
+             * As Image in this case is PIC we can ignore
+             * info->image.text_offset.
+             */
+            paddr_t aligned_start = ROUNDUP(bank_start, KERNEL_LOAD_ADDR_ALIGNMENT);
+            paddr_t bank_end = bank_start + bank->size;
+            paddr_t bank_size;
+
+            if ( aligned_start > bank_end )
+                continue;
+
+            bank_size = bank_end - aligned_start;
+
+            if ( image_size <= bank_size )
+            {
+                load_addr = aligned_start;
+                break;
+            }
+        }
+    }
+    else
+    {
+        load_addr = info->image.start + info->image.text_offset;
+
+        WARN_ON(!IS_ALIGNED(load_addr, KERNEL_LOAD_ADDR_ALIGNMENT));
+
+        /*
+         * Reject a malformed image before the loop to avoid wrapping
+         * load_addr + image_size in the per-bank check below by setting
+         * bi = nr_banks.
+         *
+         * image_size covers the kernel from _start (placed at load_addr =
+         * start + text_offset) through _end.  The alignment gap
+         * [start, load_addr) is padding and need not lie within a bank.
+         */
+        bi = image_size <= (paddr_t)-1 - load_addr ? 0 : nr_banks;
+        for ( ; bi != nr_banks; bi++ )
+        {
+            const struct membank *bank = &banks->bank[bi];
+            paddr_t bank_start = bank->start;
+            paddr_t bank_end = bank_start + bank->size;
+
+            if ( (load_addr >= bank_start) &&
+                 (load_addr + image_size <= bank_end) )
+                break;
+        }
+    }
+
+    if ( bi == nr_banks )
+        panic("Failed to place kernel image in any memory bank\n");
+
+    info->entry = load_addr;
+
+    return load_addr;
+}
+
+static void __init kernel_image_load(struct kernel_info *info)
+{
+    int rc;
+    paddr_t load_addr = kernel_image_place(info);
+    paddr_t paddr = info->image.kernel_addr;
+    paddr_t len = info->image.len;
+    paddr_t effective_size = info->image.image_size ?: len;
+    void *kernel;
+
+    place_modules(info, load_addr, load_addr + effective_size);
+
+    printk("Loading Image from %"PRIpaddr" to [%"PRIpaddr",%"PRIpaddr")\n",
+            paddr, load_addr, load_addr + effective_size);
+
+    kernel = ioremap_cache(paddr, len);
+
+    if ( !kernel )
+        panic("Unable to map kernel\n");
+
+    /* Move kernel to proper location in guest phys map */
+    rc = copy_to_guest_phys(info->bd.d, load_addr, kernel, len);
+
+    if ( rc )
+        panic("Unable to copy kernel to proper guest location\n");
+
+    iounmap(kernel);
+}
+
+/* Check if the image is a 64-bit Image */
+static int __init kernel_image64_probe(struct kernel_info *info,
+                                       paddr_t addr, paddr_t size)
+{
+    /* https://www.kernel.org/doc/Documentation/riscv/boot-image-header.rst */
+    struct {
+        uint32_t code0;         /* Executable code */
+        uint32_t code1;         /* Executable code */
+        uint64_t text_offset;   /* Image load offset, little endian */
+        uint64_t image_size;    /* Effective Image size, little endian */
+        uint64_t flags;         /* kernel flags, little endian */
+        uint32_t version;       /* Version of this header */
+        uint32_t res1;          /* Reserved */
+        uint64_t res2;          /* Reserved */
+        uint64_t magic;         /* Deprecated: Magic number, little endian, "RISCV" */
+        uint32_t magic2;        /* Magic number 2, little endian, "RSC\x05" */
+        uint32_t res3;          /* Reserved for PE COFF offset */
+    } image;
+    uint64_t effective_size;
+
+    if ( size < sizeof(image) )
+        return -EINVAL;
+
+    copy_from_paddr(&image, addr, sizeof(image));
+
+    /* Magic v1 is deprecated and may be removed.  Only use v2 */
+    if ( le32_to_cpu(image.magic2) != IMAGE64_MAGIC_V2 )
+        return -EINVAL;
+
+    effective_size = le64_to_cpu(image.image_size);
+
+    if ( !effective_size )
+        return -EINVAL;
+
+    info->image.kernel_addr = addr;
+    /* Actual size in the binary file */
+    info->image.len = size;
+    /* Total memory the kernel occupies at runtime */
+    info->image.image_size = effective_size;
+    info->image.text_offset = le64_to_cpu(image.text_offset);
+    info->image.start = 0;
+
+    info->load = kernel_image_load;
+
+    return 0;
+}
+
+int __init kernel_image_probe(struct kernel_info *info, paddr_t addr,
+                              paddr_t size)
+{
+#ifdef CONFIG_RISCV_64
+    return kernel_image64_probe(info, addr, size);
+#else
+#   error "Only 64-bit RISC-V is supported"
+#endif
+}
diff --git a/xen/include/xen/fdt-kernel.h b/xen/include/xen/fdt-kernel.h
index 8cd1670c2c..00c37be101 100644
--- a/xen/include/xen/fdt-kernel.h
+++ b/xen/include/xen/fdt-kernel.h
@@ -59,8 +59,15 @@ struct kernel_info {
         struct {
             paddr_t kernel_addr;
             paddr_t len;
-#if defined(CONFIG_ARM_64) || defined(CONFIG_RISCV_64)
-            paddr_t text_offset; /* 64-bit Image only */
+#if defined(CONFIG_ARM_64) || defined(CONFIG_RISCV)
+            /*
+             * ARM: 64-bit Image only.
+             * RISC-V: both 32-bit and 64-bit Images.
+             */
+            paddr_t text_offset;
+#endif
+#if defined(CONFIG_RISCV)
+            size_t image_size; /* Effective size of Image */
 #endif
             paddr_t start; /* Must be 0 for 64-bit Image */
         } image;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312892.1583063 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2h-0004Ow-Qc; Tue, 19 May 2026 11:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312892.1583063; Tue, 19 May 2026 11:55:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2h-0004Oo-O3; Tue, 19 May 2026 11:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1312892;
 Tue, 19 May 2026 11:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ2g-0004Og-IG
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2g-00D9ZC-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2g-00DwXI-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sL2agX8Ej/pJn5WRgNZ0TIWnX/r0wTYKA28LfO/pt/A=; b=nD8mQ1dR5u9w+cMAHb7obeuvQk
	OVNiXXLwqrq3bD3/Mt1ZzAfIYH5bXOEJRz9ec1f5wk8WSBiGSIBRxh92i7X/SIduMweN+8LOBcANY
	18jWC34iccpaXP+qYnSYRJG0ew9ETQ8JIWYWxQ5azIgRpjM2axpdABHKQ+O0IAjpNdYw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: rework G-stage mode handling
Message-Id: <E1wPJ2g-00DwXI-1c@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:22 +0000

commit 551e864360e1e4925e8b488f78eab70cb3c88487
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:47 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:15 2026 +0200

    xen/riscv: rework G-stage mode handling
    
    Rework G-stage mode handling to make the selected mode descriptor
    reusable outside of p2m initialization, both for filling CPU nodes in
    the device tree passed to dom0less guests and for per-domain G-stage
    mode selection at domain creation time.
    
    Promote gstage_modes[] from a local __initconst variable inside
    gstage_mode_detect() to a file-scope static const array, and convert
    max_gstage_mode from an embedded struct (assigned by value) to a global
    const pointer into gstage_modes[]. This allows referencing both the mode
    identifier and the mode name after init without copying the descriptor.
    Remove get_max_supported_mode(); its callers now dereference
    max_gstage_mode->mode directly.
    
    Change struct p2m_domain::mode from an embedded gstage_mode_desc to a
    const pointer into gstage_modes[], so each domain shares the descriptor
    rather than carrying its own copy.
    
    Adjust the gstage_modes[] entries in three ways:
     - Use lowercase names without the "x4" suffix (e.g. "sv39" instead of
       "Sv39x4"). The DT mmu-type binding [1] does not include the suffix,
       so the name can now be passed directly to the guest without
       transformation. The suffix is appended only in the diagnostic
       printk, where it remains informative.
     - Use "none" for Bare mode (HGATP_MODE_OFF) to match the DT binding.
     - Change paging_levels to represent the root page-table level index
       (i.e. total paging levels minus one) rather than the total count.
       P2M_ROOT_LEVEL() now returns the correct VPN index directly, without
       requiring callers to subtract one or use hardcoded offsets.
    
    Add gstage_mode to xen_arch_domainconfig so the toolstack can
    request a specific G-stage mode at domain creation time. Introduce
    find_gstage_mode() to resolve a mode descriptor by HGATP_MODE_*,
    capping the result at max_gstage_mode to prevent requesting a mode
    the hardware does not support. Update p2m_init() to accept a
    xen_domctl_createdomain pointer and call find_gstage_mode()
    instead of hardcoding Sv39x4.
    
    Add arch_parse_dom0less_node() in a new dom0less-build.c to read the
    "mmu-type" DT property from a guest domain node and store it in
    boot_domain::create_cfg.arch.gstage_mode, falling back to maximum
    supported mode when the property is absent.
    
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/riscv/cpus.yaml?h=v6.19-rc3#n82
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile          |   1 +
 xen/arch/riscv/dom0less-build.c  |  71 +++++++++++++++++++++++
 xen/arch/riscv/include/asm/p2m.h |  18 ++++--
 xen/arch/riscv/p2m.c             | 121 ++++++++++++++++++++++++++-------------
 xen/arch/riscv/vmid.c            |   2 +-
 xen/include/public/arch-riscv.h  |   5 ++
 6 files changed, 172 insertions(+), 46 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index eecdcbc768..8f7fd625dd 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
 obj-y += domain.o
+obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += extable.o
diff --git a/xen/arch/riscv/dom0less-build.c b/xen/arch/riscv/dom0less-build.c
new file mode 100644
index 0000000000..a683972e92
--- /dev/null
+++ b/xen/arch/riscv/dom0less-build.c
@@ -0,0 +1,71 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bootfdt.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+
+#include <asm/p2m.h>
+
+int __init arch_parse_dom0less_node(struct dt_device_node *node,
+                                    struct boot_domain *bd)
+{
+    const char *mmu_type;
+    unsigned long bits;
+    const char *end;
+
+    if ( dt_property_read_string(node, "mmu-type", &mmu_type) )
+    {
+        dprintk(XENLOG_WARNING, "mmu-type property is missing in guest domain "
+                "node. %s will be used as fallback\n", max_gstage_mode->name);
+
+        bits = P2M_GFN_LEVEL_SHIFT(max_gstage_mode->paging_levels + 1);
+
+        goto out;
+    }
+
+    if ( !strcasecmp(mmu_type, "riscv,none") )
+    {
+        dprintk(XENLOG_ERR, "Bare mode isn't supported by Xen\n");
+
+        return -EOPNOTSUPP;
+    }
+
+    if ( strncasecmp(mmu_type, "riscv,sv", 8) )
+    {
+        dprintk(XENLOG_ERR, "mmu-type value \"%s\" is incorrect\n", mmu_type);
+
+        return -EINVAL;
+    }
+
+    bits = simple_strtoul(mmu_type + 8, &end, 10);
+    if ( (*end != '\0') || (end == mmu_type + 8) )
+    {
+        dprintk(XENLOG_ERR, "mmu-type value \"%s\" is incorrect\n", mmu_type);
+
+        return -EINVAL;
+    }
+
+ out:
+    if ( bits > (UINT8_MAX - P2M_ROOT_EXTRA_BITS) )
+    {
+        dprintk(XENLOG_ERR, "gstage addr bits value overflows uint8\n");
+
+        return -EINVAL;
+    }
+
+    /*
+     * The mmu-type property may specify any riscv,sv<N> string, but only the
+     * following are currently supported:
+     *  - riscv,sv32
+     *  - riscv,sv39
+     *  - riscv,sv48
+     *  - riscv,sv57
+     * Any other value will be rejected by find_gstage_mode().
+     *
+     * P2M_ROOT_EXTRA_BITS is added because for G-stage mode, GPAs are
+     * extended by that many bits.
+     */
+    bd->create_cfg.arch.gaddr_bits = bits + P2M_ROOT_EXTRA_BITS;
+
+    return 0;
+}
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 54ea67990f..638c60ddc2 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -13,7 +13,7 @@
 
 #define P2M_ROOT_ORDER  (ilog2(GSTAGE_ROOT_PAGE_TABLE_SIZE) - PAGE_SHIFT)
 #define P2M_ROOT_PAGES  BIT(P2M_ROOT_ORDER, U)
-#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode.paging_levels)
+#define P2M_ROOT_LEVEL(p2m) ((p2m)->mode->paging_levels)
 
 /*
  * According to the RISC-V spec:
@@ -32,10 +32,13 @@
  */
 #define P2M_LEVEL_ORDER(lvl) XEN_PT_LEVEL_ORDER(lvl)
 
-#define P2M_ROOT_EXTRA_BITS(p2m, lvl) (2 * ((lvl) == P2M_ROOT_LEVEL(p2m)))
+#define P2M_ROOT_EXTRA_BITS 2
+
+#define P2M_LEVEL_EXTRA_BITS(p2m, lvl) \
+    (P2M_ROOT_EXTRA_BITS * ((lvl) == P2M_ROOT_LEVEL(p2m)))
 
 #define P2M_PAGETABLE_ENTRIES(p2m, lvl) \
-    (BIT(PAGETABLE_ORDER + P2M_ROOT_EXTRA_BITS(p2m, lvl), UL))
+    (BIT(PAGETABLE_ORDER + P2M_LEVEL_EXTRA_BITS(p2m, lvl), UL))
 
 #define P2M_TABLE_OFFSET(p2m, lvl) (P2M_PAGETABLE_ENTRIES(p2m, lvl) - 1UL)
 
@@ -55,6 +58,8 @@ struct gstage_mode_desc {
     char name[8];
 };
 
+extern const struct gstage_mode_desc *max_gstage_mode;
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /*
@@ -68,7 +73,7 @@ struct p2m_domain {
     /* The root of the p2m tree. May be concatenated */
     struct page_info *root;
 
-    struct gstage_mode_desc mode;
+    const struct gstage_mode_desc *mode;
 
     /* Back pointer to domain */
     struct domain *domain;
@@ -215,9 +220,10 @@ static inline bool arch_acquire_resource_check(struct domain *d)
 }
 
 void guest_mm_init(void);
-unsigned char get_max_supported_mode(void);
 
-int p2m_init(struct domain *d);
+struct xen_domctl_createdomain;
+
+int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config);
 
 static inline void p2m_write_lock(struct p2m_domain *p2m)
 {
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index adcf292a70..f889978cf7 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -45,12 +45,28 @@ struct p2m_pte_ctx {
     unsigned int level;          /* Paging level at which the PTE resides. */
 };
 
-static struct gstage_mode_desc __ro_after_init max_gstage_mode = {
-    .mode = HGATP_MODE_OFF,
-    .paging_levels = 0,
-    .name = "Bare",
+/* Values should be sorted by ->mode in this array */
+static const struct gstage_mode_desc gstage_modes[] = {
+    /*
+     * Based on the RISC-V spec:
+     *   Bare mode is always supported, regardless of SXLEN.
+     *   When SXLEN=32, the only other valid setting for MODE is Sv32.
+     *   When SXLEN=64, three paged virtual-memory schemes are defined:
+     *   Sv39, Sv48, and Sv57.
+     */
+    { HGATP_MODE_OFF,    0, "none" },
+#ifdef CONFIG_RISCV_32
+    { HGATP_MODE_SV32X4, 1, "sv32" },
+#else
+    { HGATP_MODE_SV39X4, 2, "sv39" },
+    { HGATP_MODE_SV48X4, 3, "sv48" },
+    { HGATP_MODE_SV57X4, 4, "sv57" },
+#endif
 };
 
+const struct gstage_mode_desc *__ro_after_init max_gstage_mode =
+    &gstage_modes[0];
+
 static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
 
 static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
@@ -63,11 +79,6 @@ static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
     }
 }
 
-unsigned char get_max_supported_mode(void)
-{
-    return max_gstage_mode.mode;
-}
-
 /*
  * If anything is changed here, it may also require updates to
  * p2m_{get,set}_type().
@@ -148,41 +159,24 @@ static pte_t *p2m_get_root_pointer(struct p2m_domain *p2m, gfn_t gfn)
 
 static void __init gstage_mode_detect(void)
 {
-    static const struct gstage_mode_desc modes[] __initconst = {
-        /*
-         * Based on the RISC-V spec:
-         *   Bare mode is always supported, regardless of SXLEN.
-         *   When SXLEN=32, the only other valid setting for MODE is Sv32.
-         *   When SXLEN=64, three paged virtual-memory schemes are defined:
-         *   Sv39, Sv48, and Sv57.
-         */
-#ifdef CONFIG_RISCV_32
-        { HGATP_MODE_SV32X4, 2, "Sv32x4" }
-#else
-        { HGATP_MODE_SV39X4, 3, "Sv39x4" },
-        { HGATP_MODE_SV48X4, 4, "Sv48x4" },
-        { HGATP_MODE_SV57X4, 5, "Sv57x4" },
-#endif
-    };
-
-    for ( unsigned int mode_idx = ARRAY_SIZE(modes); mode_idx-- > 0; )
+    for ( unsigned int mode_idx = ARRAY_SIZE(gstage_modes); mode_idx-- > 0; )
     {
-        unsigned long mode = modes[mode_idx].mode;
+        unsigned long mode = gstage_modes[mode_idx].mode;
 
         csr_write(CSR_HGATP, MASK_INSR(mode, HGATP_MODE_MASK));
 
         if ( MASK_EXTR(csr_read(CSR_HGATP), HGATP_MODE_MASK) == mode )
         {
-            max_gstage_mode = modes[mode_idx];
+            max_gstage_mode = &gstage_modes[mode_idx];
 
             break;
         }
     }
 
-    if ( max_gstage_mode.mode == HGATP_MODE_OFF )
+    if ( max_gstage_mode->mode == HGATP_MODE_OFF )
         panic("Xen expects that G-stage won't be Bare mode\n");
 
-    printk("Max supported G-stage mode is %s\n", max_gstage_mode.name);
+    printk("Max supported G-stage mode is %sx4\n", max_gstage_mode->name);
 
     csr_write(CSR_HGATP, 0);
 
@@ -283,7 +277,7 @@ static void clear_and_clean_page(struct page_info *page, bool clean_dcache)
 unsigned long construct_hgatp(const struct p2m_domain *p2m, uint16_t vmid)
 {
     return MASK_INSR(mfn_x(page_to_mfn(p2m->root)), HGATP_PPN_MASK) |
-           MASK_INSR(p2m->mode.mode, HGATP_MODE_MASK) |
+           MASK_INSR(p2m->mode->mode, HGATP_MODE_MASK) |
            MASK_INSR(vmid, HGATP_VMID_MASK);
 }
 
@@ -331,8 +325,35 @@ static int p2m_alloc_root_table(struct p2m_domain *p2m)
     return 0;
 }
 
-int p2m_init(struct domain *d)
+static const struct gstage_mode_desc *find_gstage_mode(
+    unsigned char gpa_bits)
+{
+    ASSERT(gstage_modes[0].mode == HGATP_MODE_OFF);
+
+    for ( unsigned int i = 1; i < ARRAY_SIZE(gstage_modes); i++ )
+    {
+        unsigned int lvl = gstage_modes[i].paging_levels + 1;
+        unsigned int bits = P2M_GFN_LEVEL_SHIFT(lvl) + P2M_ROOT_EXTRA_BITS;
+
+        if ( gpa_bits == bits )
+        {
+            if ( gstage_modes[i].mode > max_gstage_mode->mode )
+                return NULL;
+            return &gstage_modes[i];
+        }
+    }
+
+    return NULL;
+}
+
+int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
 {
+    /*
+     * TODO: This static is a temporary constraint: all guests must use the
+     * same MMU mode because p2m_gpa_bits is not yet per-domain.
+     * Drop this once per-domain p2m_gpa_bits is introduced.
+     */
+    static const struct gstage_mode_desc __ro_after_init *m = &gstage_modes[0];
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
 
     /*
@@ -341,6 +362,33 @@ int p2m_init(struct domain *d)
      */
     p2m->domain = d;
 
+    if ( !config )
+    {
+        dprintk(XENLOG_ERR, "NULL config is passed\n");
+        return -EINVAL;
+    }
+
+    p2m->mode = find_gstage_mode(config->arch.gaddr_bits);
+
+    if ( !p2m->mode )
+    {
+        dprintk(XENLOG_ERR,
+                "Unsupported or unavailable gstage addr bits: %u\n",
+                config->arch.gaddr_bits);
+
+        return -EINVAL;
+    }
+
+    if ( m->mode == HGATP_MODE_OFF )
+        m = p2m->mode;
+
+    if ( m != p2m->mode )
+    {
+        dprintk(XENLOG_ERR,
+                "Mode should be the same for all guests at the moment\n");
+        return -EINVAL;
+    }
+
     paging_domain_init(d);
 
     rwlock_init(&p2m->lock);
@@ -362,11 +410,6 @@ int p2m_init(struct domain *d)
 #   error "Add init of p2m->clean_dcache"
 #endif
 
-    /* TODO: don't hardcode used for a domain g-stage mode. */
-    p2m->mode.mode = HGATP_MODE_SV39X4;
-    p2m->mode.paging_levels = 2;
-    safe_strcpy(p2m->mode.name, "Sv39x4");
-
     return 0;
 }
 
@@ -1304,7 +1347,7 @@ static mfn_t p2m_get_entry(struct p2m_domain *p2m, gfn_t gfn,
 {
     unsigned int level = P2M_ROOT_LEVEL(p2m);
     unsigned int gfn_limit_bits =
-        P2M_LEVEL_ORDER(level + 1) + P2M_ROOT_EXTRA_BITS(p2m, level);
+        P2M_LEVEL_ORDER(level + 1) + P2M_LEVEL_EXTRA_BITS(p2m, level);
     pte_t entry, *table;
     int rc;
     mfn_t mfn = INVALID_MFN;
diff --git a/xen/arch/riscv/vmid.c b/xen/arch/riscv/vmid.c
index 8fbcd500f2..11c7e9d6d6 100644
--- a/xen/arch/riscv/vmid.c
+++ b/xen/arch/riscv/vmid.c
@@ -52,7 +52,7 @@ static DEFINE_PER_CPU(struct vmid_data, vmid_data);
 static unsigned int vmidlen_detect(void)
 {
     unsigned int vmid_bits;
-    unsigned char gstage_mode = get_max_supported_mode();
+    unsigned char gstage_mode = max_gstage_mode->mode;
 
     /*
      * According to the RISC-V Privileged Architecture Spec:
diff --git a/xen/include/public/arch-riscv.h b/xen/include/public/arch-riscv.h
index 360d8e6871..1990a1eb74 100644
--- a/xen/include/public/arch-riscv.h
+++ b/xen/include/public/arch-riscv.h
@@ -56,6 +56,11 @@ typedef struct vcpu_guest_context vcpu_guest_context_t;
 DEFINE_XEN_GUEST_HANDLE(vcpu_guest_context_t);
 
 struct xen_arch_domainconfig {
+    /*
+     * G-stage GPA address width in bits.
+     * Valid values: 34 (sv32x4), 41 (sv39x4), 50 (sv48x4), 59 (sv57x4).
+     */
+    uint8_t gaddr_bits;
 };
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312893.1583067 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2r-0004S5-TH; Tue, 19 May 2026 11:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312893.1583067; Tue, 19 May 2026 11:55:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ2r-0004Rx-Qf; Tue, 19 May 2026 11:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1312893;
 Tue, 19 May 2026 11:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ2q-0004Rr-Lu
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2q-00D9ZH-24
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ2q-00DwXg-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=t9Tkq8eaItGxPvKeoPDK89Os85RvEX4mh5TT8L6mY5c=; b=K9tACd9zrKyNyFC98Htg/XUar9
	5RwQWsnMJuWng6aVG2CBuQiuND1l5wIoXvhBErObui8LTIYzRmfESh5c+dJmvXf0Y2fNZyP3h8dkK
	GM4CSrIR2pv2eA9FX71DzxDXOuVzb1GFAaFNGpbNgPOoJQf682CVCjTZb361kqSXpRTs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: introduce p2m_gpa_bits
Message-Id: <E1wPJ2q-00DwXg-1u@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:32 +0000

commit 7fe550548152905be9209c313f40f1ea6cac0211
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:27 2026 +0200

    xen/riscv: introduce p2m_gpa_bits
    
    common/device-tree/domain-build.c uses p2m_gpa_bits to determine the
    upper bound of the GPA space when searching for unused regions, so it
    must be defined when CONFIG_DOMAIN_BUILD_HELPERS=y.
    
    The variable is initialised to PADDR_BITS and narrowed in p2m_init() to
    the GPA width of the selected G-stage mode, allowing an external entity
    (e.g. an IOMMU) to restrict it further if needed.
    
    p2m_gpa_bits is a global rather than a per-domain value, which is
    acceptable for now because all domains are required to use the same
    G-stage MMU mode, as dom0less common code allocates it per all
    domains.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/p2m.h |  3 +++
 xen/arch/riscv/p2m.c             | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index 638c60ddc2..0d1dace1a0 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -47,6 +47,9 @@
 #define P2M_LEVEL_MASK(p2m, lvl) \
     (P2M_TABLE_OFFSET(p2m, lvl) << P2M_GFN_LEVEL_SHIFT(lvl))
 
+/* Holds the bit size of GPAs in p2m tables */
+extern unsigned int p2m_gpa_bits;
+
 #define paddr_bits PADDR_BITS
 
 /* Get host p2m table */
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index f889978cf7..703b9f4d25 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -11,6 +11,8 @@
 #include <xen/sections.h>
 #include <xen/xvmalloc.h>
 
+#include <public/domctl.h>
+
 #include <asm/cpufeature.h>
 #include <asm/csr.h>
 #include <asm/flushtlb.h>
@@ -67,6 +69,12 @@ static const struct gstage_mode_desc gstage_modes[] = {
 const struct gstage_mode_desc *__ro_after_init max_gstage_mode =
     &gstage_modes[0];
 
+/*
+ * Set to the maximum configured support for GPA bits, so the number of GPA
+ * bits can be restricted by an external entity (e.g. IOMMU).
+ */
+unsigned int __ro_after_init p2m_gpa_bits = PADDR_BITS;
+
 static void p2m_free_page(struct p2m_domain *p2m, struct page_info *pg);
 
 static inline void p2m_free_metadata_page(struct p2m_domain *p2m,
@@ -355,6 +363,7 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
      */
     static const struct gstage_mode_desc __ro_after_init *m = &gstage_modes[0];
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
+    unsigned int gpa_bits;
 
     /*
      * "Trivial" initialisation is now complete.  Set the backpointer so the
@@ -410,6 +419,12 @@ int p2m_init(struct domain *d, const struct xen_domctl_createdomain *config)
 #   error "Add init of p2m->clean_dcache"
 #endif
 
+    gpa_bits = P2M_GFN_LEVEL_SHIFT(p2m->mode->paging_levels + 1) +
+               P2M_ROOT_EXTRA_BITS;
+
+    if ( gpa_bits < p2m_gpa_bits )
+        p2m_gpa_bits = gpa_bits;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312894.1583072 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ31-0004Ug-V6; Tue, 19 May 2026 11:55:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312894.1583072; Tue, 19 May 2026 11:55:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ31-0004UY-S0; Tue, 19 May 2026 11:55:43 +0000
Received: by outflank-mailman (input) for mailman id 1312894;
 Tue, 19 May 2026 11:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ30-0004US-P5
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ30-00D9ZP-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ30-00DwaU-2G
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+qYBql+hzK58FvIT948qiTPj7vQU1wzMIxWgUlVXwis=; b=gi8+bBz22uWic8JTPAMTff3tfX
	qTh3hVibByQnK4wwhWik9oSWVxMNKc3uo1kciDve2FzHpixX2NK3lcDjYLv/XjckIeBX3N+MG60Mr
	6Yp6ssMNaGyP+8aOBXOHSYChK0I64nn+bmXTuEOuL1xSXrFDb00ekBGxJXkiu3M694Qs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add definition of guest RAM banks
Message-Id: <E1wPJ30-00DwaU-2G@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:42 +0000

commit 157b67ca642e7dd629d8aca0cd82dfa8005bf5c2
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:49 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:44 2026 +0200

    xen/riscv: add definition of guest RAM banks
    
    The dom0less solution uses defined RAM banks as compile-time constants,
    so introduce macros to describe guest RAM banks.
    
    The reason for 2 banks is that there is typically always a use case for
    low memory under 4 GB, but the bank under 4 GB ends up being small because
    there are other things under 4 GB it can conflict with (interrupt
    controller, PCI BARs, etc.). So a second bank is added above that MMIO
    region (starting at 8 GiB) to provide the remaining RAM; the gap between
    the two banks also exercises code paths handling discontiguous memory.
    For Sv32 guests (34-bit GPA, 16 GiB addressable), bank0 provides 2 GB
    (2–4 GB) and the first 8 GB of bank1 (8–16 GB) is accessible.
    
    Extended regions are useful for RISC-V: they could be used to provide a
    "space" for Linux to map grant mappings.
    
    Despite the fact that for every guest MMU mode the GPA could be up
    to 56 bits wide (except Sv32 whose GPA is 34 bits), the combined size
    of both banks is limited to 1018 GB as it is more than enough for most
    use cases.
    
    Add inclusion of asm/guest-layout.h to asm/domain.h to make dom0less
    common code build happy.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/domain.h       |  1 +
 xen/arch/riscv/include/asm/guest-layout.h | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 6c48bf1311..6044ce0fee 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -7,6 +7,7 @@
 #include <xen/xmalloc.h>
 #include <public/hvm/params.h>
 
+#include <asm/guest-layout.h>
 #include <asm/p2m.h>
 #include <asm/vtimer.h>
 
diff --git a/xen/arch/riscv/include/asm/guest-layout.h b/xen/arch/riscv/include/asm/guest-layout.h
new file mode 100644
index 0000000000..68d95a0939
--- /dev/null
+++ b/xen/arch/riscv/include/asm/guest-layout.h
@@ -0,0 +1,23 @@
+#ifndef ASM_RISCV_GUEST_LAYOUT_H
+#define ASM_RISCV_GUEST_LAYOUT_H
+
+#include <public/xen.h>
+
+#define GUEST_RAM_BANKS   2
+
+/*
+ * The way to find the extended regions (to be exposed to the guest as unused
+ * address space) relies on the fact that the regions reserved for the RAM
+ * below are big enough to also accommodate such regions.
+ */
+#define GUEST_RAM0_BASE   xen_mk_ullong(0x80000000) /* 2GB of low RAM @ 2GB */
+#define GUEST_RAM0_SIZE   xen_mk_ullong(0x80000000)
+
+#define GUEST_RAM1_BASE   xen_mk_ullong(0x0200000000) /* 1016 GB of RAM @ 8GB */
+#define GUEST_RAM1_SIZE   xen_mk_ullong(0xFE00000000)
+
+/* TODO: allocate these all dynamically */
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
+
+#endif /* ASM_RISCV_GUEST_LAYOUT_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312895.1583075 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3B-0004XF-W5; Tue, 19 May 2026 11:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312895.1583075; Tue, 19 May 2026 11:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3B-0004X7-TQ; Tue, 19 May 2026 11:55:53 +0000
Received: by outflank-mailman (input) for mailman id 1312895;
 Tue, 19 May 2026 11:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ3A-0004X0-RZ
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3A-00D9ZT-2f
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3A-00Dwas-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rKCcfKA/Yont7x0+7a5IooCSCI9FDgCCf7jZ6AjMNdA=; b=lLLt65GKhT6iHMdfchqEbvebM0
	AX5jqkQWVbB6R9aw6aF7q58YRT8QNEnpUIjiBIXQ6H/8z/j4nVPk8amU9eTjjGQ9Te/JTnAqjQVmW
	GnPPgjBeuq+Pth63J7LijK5nOeIRri01ecMv3fPjRsHNHJ1oKG2d/incXOCZ3cr6rNf8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: enable DOMAIN_BUILD_HELPERS
Message-Id: <E1wPJ3A-00Dwas-2Z@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:55:52 +0000

commit f2c7c9004ad71d34797dbe77de2d496b8bd7133d
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu May 7 10:58:50 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 09:32:57 2026 +0200

    xen/riscv: enable DOMAIN_BUILD_HELPERS
    
    Everything is ready to enable DOMAIN_BUILD_HELPER which are necessary
    for dom0less common code. So enable it.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index a5e87c1757..41426c2052 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,5 +1,6 @@
 config RISCV
 	def_bool y
+	select DOMAIN_BUILD_HELPERS
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select GENERIC_UART_INIT
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312896.1583078 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3M-0004ZN-1H; Tue, 19 May 2026 11:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312896.1583078; Tue, 19 May 2026 11:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3L-0004ZF-V1; Tue, 19 May 2026 11:56:03 +0000
Received: by outflank-mailman (input) for mailman id 1312896;
 Tue, 19 May 2026 11:56:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ3K-0004Z7-UI
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:56:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3K-00D9Zm-2v
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3K-00Dwc1-2q
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:56:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=8DW6Llx5zQnE8q4NqxGtFAGqhaERegPmCanVsBukyYA=; b=bcHP1lE694yBIgjmiAlDjT98Tp
	e/FmxSOldMym3/WS/31ZG4LY8NtVE7k4TKTcNhPTCToXJWa1GwJhs4InciIftB1VBjNUn07fCeKoA
	DDQCUfEdX7EBvlIYim91Ahk6My6gxZ1D6Y2XtQ+mUcNv+1S09GnlxW0XiRXGSKYarGH4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2
Message-Id: <E1wPJ3K-00Dwc1-2q@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:56:02 +0000

commit 5e1f756fb747aa51d763b40abc5d41e598dbdcee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 09:34:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 10:59:46 2026 +0200

    x86/MCE: adjust ID2COOKIE() for Misra C:2012 rule 11.2
    
    ... ("Conversions shall not be performed between a pointer to an
    incomplete type and any other type"): Add an intermediate cast to void *.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/cpu/mcheck/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c4b3b687a2..64fa66f026 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1264,7 +1264,8 @@ static void cf_check __maybe_unused x86_mc_mceinject(void *data)
 
 #if BITS_PER_LONG == 64
 
-#define ID2COOKIE(id) ((mctelem_cookie_t)(id))
+/* Two layers of casting to cover Misra C:2012 rule 11.2. */
+#define ID2COOKIE(id) ((mctelem_cookie_t)(void *)(id))
 #define COOKIE2ID(c) ((uint64_t)(c))
 
 #elif defined(BITS_PER_LONG)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 11:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 11:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1312897.1583082 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3W-0004bP-2j; Tue, 19 May 2026 11:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1312897.1583082; Tue, 19 May 2026 11:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPJ3W-0004bH-06; Tue, 19 May 2026 11:56:14 +0000
Received: by outflank-mailman (input) for mailman id 1312897;
 Tue, 19 May 2026 11:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPJ3V-0004b9-0x
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 11:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3V-00D9a7-00
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPJ3U-00DwcR-36
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 11:56:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KbRFZf3nS3X2I5Gk+Jy1aEoe9UsMy4lIbj9BCdcSq0M=; b=flsc7z4ftkcM3qTO56o0KMdvvW
	Mqjss5mQkx8myoFmafhQgfNXMsdyKom/lTZQ48If+hZAwPZ1+UlhKwczhmbUX75digUZkKINc0Nj5
	0ZDgPP7x7m6gzztRRD/D59nzHxk35REzUnDHMnwIKYHfpsRsUOAhHFE+YUFFsUAA8Xi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shim: annotate for Misra C:2012 rule 20.12
Message-Id: <E1wPJ3U-00DwcR-36@xenbits.xenproject.org>
Date: Tue, 19 May 2026 11:56:12 +0000

commit d6fb54fa71926e2ab44ccd84f968ec9228319d65
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 09:35:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 10:59:46 2026 +0200

    x86/shim: annotate for Misra C:2012 rule 20.12
    
    ... ("A macro parameter used as an operand to the `#' or `##' operators,
    which is itself subject to further macro replacement, shall only be used
    as an operand to these operators"). Leverage the SAF-6 annotation we have
    available.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/pv/shim.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index bd29c53a2d..41000b0523 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -124,8 +124,10 @@ void __init pv_shim_fixup_e820(void)
     ASSERT(i < ARRAY_SIZE(reserved_pages));     \
     reserved_pages[i++].mfn = pfn;              \
 })
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     MARK_PARAM_RAM(HVM_PARAM_STORE_PFN);
     if ( !pv_console )
+        /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
         MARK_PARAM_RAM(HVM_PARAM_CONSOLE_PFN);
 #undef MARK_PARAM_RAM
 }
@@ -207,10 +209,14 @@ void __init pv_shim_setup_dom(struct domain *d, l4_pgentry_t *l4start,
         evtchn_reserve(d, param);                                              \
     }                                                                          \
 })
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_STORE_PFN, si->store_mfn, store_va);
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_STORE_EVTCHN, si->store_evtchn, 0);
+    /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
     SET_AND_MAP_PARAM(HVM_PARAM_CONSOLE_EVTCHN, si->console.domU.evtchn, 0);
     if ( !pv_console )
+        /* SAF-6-safe Rule 20.12 expansion of macros HVM_PARAM_*. */
         SET_AND_MAP_PARAM(HVM_PARAM_CONSOLE_PFN, si->console.domU.mfn,
                           console_va);
 #undef SET_AND_MAP_PARAM
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313010.1583159 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZD-0006an-N1; Tue, 19 May 2026 13:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313010.1583159; Tue, 19 May 2026 13:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZD-0006ae-KR; Tue, 19 May 2026 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1313010;
 Tue, 19 May 2026 13:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKZC-0006aY-BZ
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZC-00DBUe-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZC-00E1Sf-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lvrwQTFVHtPQ0IzD1UUaiTYHVIQ490p3fmC37SjbKRE=; b=KGeXNfStcT8/MPE53OrWIXdftp
	vmn8Vl6xVAQ1U/6egjcAU3GrCZe9rpoZyydEGAmPPTnOW8EOWnyWevYgUd//49r8eerKAY0v/QrzJ
	MwCtVVzv8lw+o6WN56suuj2EkumSanwT7VthLih5ueYVucPDWUspZPf2Xw6s7iTAjFnM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wPKZC-00E1Sf-0f@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:02 +0000

commit 937d1c7368d83af809d05f9ce4afd454aa9ecd81
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:37:41 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:37:41 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 93acfeb78b508984aa815d00629cc8b6b90dc047
    master date: 2026-05-05 08:27:29 +0200
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index 914661312d..3908644e55 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -118,7 +118,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -130,12 +130,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -412,10 +415,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -697,18 +701,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1456,7 +1460,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1617,21 +1621,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 98f1db2349..79754353c8 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -399,12 +399,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index d6221802bf..a3d982ce6e 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1043,15 +1043,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1457,7 +1458,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1618,7 +1619,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1709,8 +1710,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 3dfbb5297a..0dbeccec21 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bae4ff339..5680d299e7 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -515,7 +515,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2655,7 +2655,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2707,11 +2707,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3014,7 +3009,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index bc4818c943..cc41326208 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313011.1583163 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZN-0006cZ-Oi; Tue, 19 May 2026 13:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313011.1583163; Tue, 19 May 2026 13:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZN-0006cP-Lp; Tue, 19 May 2026 13:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1313011;
 Tue, 19 May 2026 13:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKZM-0006cD-Cc
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZM-00DBV6-1A
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZM-00E1UM-0z
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vDupnrCR5uluKraARahNMbygiHRgArGmcW5r0fVyP3c=; b=3/vBCfB8XgfvNCdEWijJOXA46E
	e/Wx38tWk8rgkrVDVDfBs5gHk9tUOfThPU6hnPumD7Ucf7HAp7q0N8W+AjooYuJC+U3CYg3zOTqFS
	qrZAwRH19SlyFroprHtE4Lf1VApbyXocpJ1XGqKakImL6wmnsm1ykMbXkXbCv2V6nKMs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wPKZM-00E1UM-0z@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:12 +0000

commit 869ef9bbf5ebef87e857e2206831f066081c7782
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:38:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:18 2026 +0200

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: acfd2631b95e29fd68b98d902a1663e07474ed5f
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 3dc8de3114..e0c320e165 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -904,10 +904,19 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_PL0_SSP,
                (unsigned long)stack + (PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8);
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
         asm volatile ("setssbsy" ::: "memory");
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313013.1583176 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZY-0006tB-0z; Tue, 19 May 2026 13:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313013.1583176; Tue, 19 May 2026 13:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZX-0006t3-UF; Tue, 19 May 2026 13:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1313013;
 Tue, 19 May 2026 13:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKZW-0006sU-Hf
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZW-00DBVK-1S
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZW-00E1WH-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=naHa1KmOQHgK1kIV1jkLvG/uqX3Gwi10Z8Ta5JuosOo=; b=FSXdWfkR1frBvmd+NEnsUn0Ejt
	bl5YT9aR5jOHHfvSrD07cEkHbzVCxLc2j12W8/7Ppwq6XoOj9SaSznRjjAAX1Y4p8QNhVYEmqHqDt
	kgqr9aA1e340lP2rXBYfNS7uiqEEjgKnmEr8v4GARCHCAZLBuP+JGgRbmJ8TPWapOZvk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wPKZW-00E1WH-1L@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:22 +0000

commit d006fa109f65f8141cb77888980f85cb65493bab
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:38:37 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:37 2026 +0200

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3e6bca616b344aaa62602fcef0021255d467c2fd
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 62905c2c7a..8bb829a13d 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2549,6 +2549,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313015.1583180 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZi-0006zn-2R; Tue, 19 May 2026 13:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313015.1583180; Tue, 19 May 2026 13:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZh-0006zf-Vy; Tue, 19 May 2026 13:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1313015;
 Tue, 19 May 2026 13:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKZg-0006xo-IJ
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZg-00DBVO-1j
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZg-00E1Wl-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MwjiaETjfA5EJFaQudfoc+s2kv6fI6lSRIHelEgQGAk=; b=O2YMOIsmJX26QjAeGa/fDgy/Er
	p9Rv3kisbDlrQ2QXPGsoPiVZycqj9AJ2To4X2HvaS1D+3FzfXRjebKeIfXafkjxfESQXCCJTCr0+R
	8acKuMwKpeInCaR0waMVlmL3k8rUrwK95C/D+yL58S3cRb1a2eTUC5sCvmEejcVGAizg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wPKZg-00E1Wl-1c@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:32 +0000

commit a99d16079d9bd570a7c6487ed491a1edc4960e49
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:38:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:38:55 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 96ffccef5a5f598ffbd263971b92132391f1606a
    master date: 2026-05-06 15:11:11 +0200
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 7686d49f81..e0b8368273 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -61,8 +61,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313019.1583184 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZs-00078C-3v; Tue, 19 May 2026 13:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313019.1583184; Tue, 19 May 2026 13:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKZs-000784-0y; Tue, 19 May 2026 13:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1313019;
 Tue, 19 May 2026 13:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKZq-00077o-LE
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZq-00DBVW-21
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKZq-00E1XG-1u
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zYimP0gug6y76DeJDFrQJyQxrto4lrY6VzbVUHuKbjo=; b=PfmUj+7K3S8Oeh7scIuYGOHSHl
	4meVGqgPLigziYAsxaIN6JJXqsggFyBn2ZsVeUG6nTHqFxK63Gwk7muKjDhuOL2F5EAHRIblXfhd8
	tQK8wuZLhnyQPxTjI/1Qym2bGUMZEgFUHFg97rty+EmpILN1v4ssOUatHpISfisASB9o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] EFI: adjust cfg file buffer freeing
Message-Id: <E1wPKZq-00E1XG-1u@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:42 +0000

commit 4563f9c1476bfc9d8a4e618797499a696e82bf20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:39:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:09 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4ff927133ebc32498fd4af49a8025a846cfe1dc6
    master date: 2026-05-06 15:11:11 +0200
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index c2db9afd63..5082a23a7f 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -702,6 +702,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -711,8 +721,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1435,11 +1444,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1504,11 +1509,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         dir_handle->Close(dir_handle);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313020.1583188 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKa2-0007CT-6o; Tue, 19 May 2026 13:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313020.1583188; Tue, 19 May 2026 13:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKa2-0007CM-4H; Tue, 19 May 2026 13:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1313020;
 Tue, 19 May 2026 13:33:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKa0-0007B1-Nu
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:33:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKa0-00DBW0-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKa0-00E1Xe-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LC5YcckfIOXVA3Kwemu6PjD9ENHq4VxbzP8OtaxRHeg=; b=pNwTjsxDhLGejIhaN+FbzCrKt5
	NAakPaokbpyqjkxInu0NPzX9TzZfg2GMMYxPOV0H+rpnPqzPF7oQuZc2qSv60vmciigI52W/YfehO
	6Laq6VZQn9Rni1kcaPxClYlplD+poiWu8qhwjJpiWExA/26onWGO1RD/i1qveB2iyeCQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wPKa0-00E1Xe-2B@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:33:52 +0000

commit 152183d9690d32527201524fceef017a1716f17d
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue May 19 13:39:28 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:28 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
    master date: 2026-05-06 15:11:18 +0200
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313021.1583192 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaC-0007Ez-8c; Tue, 19 May 2026 13:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313021.1583192; Tue, 19 May 2026 13:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaC-0007Er-5i; Tue, 19 May 2026 13:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1313021;
 Tue, 19 May 2026 13:34:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKaA-0007Eg-QX
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:34:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaA-00DBWK-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaA-00E1Yb-2T
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=aCRsZC184xBMgP8FgPrqim7MumPbAvOU0InWsjenuq4=; b=Gp6/sVZIXNi4I1RUl5sc5w6iRh
	hMXGyyD6tAvDyjNxHoj1u9ili3IKUioZlPa8CUYMoUqvUVhSjVraS7vuiM1cTTkBxTYyn6BCI98Jh
	HzlaTu2YgOEzzxLrXZ6boNiQp3mTS9hGPQbgnMjeWA/zb0Gp7aszN1oUHwcF1SFkuT+U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/time: make do_settime() uses more accurate
Message-Id: <E1wPKaA-00E1Yb-2T@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:34:02 +0000

commit 8f981abea3e35710dea067d8a8198c16738b068b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:39:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:39:46 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 54ca0aadc8219b19199703038205cd01c2611995
    master date: 2026-05-07 16:10:52 +0200
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5680d299e7..503c43499a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2567,6 +2567,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2584,7 +2586,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2737,6 +2740,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2748,7 +2753,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:34:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313022.1583196 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaM-0007Hf-9j; Tue, 19 May 2026 13:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313022.1583196; Tue, 19 May 2026 13:34:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaM-0007HV-77; Tue, 19 May 2026 13:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1313022;
 Tue, 19 May 2026 13:34:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKaK-0007HA-TY
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:34:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaK-00DBWg-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaK-00E1ZC-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1KbtZG4OcLhYUW9/HuEqNv7Db9f76WI9C1dzum0appQ=; b=eF0CtTVQb+0sq5imxx5GOf/psK
	i33klKU/Otsp9w92aAY4wV6WBcQXxa5UptEGkCmgmlFRYM7fb9I97GWZANzswVo3dtRExg0I5E6lV
	d7SXcyqQhFcY8ZOfoARxTMUfa934oL6Pb/tlmpEPgVC/PHauJS9lBpftqVCC9J7zMuXI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wPKaK-00E1ZC-2k@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:34:12 +0000

commit 04747ce00cbe788ec751c0446ba59a5fbf05d6f3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:40:09 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:09 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
    master date: 2026-05-13 09:59:19 +0200
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 462691f91d..b0d3082409 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -568,12 +568,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c78f0dcd0a..23bb159d9b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -848,7 +848,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -883,8 +883,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -902,8 +919,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -926,7 +943,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -940,13 +960,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:34:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313024.1583200 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaW-0007K6-BN; Tue, 19 May 2026 13:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313024.1583200; Tue, 19 May 2026 13:34:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKaW-0007Jy-8T; Tue, 19 May 2026 13:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1313024;
 Tue, 19 May 2026 13:34:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKaV-0007Jo-01
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:34:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaU-00DBWp-37
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaU-00E1Zf-31
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zmFHV36Fbgn4fjWfOzPiNJPUCpT+BaUKByVlTWGdb1U=; b=yGPM9uc+qKOhWbvttTmuQr2QsY
	gIDEwcFGwJya3a8vpP4NHBMbFWl3T5Vf3k7x0YVRM9U4SACSRvcIAPRkbgecs4xFmW+itjzxYSwRZ
	xABQ4jEKmvZnxnZQfYSQ6Cu//rxrgrSgAbt/AgTrzOXU3l/SY+TzzoGUE4xsEfHXQyNQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] symbols: explicitly specify source file name for symtab
Message-Id: <E1wPKaU-00E1Zf-31@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:34:22 +0000

commit 0bd3ff852d66745aa5e32da760169c56cffaed68
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:40:23 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:23 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c5d554edff679302b94aecb67bfe9792a2c33aa6
    master date: 2026-05-13 10:00:52 +0200
---
 xen/arch/x86/Makefile | 2 ++
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 95b30a888f..a21151b56d 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -216,6 +216,7 @@ endif
 		> $(dot-target).0r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -226,6 +227,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index e532709ba7..b597fa8918 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -63,6 +63,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -320,6 +321,7 @@ static void write_src(void)
 	printf("#define ALGN .align 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -612,6 +614,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:34:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313025.1583204 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKag-0007ME-CU; Tue, 19 May 2026 13:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313025.1583204; Tue, 19 May 2026 13:34:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKag-0007M6-9q; Tue, 19 May 2026 13:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1313025;
 Tue, 19 May 2026 13:34:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKaf-0007Lw-2a
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:34:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaf-00DBWt-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKaf-00E1a7-03
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:34:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yqgkI3FxsWiPmIPKQClWMhgZjNl6geDPtAZc73l4Q2g=; b=OySSL1pTJL+F55Am1jZVT0soWk
	mRqmoDqit1zkimIgEYd2PyRSx4BJ1OrZeS8BdkVCbKJ7xsdC2hthQHqcoeabttPzfOU35+j8kv/2G
	3AxYNXAQEzHgqhjQsws6Ful+D8lEPTMt3+XA6zEAVstUqEiyyjPzCus91bY/GiG7k2fQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wPKaf-00E1a7-03@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:34:33 +0000

commit ae41936862cc43a1fc1800f536020f984c479185
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue May 19 13:40:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:40:36 2026 +0200

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 79e060ea03583cd83ddc7e520dcd7c5c418841f3
    master date: 2026-05-14 13:38:04 +0100
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313052.1583244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKjs-0002Iw-3R; Tue, 19 May 2026 13:44:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313052.1583244; Tue, 19 May 2026 13:44:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKjs-0002Io-0n; Tue, 19 May 2026 13:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1313052;
 Tue, 19 May 2026 13:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKjq-0002Ig-J2
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKjq-00DBjw-15
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKjq-00E2Is-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zsBW66kPHVM1XYMJzPPn/3FSh8Om1uwUNOlVwSYcNkg=; b=MkGUrEQWTPQlWy7fA3fpLW+UEZ
	kQXBVSxpL3U/i0BbRXCWACio4YYZ8p9kaKVbUZJTueNwMeXox0q1wNRtM+5/xq4QPNlshJWA+9JoT
	gHHUDXgcQuQq7xndOS7z77SLzjvSL9UxaL2Orx/hNt7m2UcHNWMzCUNYQL+m/DnAsLbg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/cpu: identify uninitialized CPU data using BAD_APICID
Message-Id: <E1wPKjq-00E2Is-0y@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:02 +0000

commit 032d39ff0e9db7fc4eddbb9741b000005eefb8c2
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue May 19 13:32:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:32:48 2026 +0200

    x86/cpu: identify uninitialized CPU data using BAD_APICID
    
    Uninitialized cpu_data[] entries have the apicid field set to BAD_APICID,
    not boot_cpu_data.apicid.  Fix the check in cpu_smpboot_free() to use the
    correct condition.
    
    Fixes: 7126b7f806d5 ("x86/CPU: re-work populating of cpu_data[]")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: cd0413bfacf262b258029cbccbeadf99a7fef2b4
    master date: 2026-05-01 10:51:19 +0100
---
 xen/arch/x86/smpboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 7339aeaefd..27628800a8 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -961,8 +961,7 @@ static void cpu_smpboot_free(unsigned int cpu, bool remove)
      * In that case the socket number cannot be relied upon, but the respective
      * socket_cpumask[] slot also wouldn't have been set.
      */
-    if ( c[cpu].apicid != boot_cpu_data.apicid &&
-         cpumask_empty(socket_cpumask[socket]) )
+    if ( c[cpu].apicid != BAD_APICID && cpumask_empty(socket_cpumask[socket]) )
     {
         xfree(socket_cpumask[socket]);
         socket_cpumask[socket] = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313054.1583248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKk2-0002L8-5V; Tue, 19 May 2026 13:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313054.1583248; Tue, 19 May 2026 13:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKk2-0002L0-2E; Tue, 19 May 2026 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1313054;
 Tue, 19 May 2026 13:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKk0-0002Kp-F8
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKk0-00DBkY-1P
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKk0-00E2KE-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=MznOR9OsnYGOp4GdPLRCFZPW7QCS2yylYJuJVBhHATI=; b=wPUdQPD/SpeFPS60u6lhp65pTW
	Amj3PLAB5hp2SOETh95Qrab0W4guRDG/IW8ue2F3Nb6mA4tybTzoqcjTuUyugEVoND++FzzbFsPcA
	SFIdQ2HUxGjiBB/toe7Rs+sWEFVDjPfcfMMFqe5oLaZCkn95706DCdwz9bfCqMXRCCqc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/cpuidle: split the max_cstate variable
Message-Id: <E1wPKk0-00E2KE-1I@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:12 +0000

commit 00496ab150e3cb15ac70bc3b83e31842d956aeec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:33:29 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:33:29 2026 +0200

    x86/cpuidle: split the max_cstate variable
    
    The admin can control the upper bound wanted not only via command line
    option, but also via XEN_SYSCTL_pm_op_set_max_cstate. While decisions how
    to set up the system are okay this way as long as we deem the command line
    option a strict upper bound, what to do during S3 resume should not be
    based on that potentially varying value. Decisions there need to use
    solely the strict upper bound we may have enforced ourselves (or which was
    forced onto us via command line option).
    
    Rather than altering pit_broadcast_is_available(), drop the function
    altogether. It's pretty odd for acpi/cpu_idle.c to call into time.c, just
    for that to call into acpi/cpu_idle.c again.
    
    Fixes: 8d24303023ec ("x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 93acfeb78b508984aa815d00629cc8b6b90dc047
    master date: 2026-05-05 08:27:29 +0200
---
 xen/arch/x86/acpi/cpu_idle.c    | 37 +++++++++++++++++++++----------------
 xen/arch/x86/cpu/intel.c        |  4 ++--
 xen/arch/x86/cpu/mwait-idle.c   | 17 +++++++++--------
 xen/arch/x86/include/asm/time.h |  1 -
 xen/arch/x86/time.c             | 11 +++--------
 xen/include/xen/acpi.h          | 34 +++++++++++++++++++---------------
 xen/include/xen/cpuidle.h       |  2 +-
 7 files changed, 55 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index d60a07bfd5..3e4d9730aa 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -119,7 +119,7 @@ bool lapic_timer_init(void)
         lapic_timer_off = hpet_broadcast_enter;
         lapic_timer_on = hpet_broadcast_exit;
     }
-    else if ( pit_broadcast_is_available() )
+    else if ( cpuidle_usable_deep_cstate() )
     {
         lapic_timer_off = pit_broadcast_enter;
         lapic_timer_on = pit_broadcast_exit;
@@ -131,12 +131,15 @@ bool lapic_timer_init(void)
 }
 
 void (*__read_mostly pm_idle_save)(void);
-unsigned int max_cstate __read_mostly = UINT_MAX;
+
+unsigned int max_usable_cstate __read_mostly = UINT_MAX;
+unsigned int max_allowed_cstate __read_mostly = UINT_MAX;
 unsigned int max_csubstate __read_mostly = UINT_MAX;
 
 static int __init cf_check parse_cstate(const char *s)
 {
-    max_cstate = simple_strtoul(s, &s, 0);
+    max_allowed_cstate = simple_strtoul(s, &s, 0);
+    max_usable_cstate = max_allowed_cstate;
     if ( *s == ',' )
         max_csubstate = simple_strtoul(s + 1, NULL, 0);
     return 0;
@@ -413,10 +416,11 @@ static void cf_check dump_cx(unsigned char key)
     unsigned int cpu;
 
     printk("'%c' pressed -> printing ACPI Cx structures\n", key);
-    if ( max_cstate < UINT_MAX )
+    if ( max_cstate() < UINT_MAX )
     {
-        printk("max state: C%u\n", max_cstate);
-        if ( max_csubstate < UINT_MAX )
+        printk("max state: C%u\n", max_cstate());
+        if ( max_allowed_cstate <= max_usable_cstate &&
+             max_csubstate < UINT_MAX )
             printk("max sub-state: %u\n", max_csubstate);
         else
             printk("max sub-state: unlimited\n");
@@ -690,18 +694,18 @@ static void cf_check acpi_processor_idle(void)
     u32 exp = 0, pred = 0;
     u32 irq_traced[4] = { 0 };
 
-    if ( max_cstate > 0 && power &&
+    if ( max_cstate() > 0 && power &&
          (next_state = cpuidle_current_governor->select(power)) > 0 )
     {
         unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-                                                         : max_cstate;
+                                                         : max_cstate();
 
         do {
             cx = &power->states[next_state];
         } while ( (cx->type > max_state ||
                    cx->entry_method == ACPI_CSTATE_EM_NONE ||
                    (cx->entry_method == ACPI_CSTATE_EM_FFH &&
-                    cx->type == max_cstate &&
+                    cx->type == max_allowed_cstate &&
                     (cx->address & MWAIT_SUBSTATE_MASK) > max_csubstate)) &&
                   --next_state );
         if ( next_state )
@@ -1449,7 +1453,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     for ( i = 0; i < nr; ++i )
     {
-        if ( cx[i].type > max_cstate )
+        if ( cx[i].type > max_cstate() )
             break;
         power->states[i + 1] = cx[i];
         power->states[i + 1].idx = i + 1;
@@ -1612,21 +1616,22 @@ int pmstat_reset_cx_stat(unsigned int cpu)
 
 void cpuidle_disable_deep_cstate(void)
 {
-    if ( max_cstate > ACPI_STATE_C1 )
+    if ( max_usable_cstate > ACPI_STATE_C1 )
     {
         if ( local_apic_timer_c2_ok )
-            max_cstate = ACPI_STATE_C2;
+            max_usable_cstate = ACPI_STATE_C2;
         else
-            max_cstate = ACPI_STATE_C1;
+            max_usable_cstate = ACPI_STATE_C1;
     }
 
     hpet_disable_legacy_broadcast();
 }
 
-bool cpuidle_using_deep_cstate(void)
+bool cpuidle_usable_deep_cstate(void)
 {
-    return xen_cpuidle && max_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
-                                                               : ACPI_STATE_C1);
+    return xen_cpuidle &&
+           max_usable_cstate > (local_apic_timer_c2_ok ? ACPI_STATE_C2
+                                                       : ACPI_STATE_C1);
 }
 
 static int cf_check cpu_callback(
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 863edac4cd..9f9c30dc0a 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -404,12 +404,12 @@ static void probe_c3_errata(const struct cpuinfo_x86 *c)
     };
 
     /* Serialized by the AP bringup code. */
-    if ( max_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
+    if ( max_usable_cstate > 1 && (c->apicid & (c->x86_num_siblings - 1)) &&
          x86_match_cpu(models) )
     {
         printk(XENLOG_WARNING
 	       "Disabling C-states C3 and C6 due to CPU errata\n");
-        max_cstate = 1;
+        max_usable_cstate = 1;
     }
 }
 
diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index f47fdfb569..08be8caf5b 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -1045,15 +1045,16 @@ static void cf_check mwait_idle(void)
 	u64 before, after;
 	u32 exp = 0, pred = 0, irq_traced[4] = { 0 };
 
-	if (max_cstate > 0 && power &&
+	if (max_cstate() > 0 && power &&
 	    (next_state = cpuidle_current_governor->select(power)) > 0) {
 		unsigned int max_state = sched_has_urgent_vcpu() ? ACPI_STATE_C1
-								 : max_cstate;
+								 : max_cstate();
 
 		do {
 			cx = &power->states[next_state];
-		} while ((cx->type > max_state || (cx->type == max_cstate &&
-			  MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
+		} while ((cx->type > max_state ||
+			  (cx->type == max_allowed_cstate &&
+			   MWAIT_HINT2SUBSTATE(cx->address) > max_csubstate)) &&
 			 --next_state);
 		if (!next_state)
 			cx = NULL;
@@ -1458,7 +1459,7 @@ static void __init sklh_idle_state_table_update(void)
 	u64 msr;
 
 	/* if PC10 disabled via cmdline max_cstate=7 or shallower */
-	if (max_cstate <= 7)
+	if (max_cstate() <= 7)
 		return;
 
 	/* if PC10 not present in CPUID.MWAIT.EDX */
@@ -1623,7 +1624,7 @@ static int __init mwait_idle_probe(void)
 	    !mwait_substates)
 		return -ENODEV;
 
-	if (!max_cstate || !opt_mwait_idle) {
+	if (!max_cstate() || !opt_mwait_idle) {
 		pr_debug(PREFIX "disabled\n");
 		return -EPERM;
 	}
@@ -1714,8 +1715,8 @@ static int cf_check mwait_idle_cpu_init(
 		hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
 		state = MWAIT_HINT2CSTATE(hint) + 1;
 
-		if (state > max_cstate) {
-			printk(PREFIX "max C-state %u reached\n", max_cstate);
+		if (state > max_cstate()) {
+			printk(PREFIX "max C-state %u reached\n", max_cstate());
 			break;
 		}
 
diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index c35d25abd6..2bfdbabf6e 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -31,7 +31,6 @@ int cpu_frequency_change(u64 freq);
 
 void cf_check pit_broadcast_enter(void);
 void cf_check pit_broadcast_exit(void);
-int pit_broadcast_is_available(void);
 
 uint64_t cf_check acpi_pm_tick_to_ns(uint64_t ticks);
 
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 0bae4ff339..5680d299e7 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -515,7 +515,7 @@ static int64_t __init cf_check init_hpet(struct platform_timesource *pts)
     bool disable_hpet = false;
 
     if ( hpet_address && strcmp(opt_clocksource, pts->id) &&
-         cpuidle_using_deep_cstate() )
+         cpuidle_usable_deep_cstate() )
     {
         if ( pci_conf_read16(PCI_SBDF(0, 0, 0x1f, 0),
                              PCI_VENDOR_ID) == PCI_VENDOR_ID_INTEL )
@@ -2655,7 +2655,7 @@ static int _disable_pit_irq(bool init)
      * XXX dom0 may rely on RTC interrupt delivery, so only enable
      * hpet_broadcast if FSB mode available or if force_hpet_broadcast.
      */
-    if ( cpuidle_using_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
+    if ( cpuidle_usable_deep_cstate() && !boot_cpu_has(X86_FEATURE_ARAT) )
     {
         init ? hpet_broadcast_init() : hpet_broadcast_resume();
         if ( !hpet_broadcast_is_available() )
@@ -2707,11 +2707,6 @@ void cf_check pit_broadcast_exit(void)
         reprogram_timer(this_cpu(timer_deadline));
 }
 
-int pit_broadcast_is_available(void)
-{
-    return cpuidle_using_deep_cstate();
-}
-
 void send_timer_event(struct vcpu *v)
 {
     send_guest_vcpu_virq(v, VIRQ_TIMER);
@@ -3014,7 +3009,7 @@ static void cf_check dump_softtsc(unsigned char key)
     else if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC ) )
     {
         printk("TSC has constant rate, ");
-        if ( max_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
+        if ( max_usable_cstate <= ACPI_STATE_C2 && tsc_max_warp == 0 )
             printk("no deep Cstates, passed warp test, deemed reliable, ");
         else
             printk("deep Cstates possible, so not reliable, ");
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 57e710a16d..b001e6deba 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -142,30 +142,34 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
 
 #ifdef	CONFIG_ACPI_CSTATE
 /*
- * max_cstate sets the highest legal C-state.
- * max_cstate = 0: C0 okay, but not C1
- * max_cstate = 1: C1 okay, but not C2
- * max_cstate = 2: C2 okay, but not C3 etc.
-
- * max_csubstate sets the highest legal C-state sub-state. Only applies to the
- * highest legal C-state.
- * max_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
- * max_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
- * max_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
- * max_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_{allowed,usable}_cstate sets the highest allowed / usable C-state.
+ * max_usable_cstate, while affected by the command line, is internally driven,
+ * whereas max_allowed_cstate can be set from both command line and systcl.
+ * max_*_cstate = 0: C0 okay, but not C1
+ * max_*_cstate = 1: C1 okay, but not C2
+ * max_*_cstate = 2: C2 okay, but not C3 etc.
+ *
+ * max_csubstate sets the highest allowed C-state sub-state. Only applies to
+ * the highest allowed C-state.
+ * max_allowed_cstate = 1, max_csubstate = 0 ==> C0, C1 okay, but not C1E
+ * max_allowed_cstate = 1, max_csubstate = 1 ==> C0, C1 and C1E okay, but not C2
+ * max_allowed_cstate = 2, max_csubstate = 0 ==> C0, C1, C1E, C2 okay, but not C3
+ * max_allowed_cstate = 2, max_csubstate = 1 ==> C0, C1, C1E, C2 okay, but not C3
  */
 
-extern unsigned int max_cstate;
+extern unsigned int max_usable_cstate;
+extern unsigned int max_allowed_cstate;
 extern unsigned int max_csubstate;
 
+#define max_cstate() min(max_usable_cstate, max_allowed_cstate)
+
 static inline unsigned int acpi_get_cstate_limit(void)
 {
-	return max_cstate;
+	return max_allowed_cstate;
 }
 static inline void acpi_set_cstate_limit(unsigned int new_limit)
 {
-	max_cstate = new_limit;
-	return;
+	max_allowed_cstate = new_limit;
 }
 
 static inline unsigned int acpi_get_csubstate_limit(void)
diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h
index 120e354fe3..80b730cf02 100644
--- a/xen/include/xen/cpuidle.h
+++ b/xen/include/xen/cpuidle.h
@@ -89,7 +89,7 @@ struct cpuidle_governor
 extern int8_t xen_cpuidle;
 extern struct cpuidle_governor *cpuidle_current_governor;
 
-bool cpuidle_using_deep_cstate(void);
+bool cpuidle_usable_deep_cstate(void);
 void cpuidle_disable_deep_cstate(void);
 
 #define CPUIDLE_DRIVER_STATE_START  1
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313055.1583251 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkC-0002Nm-7h; Tue, 19 May 2026 13:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313055.1583251; Tue, 19 May 2026 13:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkC-0002Ne-5C; Tue, 19 May 2026 13:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1313055;
 Tue, 19 May 2026 13:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKkA-0002NU-Hu
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkA-00DBko-1h
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkA-00E2LS-1a
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=C3yuO65lA3UkVcdTnUmd6QDvsmc/6o2rxRslI+c5OPk=; b=mgOs6p54Xu9gV5nmCEvm74sg/f
	XuzgZ+7crfN0W0Um2z2jvlK6Ie74Ch/ruNEsbEbomNy2X+UGe+YDtvTRMVFXUAs7nd5ehKjzXmtqu
	IHQlbx3UzLtzn+I50ozipfnNj7D/nfaMC1+xZH7U9xHXsdrHw8Wcm/pwj7DObQqOL/gI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/boot: Disable interrupts when establishing SSP
Message-Id: <E1wPKkA-00E2LS-1a@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:22 +0000

commit 13ca96cdc989c68d338501a5f6dd5bbea27f2d64
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:33:53 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:33:53 2026 +0200

    x86/boot: Disable interrupts when establishing SSP
    
    Gitlab CI reported a crash on boot on Alder Lake hardware.  The bug is years
    old, making it an incredibly rare occurance:
    
      (XEN) *** DOUBLE FAULT ***
      (XEN) ----[ Xen-4.22-unstable  x86_64  debug=y ubsan=y  Not tainted ]----
      (XEN) CPU:    0
      (XEN) RIP:    e008:[<ffff82d04077bbc4>] arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160
      (XEN) RFLAGS: 0000000000010202   CONTEXT: hypervisor
      (XEN) rax: 0000000000000007   rbx: ffff83049a4b0000   rcx: 00000000000006a2
      (XEN) rdx: 0000000000000000   rsi: 0000000000000000   rdi: 0000000000000000
      (XEN) rbp: ffff83049a4b7f00   rsp: ffff83049a4b7ef8   r8:  ffff830497e47000
      (XEN) r9:  00000000ffffffff   r10: 00000000900c2121   r11: 000000009a392956
      (XEN) r12: ffff830497e47000   r13: ffff830497e49f40   r14: 0000000000000000
      (XEN) r15: ffff82d0407dad10   cr0: 0000000080050033   cr4: 0000000000f526e0
      (XEN) cr3: 0000000043c16000   cr2: fffffffffffffffc
      (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
      (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
      (XEN) Xen code around <ffff82d04077bbc4> (arch/x86/setup.c#reinit_bsp_stack+0xfa/0x160):
      (XEN)  00 b9 a2 06 00 00 0f 30 <80> 3d 71 26 f1 ff 00 74 3e 48 8d 93 f8 5f 00 00
      (XEN) Valid stack range: ffff83049a4b6000-ffff83049a4b8000, sp=ffff83049a4b7ef8, tss.rsp0=ffff83049a4b7fb0
      (XEN) No stack overflow detected. Skipping stack trace.
      (XEN)
      (XEN) ****************************************
      (XEN) Panic on CPU 0:
      (XEN) DOUBLE FAULT -- system shutdown
      (XEN) ****************************************
    
    This is on the instruction boundary after enabling CET (writing MSR_S_CET) and
    prior to establishing SSP.  Despite identifying this as a critical window
    where any fault was deadly (the CPU tries to push a shadow stack frame at 0,
    hence the CR2 value wrapping around to the top of the address space), I
    clearly forgot that this meant interrupts too, which are enabled.
    
    Disable interrupts during the critical period.
    
    Fixes: b60ab42db2f0 ("x86/shstk: Activate Supervisor Shadow Stacks")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    master commit: acfd2631b95e29fd68b98d902a1663e07474ed5f
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/setup.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 14c28ba8e7..7f264debc9 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -908,6 +908,13 @@ static void __init noreturn reinit_bsp_stack(void)
 
     if ( cpu_has_xen_shstk )
     {
+        /*
+         * Immediately after enabling CET, SSP is 0 and most interrupts and
+         * exceptions are fatal.  Like the SYSCALL/SYSENTER gaps, IST vectors
+         * (including NMI and #MC) are safe owing to IST switching the shstk.
+         */
+        local_irq_disable();
+
         wrmsrl(MSR_S_CET, xen_msr_s_cet_value());
 
         /*
@@ -932,6 +939,8 @@ static void __init noreturn reinit_bsp_stack(void)
         }
         else
             asm volatile ( "setssbsy" ::: "memory" );
+
+        local_irq_enable();
     }
 
     reset_stack_and_jump(init_done);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313056.1583257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkM-0002Pv-Ae; Tue, 19 May 2026 13:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313056.1583257; Tue, 19 May 2026 13:44:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkM-0002Pn-6b; Tue, 19 May 2026 13:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1313056;
 Tue, 19 May 2026 13:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKkK-0002Pe-LR
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkK-00DBl3-22
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkK-00E2Mk-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xp30WVKEEitv2Iyqs7M1him7ozm5bTinGKn2eUo9D1I=; b=3FC7E4IBhsfth0LhL5ZN+12eff
	lsng369GAM9cTd0BaOMSoa9OtIa9q3CSxCxmCuTeapdGLaZ1XvNaxKExW/xjY9Y72BhcJYXALdaqd
	TMtPeyFJ/C/XVxHjFpHc3k/k9REANaxZYql8d8IbMHKsjv2qh/czSIOPYFGXS97bpKqg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/svm: Always sync guest CR2 on VMExit
Message-Id: <E1wPKkK-00E2Mk-1s@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:32 +0000

commit a8e85414e6ff950932ad625a0c6e7d19db7a8b02
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue May 19 13:34:12 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:34:12 2026 +0200

    x86/svm: Always sync guest CR2 on VMExit
    
    Under SVM, there are two copies of guest CR2.  One is v->arch.hvm.guest_cr[2]
    and one is in the VMCB.
    
    Xen doesn't intercept CR2 accesses, so this mostly goes unnoticed; hardware
    loads and saves the guest CR2 in the VMCB across VMRUN/VMExit.
    
    For HAP guests (where #PF is not intercepted, and therefore we don't typically
    inject #PF either), this causes the guest CR2 value to be lost on migrate.  As
    migration is cooperative and not done from the #PF handler, this also goes
    unnoticed by guests.
    
    It also means that an emulated MOV-from-CR2 reads a stale value.
    
    Reported-by: Stefano Stabellini <sstabellini@kernel.org>
    Fixes: d1bd157fbc9b ("Big merge the HVM full-virtualisation abstractions.")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Stefano Stabellini <sstabellini@kernel.org>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 3e6bca616b344aaa62602fcef0021255d467c2fd
    master date: 2026-05-05 11:45:00 +0100
---
 xen/arch/x86/hvm/svm/svm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f1128a657d..90bff72687 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -2578,6 +2578,7 @@ void asmlinkage svm_vmexit_handler(void)
     hvm_sanitize_regs_fields(
         regs, !(vmcb_get_efer(vmcb) & EFER_LMA) || !(vmcb->cs.l));
 
+    v->arch.hvm.guest_cr[2] = vmcb_get_cr2(vmcb);
     if ( paging_mode_hap(v->domain) )
         v->arch.hvm.guest_cr[3] = v->arch.hvm.hw_cr[3] = vmcb_get_cr3(vmcb);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313057.1583259 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkW-0002S9-AT; Tue, 19 May 2026 13:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313057.1583259; Tue, 19 May 2026 13:44:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkW-0002S1-7y; Tue, 19 May 2026 13:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1313057;
 Tue, 19 May 2026 13:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKkU-0002Rm-Nz
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkU-00DBlH-2I
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKkU-00E2O4-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XD6bpwOJk1zkSzWv/S3XqGiQOag32dDU6vZnTGm833c=; b=obFot5Avy6mPuEjPg87Q7lIvtz
	RxOrE19BznamMrwRdntRHQRvy0sv5wN9GT6qC40ZMVHojA/PdKKunzJmhC9N+3CuryOwdwAmEBXre
	mbT0LkxeMYaLmNuSeIva8+mgpXGwGvMXri8IZFJ95x4rBD3XNGXtw6ARQYZ4+RLP/G8w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xvmalloc: adjust XVFREE() ordering
Message-Id: <E1wPKkU-00E2O4-2C@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:42 +0000

commit 9358a206cbf9a2bda0d3539cb5f114c4b78608d6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:34:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:34:58 2026 +0200

    xvmalloc: adjust XVFREE() ordering
    
    What c4f427ec879e ("xen: Swap order of actions in the FREE*() macros") did
    should have been done right away when XVFREE() was introduced.
    
    Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 96ffccef5a5f598ffbd263971b92132391f1606a
    master date: 2026-05-06 15:11:11 +0200
---
 xen/include/xen/xvmalloc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/xen/xvmalloc.h b/xen/include/xen/xvmalloc.h
index 110b10e88c..83c9d4dea2 100644
--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -71,8 +71,9 @@ void *_xvrealloc(void *va, size_t size, unsigned int align);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \
-    xvfree(p);         \
+    void *_ptr_ = (p); \
     (p) = NULL;        \
+    xvfree(_ptr_);     \
 } while ( false )
 
 static inline void *_xvmalloc_array(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313059.1583264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkg-0002UU-C4; Tue, 19 May 2026 13:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313059.1583264; Tue, 19 May 2026 13:44:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkg-0002UM-9L; Tue, 19 May 2026 13:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1313059;
 Tue, 19 May 2026 13:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKke-0002UF-Qn
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKke-00DBlb-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKke-00E2P4-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=+i0EQZvzgRMjXEB1Fnl1lThm2+FGNlU4+mOEjDH7hZg=; b=uX3rMUxn8xUCmN81AgxeBMjI3A
	ndivTFH3rjc8cvn5Vyk/DbDfz/m+PW72L5fi3hCd0nU6lWyiW/U5fcgZScbcAODfl782XiAGS4ubA
	UhjxBdbwbPKJ1erEIETTi9dbJzk3+hbrH6QsdQDwopgDKIGcoASfA1mQYM5xZZqOJCMA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] EFI: adjust cfg file buffer freeing
Message-Id: <E1wPKke-00E2P4-2U@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:44:52 +0000

commit 1ae7e082173b6fb5630fb7ef4635ca6c9b51c8d9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:35:13 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:13 2026 +0200

    EFI: adjust cfg file buffer freeing
    
    The boot services FreePages() needs passing the size. Since we allocated
    one more byte to put a trailing nul there, we also need to bump the size
    passed there. Make a small helper function to centralize this.
    
    Note that there's no permanent memory leak because of the oversight: The
    allocation is done using EfiLoaderData, and all memory of that type is
    later reclaimed anyway.
    
    Fixes: df75f77092c1 ("EFI: avoid OOB config file reads")
    Reported-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bernhard Kaindl <bernhard.kaindl@citrix.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4ff927133ebc32498fd4af49a8025a846cfe1dc6
    master date: 2026-05-06 15:11:11 +0200
---
 xen/common/efi/boot.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 2181cf0b0c..99d507d1f6 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -753,6 +753,16 @@ static void __init efi_relocate_esrt(EFI_SYSTEM_TABLE *SystemTable)
  */
 #include "efi-boot.h"
 
+static void __init free_cfg(void)
+{
+    if ( !cfg.need_to_free )
+        return;
+
+    /* One extra byte was allocated to put a nul character there. */
+    efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size + 1));
+    cfg.need_to_free = false;
+}
+
 void __init noreturn blexit(const CHAR16 *str)
 {
     if ( str )
@@ -762,8 +772,7 @@ void __init noreturn blexit(const CHAR16 *str)
     if ( !efi_bs )
         efi_arch_halt();
 
-    if ( cfg.need_to_free )
-        efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
+    free_cfg();
     if ( kernel.need_to_free )
         efi_bs->FreePages(kernel.addr, PFN_UP(kernel.size));
     if ( ramdisk.need_to_free )
@@ -1557,11 +1566,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, "global", "chain");
             if ( !name.s )
                 break;
-            if ( cfg.need_to_free )
-            {
-                efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-                cfg.need_to_free = false;
-            }
+            free_cfg();
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1631,11 +1636,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
 
-        if ( cfg.need_to_free )
-        {
-            efi_bs->FreePages(cfg.addr, PFN_UP(cfg.size));
-            cfg.need_to_free = false;
-        }
+        free_cfg();
 
         if ( dir_handle )
             dir_handle->Close(dir_handle);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313060.1583267 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkq-0002Wn-DP; Tue, 19 May 2026 13:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313060.1583267; Tue, 19 May 2026 13:45:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKkq-0002We-Ae; Tue, 19 May 2026 13:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1313060;
 Tue, 19 May 2026 13:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKko-0002WY-TS
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKko-00DBmA-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKko-00E2QQ-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=F4USfYoIimDyqzJxrTW88+J/4NKIXiSqjsCCkxeTs8A=; b=cGOzmB7UCcCABYrGlA1by7Z/OR
	gGu9SdnBnKg/VQfN62k++E6EHlUoPPgvBGf3/DS9ju5ZVNqEbuupahXesmZUVabAp2I2txyGe1qSN
	dzYdPtASpw9NEXz9Df2EEDt/ZKJL+YslFHy5ANHt5w1LqQ7eIuxAYOB2S28wRBiejEW0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xsm/flask: Fix undefined behaviour in avc_dump_av()
Message-Id: <E1wPKko-00E2QQ-2k@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:45:02 +0000

commit 3dccad52201bc4550e431bad788e5d70a210db1f
Author:     Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
AuthorDate: Tue May 19 13:35:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:27 2026 +0200

    xsm/flask: Fix undefined behaviour in avc_dump_av()
    
    When booting Xen with CONFIG_USBAN=y and CONFIG_XSM_FLASK=y,
    UBSAN reports undefined behaviour in avc_dump_av() due to a left
    shift on a signed int:
    
    (XEN) [    1.104348] ================================================================================
    (XEN) [    1.105096] UBSAN: Undefined behaviour in xsm/flask/avc.c:184:14
    (XEN) [    1.106052] left shift of 1073741824 by 1 places cannot be represented in type 'int'
    (XEN) [    1.107546] Xen WARN at common/ubsan/ubsan.c:176
    (XEN) [    1.108295] ----[ Xen-4.21.1  arm64  debug=y ubsan=y  Not tainted ]----
    (XEN) [    1.108848] CPU:    0
    (XEN) [    1.109147] PC:     00000a00002f64fc ubsan.c#ubsan_epilogue+0x10/0xd4
    [...]
    (XEN) [    1.146320] Xen call trace:
    (XEN) [    1.146663]    [<00000a00002f64fc>] ubsan.c#ubsan_epilogue+0x10/0xd4 (PC)
    (XEN) [    1.147227]    [<00000a00002f7bc4>] __ubsan_handle_shift_out_of_bounds+0x1a0/0x290 (LR)
    (XEN) [    1.147868]
    (XEN) [    1.148177] ================================================================================
    
    This can be solved by making 'perm' an unsigned 32-bit type (u32).
    
    Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 4f9457ece11a6231b7a17a11a873b8b4b9376fdc
    master date: 2026-05-06 15:11:18 +0200
---
 xen/xsm/flask/avc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/xsm/flask/avc.c b/xen/xsm/flask/avc.c
index 3d39e55cae..6e1972d21b 100644
--- a/xen/xsm/flask/avc.c
+++ b/xen/xsm/flask/avc.c
@@ -152,7 +152,8 @@ static void __attribute__ ((format (printf, 2, 3)))
  */
 static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
-    int i, i2, perm;
+    int i, i2;
+    uint32_t perm;
 
     if ( av == 0 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313061.1583272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKl0-0002Yo-EU; Tue, 19 May 2026 13:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313061.1583272; Tue, 19 May 2026 13:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKl0-0002Yg-Bt; Tue, 19 May 2026 13:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1313061;
 Tue, 19 May 2026 13:45:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKkz-0002YY-02
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:45:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKky-00DBp3-38
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKky-00E2Qq-32
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SzqNAGBvYtrsvZqiVz2LbMfU+vKIUxvALZvRgd/aiJ0=; b=P5zyArU68oTGkbPC1KNXMGpZFq
	Ldl7GXlS+aQMZb4IbJsWpRq8gRHwTy0gh7pddpB+rPMHzXECZeiP+/1t4WdEqMdLuwcHYcCxSgGSv
	YSDk7hzWiJQJoeiNPunhoXHhqMJaOxbezGLkwBhaT9ZPm0f4N5lW+VrLuNRimBJTjKIY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/time: make do_settime() uses more accurate
Message-Id: <E1wPKky-00E2Qq-32@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:45:12 +0000

commit fd2ccd79ab8bd58ac8d0624f4459fffbca192a5a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:35:57 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:35:57 2026 +0200

    x86/time: make do_settime() uses more accurate
    
    As a comment next to one of the invocations states, get_wallclock_time()
    can take over a second. The order of evaluation of function arguments is
    in principle unspecified; in practice at least gcc looks to be evaluating
    them from last to first. Hence with NOW() invoked first, the respective
    value passed to do_settime() can be off by over a second (which is in
    contrast to __get_cmos_time() attempting to get the time exactly after an
    update, i.e. [pretty] precisely at a seconds boundary).
    
    This also addresses a Misra C:2012 rule 13.2 ("The value of an expression
    and its persistent side-effects shall be the same under all permitted
    evaluation orders") violation each. The violations aren't flagged because
    the entire file is (bogusly) excluded from scanning.
    
    Fixes: f64134cdb81c ("x86: Fix time_resume() to notify all domains of wallclock change")
    Fixes: 0bfcf984b727 ("x86: Reintroduce clocksource=tsc")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 54ca0aadc8219b19199703038205cd01c2611995
    master date: 2026-05-07 16:10:52 +0200
---
 xen/arch/x86/time.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 5680d299e7..503c43499a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2567,6 +2567,8 @@ __initcall(verify_tsc_reliability);
 /* Late init function (after interrupts are enabled). */
 int __init init_xen_time(void)
 {
+    unsigned long wc;
+
     tsc_check_writability();
 
     open_softirq(TIME_CALIBRATE_SOFTIRQ, local_time_calibration);
@@ -2584,7 +2586,8 @@ int __init init_xen_time(void)
     printk(XENLOG_INFO "Wallclock source: %s\n", wallclock_type_to_string());
 
     /* NB. get_wallclock_time() can take over one second to execute. */
-    do_settime(get_wallclock_time(), 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc, 0,  NOW());
 
     /* Finish platform timer initialization. */
     try_platform_timer_tail();
@@ -2737,6 +2740,8 @@ int time_suspend(void)
 
 int time_resume(void)
 {
+    unsigned long wc;
+
     preinit_pit();
 
     resume_platform_timer();
@@ -2748,7 +2753,8 @@ int time_resume(void)
 
     set_timer(&calibration_timer, NOW() + EPOCH);
 
-    do_settime(get_wallclock_time() + cmos_utc_offset, 0, NOW());
+    wc = get_wallclock_time();
+    do_settime(wc + cmos_utc_offset, 0, NOW());
 
     update_vcpu_system_time(current);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313063.1583285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlA-0002ni-Mp; Tue, 19 May 2026 13:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313063.1583285; Tue, 19 May 2026 13:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlA-0002na-Ja; Tue, 19 May 2026 13:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1313063;
 Tue, 19 May 2026 13:45:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKl9-0002aa-2r
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:45:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKl9-00DBpL-0B
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKl9-00E2RC-05
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ySFdrhfe9jhoXjuOSGZ0XwctR//DAsSldAj8+GXV1Wg=; b=nEr+Vb4nqGtfBqlrcf2l49RRJH
	sWaIaiZ+ZYS7Y4PsmrASUnmLmMJAND5Irrgv5ZWEymgYTN8u3VdzY7VeZK5HziHek1qE2qx/rjZib
	cUTsEhZrx0joTcbItsvumPVH1WmCzwAmSkw3xbAFYpvA82bz+4pHutqx+J7qdKdQrnVU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] memory: overlapping XENMAPSPACE_gmfn_range requests
Message-Id: <E1wPKl9-00E2RC-05@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:45:23 +0000

commit 7372acade2bdbca0782e7fd5040b913b3724bfbb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:36:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:20 2026 +0200

    memory: overlapping XENMAPSPACE_gmfn_range requests
    
    Overlapping requests may need processing backwards, or else the intended
    effect wouldn't be achieved (and instead some pages would be moved more
    than once).
    
    With some adjustment there this also covers XEN_DMOP_relocate_memory,
    where the potential issue was first noticed.
    
    Fixes: a04811a315e0 ("mm: New XENMEM space, XENMAPSPACE_gmfn_range")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 7acc7dd36b9e30aa6c5939d9d7531b3c39ad5c03
    master date: 2026-05-13 09:59:19 +0200
---
 xen/arch/x86/hvm/dm.c |  8 ++++++--
 xen/common/memory.c   | 47 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
index 3b53471af0..066498e07e 100644
--- a/xen/arch/x86/hvm/dm.c
+++ b/xen/arch/x86/hvm/dm.c
@@ -569,12 +569,16 @@ int dm_op(const struct dmop_args *op_args)
 
         rc = xenmem_add_to_physmap(d, &xatp, 0);
         if ( rc == 0 && data->size != xatp.size )
+        {
             rc = xatp.size;
+            xatp.idx += rc;
+            xatp.gpfn += rc;
+        }
         if ( rc > 0 )
         {
             data->size -= rc;
-            data->src_gfn += rc;
-            data->dst_gfn += rc;
+            data->src_gfn = xatp.idx;
+            data->dst_gfn = xatp.gpfn;
             const_op = false;
             rc = -ERESTART;
         }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..3412c7fb4a 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -850,7 +850,7 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
                           unsigned int start)
 {
     unsigned int done = 0;
-    long rc = 0;
+    long rc = 0, adjust = 1;
     union add_to_physmap_extra extra = {};
     struct page_info *pages[16];
 
@@ -885,8 +885,25 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         return -EOVERFLOW;
     }
 
-    xatp->idx += start;
-    xatp->gpfn += start;
+    /*
+     * Overlapping ranges need processing backwards when destination is above
+     * source.
+     */
+    if ( xatp->gpfn > xatp->idx &&
+         unlikely(xatp->gpfn < xatp->idx + xatp->size) )
+    {
+        adjust = -1;
+
+        /* Both fields store "next item to process". */
+        xatp->idx += xatp->size - start - 1;
+        xatp->gpfn += xatp->size - start - 1;
+    }
+    else
+    {
+        xatp->idx += start;
+        xatp->gpfn += start;
+    }
+
     xatp->size -= start;
 
 #ifdef CONFIG_HAS_PASSTHROUGH
@@ -904,8 +921,8 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         if ( rc < 0 )
             break;
 
-        xatp->idx++;
-        xatp->gpfn++;
+        xatp->idx += adjust;
+        xatp->gpfn += adjust;
 
         if ( extra.ppage )
             ++extra.ppage;
@@ -928,7 +945,10 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
 
         this_cpu(iommu_dont_flush_iotlb) = 0;
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - done), done,
+        if ( likely(adjust > 0) )
+            adjust = done;
+
+        ret = iommu_iotlb_flush(d, _dfn(xatp->idx - adjust), done,
                                 IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
@@ -942,13 +962,26 @@ int xenmem_add_to_physmap(struct domain *d, struct xen_add_to_physmap *xatp,
         for ( i = 0; i < done; ++i )
             put_page(pages[i]);
 
-        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - done), done,
+        ret = iommu_iotlb_flush(d, _dfn(xatp->gpfn - adjust), done,
                                 IOMMU_FLUSHF_added | IOMMU_FLUSHF_modified);
         if ( unlikely(ret) && rc >= 0 )
             rc = ret;
     }
 #endif
 
+    /*
+     * For internal callers (e.g. XEN_DMOP_relocate_memory handling) leave
+     * the GFNs from where to resume in *xatp (they're correct already when
+     * we worked forwards). These are the values not biased for a possible
+     * non-zero "start" that a subsequent invocation might use, so also do
+     * this updating only when incoming "start" was 0.
+     */
+    if ( rc > 0 && !start && unlikely(adjust < 0) )
+    {
+        xatp->idx -= xatp->size - rc - 1;
+        xatp->gpfn -= xatp->size - rc - 1;
+    }
+
     return rc;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:45:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:45:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313065.1583289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlJ-0002tl-PB; Tue, 19 May 2026 13:45:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313065.1583289; Tue, 19 May 2026 13:45:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlJ-0002td-MV; Tue, 19 May 2026 13:45:33 +0000
Received: by outflank-mailman (input) for mailman id 1313065;
 Tue, 19 May 2026 13:45:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKlJ-0002tJ-5Q
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:45:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKlJ-00DBpX-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKlJ-00E2RY-0M
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Qxi+DULV9tmwmav039exYUvyp4uv/oPM4R5QcTCdIQQ=; b=Wafc1Les1uOa8vEnVzBnHekzok
	11EevL5nxjfEJWLJjQRdQT9EsB3BOUmbW0NkE83I3636WCu8eAbfxLfh0kaH5eymUNe2fqGBeDOyj
	LhJEECM55qcUm1tOcYTOU5QzHR6VzIwkUlCbUuC7ngXTe8crx86VQlCIxO1iocgUc7gk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] symbols: explicitly specify source file name for symtab
Message-Id: <E1wPKlJ-00E2RY-0M@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:45:33 +0000

commit 3db23dfdc645385e9d5961d7b9bbdaa692684eae
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue May 19 13:36:36 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:36 2026 +0200

    symbols: explicitly specify source file name for symtab
    
    If there are any local symbols in an object file, GNU ld will create an
    STT_FILE symbol derived from the object file name if there is none in the
    incoming symbol table. The object file name, however, varies between
    linking passes. As a result, symbol name compression can yield different
    results if any of those local symbols need retaining (Arm [and RISC-V]
    mapping symbols are omitted, for example). If that difference in
    compression would yield a difference in the sizes of symbol_names[] or
    symbols_token_table[], the compare-symbol-tables sanity check will fail.
    
    Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
    Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: c5d554edff679302b94aecb67bfe9792a2c33aa6
    master date: 2026-05-13 10:00:52 +0200
---
 xen/arch/x86/Makefile | 5 ++++-
 xen/tools/symbols.c   | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 9d07a0a0d6..269a1a3acb 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -208,7 +208,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
 endif
-	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
+	$(objtree)/tools/symbols $(all_symbols) --source-name=$(@F).S --empty \
+		> $(dot-target).0s.S
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
@@ -218,6 +219,7 @@ endif
 		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
@@ -228,6 +230,7 @@ endif
 		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+                  --source-name=$(@F).S \
 		> $(dot-target).2s.S
 	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 509394d5a4..bc50b1a576 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -66,6 +66,7 @@ int token_profit[0x10000];
 unsigned char best_table[256][2];
 unsigned char best_table_len[256];
 
+static const char *srcname = "xen-syms.S";
 
 static void usage(void)
 {
@@ -347,6 +348,7 @@ static void write_src(void)
 	printf("#define ALGN .balign 4\n");
 	printf("#endif\n");
 
+	printf("\t.file \"%s\"\n", srcname);
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
@@ -682,6 +684,8 @@ int main(int argc, char **argv)
 				unsorted = true;
 			else if (strcmp(argv[i], "--sort-by-name") == 0)
 				sort_by_name = 1;
+			else if (strncmp(argv[i], "--source-name=", 14) == 0)
+				srcname = argv[i] + 14;
 			else if (strcmp(argv[i], "--warn-dup") == 0)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 13:45:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 13:45:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313070.1583295 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlT-00032n-RE; Tue, 19 May 2026 13:45:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313070.1583295; Tue, 19 May 2026 13:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPKlT-00032e-Nn; Tue, 19 May 2026 13:45:43 +0000
Received: by outflank-mailman (input) for mailman id 1313070;
 Tue, 19 May 2026 13:45:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPKlT-00031J-7z
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 13:45:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKlT-00DBph-0h
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPKlT-00E2S2-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 13:45:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1ZkP0cAeXpvynrNKAaBRqvwe0WCixgmylafVd0ZpNCU=; b=O1Nf3vj7YO2A0eBdFC9KjXgZfo
	RwMSFuAWDh3cSDgQI87uNSNHZTgQHrk6HvZ54Frdj1UmZ8rmZcNd2S6/DE+qKdJP7L3JMdt94uT2h
	SGzoMmM6/cnqk0jAC+o3aEcC8nf2NABQ4kVyXH3dr7ly5ubvNnKceUjAamxHhfWoqYQw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] CI/ECLAIR: avoid intercepting intermediate linking steps
Message-Id: <E1wPKlT-00E2S2-0c@xenbits.xenproject.org>
Date: Tue, 19 May 2026 13:45:43 +0000

commit ed13b648828a3b334f01389aa610b4cafc434294
Author:     Nicola Vetrini <nicola.vetrini@bugseng.com>
AuthorDate: Tue May 19 13:36:56 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue May 19 13:36:56 2026 +0200

    CI/ECLAIR: avoid intercepting intermediate linking steps
    
    These do not add any value to the analysis other than duplicating some reports
    in whole-program analysis, as the intermediate linking steps are only used to
    build the symbol table.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 79e060ea03583cd83ddc7e520dcd7c5c418841f3
    master date: 2026-05-14 13:38:04 +0100
---
 automation/eclair_analysis/ECLAIR/analysis.ecl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl
index 399099938f..675602e15a 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -34,6 +34,13 @@ their Standard Library equivalents."
 
 -doc_end
 
+-doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final
+counterparts for the purposes of MISRA C static analysis."
+-file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\..*$"}
+-file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\..*$"}
+-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
+-doc_end
+
 -eval_file=toolchain.ecl
 -eval_file=public_APIs.ecl
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue May 19 21:33:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 21:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313426.1583552 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPS3i-0008It-Hh; Tue, 19 May 2026 21:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313426.1583552; Tue, 19 May 2026 21:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPS3i-0008Il-Et; Tue, 19 May 2026 21:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1313426;
 Tue, 19 May 2026 21:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPS3h-0008If-SH
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 21:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPS3h-00DMds-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 21:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPS3h-00EWAJ-2S
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 21:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PddTOfI+T96colrmmki73A4u3xS7xjr5NVUMj7zjO5k=; b=1OOmJtnvsm/XkZL39QZx0JuFvq
	FuGe3HQl0PZ1AWBPkyniTMDUPiOV47d31Lv6HS3uEVrHsgJPwe3y+4O6kXH8kZDzgY5XcqXyHOuAh
	p5OXxd+vUBQ2NLFAOgi8TVkSXqtZ1brAlrQG1QNNvASl0UNgTAX/RYIXhO1eJbSTxhks=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/vmac: Delete STDINT block in vmac.h
Message-Id: <E1wPS3h-00EWAJ-2S@xenbits.xenproject.org>
Date: Tue, 19 May 2026 21:33:01 +0000

commit 2b51691c8c7dccd39d0824fa1158078f23261ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 17:25:34 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 22:29:31 2026 +0100

    xen/vmac: Delete STDINT block in vmac.h
    
    Eclair reports that _MSC_VER is undefined, a MISRA Rule 20.9 violation.
    
    This could be fixed by inserting an "&& defined(_MSC_VER)" clause, but the
    whole block is entirely useless (it comments out the include of stdint) and
    users pull in xen/types.h transitively.
    
    Delete the whole block, and include xen/types.h to make it standalone.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/crypto/vmac.h | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/xen/include/crypto/vmac.h b/xen/include/crypto/vmac.h
index 7574c4a3f3..735d2760a5 100644
--- a/xen/include/crypto/vmac.h
+++ b/xen/include/crypto/vmac.h
@@ -1,6 +1,8 @@
 #ifndef HEADER_VMAC_H
 #define HEADER_VMAC_H
 
+#include <xen/types.h>
+
 /* --------------------------------------------------------------------------
  * VMAC and VHASH Implementation by Ted Krovetz (tdk@acm.org) and Wei Dai.
  * This implementation is herby placed in the public domain.
@@ -35,29 +37,6 @@
 #define hz (400e6)   mips
 */
 
-/* --------------------------------------------------------------------------
- * This implementation uses uint32_t and uint64_t as names for unsigned 32-
- * and 64-bit integer types. These are defined in C99 stdint.h. The
- * following may need adaptation if you are not running a C99 or
- * Microsoft C environment.
- * ----------------------------------------------------------------------- */
-#define VMAC_USE_STDINT 1  /* Set to zero if system has no stdint.h        */
- 
-#if VMAC_USE_STDINT && !_MSC_VER /* Try stdint.h if non-Microsoft          */
-#ifdef  __cplusplus
-#define __STDC_CONSTANT_MACROS
-#endif
-//#include <stdint.h>
-#elif (_MSC_VER)                  /* Microsoft C does not have stdint.h    */
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#define UINT64_C(v) v ## UI64
-#else                             /* Guess sensibly - may need adaptation  */
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-#define UINT64_C(v) v ## ULL
-#endif
-
 /* --------------------------------------------------------------------------
  * This implementation supports two free AES implementations: OpenSSL's and
  * Paulo Barreto's. To use OpenSSL's, you will need to include the OpenSSL
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue May 19 21:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 19 May 2026 21:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313427.1583556 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPS3s-0008KY-J0; Tue, 19 May 2026 21:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313427.1583556; Tue, 19 May 2026 21:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPS3s-0008KQ-GE; Tue, 19 May 2026 21:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1313427;
 Tue, 19 May 2026 21:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPS3r-0008KK-V3
 for xen-changelog@lists.xenproject.org; Tue, 19 May 2026 21:33:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPS3r-00DMdy-30
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 21:33:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPS3r-00EWAh-2t
 for xen-changelog@lists.xenproject.org;
 Tue, 19 May 2026 21:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V0UvcNAisPKvBLkdDRIWaQzTb83r6ELNM/56W13pN48=; b=vt/tbg9nfkVg6KmAwhM3tbgdkA
	4dOKQl7EwP04WKToQb587iJQ0kHYtQQ/1O0tiGJuP4pUliG/s8/UOvPhXed1MYC1S/6OHfg9qUXcz
	FTey4/RLlCgIZTaSWJx8zLYKjmEZbk66wHIDcanTK/wNeOPZ1To4D8ZpTUPjM3hxXWiE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: Fix SSTC init to write VSTIMECMP instead of STIMECMP
Message-Id: <E1wPS3r-00EWAh-2t@xenbits.xenproject.org>
Date: Tue, 19 May 2026 21:33:11 +0000

commit a472f640dd49c03c479c49a6ec24344472b0e223
Author:     Baptiste Le Duc <baptiste.le-duc@vates.tech>
AuthorDate: Tue May 19 18:14:44 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 22:29:31 2026 +0100

    xen/riscv: Fix SSTC init to write VSTIMECMP instead of STIMECMP
    
    According to the preceeding comment, CSR_VSTIMECMP should be written rather
    than CSR_STIMECMP.
    
    Fixes: 25e032730690 ("xen/riscv: allow Xen to use SSTC while hiding it from guests")
    Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 8769709e52..10b7e35f13 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -101,6 +101,6 @@ void __init preinit_xen_time(void)
          * Thereby to avoid spurious VS-timer irqs set vstimecmp CSR to
          * ULONG_MAX.
          */
-        csr_write64(CSR_STIMECMP, ULONG_MAX);
+        csr_write64(CSR_VSTIMECMP, ULONG_MAX);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 20 02:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 May 2026 02:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313502.1583603 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPWuh-00009m-D2; Wed, 20 May 2026 02:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313502.1583603; Wed, 20 May 2026 02:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPWuh-00009c-A8; Wed, 20 May 2026 02:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1313502;
 Wed, 20 May 2026 02:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPWuf-00009V-PR
 for xen-changelog@lists.xenproject.org; Wed, 20 May 2026 02:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPWuf-00EeVm-2O
 for xen-changelog@lists.xenproject.org;
 Wed, 20 May 2026 02:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPWuf-00EosX-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 20 May 2026 02:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y9AfrGwgpobGUXGrMLciiSG6hjmbx22kJv6dFjcT4fU=; b=XKPh0OmhK6+fpFwCIutNOwnDlY
	H2Q2GDj40lpY95jG5I4y0tFEdZY50wKYe4RgN8FQNZjNgD03NPyiZWtmtWQN6lvIn5U7kBlZuhETf
	02EfB0QJzLAZhhVI474bmBWCaIyIOwPY91CyDJPFfkFdGXm8NAvuDbDzW8TMny3rDjHM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vmac: Delete STDINT block in vmac.h
Message-Id: <E1wPWuf-00EosX-2C@xenbits.xenproject.org>
Date: Wed, 20 May 2026 02:44:01 +0000

commit 2b51691c8c7dccd39d0824fa1158078f23261ccb
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 17:25:34 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 22:29:31 2026 +0100

    xen/vmac: Delete STDINT block in vmac.h
    
    Eclair reports that _MSC_VER is undefined, a MISRA Rule 20.9 violation.
    
    This could be fixed by inserting an "&& defined(_MSC_VER)" clause, but the
    whole block is entirely useless (it comments out the include of stdint) and
    users pull in xen/types.h transitively.
    
    Delete the whole block, and include xen/types.h to make it standalone.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/crypto/vmac.h | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/xen/include/crypto/vmac.h b/xen/include/crypto/vmac.h
index 7574c4a3f3..735d2760a5 100644
--- a/xen/include/crypto/vmac.h
+++ b/xen/include/crypto/vmac.h
@@ -1,6 +1,8 @@
 #ifndef HEADER_VMAC_H
 #define HEADER_VMAC_H
 
+#include <xen/types.h>
+
 /* --------------------------------------------------------------------------
  * VMAC and VHASH Implementation by Ted Krovetz (tdk@acm.org) and Wei Dai.
  * This implementation is herby placed in the public domain.
@@ -35,29 +37,6 @@
 #define hz (400e6)   mips
 */
 
-/* --------------------------------------------------------------------------
- * This implementation uses uint32_t and uint64_t as names for unsigned 32-
- * and 64-bit integer types. These are defined in C99 stdint.h. The
- * following may need adaptation if you are not running a C99 or
- * Microsoft C environment.
- * ----------------------------------------------------------------------- */
-#define VMAC_USE_STDINT 1  /* Set to zero if system has no stdint.h        */
- 
-#if VMAC_USE_STDINT && !_MSC_VER /* Try stdint.h if non-Microsoft          */
-#ifdef  __cplusplus
-#define __STDC_CONSTANT_MACROS
-#endif
-//#include <stdint.h>
-#elif (_MSC_VER)                  /* Microsoft C does not have stdint.h    */
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-#define UINT64_C(v) v ## UI64
-#else                             /* Guess sensibly - may need adaptation  */
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-#define UINT64_C(v) v ## ULL
-#endif
-
 /* --------------------------------------------------------------------------
  * This implementation supports two free AES implementations: OpenSSL's and
  * Paulo Barreto's. To use OpenSSL's, you will need to include the OpenSSL
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 20 02:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 20 May 2026 02:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1313503.1583606 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPWur-0000Bg-ED; Wed, 20 May 2026 02:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1313503.1583606; Wed, 20 May 2026 02:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPWur-0000BX-BQ; Wed, 20 May 2026 02:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1313503;
 Wed, 20 May 2026 02:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPWuq-0000BP-0y
 for xen-changelog@lists.xenproject.org; Wed, 20 May 2026 02:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPWup-00EeVr-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 20 May 2026 02:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPWup-00Eot0-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 20 May 2026 02:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XZiT+PNy1h7NDYwplqNdr8ImDFih7dCQlxngS50XdJM=; b=i0ROCJzZhyUogHBsuTljKpSF1O
	CmZRmwn69nZ5s8lZzbLn8LT0m3eMYqPlsxbR4r5qDqbL9x6pxZgQwDN0wFAHhgXdm2R2lgPZEo9sx
	QYTFvRrJ41DAoVumXeVsoXf0en5+Uo4XmbC07wPS5oKcZvJOggavB/zEoouOqySkur0g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: Fix SSTC init to write VSTIMECMP instead of STIMECMP
Message-Id: <E1wPWup-00Eot0-2Y@xenbits.xenproject.org>
Date: Wed, 20 May 2026 02:44:11 +0000

commit a472f640dd49c03c479c49a6ec24344472b0e223
Author:     Baptiste Le Duc <baptiste.le-duc@vates.tech>
AuthorDate: Tue May 19 18:14:44 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 22:29:31 2026 +0100

    xen/riscv: Fix SSTC init to write VSTIMECMP instead of STIMECMP
    
    According to the preceeding comment, CSR_VSTIMECMP should be written rather
    than CSR_STIMECMP.
    
    Fixes: 25e032730690 ("xen/riscv: allow Xen to use SSTC while hiding it from guests")
    Signed-off-by: Baptiste Le Duc <baptiste.le-duc@vates.tech>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/time.c b/xen/arch/riscv/time.c
index 8769709e52..10b7e35f13 100644
--- a/xen/arch/riscv/time.c
+++ b/xen/arch/riscv/time.c
@@ -101,6 +101,6 @@ void __init preinit_xen_time(void)
          * Thereby to avoid spurious VS-timer irqs set vstimecmp CSR to
          * ULONG_MAX.
          */
-        csr_write64(CSR_STIMECMP, ULONG_MAX);
+        csr_write64(CSR_VSTIMECMP, ULONG_MAX);
     }
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 01:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 01:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314756.1584737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPsco-00038r-Pv; Thu, 21 May 2026 01:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314756.1584737; Thu, 21 May 2026 01:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPsco-00038j-NA; Thu, 21 May 2026 01:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1314756;
 Thu, 21 May 2026 01:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPscn-00038d-OM
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 01:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPscn-00GJ8g-2A
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPscn-00GBo4-1s
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=w/yq486pGWF4FBAe9FgYZ803vP5zJlIYAgPnBr9EqbM=; b=TuaUvs2a4TODsjDCPLGWCjLMOl
	JTMqxgMEK3++XO1/S6A5RtJ3ifzLtp4mMgvrhWUAPB7AlktcwtNSB4Jsjnnq2ya7vCxG//SkJmBuN
	Q/nk/r8Zz9QLvRT4TePqawKwfagfmnLx6SYkcrNPsv+4F9dP6+oUxqCqpJjZO+f0MKg0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/domain: introduce DOMID_ANY
Message-Id: <E1wPscn-00GBo4-1s@xenbits.xenproject.org>
Date: Thu, 21 May 2026 01:55:01 +0000

commit 23e2479ff9de8fbd0f7e825821d74b32e7625d5c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue May 19 22:29:10 2026 -0500
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:29:10 2026 -0500

    xen/domain: introduce DOMID_ANY
    
    Add a new symbol DOMID_ANY to improve the readability of the code.
    
    Update all relevant domid_alloc() call sites and harden the domid_alloc()
    input value check.
    
    Also, fix problem with passing invalid domain IDs in
    XEN_DOMCTL_createdomain: turns out libxl__domain_make() (toolstack)
    uses 0xffff as domain ID.
    
    Fix failing tools tests too.
    
    Amends: 2d5065060710 ("xen/domain: unify domain ID allocation")
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 tools/libs/light/libxl_create.c                  |  4 +++-
 tools/tests/domid/harness.h                      |  1 +
 tools/tests/domid/test-domid.c                   | 12 ++++++------
 tools/tests/mem-claim/test-mem-claim.c           |  6 +++---
 tools/tests/paging-mempool/test-paging-mempool.c |  2 +-
 tools/tests/resource/test-resource.c             |  2 +-
 tools/tests/tsx/test-tsx.c                       |  2 +-
 xen/common/device-tree/dom0less-build.c          |  2 +-
 xen/common/domctl.c                              |  3 +--
 xen/common/domid.c                               |  5 ++++-
 xen/include/public/xen.h                         |  7 +++++++
 11 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index bfc9149096..6fd62d1403 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -681,8 +681,10 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
                     continue;
 
                 local_domid = v;
+            } else if (libxl_domid_valid_guest(info->domid)) {
+                local_domid = info->domid;
             } else {
-                local_domid = info->domid; /* May not be valid */
+                local_domid = DOMID_ANY;
             }
 
             ret = xc_domain_create(ctx->xch, &local_domid, &create);
diff --git a/tools/tests/domid/harness.h b/tools/tests/domid/harness.h
index 17eb22a9a8..65da0d075a 100644
--- a/tools/tests/domid/harness.h
+++ b/tools/tests/domid/harness.h
@@ -41,6 +41,7 @@ extern unsigned long find_next_zero_bit(const unsigned long *addr,
 
 #define DOMID_FIRST_RESERVED            (100)
 #define DOMID_INVALID                   (101)
+#define DOMID_ANY                       (102)
 
 #endif /* _TEST_HARNESS_ */
 
diff --git a/tools/tests/domid/test-domid.c b/tools/tests/domid/test-domid.c
index 5915c4699a..71cc4e7fd8 100644
--- a/tools/tests/domid/test-domid.c
+++ b/tools/tests/domid/test-domid.c
@@ -41,20 +41,20 @@ int main(int argc, char **argv)
         domid_free(expected);
 
     /*
-     * Test that that two consecutive calls of domid_alloc(DOMID_INVALID)
+     * Test that that two consecutive calls of domid_alloc(DOMID_ANY)
      * will never return the same ID.
      * NB: ID#0 is reserved and shall not be allocated by
-     * domid_alloc(DOMID_INVALID).
+     * domid_alloc(DOMID_ANY).
      */
     for ( expected = 1; expected < DOMID_FIRST_RESERVED; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == expected,
                "TEST 3: expected %u allocated %u\n", expected, allocated);
     }
     for ( expected = 1; expected < DOMID_FIRST_RESERVED; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == DOMID_INVALID,
                "TEST 4: expected %u allocated %u\n", DOMID_INVALID, allocated);
     }
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
         domid_free(expected);
     for ( expected = 1; expected < DOMID_FIRST_RESERVED / 2; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == expected,
                "TEST 5: expected %u allocated %u\n", expected, allocated);
     }
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
     /* Re-allocate last ID from [1..DOMID_FIRST_RESERVED - 1]. */
     expected = DOMID_FIRST_RESERVED - 1;
     domid_free(DOMID_FIRST_RESERVED - 1);
-    allocated = domid_alloc(DOMID_INVALID);
+    allocated = domid_alloc(DOMID_ANY);
     verify(allocated == expected,
            "TEST 6: expected %u allocated %u\n", expected, allocated);
 
diff --git a/tools/tests/mem-claim/test-mem-claim.c b/tools/tests/mem-claim/test-mem-claim.c
index ad038e45d1..69dc99cfdd 100644
--- a/tools/tests/mem-claim/test-mem-claim.c
+++ b/tools/tests/mem-claim/test-mem-claim.c
@@ -21,7 +21,7 @@ static unsigned int nr_failures;
 #define MB_PAGES(x) (MB(x) / XC_PAGE_SIZE)
 
 static xc_interface *xch;
-static uint32_t domid = DOMID_INVALID;
+static uint32_t domid = DOMID_ANY;
 
 static xc_physinfo_t physinfo;
 
@@ -142,7 +142,7 @@ static void run_tests(void)
     rc = xc_domain_destroy(xch, domid);
 
     /* Cancel the cleanup path, even in the case of an error. */
-    domid = DOMID_INVALID;
+    domid = DOMID_ANY;
 
     if ( rc )
         return fail("  Failed to destroy domain: %d - %s\n",
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
 
     run_tests();
 
-    if ( domid != DOMID_INVALID )
+    if ( domid != DOMID_ANY )
     {
         rc = xc_domain_destroy(xch, domid);
         if ( rc )
diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 3c87925288..97f5b77209 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -22,7 +22,7 @@ static unsigned int nr_failures;
 static xc_interface *xch;
 static xendevicemodel_handle *dh;
 static xenforeignmemory_handle *fh;
-static uint32_t domid;
+static uint32_t domid = DOMID_ANY;
 
 static struct xen_domctl_createdomain create = {
     .flags = (XEN_DOMCTL_CDF_hvm |
diff --git a/tools/tests/resource/test-resource.c b/tools/tests/resource/test-resource.c
index a7f2d04643..236da0dcd4 100644
--- a/tools/tests/resource/test-resource.c
+++ b/tools/tests/resource/test-resource.c
@@ -178,7 +178,7 @@ static void test_domain_configurations(void)
     for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
     {
         struct test *t = &tests[i];
-        uint32_t domid = 0;
+        uint32_t domid = DOMID_ANY;
         int rc;
         xen_pfn_t ram[1] = { 0 };
 
diff --git a/tools/tests/tsx/test-tsx.c b/tools/tests/tsx/test-tsx.c
index 5af04953f3..ea7c03ad30 100644
--- a/tools/tests/tsx/test-tsx.c
+++ b/tools/tests/tsx/test-tsx.c
@@ -362,7 +362,7 @@ static void test_def_max_policies(void)
 
 static void test_guest(struct xen_domctl_createdomain *c)
 {
-    uint32_t domid = 0;
+    uint32_t domid = DOMID_ANY;
     int rc;
 
     rc = xc_domain_create(xch, &domid, c);
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 6d6882a34b..eacfd93087 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -871,7 +871,7 @@ void __init create_domUs(void)
         if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
             panic("No more domain IDs available\n");
 
-        domid = domid_alloc(DOMID_INVALID);
+        domid = domid_alloc(DOMID_ANY);
         if ( domid == DOMID_INVALID )
             panic("Error allocating ID for domain %s\n", dt_node_name(node));
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 93738931c5..b969f5ada6 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -409,8 +409,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_createdomain:
     {
-        /* NB: ID#0 is reserved, find the first suitable ID instead. */
-        domid_t domid = domid_alloc(op->domain ?: DOMID_INVALID);
+        domid_t domid = domid_alloc(op->domain);
 
         if ( domid == DOMID_INVALID )
         {
diff --git a/xen/common/domid.c b/xen/common/domid.c
index 2387ddb083..b0258e477c 100644
--- a/xen/common/domid.c
+++ b/xen/common/domid.c
@@ -19,7 +19,7 @@ static DECLARE_BITMAP(domid_bitmap, DOMID_FIRST_RESERVED);
  * @param domid Domain ID hint:
  * - If an explicit domain ID is provided, verify its availability and use it
  *   if ID is not used;
- * - If DOMID_INVALID is provided, search [1..DOMID_FIRST_RESERVED-1] range,
+ * - If DOMID_ANY is provided, search [1..DOMID_FIRST_RESERVED-1] range,
  *   starting from the last used ID. Implementation guarantees that two
  *   consecutive calls will never return the same ID. ID#0 is reserved for
  *   the first boot domain (currently, dom0) and excluded from the allocation
@@ -31,6 +31,9 @@ domid_t domid_alloc(domid_t domid)
 {
     static domid_t domid_last;
 
+    if ( domid >= DOMID_FIRST_RESERVED && domid != DOMID_ANY )
+        return DOMID_INVALID;
+
     spin_lock(&domid_lock);
 
     /* Exact match. */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index b12fd10e63..2149b8dd38 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -608,6 +608,13 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 /* DOMID_INVALID is used to identify pages with unknown owner. */
 #define DOMID_INVALID        xen_mk_uint(0x7FF4)
 
+/*
+ * DOMID_ANY is used to signal no specific domain ID requested.
+ * Handler should pick a valid ID, or handle it as a wildcard value
+ * depending on the context.
+ */
+#define DOMID_ANY            xen_mk_uint(0x7FF5)
+
 /* Idle domain. */
 #define DOMID_IDLE           xen_mk_uint(0x7FFF)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 01:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 01:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314757.1584741 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPscy-0003Ak-R2; Thu, 21 May 2026 01:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314757.1584741; Thu, 21 May 2026 01:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPscy-0003Ac-OZ; Thu, 21 May 2026 01:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1314757;
 Thu, 21 May 2026 01:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPscx-0003A6-Pl
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 01:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPscx-00GJB7-2T
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPscx-00GBpO-2L
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=dPsxG/P25ZA3rGtaAwxRHbMAuqzdvpAdl+ug5KStLt0=; b=aRd+yahDnsuiXW0y6P7AwpVzly
	0v1vR4iZIeQK2KXMfqRbbTxgpEMC1DP1xgqX4T4iQQBy58OwCYHhUYx2FlJB8rpIwA3qqHm2tZUNc
	7ytIa3USHE0DaiM6tkZjWM07ZgUwRXXjkeyejGH5WbadKTgLsAzg92wG2Fh+ALjn00S0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/gicv3: Detect normal NC ITS command queues
Message-Id: <E1wPscx-00GBpO-2L@xenbits.xenproject.org>
Date: Thu, 21 May 2026 01:55:11 +0000

commit 98bea5e531ba76f346556b79f84236db064aef9f
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri May 15 12:40:31 2026 +0300
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:30:00 2026 -0500

    arm/gicv3: Detect normal NC ITS command queues
    
    GITS_CBASER.InnerCache uses the GIC BASER cacheability encoding.
    Both 0b000 (Device-nGnRnE) and 0b001 (Normal Inner
    Non-cacheable) describe non-cacheable accesses to the command queue.
    
    its_map_cbaser() only checked whether the shifted field was zero,
    so an ITS that reports Normal Inner Non-cacheable would not set
    HOST_ITS_FLUSH_CMD_QUEUE. Decode the field before comparing it with
    the unshifted enum value, matching the handling of ITS BASER tables
    and GICR_PROPBASER.
    
    Fixes: 8ed8d21373be ("ARM: GICv3 ITS: map ITS command buffer")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 9005ce8ce5..7560d46c6d 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -424,7 +424,8 @@ static void *its_map_cbaser(struct host_its *its)
      * If the command queue memory is mapped as uncached, we need to flush
      * it on every access.
      */
-    if ( !(reg & GITS_BASER_INNER_CACHEABILITY_MASK) )
+    if ( MASK_EXTR(reg, GITS_BASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
     {
         its->flags |= HOST_ITS_FLUSH_CMD_QUEUE;
         printk(XENLOG_WARNING "using non-cacheable ITS command queue\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 01:55:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 01:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314758.1584744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPsd8-0003Ck-SU; Thu, 21 May 2026 01:55:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314758.1584744; Thu, 21 May 2026 01:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPsd8-0003Cc-Pv; Thu, 21 May 2026 01:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1314758;
 Thu, 21 May 2026 01:55:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPsd7-0003CS-Sd
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 01:55:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPsd7-00GJBH-2l
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPsd7-00GBqC-2f
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 01:55:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EOOqNI7tTy3owRwFnDFCqCVpJw/GWTkQkuTYrUaATU4=; b=6qEgvkTi/Uh5aR1kVFaw7muti+
	TyBYxyqJyaJ/tEH2d40+ZimvjouCk5PqPuEbmm4reeOcSY5Ahn6lLTFjNZZOyWRyG6mZS86WdJTF7
	kyynTrDMrx8zArIWH7hBWaFgnafBHBljsRa1VcBKIrPWlgomCmVlNyieXfLJeuSzxaJE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v3: Wait for redistributor RWP using the right bit
Message-Id: <E1wPsd7-00GBqC-2f@xenbits.xenproject.org>
Date: Thu, 21 May 2026 01:55:21 +0000

commit d86cf3cbd4ad105c00e12b0d51646049a87f1c44
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 14 12:08:13 2026 +0300
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:30:35 2026 -0500

    xen/arm: gic-v3: Wait for redistributor RWP using the right bit
    
    gicv3_do_wait_for_rwp() is used for both distributor and
    redistributor writes. The CTLR register is at offset 0 for both,
    but the RWP bit is not in the same position.
    
    For GICD_CTLR, RWP is bit 31. For GICR_CTLR, bit 31 is UWP,
    while RWP is bit 3. The redistributor wait path was therefore
    polling UWP instead of RWP.
    
    UWP covers upstream writes, including Generate SGI packets, and is
    not a substitute for redistributor register write completion. The
    existing redistributor callers need RWP semantics for redistributor
    register writes such as GICR_ICENABLER0 and GICR_CTLR updates.
    
    Add GICR_CTLR_RWP and pass the expected RWP bit to the shared
    helper.
    
    Fixes: bc183a0235e ("xen/arm: Add support for GIC v3")
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3.c                  | 14 +++++++++-----
 xen/arch/arm/include/asm/gic_v3_defs.h |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 7f365cdbe9..dfd5d44603 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -274,16 +274,20 @@ static void gicv3_enable_sre(void)
     isb();
 }
 
-/* Wait for completion of a distributor change */
-static void gicv3_do_wait_for_rwp(void __iomem *base)
+/* Wait for completion of a distributor/redistributor change */
+static void gicv3_do_wait_for_rwp(void __iomem *base, uint32_t rwp_bit)
 {
     uint32_t val;
     bool timeout = false;
     s_time_t deadline = NOW() + MILLISECS(1000);
 
     do {
+        /*
+         * GICD_CTLR and GICR_CTLR are both at offset 0, so this is
+         * valid for either a distributor or redistributor base.
+         */
         val = readl_relaxed(base + GICD_CTLR);
-        if ( !(val & GICD_CTLR_RWP) )
+        if ( !(val & rwp_bit) )
             break;
         if ( NOW() > deadline )
         {
@@ -300,12 +304,12 @@ static void gicv3_do_wait_for_rwp(void __iomem *base)
 
 static void gicv3_dist_wait_for_rwp(void)
 {
-    gicv3_do_wait_for_rwp(GICD);
+    gicv3_do_wait_for_rwp(GICD, GICD_CTLR_RWP);
 }
 
 static void gicv3_redist_wait_for_rwp(void)
 {
-    gicv3_do_wait_for_rwp(GICD_RDIST_BASE);
+    gicv3_do_wait_for_rwp(GICD_RDIST_BASE, GICR_CTLR_RWP);
 }
 
 static void gicv3_wait_for_rwp(int irq)
diff --git a/xen/arch/arm/include/asm/gic_v3_defs.h b/xen/arch/arm/include/asm/gic_v3_defs.h
index c373b94d19..3714cfeb7d 100644
--- a/xen/arch/arm/include/asm/gic_v3_defs.h
+++ b/xen/arch/arm/include/asm/gic_v3_defs.h
@@ -146,6 +146,7 @@
 #define GICR_NSACR                   (0x0E00)
 
 #define GICR_CTLR_ENABLE_LPIS        (1U << 0)
+#define GICR_CTLR_RWP                (1U << 3)
 
 #define GICR_TYPER_PLPIS             (1U << 0)
 #define GICR_TYPER_VLPIS             (1U << 1)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 02:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 02:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314766.1584749 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOF-0001Xw-5f; Thu, 21 May 2026 02:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314766.1584749; Thu, 21 May 2026 02:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOF-0001Xo-2N; Thu, 21 May 2026 02:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1314766;
 Thu, 21 May 2026 02:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPtOE-0001Xi-7E
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 02:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOE-00GKXA-0Q
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOE-00GE3f-0C
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SlpYH7euSjzOrSVEaw9ztXu+S7/KHG1z9+WvSsTIhQY=; b=DkYWlcVHreZ3xcJ7d83HLp+6Qu
	4AWDjEuXsB7tGXok0JiB9mTSrtKVIHghtxQD+XNr9SIVZRhM5hhjT/dH3HcqAh9c7ApeiRpwv98Ym
	NOL9YG66DDlUS51Nr3mjfZNqTZOqVJblT/MD4qt3VPCpp1y7bURcIYiKQG3nVOWH/J6o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/domain: introduce DOMID_ANY
Message-Id: <E1wPtOE-00GE3f-0C@xenbits.xenproject.org>
Date: Thu, 21 May 2026 02:44:02 +0000

commit 23e2479ff9de8fbd0f7e825821d74b32e7625d5c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue May 19 22:29:10 2026 -0500
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:29:10 2026 -0500

    xen/domain: introduce DOMID_ANY
    
    Add a new symbol DOMID_ANY to improve the readability of the code.
    
    Update all relevant domid_alloc() call sites and harden the domid_alloc()
    input value check.
    
    Also, fix problem with passing invalid domain IDs in
    XEN_DOMCTL_createdomain: turns out libxl__domain_make() (toolstack)
    uses 0xffff as domain ID.
    
    Fix failing tools tests too.
    
    Amends: 2d5065060710 ("xen/domain: unify domain ID allocation")
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 tools/libs/light/libxl_create.c                  |  4 +++-
 tools/tests/domid/harness.h                      |  1 +
 tools/tests/domid/test-domid.c                   | 12 ++++++------
 tools/tests/mem-claim/test-mem-claim.c           |  6 +++---
 tools/tests/paging-mempool/test-paging-mempool.c |  2 +-
 tools/tests/resource/test-resource.c             |  2 +-
 tools/tests/tsx/test-tsx.c                       |  2 +-
 xen/common/device-tree/dom0less-build.c          |  2 +-
 xen/common/domctl.c                              |  3 +--
 xen/common/domid.c                               |  5 ++++-
 xen/include/public/xen.h                         |  7 +++++++
 11 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c
index bfc9149096..6fd62d1403 100644
--- a/tools/libs/light/libxl_create.c
+++ b/tools/libs/light/libxl_create.c
@@ -681,8 +681,10 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
                     continue;
 
                 local_domid = v;
+            } else if (libxl_domid_valid_guest(info->domid)) {
+                local_domid = info->domid;
             } else {
-                local_domid = info->domid; /* May not be valid */
+                local_domid = DOMID_ANY;
             }
 
             ret = xc_domain_create(ctx->xch, &local_domid, &create);
diff --git a/tools/tests/domid/harness.h b/tools/tests/domid/harness.h
index 17eb22a9a8..65da0d075a 100644
--- a/tools/tests/domid/harness.h
+++ b/tools/tests/domid/harness.h
@@ -41,6 +41,7 @@ extern unsigned long find_next_zero_bit(const unsigned long *addr,
 
 #define DOMID_FIRST_RESERVED            (100)
 #define DOMID_INVALID                   (101)
+#define DOMID_ANY                       (102)
 
 #endif /* _TEST_HARNESS_ */
 
diff --git a/tools/tests/domid/test-domid.c b/tools/tests/domid/test-domid.c
index 5915c4699a..71cc4e7fd8 100644
--- a/tools/tests/domid/test-domid.c
+++ b/tools/tests/domid/test-domid.c
@@ -41,20 +41,20 @@ int main(int argc, char **argv)
         domid_free(expected);
 
     /*
-     * Test that that two consecutive calls of domid_alloc(DOMID_INVALID)
+     * Test that that two consecutive calls of domid_alloc(DOMID_ANY)
      * will never return the same ID.
      * NB: ID#0 is reserved and shall not be allocated by
-     * domid_alloc(DOMID_INVALID).
+     * domid_alloc(DOMID_ANY).
      */
     for ( expected = 1; expected < DOMID_FIRST_RESERVED; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == expected,
                "TEST 3: expected %u allocated %u\n", expected, allocated);
     }
     for ( expected = 1; expected < DOMID_FIRST_RESERVED; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == DOMID_INVALID,
                "TEST 4: expected %u allocated %u\n", DOMID_INVALID, allocated);
     }
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
         domid_free(expected);
     for ( expected = 1; expected < DOMID_FIRST_RESERVED / 2; expected++ )
     {
-        allocated = domid_alloc(DOMID_INVALID);
+        allocated = domid_alloc(DOMID_ANY);
         verify(allocated == expected,
                "TEST 5: expected %u allocated %u\n", expected, allocated);
     }
@@ -72,7 +72,7 @@ int main(int argc, char **argv)
     /* Re-allocate last ID from [1..DOMID_FIRST_RESERVED - 1]. */
     expected = DOMID_FIRST_RESERVED - 1;
     domid_free(DOMID_FIRST_RESERVED - 1);
-    allocated = domid_alloc(DOMID_INVALID);
+    allocated = domid_alloc(DOMID_ANY);
     verify(allocated == expected,
            "TEST 6: expected %u allocated %u\n", expected, allocated);
 
diff --git a/tools/tests/mem-claim/test-mem-claim.c b/tools/tests/mem-claim/test-mem-claim.c
index ad038e45d1..69dc99cfdd 100644
--- a/tools/tests/mem-claim/test-mem-claim.c
+++ b/tools/tests/mem-claim/test-mem-claim.c
@@ -21,7 +21,7 @@ static unsigned int nr_failures;
 #define MB_PAGES(x) (MB(x) / XC_PAGE_SIZE)
 
 static xc_interface *xch;
-static uint32_t domid = DOMID_INVALID;
+static uint32_t domid = DOMID_ANY;
 
 static xc_physinfo_t physinfo;
 
@@ -142,7 +142,7 @@ static void run_tests(void)
     rc = xc_domain_destroy(xch, domid);
 
     /* Cancel the cleanup path, even in the case of an error. */
-    domid = DOMID_INVALID;
+    domid = DOMID_ANY;
 
     if ( rc )
         return fail("  Failed to destroy domain: %d - %s\n",
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
 
     run_tests();
 
-    if ( domid != DOMID_INVALID )
+    if ( domid != DOMID_ANY )
     {
         rc = xc_domain_destroy(xch, domid);
         if ( rc )
diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 3c87925288..97f5b77209 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -22,7 +22,7 @@ static unsigned int nr_failures;
 static xc_interface *xch;
 static xendevicemodel_handle *dh;
 static xenforeignmemory_handle *fh;
-static uint32_t domid;
+static uint32_t domid = DOMID_ANY;
 
 static struct xen_domctl_createdomain create = {
     .flags = (XEN_DOMCTL_CDF_hvm |
diff --git a/tools/tests/resource/test-resource.c b/tools/tests/resource/test-resource.c
index a7f2d04643..236da0dcd4 100644
--- a/tools/tests/resource/test-resource.c
+++ b/tools/tests/resource/test-resource.c
@@ -178,7 +178,7 @@ static void test_domain_configurations(void)
     for ( unsigned int i = 0; i < ARRAY_SIZE(tests); ++i )
     {
         struct test *t = &tests[i];
-        uint32_t domid = 0;
+        uint32_t domid = DOMID_ANY;
         int rc;
         xen_pfn_t ram[1] = { 0 };
 
diff --git a/tools/tests/tsx/test-tsx.c b/tools/tests/tsx/test-tsx.c
index 5af04953f3..ea7c03ad30 100644
--- a/tools/tests/tsx/test-tsx.c
+++ b/tools/tests/tsx/test-tsx.c
@@ -362,7 +362,7 @@ static void test_def_max_policies(void)
 
 static void test_guest(struct xen_domctl_createdomain *c)
 {
-    uint32_t domid = 0;
+    uint32_t domid = DOMID_ANY;
     int rc;
 
     rc = xc_domain_create(xch, &domid, c);
diff --git a/xen/common/device-tree/dom0less-build.c b/xen/common/device-tree/dom0less-build.c
index 6d6882a34b..eacfd93087 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -871,7 +871,7 @@ void __init create_domUs(void)
         if ( (max_init_domid + 1) >= DOMID_FIRST_RESERVED )
             panic("No more domain IDs available\n");
 
-        domid = domid_alloc(DOMID_INVALID);
+        domid = domid_alloc(DOMID_ANY);
         if ( domid == DOMID_INVALID )
             panic("Error allocating ID for domain %s\n", dt_node_name(node));
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 93738931c5..b969f5ada6 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -409,8 +409,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 
     case XEN_DOMCTL_createdomain:
     {
-        /* NB: ID#0 is reserved, find the first suitable ID instead. */
-        domid_t domid = domid_alloc(op->domain ?: DOMID_INVALID);
+        domid_t domid = domid_alloc(op->domain);
 
         if ( domid == DOMID_INVALID )
         {
diff --git a/xen/common/domid.c b/xen/common/domid.c
index 2387ddb083..b0258e477c 100644
--- a/xen/common/domid.c
+++ b/xen/common/domid.c
@@ -19,7 +19,7 @@ static DECLARE_BITMAP(domid_bitmap, DOMID_FIRST_RESERVED);
  * @param domid Domain ID hint:
  * - If an explicit domain ID is provided, verify its availability and use it
  *   if ID is not used;
- * - If DOMID_INVALID is provided, search [1..DOMID_FIRST_RESERVED-1] range,
+ * - If DOMID_ANY is provided, search [1..DOMID_FIRST_RESERVED-1] range,
  *   starting from the last used ID. Implementation guarantees that two
  *   consecutive calls will never return the same ID. ID#0 is reserved for
  *   the first boot domain (currently, dom0) and excluded from the allocation
@@ -31,6 +31,9 @@ domid_t domid_alloc(domid_t domid)
 {
     static domid_t domid_last;
 
+    if ( domid >= DOMID_FIRST_RESERVED && domid != DOMID_ANY )
+        return DOMID_INVALID;
+
     spin_lock(&domid_lock);
 
     /* Exact match. */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index b12fd10e63..2149b8dd38 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -608,6 +608,13 @@ DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 /* DOMID_INVALID is used to identify pages with unknown owner. */
 #define DOMID_INVALID        xen_mk_uint(0x7FF4)
 
+/*
+ * DOMID_ANY is used to signal no specific domain ID requested.
+ * Handler should pick a valid ID, or handle it as a wildcard value
+ * depending on the context.
+ */
+#define DOMID_ANY            xen_mk_uint(0x7FF5)
+
 /* Idle domain. */
 #define DOMID_IDLE           xen_mk_uint(0x7FFF)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 02:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 02:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314767.1584753 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOP-0001aH-7t; Thu, 21 May 2026 02:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314767.1584753; Thu, 21 May 2026 02:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOP-0001a9-51; Thu, 21 May 2026 02:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1314767;
 Thu, 21 May 2026 02:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPtOO-0001Ze-8w
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 02:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOO-00GKXE-0n
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOO-00GE5B-0b
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gDZZZ9QWnjruDDntmyO0ZElrYB56SfEdlFOxzwDK26w=; b=2tkiTaV54fGwFSdtEVd3PW1F3N
	ga2OpPtss07mzKLcKkgTXbWqOeL5A/XTcllZCC8GciOy4Lk4yEJYCp19kxuEzypTAAhW+Sxb+QBjR
	KQhHgPiOumVhgwNemCJz5RyWQ5fHL79wbNX9cLNP0Wj5K57vxMA/9Y2quyjCURusdv6c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/gicv3: Detect normal NC ITS command queues
Message-Id: <E1wPtOO-00GE5B-0b@xenbits.xenproject.org>
Date: Thu, 21 May 2026 02:44:12 +0000

commit 98bea5e531ba76f346556b79f84236db064aef9f
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Fri May 15 12:40:31 2026 +0300
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:30:00 2026 -0500

    arm/gicv3: Detect normal NC ITS command queues
    
    GITS_CBASER.InnerCache uses the GIC BASER cacheability encoding.
    Both 0b000 (Device-nGnRnE) and 0b001 (Normal Inner
    Non-cacheable) describe non-cacheable accesses to the command queue.
    
    its_map_cbaser() only checked whether the shifted field was zero,
    so an ITS that reports Normal Inner Non-cacheable would not set
    HOST_ITS_FLUSH_CMD_QUEUE. Decode the field before comparing it with
    the unshifted enum value, matching the handling of ITS BASER tables
    and GICR_PROPBASER.
    
    Fixes: 8ed8d21373be ("ARM: GICv3 ITS: map ITS command buffer")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 9005ce8ce5..7560d46c6d 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -424,7 +424,8 @@ static void *its_map_cbaser(struct host_its *its)
      * If the command queue memory is mapped as uncached, we need to flush
      * it on every access.
      */
-    if ( !(reg & GITS_BASER_INNER_CACHEABILITY_MASK) )
+    if ( MASK_EXTR(reg, GITS_BASER_INNER_CACHEABILITY_MASK) <=
+         GIC_BASER_CACHE_nC )
     {
         its->flags |= HOST_ITS_FLUSH_CMD_QUEUE;
         printk(XENLOG_WARNING "using non-cacheable ITS command queue\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 02:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 02:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314768.1584758 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOa-0001cU-9H; Thu, 21 May 2026 02:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314768.1584758; Thu, 21 May 2026 02:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPtOa-0001cM-6P; Thu, 21 May 2026 02:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1314768;
 Thu, 21 May 2026 02:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPtOY-0001cF-C6
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 02:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOY-00GKXK-16
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPtOY-00GE6L-0z
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 02:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=lNonWrHEhYwYhGRPl+kuVnZzpkKsOdosP9rhjWTG808=; b=GRvw68h5rtmhohpahBeaOcDUZg
	9ZDvxvfsZSFLoHZ/AQKOXBFoKkQ4OiiyqwEzBPDA0rY+Gk2mK2RInp8kzu8UYy/tMdKxbheORdYuZ
	eE2ovlaqAHQUOPpNNpQaOpNKoSDpRpLiTJbC29JGApc4X+K+l0OnisYX1u4+Ec1QmZXc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: Wait for redistributor RWP using the right bit
Message-Id: <E1wPtOY-00GE6L-0z@xenbits.xenproject.org>
Date: Thu, 21 May 2026 02:44:22 +0000

commit d86cf3cbd4ad105c00e12b0d51646049a87f1c44
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 14 12:08:13 2026 +0300
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Tue May 19 22:30:35 2026 -0500

    xen/arm: gic-v3: Wait for redistributor RWP using the right bit
    
    gicv3_do_wait_for_rwp() is used for both distributor and
    redistributor writes. The CTLR register is at offset 0 for both,
    but the RWP bit is not in the same position.
    
    For GICD_CTLR, RWP is bit 31. For GICR_CTLR, bit 31 is UWP,
    while RWP is bit 3. The redistributor wait path was therefore
    polling UWP instead of RWP.
    
    UWP covers upstream writes, including Generate SGI packets, and is
    not a substitute for redistributor register write completion. The
    existing redistributor callers need RWP semantics for redistributor
    register writes such as GICR_ICENABLER0 and GICR_CTLR updates.
    
    Add GICR_CTLR_RWP and pass the expected RWP bit to the shared
    helper.
    
    Fixes: bc183a0235e ("xen/arm: Add support for GIC v3")
    Reported-by: Luca Fancellu <luca.fancellu@arm.com>
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/arch/arm/gic-v3.c                  | 14 +++++++++-----
 xen/arch/arm/include/asm/gic_v3_defs.h |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 7f365cdbe9..dfd5d44603 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -274,16 +274,20 @@ static void gicv3_enable_sre(void)
     isb();
 }
 
-/* Wait for completion of a distributor change */
-static void gicv3_do_wait_for_rwp(void __iomem *base)
+/* Wait for completion of a distributor/redistributor change */
+static void gicv3_do_wait_for_rwp(void __iomem *base, uint32_t rwp_bit)
 {
     uint32_t val;
     bool timeout = false;
     s_time_t deadline = NOW() + MILLISECS(1000);
 
     do {
+        /*
+         * GICD_CTLR and GICR_CTLR are both at offset 0, so this is
+         * valid for either a distributor or redistributor base.
+         */
         val = readl_relaxed(base + GICD_CTLR);
-        if ( !(val & GICD_CTLR_RWP) )
+        if ( !(val & rwp_bit) )
             break;
         if ( NOW() > deadline )
         {
@@ -300,12 +304,12 @@ static void gicv3_do_wait_for_rwp(void __iomem *base)
 
 static void gicv3_dist_wait_for_rwp(void)
 {
-    gicv3_do_wait_for_rwp(GICD);
+    gicv3_do_wait_for_rwp(GICD, GICD_CTLR_RWP);
 }
 
 static void gicv3_redist_wait_for_rwp(void)
 {
-    gicv3_do_wait_for_rwp(GICD_RDIST_BASE);
+    gicv3_do_wait_for_rwp(GICD_RDIST_BASE, GICR_CTLR_RWP);
 }
 
 static void gicv3_wait_for_rwp(int irq)
diff --git a/xen/arch/arm/include/asm/gic_v3_defs.h b/xen/arch/arm/include/asm/gic_v3_defs.h
index c373b94d19..3714cfeb7d 100644
--- a/xen/arch/arm/include/asm/gic_v3_defs.h
+++ b/xen/arch/arm/include/asm/gic_v3_defs.h
@@ -146,6 +146,7 @@
 #define GICR_NSACR                   (0x0E00)
 
 #define GICR_CTLR_ENABLE_LPIS        (1U << 0)
+#define GICR_CTLR_RWP                (1U << 3)
 
 #define GICR_TYPER_PLPIS             (1U << 0)
 #define GICR_TYPER_VLPIS             (1U << 1)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314893.1584834 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfL-0008Km-W4; Thu, 21 May 2026 08:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314893.1584834; Thu, 21 May 2026 08:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfL-0008Kc-SN; Thu, 21 May 2026 08:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1314893;
 Thu, 21 May 2026 08:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyfK-0008KW-Dp
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfK-00GSrz-0w
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfK-00GacO-0n
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tp84JmO5EUuveCFygMINlRPzbVNvb22z1ybb4nXLEvY=; b=Myds/i0ZP+8RVzej9IzHVHrYE3
	G4a8b61yDKbj+im7uBI2QGuc5ApYRDdbXhT87VhvWhaELVChqs5W3l7kZzn8HgIMFxZBeh4bfgFKS
	5/Cf7aLBE/eoPbwy/8oXLlz1Jc8hp3tJubwhruzTqrnXnDYSa6hTX6/qEyDb6ONOL5DA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: VRAM last_dirty tagging
Message-Id: <E1wPyfK-00GacO-0n@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:02 +0000

commit 2965f75ebd3814158878464d3c15c3b94fb96571
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 21 09:10:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:10:58 2026 +0200

    x86/shadow: VRAM last_dirty tagging
    
    ->last_dirty holding a valid value (one other than -1) is solely an
    indication of the bitmap being entirely clean. (The opposite isn't true,
    because of _sh_propagate() setting the field to a valid value without
    setting a bit in the bitmap.) As a consequence
    - setting the field to a valid value right after having allocated zero-
      filled space is pointless,
    - copying the all empty bitmap to the output array is pointless; with the
      output array also having been allocated zero-filled, not even a memset()
      is needed there,
    - after restoring bitmap contents when dealing with copy_to_guest() having
      failed, the field needs setting to a valid value again.
    
    Furthermore invoking NOW() in perhaps many loop iterations of the main
    loop is wasteful, too. Record whether any bit was set, and record a new
    ->last_dirty only once, after the loop. Then use the same NOW() value also
    for the subsequent check.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index cf4862cbc9..ff4dd1f94c 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1068,18 +1068,18 @@ int shadow_track_dirty_vram(struct domain *d,
         if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
             goto out_sl1ma;
 
-        dirty_vram->last_dirty = NOW();
+        dirty_vram->last_dirty = -1;
 
         /* Tell the caller that this time we could not track dirty bits. */
         rc = -ENODATA;
     }
-    else if ( dirty_vram->last_dirty == -1 )
-        /* still completely clean, just copy our empty bitmap */
-        memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size);
-    else
+    /* Nothing to do when the bitmap is still completely clean. */
+    else if ( dirty_vram->last_dirty != -1 )
     {
         mfn_t map_mfn = INVALID_MFN;
         void *map_sl1p = NULL;
+        bool any_dirty = false;
+        s_time_t now;
 
         /* Iterate over VRAM to track dirty bits. */
         for ( i = 0; i < nr_frames; i++ )
@@ -1155,16 +1155,20 @@ int shadow_track_dirty_vram(struct domain *d,
             if ( dirty )
             {
                 dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                any_dirty = true;
             }
         }
 
+        now = NOW();
+        if ( any_dirty )
+            dirty_vram->last_dirty = now;
+
         if ( map_sl1p )
             unmap_domain_page(map_sl1p);
 
         memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size);
         memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-        if ( dirty_vram->last_dirty + SECONDS(2) < NOW() )
+        if ( dirty_vram->last_dirty + SECONDS(2) < now )
         {
             /*
              * Was clean for more than two seconds, try to disable guest
@@ -1197,6 +1201,7 @@ int shadow_track_dirty_vram(struct domain *d,
         paging_lock(d);
         for ( i = 0; i < dirty_size; i++ )
             dirty_vram->dirty_bitmap[i] |= dirty_bitmap[i];
+        dirty_vram->last_dirty = NOW();
         paging_unlock(d);
         rc = -EFAULT;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314894.1584837 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfW-0008Nq-0D; Thu, 21 May 2026 08:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314894.1584837; Thu, 21 May 2026 08:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfV-0008Ni-Tf; Thu, 21 May 2026 08:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1314894;
 Thu, 21 May 2026 08:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyfU-0008NI-HH
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfU-00GSs4-1a
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfU-00Gadc-17
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uOglcD47PcUknj2uDZJYuajCy4kigHh3oeRqVhnusuY=; b=trKDoBiSTxVRtiZFp1pFTlnj0r
	Ymsa783+IZcbbByAxBM9mnGzI1XYzhmUpeA5qHmf/4n45i6OsYGdxOg1JeyxEsEag3SUbkGrYwx0A
	GVdMtfgaC3CNox82+FsXi/cycojYX5kplrlXZoUvPY6cffo4zjl8v46cVZddD0UjRpHE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: reduce flush_tlb's scope in shadow_track_dirty_vram()
Message-Id: <E1wPyfU-00Gadc-17@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:12 +0000

commit 1146b4f52457c2048ed8cb52ecab799719e21f92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 21 09:11:33 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:11:33 2026 +0200

    x86/shadow: reduce flush_tlb's scope in shadow_track_dirty_vram()
    
    It's set only in the main "else", so the declaration as well as the sole
    consumer can also move into that more narrow scope. This may in particular
    help with possible future locking changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index ff4dd1f94c..e6fb97c4b6 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1003,7 +1003,6 @@ int shadow_track_dirty_vram(struct domain *d,
     int rc = 0;
     unsigned long end_pfn = begin_pfn + nr_frames;
     unsigned int dirty_size = DIV_ROUND_UP(nr_frames, BITS_PER_BYTE);
-    int flush_tlb = 0;
     unsigned long i;
     p2m_type_t t;
     struct sh_dirty_vram *dirty_vram;
@@ -1078,7 +1077,7 @@ int shadow_track_dirty_vram(struct domain *d,
     {
         mfn_t map_mfn = INVALID_MFN;
         void *map_sl1p = NULL;
-        bool any_dirty = false;
+        bool any_dirty = false, flush_tlb = false;
         s_time_t now;
 
         /* Iterate over VRAM to track dirty bits. */
@@ -1139,7 +1138,7 @@ int shadow_track_dirty_vram(struct domain *d,
                              * _PAGE_ACCESSED set by another processor.
                              */
                             l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
+                            flush_tlb = true;
                         }
                     }
                     break;
@@ -1182,9 +1181,10 @@ int shadow_track_dirty_vram(struct domain *d,
             }
             dirty_vram->last_dirty = -1;
         }
+
+        if ( flush_tlb )
+            guest_flush_tlb_mask(d, d->dirty_cpumask);
     }
-    if ( flush_tlb )
-        guest_flush_tlb_mask(d, d->dirty_cpumask);
     goto out;
 
  out_sl1ma:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314895.1584842 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfg-0008Qc-27; Thu, 21 May 2026 08:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314895.1584842; Thu, 21 May 2026 08:22:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyff-0008QR-V4; Thu, 21 May 2026 08:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1314895;
 Thu, 21 May 2026 08:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyfe-0008QE-KU
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfe-00GSs8-1x
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfe-00GaeC-1n
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=bp8jzbwmeP11OG8FuWyGk28WM/Pa4kk7PKIqTijAgjs=; b=rejvw7ZHt2EqQDC7BvJdOmdyld
	qfx87vuwsLHXQ6APi3IcDHTqCwhOnLTQbfIAb3tKZKXIcAtB6Fi5SaVJdzrk1o35Qj2Kq8lwP5uaP
	gmU7jgLMTc+uUv3sMJEb+KEJ58E/Fk4MDqu/HKDf0a93C84IFHuinPgz6LWhqsWZVY/Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: add support for "all domains" node permission
Message-Id: <E1wPyfe-00GaeC-1n@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:22 +0000

commit 42aeed3b533bce6accbd9e0c2545cd850ae7c178
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:12:54 2026 +0200

    tools/xenstored: add support for "all domains" node permission
    
    Add support for using DOMID_ANY in node permissions to indicate that
    all domains are allowed to access the node.
    
    Add a new feature bit for indicating the support of DOMID_ANY.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/man/xl.cfg.5.pod.in        |  4 ++++
 tools/xenstored/core.c          | 19 ++++++++++++++-----
 tools/xenstored/domain.c        | 16 ++++++++++++++--
 tools/xenstored/domain.h        |  3 ++-
 xen/include/public/io/xs_wire.h |  2 ++
 5 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 2f77016ecf..d34951edb9 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -746,6 +746,10 @@ Xenstore supports to set watches with a limited depth (depth 0 matches
 only the watched node, depth 1 matches the node and its direct children,
 etc.).
 
+=item B<0x00000008>
+
+Xenstore supports the B<all domains> node access permission.
+
 =back
 
 The features supported by the running Xenstore instance can be retrieved
diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 6d82111e29..7dbcd5daad 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -882,6 +882,16 @@ static int write_node(struct connection *conn, struct node *node,
 	return ret;
 }
 
+/* Check one node permission to match a connection. */
+static bool perm_allows_conn(const struct connection *conn,
+			     const struct xs_permissions *p)
+{
+	if (p->id == conn->id || (conn->target && p->id == conn->target->id))
+		return true;
+
+	return p->id == DOMID_ANY;
+}
+
 unsigned int perm_for_conn(struct connection *conn,
 			   const struct node_perms *perms)
 {
@@ -889,14 +899,13 @@ unsigned int perm_for_conn(struct connection *conn,
 	unsigned int mask = XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER;
 
 	/* Owners and tools get it all... */
-	if (!domain_is_unprivileged(conn) || perms->p[0].id == conn->id
-                || (conn->target && perms->p[0].id == conn->target->id))
+	if (!domain_is_unprivileged(conn) ||
+	    perm_allows_conn(conn, perms->p))
 		return (XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER) & mask;
 
 	for (i = 1; i < perms->num; i++)
 		if (!(perms->p[i].perms & XS_PERM_IGNORE) &&
-		    (perms->p[i].id == conn->id ||
-		     (conn->target && perms->p[i].id == conn->target->id)))
+		    perm_allows_conn(conn, perms->p + i))
 			return perms->p[i].perms & mask;
 
 	return perms->p[0].perms & mask;
@@ -1832,7 +1841,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (!xenstore_strings_to_perms(perms.p, perms.num, permstr))
 		return errno;
 
-	if (domain_alloc_permrefs(&perms))
+	if (domain_alloc_permrefs(conn, &perms))
 		return ENOMEM;
 	if (perms.p[0].perms & XS_PERM_IGNORE)
 		return ENOENT;
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 00875d6b5c..7074abd197 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -44,7 +44,8 @@
 #endif
 
 #define XENSTORE_FEATURES	(XENSTORE_SERVER_FEATURE_ERROR |	\
-				 XENSTORE_SERVER_FEATURE_WATCHDEPTH)
+				 XENSTORE_SERVER_FEATURE_WATCHDEPTH |	\
+				 XENSTORE_SERVER_FEATURE_DOMID_ANY)
 
 static xenmanage_handle *xm_handle;
 xengnttab_handle **xgt_handle;
@@ -1754,8 +1755,12 @@ static bool chk_domain_generation(unsigned int domid, uint64_t gen)
  * Allocate all missing struct domain referenced by a permission set.
  * Any permission entries for not existing domains will be marked to be
  * ignored.
+ * A DOMID_ANY entry will be marked to be ignored, if the writing
+ * domain doesn't have the XENSTORE_SERVER_FEATURE_DOMID_ANY enabled. Note
+ * that Xen tools will never set DOMID_ANY for a guest owned node.
  */
-int domain_alloc_permrefs(struct node_perms *perms)
+int domain_alloc_permrefs(const struct connection *conn,
+			  struct node_perms *perms)
 {
 	unsigned int i, domid;
 	struct domain *d;
@@ -1763,6 +1768,12 @@ int domain_alloc_permrefs(struct node_perms *perms)
 
 	for (i = 0; i < perms->num; i++) {
 		domid = perms->p[i].id;
+		if (domid == DOMID_ANY) {
+			if (!(conn->domain->features &
+			      XENSTORE_SERVER_FEATURE_DOMID_ANY))
+				perms->p[i].perms |= XS_PERM_IGNORE;
+			continue;
+		}
 		d = find_domain_struct(domid);
 		if (!d) {
 			if (xenmanage_get_domain_info(xm_handle, domid, NULL,
@@ -1788,6 +1799,7 @@ int domain_adjust_node_perms(struct node *node)
 
 	for (i = 1; i < node->hdr.num_perms; i++) {
 		if ((perms[i].perms & XS_PERM_IGNORE) ||
+		    perms[i].id == DOMID_ANY ||
 		    chk_domain_generation(perms[i].id, node->hdr.generation))
 			continue;
 
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index b1cfb5cd82..7dad4849a0 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -116,7 +116,8 @@ const char *get_implicit_path(const struct connection *conn);
  */
 int domain_adjust_node_perms(struct node *node);
 
-int domain_alloc_permrefs(struct node_perms *perms);
+int domain_alloc_permrefs(const struct connection *conn,
+			  struct node_perms *perms);
 
 /* Quota manipulation */
 int domain_nbentry_inc(struct connection *conn, unsigned int domid);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 2e763bc877..d6533a8452 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -126,6 +126,8 @@ struct xenstore_domain_interface {
 #define XENSTORE_SERVER_FEATURE_ERROR        2
 /* The XS_WATCH command can be used with a <depth> parameter */
 #define XENSTORE_SERVER_FEATURE_WATCHDEPTH   4
+/* The capability to use DOMID_ANY for node permissions */
+#define XENSTORE_SERVER_FEATURE_DOMID_ANY    8
 
 /* Valid values for the connection field */
 #define XENSTORE_CONNECTED 0 /* the steady-state */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314897.1584845 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfq-0008SV-34; Thu, 21 May 2026 08:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314897.1584845; Thu, 21 May 2026 08:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyfq-0008SN-0A; Thu, 21 May 2026 08:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1314897;
 Thu, 21 May 2026 08:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyfo-0008SE-PP
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfo-00GSsC-2R
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfo-00Gaex-28
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=R9/7vIjCUww6XDXvy8zWme0QrufopPuymw1NDjeHEgA=; b=WDpeZAZ1kP1NsB3maac1e6R8Vq
	I3gtv4K2V5XBeXyGuko4DY+4YJYMOpP3mDDfgGwhYfYcveICvPpELaqZcrRM+9tVUbZ5lvS3mOeRK
	ravRQY/8B/rhkkq53YrB8Jebx5jghRctzala+KlHRXiiqjDTYvF0bgot8uCv2yxRRbfo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: allow @releaseDomain watch for all domains
Message-Id: <E1wPyfo-00Gaex-28@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:32 +0000

commit 258263a4fb8fa3e46800ff903cf1c65fa0538bac
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:00 2026 +0200

    tools/xenstored: allow @releaseDomain watch for all domains
    
    Currently the @releaseDomain watch is allowed for dom0 only. This is
    problematic for guests which want to give other domains access to
    Xenstore entries, as they have no simple way to tell when such a
    domain is stopped.
    
    Allow @releaseDomain to be usable by all domains as the default.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xenstored/core.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 7dbcd5daad..d6d462b7bc 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2279,19 +2279,19 @@ struct connection *get_connection_by_id(unsigned int conn_id)
 }
 
 /* We create initial nodes manually. */
-static void manual_node(const char *name, const char *child)
+static void manual_node_perms(const char *name, const char *child,
+			      struct xs_permissions *perms,
+			      unsigned int n_perms)
 {
 	struct node *node;
-	struct xs_permissions perms = { .id = priv_domid,
-					.perms = XS_PERM_NONE };
 
 	node = talloc_zero(NULL, struct node);
 	if (!node)
 		barf_perror("Could not allocate initial node %s", name);
 
 	node->name = name;
-	node->perms = &perms;
-	node->hdr.num_perms = 1;
+	node->perms = perms;
+	node->hdr.num_perms = n_perms;
 	node->children = (char *)child;
 	if (child)
 		node->hdr.childlen = strlen(child) + 1;
@@ -2301,6 +2301,14 @@ static void manual_node(const char *name, const char *child)
 	talloc_free(node);
 }
 
+static void manual_node(const char *name, const char *child)
+{
+	struct xs_permissions perms = { .id = priv_domid,
+					.perms = XS_PERM_NONE };
+
+	manual_node_perms(name, child, &perms, 1);
+}
+
 static unsigned int hash_from_key_fn(const void *k)
 {
 	const char *str = k;
@@ -2320,6 +2328,11 @@ static int keys_equal_fn(const void *key1, const void *key2)
 
 void setup_structure(bool live_update)
 {
+	struct xs_permissions perms[] = {
+		{ .id = priv_domid,	.perms = XS_PERM_NONE },
+		{ .id = DOMID_ANY,	.perms = XS_PERM_READ },
+	};
+
 	nodes = create_hashtable(NULL, "nodes", hash_from_key_fn, keys_equal_fn,
 				 HASHTABLE_FREE_KEY | HASHTABLE_FREE_VALUE);
 	if (!nodes)
@@ -2331,7 +2344,8 @@ void setup_structure(bool live_update)
 		manual_node("/", "tool");
 		manual_node("/tool", "xenstored");
 		manual_node("/tool/xenstored", NULL);
-		manual_node("@releaseDomain", NULL);
+		manual_node_perms("@releaseDomain", NULL,
+				  perms, ARRAY_SIZE(perms));
 		manual_node("@introduceDomain", NULL);
 		domain_nbentry_fix(priv_domid, 5);
 	}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314898.1584849 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyg0-0008Uu-5X; Thu, 21 May 2026 08:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314898.1584849; Thu, 21 May 2026 08:22:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPyg0-0008Um-2s; Thu, 21 May 2026 08:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1314898;
 Thu, 21 May 2026 08:22:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyfy-0008Ug-SC
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfy-00GSsG-2i
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyfy-00Gafm-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ilygbpBQPKIT7HXBV/IyMd6tvWN4lrXAvjhl8lp3kH0=; b=bmBkdxY2B1yZmqC+UbbuvaEsEp
	rHnC1XIvlrea/OhM+wULMlHKY/k7e3gG1UoX5eiqgRxHvVcdC+q0GYxcDm6bqsshYtKipXVJw9tuk
	1B/S/Xl9WYN9Ue++cHtJrARzD/NqN3hHgqZrVVA0ydi8RpYpWBWemdA3uJsoIEvpsH34=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: remove permissions related to dead domain
Message-Id: <E1wPyfy-00Gafm-2b@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:42 +0000

commit cdbcfd5d05521694447ec719bd5935e19a848060
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:05 2026 +0200

    tools/xenstored: remove permissions related to dead domain
    
    With unprivileged domains now capable to use the @releaseDomain watch,
    there is no reason not to remove any node permissions which relate to
    a domain which has been removed.
    
    This resolves a complex scenario where a new domain could inherit the
    permissions of an old one with the same domid.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xenstored/domain.c | 62 +++++++++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 7074abd197..2db452144d 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -569,24 +569,10 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 				  struct node *node, void *arg)
 {
 	struct domain *domain = arg;
-	int ret = WALK_TREE_OK;
-
-	if (node->perms[0].id != domain->domid)
-		return WALK_TREE_OK;
+	bool node_changed = false;
+	unsigned int i;
 
-	if (keep_orphans) {
-		domain_nbentry_dec(NULL, domain->domid);
-		node->perms[0].id = priv_domid;
-		node->acc.memory = 0;
-		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
-			/* That's unfortunate. We only can try to continue. */
-			syslog(LOG_ERR,
-			       "error when moving orphaned node %s to dom0\n",
-			       node->name);
-		} else
-			trace("orphaned node %s moved to dom0\n", node->name);
-	} else {
+	if (node->perms[0].id == domain->domid && !keep_orphans) {
 		if (rm_node(NULL, ctx, node->name)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
@@ -596,10 +582,39 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 			trace("orphaned node %s deleted\n", node->name);
 
 		/* Skip children in all cases in order to avoid more errors. */
-		ret = WALK_TREE_SKIP_CHILDREN;
+		return WALK_TREE_SKIP_CHILDREN;
 	}
 
-	return domain->acc_val[ACC_NODES] ? ret : WALK_TREE_SUCCESS_STOP;
+	if (node->perms[0].id == domain->domid) {
+		domain_nbentry_dec(NULL, domain->domid);
+		node->perms[0].id = priv_domid;
+		node->acc.memory = 0;
+		domain_nbentry_inc(NULL, priv_domid);
+		trace("moving orphaned node %s to dom%d\n", node->name,
+		      priv_domid);
+		node_changed = true;
+	}
+
+	for (i = 1; i < node->hdr.num_perms; i++) {
+		if (node->perms[i].id != domain->domid)
+			continue;
+		memmove(node->perms + i, node->perms + i + 1,
+			sizeof(*node->perms) * (node->hdr.num_perms - i - 1));
+		node->hdr.num_perms--;
+		i--;
+		node_changed = true;
+	}
+
+	if (node_changed) {
+		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
+			/* That's unfortunate. We only can try to continue. */
+			syslog(LOG_ERR,
+			       "error when writing modified node %s\n",
+			       node->name);
+		}
+	}
+
+	return WALK_TREE_OK;
 }
 
 static void domain_tree_remove(struct domain *domain)
@@ -607,12 +622,9 @@ static void domain_tree_remove(struct domain *domain)
 	int ret;
 	struct walk_funcs walkfuncs = { .enter = domain_tree_remove_sub };
 
-	if (domain->acc_val[ACC_NODES]) {
-		ret = walk_node_tree(domain, NULL, "/", &walkfuncs, domain);
-		if (ret == WALK_TREE_ERROR_STOP)
-			syslog(LOG_ERR,
-			       "error when looking for orphaned nodes\n");
-	}
+	ret = walk_node_tree(domain, NULL, "/", &walkfuncs, domain);
+	if (ret == WALK_TREE_ERROR_STOP)
+		syslog(LOG_ERR, "error when looking for orphaned nodes\n");
 
 	walk_node_tree(domain, NULL, "@releaseDomain", &walkfuncs, domain);
 	walk_node_tree(domain, NULL, "@introduceDomain", &walkfuncs, domain);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314899.1584853 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPygA-00005r-6y; Thu, 21 May 2026 08:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314899.1584853; Thu, 21 May 2026 08:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPygA-00005j-4G; Thu, 21 May 2026 08:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1314899;
 Thu, 21 May 2026 08:22:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPyg8-00005Y-Uu
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:22:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyg8-00GSsb-2z
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPyg8-00GahM-2s
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:22:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qLHxJhp3N2N265R7IbffjdeYfqMm0C9q+KmuCUUo+Xg=; b=kUlx0gShJQFHu+UMRO24DxZ3sW
	yT1pLKQBn3kUhnO6yC10Shbwzel5aZKNa8ikaIyL3HFul5nHWSNVGNK8+u7yRHXRnONXJ99sQwznB
	D5qVFuCl614YSAkkLmYG7sGD5kCxRCpeMZiZJyVSQVzrLBtRR9z7ePPn8JYReaMo7/o4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: Fix helpers build
Message-Id: <E1wPyg8-00GahM-2s@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:22:52 +0000

commit 9ae6772f13f5d770aa5763fdbb747ff4bf9f6267
Author:     Mykyta Poturai <mykyta_poturai@epam.com>
AuthorDate: Thu May 21 09:13:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:27 2026 +0200

    tools: Fix helpers build
    
    Init helpers sometimes fail to rebuild after switching branches,
    which results in runtime faults.
    
    Fix this by adding missing DEPS_INCLUDE to the Makefile.
    
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/helpers/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 8262d9e75a..11db7d8982 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -64,3 +64,5 @@ clean:
 	$(RM) *.o $(TARGETS) $(DEPS_RM)
 
 distclean: clean
+
+-include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 08:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 08:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1314901.1584857 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPygK-000081-8h; Thu, 21 May 2026 08:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1314901.1584857; Thu, 21 May 2026 08:23:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wPygK-00007s-5i; Thu, 21 May 2026 08:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1314901;
 Thu, 21 May 2026 08:23:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wPygJ-00007m-1n
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 08:23:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPygJ-00GSsv-05
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:23:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wPygI-00GaiC-3A
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 08:23:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2WNCHcFd+C2xSaq7P1QehkzBLDjIbaYeE61mw+AjXuo=; b=XQNFCvpz3HW3uHDw7rNa0S+LB0
	1MjxEE6Rp3pS3T/+EAeVC9fzBvQcGv4U514qx0ijPj4d1A1i7faTx92kt9je7v2DzM5LPiGSuyhUT
	jgDS0lgcgucAS2LTsaFUb7Cchqy/b92/Iqjwk6xSU+XnKstXOlDJYyiFFrbE0ldQZVOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs: Update console=pv requirement
Message-Id: <E1wPygI-00GaiC-3A@xenbits.xenproject.org>
Date: Thu, 21 May 2026 08:23:02 +0000

commit f47c2e96ab9b61debe18fc0c52faa1672a5d24f9
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu May 21 09:13:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:42 2026 +0200

    docs: Update console=pv requirement
    
    PV console doesn't require Xen to be running as a shim and only
    requires CONFIG_XEN_GUEST and running as a Xen guest. Update the
    documentation accordingly.
    
    Fixes: 4f6609d6a665 ("x86/guest: use PV console for Xen/Dom0 I/O")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.pandoc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 52d4ca0f2f..d46d5b2152 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -446,8 +446,9 @@ the converse; transmitted and received characters will have their MSB
 cleared.  This allows a single port to be shared by two subsystems
 (e.g. console and debugger).
 
-`pv` indicates that Xen should use Xen's PV console. This option is
-only available when used together with `pv-in-pvh`.
+`pv` indicates that Xen should use Xen's PV console. This option requires
+Xen running as a Xen guest. and is only available if the hypervisor was
+compiled with `CONFIG_XEN_GUEST` enabled.
 
 `dbgp` or `ehci` indicates that Xen should use a USB2 debug port.
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315024.1584914 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0i7-0003Xd-5a; Thu, 21 May 2026 10:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315024.1584914; Thu, 21 May 2026 10:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0i7-0003XV-33; Thu, 21 May 2026 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1315024;
 Thu, 21 May 2026 10:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0i6-0003XP-Fe
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0i6-00GVVm-1O
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0i6-00GjJS-1H
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9rdaOQ5pcy7m634rKSdaNR3+lMjodOeoCiDZ99y6fGk=; b=sTqRexlPPV8nFOtx1PIKRxO7ZR
	amn9aYd++UiQ3kLLN8EMvaErgsCH6kCYvmXVEvjgfTtkwWUKm3vQ0tgBPJj5Ct+rKUUaiK+7TiS0M
	XOGqdwPR1U4g8LOEd+3WZbQnhVYZnymA+L+KAr7MvgdRXDoTvqgmyCH9kwe/LtiiuNqk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: VRAM last_dirty tagging
Message-Id: <E1wQ0i6-00GjJS-1H@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:02 +0000

commit 2965f75ebd3814158878464d3c15c3b94fb96571
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 21 09:10:58 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:10:58 2026 +0200

    x86/shadow: VRAM last_dirty tagging
    
    ->last_dirty holding a valid value (one other than -1) is solely an
    indication of the bitmap being entirely clean. (The opposite isn't true,
    because of _sh_propagate() setting the field to a valid value without
    setting a bit in the bitmap.) As a consequence
    - setting the field to a valid value right after having allocated zero-
      filled space is pointless,
    - copying the all empty bitmap to the output array is pointless; with the
      output array also having been allocated zero-filled, not even a memset()
      is needed there,
    - after restoring bitmap contents when dealing with copy_to_guest() having
      failed, the field needs setting to a valid value again.
    
    Furthermore invoking NOW() in perhaps many loop iterations of the main
    loop is wasteful, too. Record whether any bit was set, and record a new
    ->last_dirty only once, after the loop. Then use the same NOW() value also
    for the subsequent check.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index cf4862cbc9..ff4dd1f94c 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1068,18 +1068,18 @@ int shadow_track_dirty_vram(struct domain *d,
         if ( (dirty_vram->dirty_bitmap = xzalloc_array(uint8_t, dirty_size)) == NULL )
             goto out_sl1ma;
 
-        dirty_vram->last_dirty = NOW();
+        dirty_vram->last_dirty = -1;
 
         /* Tell the caller that this time we could not track dirty bits. */
         rc = -ENODATA;
     }
-    else if ( dirty_vram->last_dirty == -1 )
-        /* still completely clean, just copy our empty bitmap */
-        memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size);
-    else
+    /* Nothing to do when the bitmap is still completely clean. */
+    else if ( dirty_vram->last_dirty != -1 )
     {
         mfn_t map_mfn = INVALID_MFN;
         void *map_sl1p = NULL;
+        bool any_dirty = false;
+        s_time_t now;
 
         /* Iterate over VRAM to track dirty bits. */
         for ( i = 0; i < nr_frames; i++ )
@@ -1155,16 +1155,20 @@ int shadow_track_dirty_vram(struct domain *d,
             if ( dirty )
             {
                 dirty_vram->dirty_bitmap[i / 8] |= 1 << (i % 8);
-                dirty_vram->last_dirty = NOW();
+                any_dirty = true;
             }
         }
 
+        now = NOW();
+        if ( any_dirty )
+            dirty_vram->last_dirty = now;
+
         if ( map_sl1p )
             unmap_domain_page(map_sl1p);
 
         memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size);
         memset(dirty_vram->dirty_bitmap, 0, dirty_size);
-        if ( dirty_vram->last_dirty + SECONDS(2) < NOW() )
+        if ( dirty_vram->last_dirty + SECONDS(2) < now )
         {
             /*
              * Was clean for more than two seconds, try to disable guest
@@ -1197,6 +1201,7 @@ int shadow_track_dirty_vram(struct domain *d,
         paging_lock(d);
         for ( i = 0; i < dirty_size; i++ )
             dirty_vram->dirty_bitmap[i] |= dirty_bitmap[i];
+        dirty_vram->last_dirty = NOW();
         paging_unlock(d);
         rc = -EFAULT;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315025.1584918 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iH-0003ZL-6s; Thu, 21 May 2026 10:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315025.1584918; Thu, 21 May 2026 10:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iH-0003ZE-4R; Thu, 21 May 2026 10:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1315025;
 Thu, 21 May 2026 10:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0iG-0003Z6-Ht
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iG-00GVVq-1g
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iG-00GjJt-1Z
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EFc/u2m/pwxUt2EsQSXlWAteoCrlhgostFp3sG7SIp0=; b=dnk6L30nMkE7qtxbCmZqnr8ngB
	gylooF2GRMVPfkXl7oIDpZ1zrRnaB8dllDYnXR6/N61yZ6ofEfX53gWJutTokO/VQ3Crd/PrBPXtm
	bZ+7TsmHH0L67G/RwLNRFbqzit54gOQaGW1bd/6lCB6r6wfsXwJowWchN/EB0Q7XpsrY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: reduce flush_tlb's scope in shadow_track_dirty_vram()
Message-Id: <E1wQ0iG-00GjJt-1Z@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:12 +0000

commit 1146b4f52457c2048ed8cb52ecab799719e21f92
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 21 09:11:33 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:11:33 2026 +0200

    x86/shadow: reduce flush_tlb's scope in shadow_track_dirty_vram()
    
    It's set only in the main "else", so the declaration as well as the sole
    consumer can also move into that more narrow scope. This may in particular
    help with possible future locking changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index ff4dd1f94c..e6fb97c4b6 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1003,7 +1003,6 @@ int shadow_track_dirty_vram(struct domain *d,
     int rc = 0;
     unsigned long end_pfn = begin_pfn + nr_frames;
     unsigned int dirty_size = DIV_ROUND_UP(nr_frames, BITS_PER_BYTE);
-    int flush_tlb = 0;
     unsigned long i;
     p2m_type_t t;
     struct sh_dirty_vram *dirty_vram;
@@ -1078,7 +1077,7 @@ int shadow_track_dirty_vram(struct domain *d,
     {
         mfn_t map_mfn = INVALID_MFN;
         void *map_sl1p = NULL;
-        bool any_dirty = false;
+        bool any_dirty = false, flush_tlb = false;
         s_time_t now;
 
         /* Iterate over VRAM to track dirty bits. */
@@ -1139,7 +1138,7 @@ int shadow_track_dirty_vram(struct domain *d,
                              * _PAGE_ACCESSED set by another processor.
                              */
                             l1e_remove_flags(*sl1e, _PAGE_DIRTY);
-                            flush_tlb = 1;
+                            flush_tlb = true;
                         }
                     }
                     break;
@@ -1182,9 +1181,10 @@ int shadow_track_dirty_vram(struct domain *d,
             }
             dirty_vram->last_dirty = -1;
         }
+
+        if ( flush_tlb )
+            guest_flush_tlb_mask(d, d->dirty_cpumask);
     }
-    if ( flush_tlb )
-        guest_flush_tlb_mask(d, d->dirty_cpumask);
     goto out;
 
  out_sl1ma:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315026.1584923 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iR-0003br-8u; Thu, 21 May 2026 10:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315026.1584923; Thu, 21 May 2026 10:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iR-0003bi-5q; Thu, 21 May 2026 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1315026;
 Thu, 21 May 2026 10:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0iQ-0003ba-LF
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iQ-00GVVy-21
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iQ-00GjKg-1t
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mGH202BDZQqh05nhEgCXwVyZ9geboYsNJUGqzeCaoFI=; b=tGiYNcLRs4+xD/9AyMT/K/h2Dk
	Fkbil7kMUarnJKQ80d4Vv58AUNLxkhZqWkpnIrZfZSjx4j1I7Vzi1NniOnC7oTXHCQcZsps0kcJdw
	0ZtuvdvyXLNJgZvS5XBPhsNT3Q/EC5qfkjhLUWoDUCiPstuAnfElvlvKBVG+2273/HoA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: add support for "all domains" node permission
Message-Id: <E1wQ0iQ-00GjKg-1t@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:22 +0000

commit 42aeed3b533bce6accbd9e0c2545cd850ae7c178
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:12:54 2026 +0200

    tools/xenstored: add support for "all domains" node permission
    
    Add support for using DOMID_ANY in node permissions to indicate that
    all domains are allowed to access the node.
    
    Add a new feature bit for indicating the support of DOMID_ANY.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 docs/man/xl.cfg.5.pod.in        |  4 ++++
 tools/xenstored/core.c          | 19 ++++++++++++++-----
 tools/xenstored/domain.c        | 16 ++++++++++++++--
 tools/xenstored/domain.h        |  3 ++-
 xen/include/public/io/xs_wire.h |  2 ++
 5 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in
index 2f77016ecf..d34951edb9 100644
--- a/docs/man/xl.cfg.5.pod.in
+++ b/docs/man/xl.cfg.5.pod.in
@@ -746,6 +746,10 @@ Xenstore supports to set watches with a limited depth (depth 0 matches
 only the watched node, depth 1 matches the node and its direct children,
 etc.).
 
+=item B<0x00000008>
+
+Xenstore supports the B<all domains> node access permission.
+
 =back
 
 The features supported by the running Xenstore instance can be retrieved
diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 6d82111e29..7dbcd5daad 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -882,6 +882,16 @@ static int write_node(struct connection *conn, struct node *node,
 	return ret;
 }
 
+/* Check one node permission to match a connection. */
+static bool perm_allows_conn(const struct connection *conn,
+			     const struct xs_permissions *p)
+{
+	if (p->id == conn->id || (conn->target && p->id == conn->target->id))
+		return true;
+
+	return p->id == DOMID_ANY;
+}
+
 unsigned int perm_for_conn(struct connection *conn,
 			   const struct node_perms *perms)
 {
@@ -889,14 +899,13 @@ unsigned int perm_for_conn(struct connection *conn,
 	unsigned int mask = XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER;
 
 	/* Owners and tools get it all... */
-	if (!domain_is_unprivileged(conn) || perms->p[0].id == conn->id
-                || (conn->target && perms->p[0].id == conn->target->id))
+	if (!domain_is_unprivileged(conn) ||
+	    perm_allows_conn(conn, perms->p))
 		return (XS_PERM_READ|XS_PERM_WRITE|XS_PERM_OWNER) & mask;
 
 	for (i = 1; i < perms->num; i++)
 		if (!(perms->p[i].perms & XS_PERM_IGNORE) &&
-		    (perms->p[i].id == conn->id ||
-		     (conn->target && perms->p[i].id == conn->target->id)))
+		    perm_allows_conn(conn, perms->p + i))
 			return perms->p[i].perms & mask;
 
 	return perms->p[0].perms & mask;
@@ -1832,7 +1841,7 @@ static int do_set_perms(const void *ctx, struct connection *conn,
 	if (!xenstore_strings_to_perms(perms.p, perms.num, permstr))
 		return errno;
 
-	if (domain_alloc_permrefs(&perms))
+	if (domain_alloc_permrefs(conn, &perms))
 		return ENOMEM;
 	if (perms.p[0].perms & XS_PERM_IGNORE)
 		return ENOENT;
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 00875d6b5c..7074abd197 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -44,7 +44,8 @@
 #endif
 
 #define XENSTORE_FEATURES	(XENSTORE_SERVER_FEATURE_ERROR |	\
-				 XENSTORE_SERVER_FEATURE_WATCHDEPTH)
+				 XENSTORE_SERVER_FEATURE_WATCHDEPTH |	\
+				 XENSTORE_SERVER_FEATURE_DOMID_ANY)
 
 static xenmanage_handle *xm_handle;
 xengnttab_handle **xgt_handle;
@@ -1754,8 +1755,12 @@ static bool chk_domain_generation(unsigned int domid, uint64_t gen)
  * Allocate all missing struct domain referenced by a permission set.
  * Any permission entries for not existing domains will be marked to be
  * ignored.
+ * A DOMID_ANY entry will be marked to be ignored, if the writing
+ * domain doesn't have the XENSTORE_SERVER_FEATURE_DOMID_ANY enabled. Note
+ * that Xen tools will never set DOMID_ANY for a guest owned node.
  */
-int domain_alloc_permrefs(struct node_perms *perms)
+int domain_alloc_permrefs(const struct connection *conn,
+			  struct node_perms *perms)
 {
 	unsigned int i, domid;
 	struct domain *d;
@@ -1763,6 +1768,12 @@ int domain_alloc_permrefs(struct node_perms *perms)
 
 	for (i = 0; i < perms->num; i++) {
 		domid = perms->p[i].id;
+		if (domid == DOMID_ANY) {
+			if (!(conn->domain->features &
+			      XENSTORE_SERVER_FEATURE_DOMID_ANY))
+				perms->p[i].perms |= XS_PERM_IGNORE;
+			continue;
+		}
 		d = find_domain_struct(domid);
 		if (!d) {
 			if (xenmanage_get_domain_info(xm_handle, domid, NULL,
@@ -1788,6 +1799,7 @@ int domain_adjust_node_perms(struct node *node)
 
 	for (i = 1; i < node->hdr.num_perms; i++) {
 		if ((perms[i].perms & XS_PERM_IGNORE) ||
+		    perms[i].id == DOMID_ANY ||
 		    chk_domain_generation(perms[i].id, node->hdr.generation))
 			continue;
 
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index b1cfb5cd82..7dad4849a0 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -116,7 +116,8 @@ const char *get_implicit_path(const struct connection *conn);
  */
 int domain_adjust_node_perms(struct node *node);
 
-int domain_alloc_permrefs(struct node_perms *perms);
+int domain_alloc_permrefs(const struct connection *conn,
+			  struct node_perms *perms);
 
 /* Quota manipulation */
 int domain_nbentry_inc(struct connection *conn, unsigned int domid);
diff --git a/xen/include/public/io/xs_wire.h b/xen/include/public/io/xs_wire.h
index 2e763bc877..d6533a8452 100644
--- a/xen/include/public/io/xs_wire.h
+++ b/xen/include/public/io/xs_wire.h
@@ -126,6 +126,8 @@ struct xenstore_domain_interface {
 #define XENSTORE_SERVER_FEATURE_ERROR        2
 /* The XS_WATCH command can be used with a <depth> parameter */
 #define XENSTORE_SERVER_FEATURE_WATCHDEPTH   4
+/* The capability to use DOMID_ANY for node permissions */
+#define XENSTORE_SERVER_FEATURE_DOMID_ANY    8
 
 /* Valid values for the connection field */
 #define XENSTORE_CONNECTED 0 /* the steady-state */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315027.1584927 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0ib-0003eJ-BX; Thu, 21 May 2026 10:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315027.1584927; Thu, 21 May 2026 10:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0ib-0003eC-8u; Thu, 21 May 2026 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1315027;
 Thu, 21 May 2026 10:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0ia-0003e5-OK
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0ia-00GVW2-2K
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0ia-00GjL2-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=eE17fMQ0ZtsMqZlRVKgI36s2X0yUgD00y8bpcEFtB+I=; b=fl4PsROAECM07riFjPtj6d8Ykb
	H84L1sdEUavpSWDIYtRKdgbB6B5dZfBvcPQkkGpNAwlZ3rur3iS4KHlbJAMRyJ9WBZso1b5+GNFMR
	VJcgO9YNx0yf+cgg1Wa1BDURsHsZcakzMEAz2D+lLQeKYBsqUm3tzDLBIo1SjhUTUAKM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: allow @releaseDomain watch for all domains
Message-Id: <E1wQ0ia-00GjL2-2C@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:32 +0000

commit 258263a4fb8fa3e46800ff903cf1c65fa0538bac
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:18 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:00 2026 +0200

    tools/xenstored: allow @releaseDomain watch for all domains
    
    Currently the @releaseDomain watch is allowed for dom0 only. This is
    problematic for guests which want to give other domains access to
    Xenstore entries, as they have no simple way to tell when such a
    domain is stopped.
    
    Allow @releaseDomain to be usable by all domains as the default.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xenstored/core.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 7dbcd5daad..d6d462b7bc 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2279,19 +2279,19 @@ struct connection *get_connection_by_id(unsigned int conn_id)
 }
 
 /* We create initial nodes manually. */
-static void manual_node(const char *name, const char *child)
+static void manual_node_perms(const char *name, const char *child,
+			      struct xs_permissions *perms,
+			      unsigned int n_perms)
 {
 	struct node *node;
-	struct xs_permissions perms = { .id = priv_domid,
-					.perms = XS_PERM_NONE };
 
 	node = talloc_zero(NULL, struct node);
 	if (!node)
 		barf_perror("Could not allocate initial node %s", name);
 
 	node->name = name;
-	node->perms = &perms;
-	node->hdr.num_perms = 1;
+	node->perms = perms;
+	node->hdr.num_perms = n_perms;
 	node->children = (char *)child;
 	if (child)
 		node->hdr.childlen = strlen(child) + 1;
@@ -2301,6 +2301,14 @@ static void manual_node(const char *name, const char *child)
 	talloc_free(node);
 }
 
+static void manual_node(const char *name, const char *child)
+{
+	struct xs_permissions perms = { .id = priv_domid,
+					.perms = XS_PERM_NONE };
+
+	manual_node_perms(name, child, &perms, 1);
+}
+
 static unsigned int hash_from_key_fn(const void *k)
 {
 	const char *str = k;
@@ -2320,6 +2328,11 @@ static int keys_equal_fn(const void *key1, const void *key2)
 
 void setup_structure(bool live_update)
 {
+	struct xs_permissions perms[] = {
+		{ .id = priv_domid,	.perms = XS_PERM_NONE },
+		{ .id = DOMID_ANY,	.perms = XS_PERM_READ },
+	};
+
 	nodes = create_hashtable(NULL, "nodes", hash_from_key_fn, keys_equal_fn,
 				 HASHTABLE_FREE_KEY | HASHTABLE_FREE_VALUE);
 	if (!nodes)
@@ -2331,7 +2344,8 @@ void setup_structure(bool live_update)
 		manual_node("/", "tool");
 		manual_node("/tool", "xenstored");
 		manual_node("/tool/xenstored", NULL);
-		manual_node("@releaseDomain", NULL);
+		manual_node_perms("@releaseDomain", NULL,
+				  perms, ARRAY_SIZE(perms));
 		manual_node("@introduceDomain", NULL);
 		domain_nbentry_fix(priv_domid, 5);
 	}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315028.1584931 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0im-0003gI-D7; Thu, 21 May 2026 10:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315028.1584931; Thu, 21 May 2026 10:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0im-0003gA-AW; Thu, 21 May 2026 10:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1315028;
 Thu, 21 May 2026 10:33:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0ik-0003g4-S9
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0ik-00GVW6-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0ik-00GjLa-2V
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=minBjiBpQL6sZ+ljZ5t1e1TWG3kgnm7Fkh0X0USzJvI=; b=27S+LOf5py7BKf7BzYuJ+ha1L0
	nBv45sdRIvBSRc/d14mBEE5C3Ct7raDfSWz0h8iHXXcoo/48dclekfp6IuohUuj1JNcYlS20Sqc5x
	oOrmZOI1jlKFbmXSzF28XXVCWoVuAjypJq6p9JOCWvYx02kB2w/Y4fXdGzdHHj1A+DVE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: remove permissions related to dead domain
Message-Id: <E1wQ0ik-00GjLa-2V@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:42 +0000

commit cdbcfd5d05521694447ec719bd5935e19a848060
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Wed Apr 29 14:06:19 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:05 2026 +0200

    tools/xenstored: remove permissions related to dead domain
    
    With unprivileged domains now capable to use the @releaseDomain watch,
    there is no reason not to remove any node permissions which relate to
    a domain which has been removed.
    
    This resolves a complex scenario where a new domain could inherit the
    permissions of an old one with the same domid.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 tools/xenstored/domain.c | 62 +++++++++++++++++++++++++++++-------------------
 1 file changed, 37 insertions(+), 25 deletions(-)

diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 7074abd197..2db452144d 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -569,24 +569,10 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 				  struct node *node, void *arg)
 {
 	struct domain *domain = arg;
-	int ret = WALK_TREE_OK;
-
-	if (node->perms[0].id != domain->domid)
-		return WALK_TREE_OK;
+	bool node_changed = false;
+	unsigned int i;
 
-	if (keep_orphans) {
-		domain_nbentry_dec(NULL, domain->domid);
-		node->perms[0].id = priv_domid;
-		node->acc.memory = 0;
-		domain_nbentry_inc(NULL, priv_domid);
-		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
-			/* That's unfortunate. We only can try to continue. */
-			syslog(LOG_ERR,
-			       "error when moving orphaned node %s to dom0\n",
-			       node->name);
-		} else
-			trace("orphaned node %s moved to dom0\n", node->name);
-	} else {
+	if (node->perms[0].id == domain->domid && !keep_orphans) {
 		if (rm_node(NULL, ctx, node->name)) {
 			/* That's unfortunate. We only can try to continue. */
 			syslog(LOG_ERR,
@@ -596,10 +582,39 @@ static int domain_tree_remove_sub(const void *ctx, struct connection *conn,
 			trace("orphaned node %s deleted\n", node->name);
 
 		/* Skip children in all cases in order to avoid more errors. */
-		ret = WALK_TREE_SKIP_CHILDREN;
+		return WALK_TREE_SKIP_CHILDREN;
 	}
 
-	return domain->acc_val[ACC_NODES] ? ret : WALK_TREE_SUCCESS_STOP;
+	if (node->perms[0].id == domain->domid) {
+		domain_nbentry_dec(NULL, domain->domid);
+		node->perms[0].id = priv_domid;
+		node->acc.memory = 0;
+		domain_nbentry_inc(NULL, priv_domid);
+		trace("moving orphaned node %s to dom%d\n", node->name,
+		      priv_domid);
+		node_changed = true;
+	}
+
+	for (i = 1; i < node->hdr.num_perms; i++) {
+		if (node->perms[i].id != domain->domid)
+			continue;
+		memmove(node->perms + i, node->perms + i + 1,
+			sizeof(*node->perms) * (node->hdr.num_perms - i - 1));
+		node->hdr.num_perms--;
+		i--;
+		node_changed = true;
+	}
+
+	if (node_changed) {
+		if (write_node_raw(NULL, node->name, node, NODE_MODIFY, true)) {
+			/* That's unfortunate. We only can try to continue. */
+			syslog(LOG_ERR,
+			       "error when writing modified node %s\n",
+			       node->name);
+		}
+	}
+
+	return WALK_TREE_OK;
 }
 
 static void domain_tree_remove(struct domain *domain)
@@ -607,12 +622,9 @@ static void domain_tree_remove(struct domain *domain)
 	int ret;
 	struct walk_funcs walkfuncs = { .enter = domain_tree_remove_sub };
 
-	if (domain->acc_val[ACC_NODES]) {
-		ret = walk_node_tree(domain, NULL, "/", &walkfuncs, domain);
-		if (ret == WALK_TREE_ERROR_STOP)
-			syslog(LOG_ERR,
-			       "error when looking for orphaned nodes\n");
-	}
+	ret = walk_node_tree(domain, NULL, "/", &walkfuncs, domain);
+	if (ret == WALK_TREE_ERROR_STOP)
+		syslog(LOG_ERR, "error when looking for orphaned nodes\n");
 
 	walk_node_tree(domain, NULL, "@releaseDomain", &walkfuncs, domain);
 	walk_node_tree(domain, NULL, "@introduceDomain", &walkfuncs, domain);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315029.1584935 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iw-0003iE-EN; Thu, 21 May 2026 10:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315029.1584935; Thu, 21 May 2026 10:33:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0iw-0003i6-Bp; Thu, 21 May 2026 10:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1315029;
 Thu, 21 May 2026 10:33:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0iu-0003hw-Uw
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:33:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iu-00GVWf-30
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0iu-00GjMD-2q
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:33:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=svX8iu3pDYRNfFK4Mvm4PyysZx8Cmxd41WeDaB7CBzc=; b=VKGjZ0NrNXflnVWjM0l97n6i9W
	sFm6vnAEPj6QYPKZgHyHgMW+oxt+3nrI6/MzU95HrcNxyK4K1ynXdsDKrtjSeRINesJi0d8tlyPY7
	3T4rmkji7q9BlA27ZnqOHgpiPAO4BHESucDdy+nepPnOBsR+u3WPUqTBiMPRs2TouAog=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: Fix helpers build
Message-Id: <E1wQ0iu-00GjMD-2q@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:33:52 +0000

commit 9ae6772f13f5d770aa5763fdbb747ff4bf9f6267
Author:     Mykyta Poturai <mykyta_poturai@epam.com>
AuthorDate: Thu May 21 09:13:27 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:27 2026 +0200

    tools: Fix helpers build
    
    Init helpers sometimes fail to rebuild after switching branches,
    which results in runtime faults.
    
    Fix this by adding missing DEPS_INCLUDE to the Makefile.
    
    Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/helpers/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/helpers/Makefile b/tools/helpers/Makefile
index 8262d9e75a..11db7d8982 100644
--- a/tools/helpers/Makefile
+++ b/tools/helpers/Makefile
@@ -64,3 +64,5 @@ clean:
 	$(RM) *.o $(TARGETS) $(DEPS_RM)
 
 distclean: clean
+
+-include $(DEPS_INCLUDE)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 10:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 10:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315030.1584939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0j6-0003kC-Fk; Thu, 21 May 2026 10:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315030.1584939; Thu, 21 May 2026 10:34:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ0j6-0003k4-D9; Thu, 21 May 2026 10:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1315030;
 Thu, 21 May 2026 10:34:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ0j5-0003jy-1Z
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 10:34:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0j5-00GVWu-04
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ0j4-00GjNW-3A
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 10:34:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/vA3uGP3MP7zJ/4GmjYP/NJ+g4Kxq+fbGhoQaoimCSM=; b=UTqwHfR+VZOjtDBUcJRgdsIf1V
	w/TvEkxKq9BaZaM7Vjs4fr+z4YFxQdqSXUMMLM/3fn10WwmrJBmKkTBYuCGtYYWt8iEifs6U5Ldje
	FtLctINKp1FnAaFYbvT5R4zFzOVCiWBNxIl5fDYFkZWmrp1CrrfFWKeNkOgZViI9ecKQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs: Update console=pv requirement
Message-Id: <E1wQ0j4-00GjNW-3A@xenbits.xenproject.org>
Date: Thu, 21 May 2026 10:34:02 +0000

commit f47c2e96ab9b61debe18fc0c52faa1672a5d24f9
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Thu May 21 09:13:42 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 21 09:13:42 2026 +0200

    docs: Update console=pv requirement
    
    PV console doesn't require Xen to be running as a shim and only
    requires CONFIG_XEN_GUEST and running as a Xen guest. Update the
    documentation accordingly.
    
    Fixes: 4f6609d6a665 ("x86/guest: use PV console for Xen/Dom0 I/O")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.pandoc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 52d4ca0f2f..d46d5b2152 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -446,8 +446,9 @@ the converse; transmitted and received characters will have their MSB
 cleared.  This allows a single port to be shared by two subsystems
 (e.g. console and debugger).
 
-`pv` indicates that Xen should use Xen's PV console. This option is
-only available when used together with `pv-in-pvh`.
+`pv` indicates that Xen should use Xen's PV console. This option requires
+Xen running as a Xen guest. and is only available if the hypervisor was
+compiled with `CONFIG_XEN_GUEST` enabled.
 
 `dbgp` or `ehci` indicates that Xen should use a USB2 debug port.
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 15:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 15:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315475.1585285 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ5jj-0008Pt-Ey; Thu, 21 May 2026 15:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315475.1585285; Thu, 21 May 2026 15:55:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ5jj-0008Pl-CH; Thu, 21 May 2026 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1315475;
 Thu, 21 May 2026 15:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ5jh-0008Pf-Qi
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 15:55:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ5jh-00Gc4e-2S
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 15:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ5jh-00H4bQ-2K
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 15:55:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5v9jgBktk0nyzPCfqNjjE86RfbZRz2o42UcjfZf1UbU=; b=OyWufj7oAdZD801DfS7bq+0vLL
	8oI9+w6HJc92UnqWVP6DckhxJQ0DcNHl4hTlhA9FOZsOQbI1Mqw+sbdyQel/e+ttCpgRQasEEpaaa
	Bpsanu+fh9EuYpkCTlbO4JGoCwmG+df+kizbe9lqqqW8zXPQ7mI4k1gd2Q2mxooBI0Qw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: Drop unused parameter from soft_rdtsc()
Message-Id: <E1wQ5jh-00H4bQ-2K@xenbits.xenproject.org>
Date: Thu, 21 May 2026 15:55:01 +0000

commit 614825f0d0a8a55911f6244fb3b0e9829f68b020
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 15 09:40:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 21 16:43:01 2026 +0100

    x86/time: Drop unused parameter from soft_rdtsc()
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index d98c7f166a..6afbb79f0b 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -877,8 +877,7 @@ static uint64_t guest_efer(const struct domain *d)
     return val;
 }
 
-static uint64_t soft_rdtsc(
-    const struct vcpu *v, const struct cpu_user_regs *regs)
+static uint64_t soft_rdtsc(const struct vcpu *v)
 {
     s_time_t old, new, now = get_s_time();
     struct domain *d = v->domain;
@@ -938,7 +937,7 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_IA32_TSC:
-        *val = currd->arch.vtsc ? soft_rdtsc(curr, ctxt->regs) : rdtsc();
+        *val = currd->arch.vtsc ? soft_rdtsc(curr) : rdtsc();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 15:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 15:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315476.1585289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ5jt-0008RZ-GM; Thu, 21 May 2026 15:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315476.1585289; Thu, 21 May 2026 15:55:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ5jt-0008RR-Df; Thu, 21 May 2026 15:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1315476;
 Thu, 21 May 2026 15:55:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ5jr-0008RL-Sd
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 15:55:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ5jr-00Gc75-2l
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 15:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ5jr-00H4cC-2d
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 15:55:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vpIeuC/XWu9JabJrZoInskJpvzHW9xwTItjU8Vo9YA8=; b=Ft0Tpux5HOyJWvjDo68ZbqJyLM
	YEUQQyX4ZEhAQxWK2VP9X6T6rwG/LiFvODL97RK0JKs/wIyPWrBFHw+NgVfg473AEziM8KCea+2k9
	RRFlqxZESfGFrvEsTzI+uIUhL+DAXg0fiwCaK90BL4x56OTm5/UEQx7732KnLueTvmhs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Support vNMI on capable hardware
Message-Id: <E1wQ5jr-00H4cC-2d@xenbits.xenproject.org>
Date: Thu, 21 May 2026 15:55:11 +0000

commit 86a203ab8d38f3bae19219980c2a37d091a8f7aa
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Thu Feb 26 13:20:43 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 21 16:43:01 2026 +0100

    x86/svm: Support vNMI on capable hardware
    
    Starting with Zen4, AMD CPUs can virtualise NMIs for a guest.  On older
    hardware, determining when an NMI is safe to deliver is a challenge and Xen
    does not handle all corner cases correctly.
    
    With vNMI, there is an enablement bit and two new bits of state in the VMCB; a
    pending bit, and a blocked bit.  These directly map to the CPU state for
    handling NMIs, and are maintained by hardware during the running of the vCPU.
    
    When vNMI is enabled, have svm_{get,set}_interrupt_shadow() work in terms of
    the vnmi_blocking bit rather than the IRET intercept.  This allows an emulated
    IRET instruction to re-enable NMIs.
    
    When injecting a new NMI, simply set the vnmi_pending bit; hardware will
    deliver the NMI to the guest at the next suitable juncture.
    
    One complication is that, when delivering a second NMI before the first has
    completed, the mix between common HVM logic and SVM specific logic will try to
    open an NMI window, malfunctioning as it does so.  When vNMI is enabled, short
    circuit this to not consider NMIs blocked.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hvm/svm/intr.c | 19 +++++++++++++++++++
 xen/arch/x86/hvm/svm/svm.c  | 23 +++++++++++++++++------
 xen/arch/x86/hvm/svm/vmcb.c |  2 ++
 3 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 6453a46b85..cf0621d2f6 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -33,6 +33,12 @@ static void svm_inject_nmi(struct vcpu *v)
     u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
     intinfo_t event;
 
+    if ( vmcb->_vintr.fields.vnmi_enable )
+    {
+        vmcb->_vintr.fields.vnmi_pending = true;
+        return;
+    }
+
     event.raw = 0;
     event.v = true;
     event.type = X86_ET_NMI;
@@ -142,6 +148,19 @@ void asmlinkage svm_intr_assist(void)
             return;
 
         intblk = hvm_interrupt_blocked(v, intack);
+
+        /*
+         * When vNMI is active, NMIs can be injected by setting vnmi_pending
+         * and hardware will deliver them at the next appropriate opportunity.
+         * Consider them not blocked, to avoid trying to open an NMI Window.
+         *
+         * Correctness here relies on the fact that all vNMI capable hardware
+         * has vGIF, and vGIF is always activated when appropriate.
+         */
+        if ( intblk == hvm_intblk_nmi_iret &&
+             vmcb->_vintr.fields.vnmi_enable )
+            intblk = hvm_intblk_none;
+
         if ( intblk == hvm_intblk_svm_gif )
         {
             ASSERT(nestedhvm_enabled(v->domain));
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f49d2ebbfd..49fcdd906c 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -499,7 +499,9 @@ static unsigned cf_check int svm_get_interrupt_shadow(struct vcpu *v)
     if ( vmcb->int_stat.intr_shadow )
         intr_shadow |= HVM_INTR_SHADOW_MOV_SS | HVM_INTR_SHADOW_STI;
 
-    if ( vmcb_get_general1_intercepts(vmcb) & GENERAL1_INTERCEPT_IRET )
+    if ( vmcb->_vintr.fields.vnmi_enable
+         ? vmcb->_vintr.fields.vnmi_blocking
+         : (vmcb_get_general1_intercepts(vmcb) & GENERAL1_INTERCEPT_IRET) )
         intr_shadow |= HVM_INTR_SHADOW_NMI;
 
     return intr_shadow;
@@ -509,15 +511,23 @@ static void cf_check svm_set_interrupt_shadow(
     struct vcpu *v, unsigned int intr_shadow)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
-    u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
+    bool block_nmi = intr_shadow & HVM_INTR_SHADOW_NMI;
 
     vmcb->int_stat.intr_shadow =
         !!(intr_shadow & (HVM_INTR_SHADOW_MOV_SS|HVM_INTR_SHADOW_STI));
 
-    general1_intercepts &= ~GENERAL1_INTERCEPT_IRET;
-    if ( intr_shadow & HVM_INTR_SHADOW_NMI )
-        general1_intercepts |= GENERAL1_INTERCEPT_IRET;
-    vmcb_set_general1_intercepts(vmcb, general1_intercepts);
+    if ( vmcb->_vintr.fields.vnmi_enable )
+        vmcb->_vintr.fields.vnmi_blocking = block_nmi;
+    else
+    {
+        uint32_t gen1 = vmcb_get_general1_intercepts(vmcb);
+
+        gen1 &= ~GENERAL1_INTERCEPT_IRET;
+        if ( block_nmi )
+            gen1 |= GENERAL1_INTERCEPT_IRET;
+
+        vmcb_set_general1_intercepts(vmcb, gen1);
+    }
 }
 
 static int cf_check svm_guest_x86_mode(struct vcpu *v)
@@ -2460,6 +2470,7 @@ const struct hvm_function_table * __init start_svm(void)
     P(cpu_has_tsc_ratio, "TSC Rate MSR");
     P(cpu_has_svm_sss, "NPT Supervisor Shadow Stack");
     P(cpu_has_svm_spec_ctrl, "MSR_SPEC_CTRL virtualisation");
+    P(cpu_has_svm_vnmi, "Virtual NMI");
     P(cpu_has_svm_bus_lock, "Bus Lock Filter");
 #undef P
 
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 514e530cbd..975a1eaef8 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -185,6 +185,8 @@ static int construct_vmcb(struct vcpu *v)
     if ( default_xen_spec_ctrl == SPEC_CTRL_STIBP )
         v->arch.msrs->spec_ctrl.raw = SPEC_CTRL_STIBP;
 
+    vmcb->_vintr.fields.vnmi_enable = cpu_has_svm_vnmi;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 21 16:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 16:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315611.1585347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ6V9-0005Ya-Gs; Thu, 21 May 2026 16:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315611.1585347; Thu, 21 May 2026 16:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ6V9-0005YT-E1; Thu, 21 May 2026 16:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1315611;
 Thu, 21 May 2026 16:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ6V8-0005YH-Ff
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 16:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ6V8-00Gdc1-1N
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 16:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ6V8-00H8B2-1F
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 16:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rIkAmf2k/awkK5tyX/4eaVaNOZA7dRvTF8ndFvBCN20=; b=Gw0dwe8pSM2xGqO5ybve/ZwVD5
	4r/3pBS1iq1LZH2OpL6fPtitTXXyJea2TCdx115e6yEy19a19ycpP9QSnhzNImRNMLtVl77VhrJkT
	V0GEGr0/UzJoGf/FRJHrg5GKY+sRmKAtH9MKV4PI9EdgX1AAHMQt/r0jOAGY3YVcWr/8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: Drop unused parameter from soft_rdtsc()
Message-Id: <E1wQ6V8-00H8B2-1F@xenbits.xenproject.org>
Date: Thu, 21 May 2026 16:44:02 +0000

commit 614825f0d0a8a55911f6244fb3b0e9829f68b020
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 15 09:40:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 21 16:43:01 2026 +0100

    x86/time: Drop unused parameter from soft_rdtsc()
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index d98c7f166a..6afbb79f0b 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -877,8 +877,7 @@ static uint64_t guest_efer(const struct domain *d)
     return val;
 }
 
-static uint64_t soft_rdtsc(
-    const struct vcpu *v, const struct cpu_user_regs *regs)
+static uint64_t soft_rdtsc(const struct vcpu *v)
 {
     s_time_t old, new, now = get_s_time();
     struct domain *d = v->domain;
@@ -938,7 +937,7 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_IA32_TSC:
-        *val = currd->arch.vtsc ? soft_rdtsc(curr, ctxt->regs) : rdtsc();
+        *val = currd->arch.vtsc ? soft_rdtsc(curr) : rdtsc();
         return X86EMUL_OKAY;
 
     case MSR_EFER:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 21 16:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 21 May 2026 16:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1315612.1585351 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ6VJ-0005cQ-IK; Thu, 21 May 2026 16:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1315612.1585351; Thu, 21 May 2026 16:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQ6VJ-0005cH-Ff; Thu, 21 May 2026 16:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1315612;
 Thu, 21 May 2026 16:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQ6VI-0005c5-IB
 for xen-changelog@lists.xenproject.org; Thu, 21 May 2026 16:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ6VI-00Gdc8-1i
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 16:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQ6VI-00H8Ch-1Z
 for xen-changelog@lists.xenproject.org;
 Thu, 21 May 2026 16:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=vcf28ntriq55DEDZXy+xiQKSy5ZvLaTKh+gdl4xnyQo=; b=o1wOk6aiRJTcMtWR/xZijHWS8s
	Kif4RkcEb02cUIMKpqL4Sic8sIK/DuZohQCCH5JvHr4XnHiahf0+NT/2eYTGN+R9Rmy56Sae7Yqvo
	hEAZeZM5bDKeLCzXxe9N6eSAtFOph4/vSe1PHVn1oKO+ZHsVuvKK6NafBT5AIUeQjWTk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Support vNMI on capable hardware
Message-Id: <E1wQ6VI-00H8Ch-1Z@xenbits.xenproject.org>
Date: Thu, 21 May 2026 16:44:12 +0000

commit 86a203ab8d38f3bae19219980c2a37d091a8f7aa
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Thu Feb 26 13:20:43 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 21 16:43:01 2026 +0100

    x86/svm: Support vNMI on capable hardware
    
    Starting with Zen4, AMD CPUs can virtualise NMIs for a guest.  On older
    hardware, determining when an NMI is safe to deliver is a challenge and Xen
    does not handle all corner cases correctly.
    
    With vNMI, there is an enablement bit and two new bits of state in the VMCB; a
    pending bit, and a blocked bit.  These directly map to the CPU state for
    handling NMIs, and are maintained by hardware during the running of the vCPU.
    
    When vNMI is enabled, have svm_{get,set}_interrupt_shadow() work in terms of
    the vnmi_blocking bit rather than the IRET intercept.  This allows an emulated
    IRET instruction to re-enable NMIs.
    
    When injecting a new NMI, simply set the vnmi_pending bit; hardware will
    deliver the NMI to the guest at the next suitable juncture.
    
    One complication is that, when delivering a second NMI before the first has
    completed, the mix between common HVM logic and SVM specific logic will try to
    open an NMI window, malfunctioning as it does so.  When vNMI is enabled, short
    circuit this to not consider NMIs blocked.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/hvm/svm/intr.c | 19 +++++++++++++++++++
 xen/arch/x86/hvm/svm/svm.c  | 23 +++++++++++++++++------
 xen/arch/x86/hvm/svm/vmcb.c |  2 ++
 3 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/intr.c b/xen/arch/x86/hvm/svm/intr.c
index 6453a46b85..cf0621d2f6 100644
--- a/xen/arch/x86/hvm/svm/intr.c
+++ b/xen/arch/x86/hvm/svm/intr.c
@@ -33,6 +33,12 @@ static void svm_inject_nmi(struct vcpu *v)
     u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
     intinfo_t event;
 
+    if ( vmcb->_vintr.fields.vnmi_enable )
+    {
+        vmcb->_vintr.fields.vnmi_pending = true;
+        return;
+    }
+
     event.raw = 0;
     event.v = true;
     event.type = X86_ET_NMI;
@@ -142,6 +148,19 @@ void asmlinkage svm_intr_assist(void)
             return;
 
         intblk = hvm_interrupt_blocked(v, intack);
+
+        /*
+         * When vNMI is active, NMIs can be injected by setting vnmi_pending
+         * and hardware will deliver them at the next appropriate opportunity.
+         * Consider them not blocked, to avoid trying to open an NMI Window.
+         *
+         * Correctness here relies on the fact that all vNMI capable hardware
+         * has vGIF, and vGIF is always activated when appropriate.
+         */
+        if ( intblk == hvm_intblk_nmi_iret &&
+             vmcb->_vintr.fields.vnmi_enable )
+            intblk = hvm_intblk_none;
+
         if ( intblk == hvm_intblk_svm_gif )
         {
             ASSERT(nestedhvm_enabled(v->domain));
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index f49d2ebbfd..49fcdd906c 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -499,7 +499,9 @@ static unsigned cf_check int svm_get_interrupt_shadow(struct vcpu *v)
     if ( vmcb->int_stat.intr_shadow )
         intr_shadow |= HVM_INTR_SHADOW_MOV_SS | HVM_INTR_SHADOW_STI;
 
-    if ( vmcb_get_general1_intercepts(vmcb) & GENERAL1_INTERCEPT_IRET )
+    if ( vmcb->_vintr.fields.vnmi_enable
+         ? vmcb->_vintr.fields.vnmi_blocking
+         : (vmcb_get_general1_intercepts(vmcb) & GENERAL1_INTERCEPT_IRET) )
         intr_shadow |= HVM_INTR_SHADOW_NMI;
 
     return intr_shadow;
@@ -509,15 +511,23 @@ static void cf_check svm_set_interrupt_shadow(
     struct vcpu *v, unsigned int intr_shadow)
 {
     struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
-    u32 general1_intercepts = vmcb_get_general1_intercepts(vmcb);
+    bool block_nmi = intr_shadow & HVM_INTR_SHADOW_NMI;
 
     vmcb->int_stat.intr_shadow =
         !!(intr_shadow & (HVM_INTR_SHADOW_MOV_SS|HVM_INTR_SHADOW_STI));
 
-    general1_intercepts &= ~GENERAL1_INTERCEPT_IRET;
-    if ( intr_shadow & HVM_INTR_SHADOW_NMI )
-        general1_intercepts |= GENERAL1_INTERCEPT_IRET;
-    vmcb_set_general1_intercepts(vmcb, general1_intercepts);
+    if ( vmcb->_vintr.fields.vnmi_enable )
+        vmcb->_vintr.fields.vnmi_blocking = block_nmi;
+    else
+    {
+        uint32_t gen1 = vmcb_get_general1_intercepts(vmcb);
+
+        gen1 &= ~GENERAL1_INTERCEPT_IRET;
+        if ( block_nmi )
+            gen1 |= GENERAL1_INTERCEPT_IRET;
+
+        vmcb_set_general1_intercepts(vmcb, gen1);
+    }
 }
 
 static int cf_check svm_guest_x86_mode(struct vcpu *v)
@@ -2460,6 +2470,7 @@ const struct hvm_function_table * __init start_svm(void)
     P(cpu_has_tsc_ratio, "TSC Rate MSR");
     P(cpu_has_svm_sss, "NPT Supervisor Shadow Stack");
     P(cpu_has_svm_spec_ctrl, "MSR_SPEC_CTRL virtualisation");
+    P(cpu_has_svm_vnmi, "Virtual NMI");
     P(cpu_has_svm_bus_lock, "Bus Lock Filter");
 #undef P
 
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 514e530cbd..975a1eaef8 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -185,6 +185,8 @@ static int construct_vmcb(struct vcpu *v)
     if ( default_xen_spec_ctrl == SPEC_CTRL_STIBP )
         v->arch.msrs->spec_ctrl.raw = SPEC_CTRL_STIBP;
 
+    vmcb->_vintr.fields.vnmi_enable = cpu_has_svm_vnmi;
+
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316416.1585787 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKim-0004vA-7Q; Fri, 22 May 2026 07:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316416.1585787; Fri, 22 May 2026 07:55:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKim-0004v2-4N; Fri, 22 May 2026 07:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1316416;
 Fri, 22 May 2026 07:55:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKik-0004uw-Hb
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKik-000aUU-1O
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKik-000t9p-1E
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Ieyq3h1dEwEkZ/1+RPS6oOme6ER0uRmnzGWR+7Dr1yY=; b=uAHniYoc6KIz05755yxYpH3+3l
	Ik3O5p3yWiPz0ggWdV52riFoxz23/JiMLPb1WF/28/+CiYc2ulQf3s2dxZ4ypZFqj9cRrp7vt1tmI
	dGQeQp5sxneZRRGGxo57Zsp68UPTYmx24h+sDUaPXO4X3qjktambDAIEPUiLpmnrlaNk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/sched: rtds: prevent extratime priority_level wraparound
Message-Id: <E1wQKik-000t9p-1E@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:02 +0000

commit 410d44fcf3911679c19af24a9b4f3ddfb4788f42
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Fri May 22 08:13:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:13:59 2026 +0200

    xen/sched: rtds: prevent extratime priority_level wraparound
    
    In RTDS, burn_budget() increments priority_level for extratime units
    whenever cur_budget is exhausted. As priority_level is unsigned and was
    unbounded, it could eventually overflow to 0.
    
    A wrapped value of 0 is the highest RTDS priority, so an extratime unit
    could unexpectedly regain top priority and preempt units with active
    real-time reservations, violating EDF intent.
    
    Fix this by saturating priority_level at RTDS_MAX_PRIORITY_LEVEL instead
    of incrementing unconditionally. Budget refill semantics are unchanged.
    
    Normal behavior is unchanged. Once saturated, priority_level remains at
    the lowest priority until the next period update resets it.
    
    Fixes: 463b958317 (xen:rtds: towards work conserving RTDS)
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched/rt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index b156f61afa..6109aa66c2 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -110,6 +110,12 @@
  */
 #define RTDS_MIN_BUDGET     (MICROSECS(10))
 
+/*
+ * Maximum extratime demotion level. Saturating at this value avoids
+ * unsigned wraparound back to 0 (highest scheduling priority).
+ */
+#define RTDS_MAX_PRIORITY_LEVEL (~0U)
+
 /*
  * UPDATE_LIMIT_SHIFT: a constant used in rt_update_deadline(). When finding
  * the next deadline, performing addition could be faster if the difference
@@ -976,7 +982,9 @@ burn_budget(const struct scheduler *ops, struct rt_unit *svc, s_time_t now)
     {
         if ( has_extratime(svc) )
         {
-            svc->priority_level++;
+            if ( svc->priority_level < RTDS_MAX_PRIORITY_LEVEL )
+                svc->priority_level++;
+
             svc->cur_budget = svc->budget;
         }
         else
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316417.1585791 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKiw-0004wq-8L; Fri, 22 May 2026 07:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316417.1585791; Fri, 22 May 2026 07:55:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKiw-0004wi-5p; Fri, 22 May 2026 07:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1316417;
 Fri, 22 May 2026 07:55:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKiu-0004wY-K5
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKiu-000aXB-1j
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKiu-000tDA-1Z
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=I9uhaU0BSoHhAaCAXwVeP6UmUMnL0feDej3Mx+CE8b4=; b=L866kM9pJclol3Cr7YHYEuvWj6
	D8EmEIgV3wksqO3w7ohISFjtVROMoJ/LEwWuroznVLqrqI7v5PQR6HrQtJFoTkjd/97ak6VpNE6LJ
	GHLvDxSWzIHAw8Ma4k8qpiESfgn85uAHLj4xZNDZ+cE05DfSIkiUng18jCYb8SFPSI0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/sched: rtds: assert replq is empty on timer (re-)init
Message-Id: <E1wQKiu-000tDA-1Z@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:12 +0000

commit 8969e435d44ace820c46c7540cc66e68e62b1249
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Fri May 22 08:14:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:14:48 2026 +0200

    xen/sched: rtds: assert replq is empty on timer (re-)init
    
    In RTDS, removing the last eligible pCPU kills repl_timer. When a pCPU
    is later re-added, rt_switch_sched() reinitializes the timer object.
    
    cpupool_unassign_cpu_start() refuses to remove the last pCPU from a
    populated cpupool: if any domain is still alive while the system is
    active it returns -EBUSY, otherwise all domains are first moved to
    cpupool0. Consequently, by the time the killed-timer branch runs, no
    units remain in the pool and replq is guaranteed to be empty.
    
    Document this invariant by asserting list_empty(replq) right after
    init_timer(). This catches any future regression in cpupool semantics
    that would leave pending replenishment events behind across a
    TIMER_STATUS_killed -> init_timer() transition, where the timer would
    otherwise stay disarmed until an unrelated event reprogrammed it.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched/rt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 6109aa66c2..4b637aa9db 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -749,6 +749,14 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     {
         init_timer(&prv->repl_timer, repl_timer_handler, (void *)new_ops, cpu);
         dprintk(XENLOG_DEBUG, "RTDS: timer initialized on cpu %u\n", cpu);
+
+        /*
+         * cpupool_unassign_cpu_start() refuses to remove the last pCPU from
+         * a populated cpupool, so by the time this path runs (timer was
+         * killed because all RTDS pCPUs were removed) the pool must have
+         * been empty of domains, which implies replq is empty too.
+         */
+        ASSERT(list_empty(rt_replq(new_ops)));
     }
 
     sched_idle_unit(cpu)->priv = vdata;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316418.1585795 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKj6-0004zG-B3; Fri, 22 May 2026 07:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316418.1585795; Fri, 22 May 2026 07:55:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKj6-0004z8-8a; Fri, 22 May 2026 07:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1316418;
 Fri, 22 May 2026 07:55:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKj4-0004z2-LH
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKj4-000aXM-21
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKj4-000tDx-1t
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=UVqFTiA1Xov3k1JxDOJoIVljBbp8eFHxJ7Dv+w9l2vM=; b=kI/ppxJaoB0UVNQqkmqBmjHYUg
	9ydyW2/ypbPgWezHUX8OAPWI5BtfUSebVFVt6Nvp6Lxm1TNYUqsmsPiXqYx356taOrm5hCJjdEMO7
	s0edCvjNKEF3JycQvXJuYl0CQAEwrmAyECqmTWcA9S4xK9jsz9ANrkpk0Onfv4uPcBQA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: strip debug info for intermediate linking steps
Message-Id: <E1wQKj4-000tDx-1t@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:22 +0000

commit b74e973b961c7bc6c3aafb5c9165a2a2f17490f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:15:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:15:55 2026 +0200

    x86: strip debug info for intermediate linking steps
    
    Linking debug info takes time, especially for xen.efi. At the same time
    symbol table contents aren't affected by presence / absence of debug info
    in the linked binaries (the ELF and COFF symbol tables would have extra
    section symbols, but tools/symbols omits those anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 2d13e9d7e8..47dd6c50fe 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -127,13 +127,13 @@ CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) --strip-debug \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) --strip-debug \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
@@ -205,7 +205,7 @@ endif
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
-	                $(dot-target).0s.o $(note_file_option) \
+	                $(dot-target).0s.o $(note_file_option) --strip-debug \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
 		> $(dot-target).1r.S
@@ -215,7 +215,7 @@ endif
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $<  --strip-debug \
 	                $(dot-target).1r.o $(dot-target).1s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316419.1585798 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjG-00051m-Cc; Fri, 22 May 2026 07:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316419.1585798; Fri, 22 May 2026 07:55:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjG-00051e-9w; Fri, 22 May 2026 07:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1316419;
 Fri, 22 May 2026 07:55:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKjE-00051X-Ok
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjE-000aXQ-2J
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjE-000tEi-2C
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=E9kPPB0Lv5focVY2CnTN4jtXTWTmXnNPxM4FHyn9a5E=; b=T3aQK2xVXdlU7BP2r0lrLTCebp
	b3DAZVGe2dORDg+BGTfC123ZHxm//XBzkEQSKb7n137La5Too+lqmgsBJTCJ9UoJ1A9fLFEAQFH5/
	5mervJOP7MSm+6d+xbt2gpTMK3x7mt0Nhe5/zYc6BQUwadTHCpcSHmEokxnCuQpqe+vY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: do a 4th linking pass if necessary
Message-Id: <E1wQKjE-000tEi-2C@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:32 +0000

commit 35de7285d508d97e22aff18a9cdba21d52431e27
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:16:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:16:25 2026 +0200

    Arm: do a 4th linking pass if necessary
    
    The .rodata growth between 1st and 2nd linking passes may affect the
    number of stubs the linker wants to insert, which in turn affects the
    number of symbols. If symbol table sizes change after the 2nd linking
    pass, insert another one before the final one. (As a comment in Linux puts
    it, "In theory it's possible this results in even more stubs, but
    unlikely.")
    
    To use the $(compare-symbol-tables) macro in a shell "if", it needs
    slightly adjusting (and then wrapping to be run in a sub-shell).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Makefile      | 16 ++++++++++++++--
 xen/scripts/Kbuild.include |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 982c6c396a..84c4062b30 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -99,9 +99,21 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
-	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
+	if ! { $(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o) >/dev/null; }; \
+	then \
+		set -e; \
+		$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+		    $(dot-target).2.o -o $(dot-target).2; \
+		$(NM) -pa --format=sysv $(dot-target).2 \
+			| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+			> $(dot-target).3.S; \
+		$(MAKE) $(build)=$(@D) $(dot-target).3.o; \
+		$(call compare-symbol-tables, $(dot-target).2.o, $(dot-target).3.o); \
+	else \
+		ln -sf $(dot-target).2.o $(dot-target).3.o; \
+	fi
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).2.o -o $@
+	    $(dot-target).3.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index d5e36e7f55..41483513ac 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -65,7 +65,7 @@ define compare-symbol-tables
     $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \
     ln -f $(2) $(@D)/.cst.$$$$; \
     $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \
-    rm -f $(@D)/.cst.$$$$
+    rm -f $(@D)/.cst.$$$$; \
     diff -u $(1).sym $(2).sym
 endef
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316420.1585802 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjQ-00053j-Dt; Fri, 22 May 2026 07:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316420.1585802; Fri, 22 May 2026 07:55:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjQ-00053b-BL; Fri, 22 May 2026 07:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1316420;
 Fri, 22 May 2026 07:55:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKjO-00053V-Se
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjO-000aXY-2l
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjO-000tFJ-2U
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=qLL50vEnNLX2CpSLRib5T02hIwixslu+sGnzs7k6VS8=; b=hMa9AGQ7mPBSlSe+C/8k/eYvou
	RxEESMRMHInpR/fBFiTKjkPbxYOdPSwPMSumtNXuvkKH4qVP1YcuURpWdHZnjsQocPuvOo2t6wf+1
	vU6VbKMAYZ34jGNQz99kRzJWmcmHduWHAEZ/5FIQFPgOkcUMX81qDZywwYgK0PZ5XjP8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: collect certain intermediate files as artifacts (part 2)
Message-Id: <E1wQKjO-000tFJ-2U@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:42 +0000

commit 1615934e29589da368c1b7810f1054f4c69c4758
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:17:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:17:34 2026 +0200

    CI: collect certain intermediate files as artifacts (part 2)
    
    Build issues may also surface for analysis jobs. Collect intermediate
    files (if any) there as well. Include xen/.config too, since it's not
    otherwise collected.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/build.sh | 13 ++++++++++++-
 automation/gitlab-ci/analyze.yaml   |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
index 122b93b805..3c13b27221 100755
--- a/automation/eclair_analysis/build.sh
+++ b/automation/eclair_analysis/build.sh
@@ -58,10 +58,21 @@ runtime_failures_docs() {
 (
   runtime_failures_docs
 
+  ret=0
+  mkdir -p intermediates
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
        "CC=${CC}"                               \
        "CXX=${CXX}"                             \
        "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
-       -C xen
+       -C xen || ret=$?
+
+  # Preserve Xen intermediate files.  Some may be there only upon build failure.
+  for f in xen/.config xen/.xen-syms.* xen/.xen.efi.*; do
+      if [[ -f $f ]]; then
+          cp $f intermediates/
+      fi
+  done
+
+  exit $ret
 )
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index b3f99f472d..9bf032931f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -18,6 +18,7 @@
       - "${ECLAIR_OUTPUT_DIR}/*.txt"
       - '*.log'
       - '*.json'
+      - intermediates/
     reports:
       codequality: gl-code-quality-report.json
   rules:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316421.1585806 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKja-00055X-FK; Fri, 22 May 2026 07:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316421.1585806; Fri, 22 May 2026 07:55:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKja-00055P-Cl; Fri, 22 May 2026 07:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1316421;
 Fri, 22 May 2026 07:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKjY-00055I-Vf
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:55:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjY-000aXc-34
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjY-000tFy-2x
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:55:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kxKYWKwCyf8Cv8QCx3h+vCX+V14dHwo3Pfy6irzEFWw=; b=EJQMeI5mJ2GJ55fkuz+7Y+Lt7/
	z0hrWWYX+125J8WCbc/LW8oDLu3Y49HF0r92CS+4QGU+PtvPCmSJAlLD2pc+HTYfiu3NzZGmfpH24
	iN10EF2MK2SMMJH+fncZzXefwww5rAbpGco1PCRL5Z3QHYNZo98OLAaYkI0/92OUUtvs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: split get_unsafe() invocations
Message-Id: <E1wQKjY-000tFy-2x@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:55:52 +0000

commit f71a3e1d3c1d219b0cf59bf4d019af2319bb23e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:18:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:18:38 2026 +0200

    x86/shadow: split get_unsafe() invocations
    
    Misra C:2012 rule 13.6 takes issue with is_hvm_vcpu() uses (deep) inside
    sizeof(), as used by get_unsafe(). While sh_linear_l1_table() doesn't
    involve is_hvm_vcpu(), the rule there kicks in for "call to function
    `__builtin_expect(long, long)' (unevaluated `nothrow' call effect)".
    Break out the address calculations.
    
    This, overall, turns out to also improve generated code (with gcc15 at
    least). No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 80cd3299fa..cc5e1c50d2 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2197,16 +2197,19 @@ static int cf_check sh_page_fault(
 #if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
     if ( (regs->error_code & PFEC_reserved_bit) )
     {
+        const shadow_l1e_t *psl1e;
+
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
         /* First, need to check that this isn't an out-of-sync
          * shadow l1e.  If it is, we fall back to the slow path, which
          * will sync it up again. */
         {
             shadow_l2e_t sl2e;
+            const shadow_l2e_t *psl2e = sh_linear_l2_table(v) +
+                                        shadow_l2_linear_offset(va);
             mfn_t gl1mfn;
-            if ( (get_unsafe(sl2e,
-                             (sh_linear_l2_table(v) +
-                              shadow_l2_linear_offset(va))) != 0)
+
+            if ( (get_unsafe(sl2e, psl2e) != 0)
                  || !(shadow_l2e_get_flags(sl2e) & _PAGE_PRESENT)
                  || !mfn_valid(gl1mfn = backpointer(mfn_to_page(
                                   shadow_l2e_get_mfn(sl2e))))
@@ -2222,9 +2225,8 @@ static int cf_check sh_page_fault(
 #endif /* SHOPT_OUT_OF_SYNC */
         /* The only reasons for reserved bits to be set in shadow entries
          * are the two "magic" shadow_l1e entries. */
-        if ( likely((get_unsafe(sl1e,
-                                (sh_linear_l1_table(v) +
-                                 shadow_l1_linear_offset(va))) == 0)
+        psl1e = sh_linear_l1_table(v) + shadow_l1_linear_offset(va);
+        if ( likely((get_unsafe(sl1e, psl1e) == 0)
                     && sh_l1e_is_magic(sl1e)) )
         {
 
@@ -2879,6 +2881,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 {
     mfn_t sl1mfn;
     shadow_l2e_t sl2e;
+    const shadow_l2e_t *psl2e;
 
     perfc_incr(shadow_invlpg);
 
@@ -2897,6 +2900,9 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 #if SHADOW_PAGING_LEVELS == 4
     {
         shadow_l3e_t sl3e;
+        const shadow_l3e_t *psl3e = sh_linear_l3_table(v) +
+                                    shadow_l3_linear_offset(linear);
+
         if ( !(shadow_l4e_get_flags(
                    sh_linear_l4_table(v)[shadow_l4_linear_offset(linear)])
                & _PAGE_PRESENT) )
@@ -2904,9 +2910,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
         /* This must still be a copy-from-unsafe because we don't have the
          * paging lock, and the higher-level shadows might disappear
          * under our feet. */
-        if ( get_unsafe(sl3e,
-                        (sh_linear_l3_table(v) +
-                         shadow_l3_linear_offset(linear))) != 0 )
+        if ( get_unsafe(sl3e, psl3e) != 0 )
         {
             perfc_incr(shadow_invlpg_fault);
             return false;
@@ -2925,9 +2929,8 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 
     /* This must still be a copy-from-unsafe because we don't have the shadow
      * lock, and the higher-level shadows might disappear under our feet. */
-    if ( get_unsafe(sl2e,
-                    (sh_linear_l2_table(v) +
-                     shadow_l2_linear_offset(linear))) != 0 )
+    psl2e = sh_linear_l2_table(v) + shadow_l2_linear_offset(linear);
+    if ( get_unsafe(sl2e, psl2e) != 0 )
     {
         perfc_incr(shadow_invlpg_fault);
         return false;
@@ -2968,9 +2971,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
              * have the paging lock last time we checked, and the
              * higher-level shadows might have disappeared under our
              * feet. */
-            if ( get_unsafe(sl2e,
-                            (sh_linear_l2_table(v) +
-                             shadow_l2_linear_offset(linear))) != 0 )
+            if ( get_unsafe(sl2e, psl2e) != 0 )
             {
                 perfc_incr(shadow_invlpg_fault);
                 paging_unlock(d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316422.1585812 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjk-00057j-HW; Fri, 22 May 2026 07:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316422.1585812; Fri, 22 May 2026 07:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKjk-00057W-E9; Fri, 22 May 2026 07:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1316422;
 Fri, 22 May 2026 07:56:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKjj-00057L-4g
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:56:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjj-000aXy-0M
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjj-000tJt-01
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:03 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=mht1M8vdPoFJRfh5EBZKwaTEDPBS9e8VIUmDvPrjXaY=; b=gc8gm8Mfj91DytNOMNDjBUYFpk
	nzff+1rK/JVW0nkXce8aqGr9DTHTGJIdEb1yp1/X82T/COcIbc3WNfeT+oYXawxpwGpJUJULoS+Nm
	xUgsSCIewK3OpOgXdwusYqfQD/cw0TGn4AyFeng4iLl6Mj9OyaxcMetnop98d3YvuIFk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: avoid sizeof(this_cpu(...))
Message-Id: <E1wQKjj-000tJt-01@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:56:03 +0000

commit 6621fa6708b8259c4b72bcb967a73fe1f4fb01ec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:00 2026 +0200

    x86/shadow: avoid sizeof(this_cpu(...))
    
    Misra C:2012 rule 13.6 takes issue with RELOC_HIDE() uses inside sizeof(),
    as used by this_cpu(). Latch the address of the per-CPU variable into a
    local variable, and use that in the two sizeof().
    
    No difference in generated code for 2- and 4-level code. There's a small
    improvement for the 3-level case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index cc5e1c50d2..775cf4c39b 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2057,22 +2057,24 @@ static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
-    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
-        bytes = sizeof(this_cpu(trace_emulate_write_val));
+    guest_l1e_t *pval = &this_cpu(trace_emulate_write_val);
+
+    if ( bytes > sizeof(*pval) )
+        bytes = sizeof(*pval);
 
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
-        memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
+        memcpy(pval, src, bytes);
     else if ( (vaddr & ~(GUEST_PTE_SIZE - 1)) ==
               this_cpu(trace_emulate_initial_va) )
     {
         TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_EMULATE_FULL_PT);
-        memcpy(&this_cpu(trace_emulate_write_val),
+        memcpy(pval,
                (typeof(ptr))((unsigned long)ptr & ~(GUEST_PTE_SIZE - 1)),
                GUEST_PTE_SIZE);
     }
 #else
-    memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
+    memcpy(pval, src, bytes);
 #endif
 }
 #endif /* CONFIG_TRACEBUFFER */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316423.1585816 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKju-00059j-Ia; Fri, 22 May 2026 07:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316423.1585816; Fri, 22 May 2026 07:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKju-00059a-FX; Fri, 22 May 2026 07:56:14 +0000
Received: by outflank-mailman (input) for mailman id 1316423;
 Fri, 22 May 2026 07:56:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKjt-00059S-7P
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:56:13 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjt-000aYM-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKjt-000tKz-0X
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:13 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GNes3/0gLIbDgi780o17KJXbLIEj+/zWPxV9OnIXHy0=; b=SXfropqq2bOt2e+Zkx6euRl4zd
	cW6ddxqO1havidQYl4asTxOuLD9bWEJzwpTa+dcioaNKcGsrMFFkgFX/Z10FRnKhVzNb67RR7Atoq
	cgaGcKjmkbChyD2evVYbT6KwwLbIJnaCsAnlqr70/Uh/V/rw/MeBe3py1tPeaKBrbHPo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/P2M: split a read_atomic() invocation
Message-Id: <E1wQKjt-000tKz-0X@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:56:13 +0000

commit 91ea85ec1213bf3dbc052bd8b3710f9be7a71000
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:34 2026 +0200

    x86/P2M: split a read_atomic() invocation
    
    Misra C:2012 rule 13.6 takes issue with pfn_to_pdx() and mfn_x() uses
    (deep) inside sizeof(), as used by read_atomic(). Break out the MFN ->
    struct page_info * translation.
    
    No difference in generated code, except for a line number change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index f5f9c0ac45..027b9ae69b 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1332,6 +1332,7 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn)
     p2m_access_t a;
     p2m_type_t ot;
     mfn_t omfn;
+    const struct page_info *pg;
     unsigned long pg_type;
 
     if ( !paging_mode_translate(p2m->domain) )
@@ -1345,7 +1346,8 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn)
     ASSERT(mfn_valid(omfn));
     /* Set the m2p entry to invalid only if there are no further type
      * refs to this page as shared */
-    pg_type = read_atomic(&(mfn_to_page(omfn)->u.inuse.type_info));
+    pg = mfn_to_page(omfn);
+    pg_type = read_atomic(&pg->u.inuse.type_info);
     if ( (pg_type & PGT_count_mask) == 0
          || (pg_type & PGT_type_mask) != PGT_shared_page )
         set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:56:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:56:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316426.1585828 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKk3-0005Qi-VF; Fri, 22 May 2026 07:56:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316426.1585828; Fri, 22 May 2026 07:56:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKk3-0005Qa-SF; Fri, 22 May 2026 07:56:23 +0000
Received: by outflank-mailman (input) for mailman id 1316426;
 Fri, 22 May 2026 07:56:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKk3-0005QQ-9n
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:56:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKk3-000aYW-0s
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKk3-000tMI-0n
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:23 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Hc1S/huH/1Ej8bZELVycWKldDsKQAB8fVW9HG7yXSg8=; b=mLUSxt+ZbwNV5Td1jS7P66nTSR
	iUDUGNk1201WDCaJbrA9t8XunKT4wvu1Kq7utlB+WM1bgKdZWqJgSoTUjFQnSJnMgVY6nKZ0SYgNt
	gUXdo8LNsdh+QzRzpl7DpW9tsUgCeCD0sBROek7wqp2b18elJmjkUs5YFHN/ud7cia4Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/PV: split a get_unsafe() invocation
Message-Id: <E1wQKk3-000tMI-0n@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:56:23 +0000

commit bcbef3bdbd091adedd33044a4260fa8dab21fb8a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:54 2026 +0200

    x86/PV: split a get_unsafe() invocation
    
    Misra C:2012 rule 13.6 takes issue with the gdt_ldt_desc_ptr() call
    appearing (deep) inside sizeof(), as used by get_unsafe().
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/pv/emulate.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c
index a00d1c6c82..48052f9ac3 100644
--- a/xen/arch/x86/pv/emulate.c
+++ b/xen/arch/x86/pv/emulate.c
@@ -29,8 +29,14 @@ int pv_emul_read_descriptor(unsigned int sel, const struct vcpu *v,
           */
          ((sel & 4) && (sel >> 3) >= v->arch.pv.ldt_ents) )
         desc.b = desc.a = 0;
-    else if ( get_unsafe(desc, gdt_ldt_desc_ptr(sel)) )
-        return 0;
+    else
+    {
+        const seg_desc_t *pdesc = gdt_ldt_desc_ptr(sel);
+
+        if ( get_unsafe(desc, pdesc) )
+            return 0;
+    }
+
     if ( !insn_fetch )
         desc.b &= ~_SEGMENT_L;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:56:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316428.1585832 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKkE-0005Yv-2W; Fri, 22 May 2026 07:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316428.1585832; Fri, 22 May 2026 07:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKkD-0005Yn-VH; Fri, 22 May 2026 07:56:33 +0000
Received: by outflank-mailman (input) for mailman id 1316428;
 Fri, 22 May 2026 07:56:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKkD-0005XA-CI
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:56:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKkD-000aYc-18
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKkD-000tNY-13
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:33 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=GBlPCL4wcbcsXBh3QEe050aobP9T0zMCDR17l6QQNeU=; b=OACkdaLbup0DnbeeR24O90RBNW
	enNlkVBJS/9zv2qs9EYhp0IfsPckdUNPjc0BWbNcTRD9LXzdAf0uNYrGLUDS4SzlG3Ft0tMkpzYjt
	8ea0fzsR7TZq8lWgGh4oTLIeXt3bGrlrDmLsGvtZQezcWaWksxAQeZmDpidzst0GbV6A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests: Fix paging-mempool xen_pfn_t format strings
Message-Id: <E1wQKkD-000tNY-13@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:56:33 +0000

commit 71f8fd5a644f6e2c4d443d8b564a8cc60b928ccb
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri May 22 08:20:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:20:44 2026 +0200

    tools/tests: Fix paging-mempool xen_pfn_t format strings
    
    xen_pfn_t is not an unsigned long on all architectures. In particular,
    Arm32 builds see it as a 64-bit type, so printing it with %lx triggers
    a -Werror=format build failure.
    
    Use PRI_xen_pfn for the GFN diagnostics instead.
    
    Fixes: 66c982a5d3614 ("tests/paging-mempool: Extend to test P2M relocation")
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/paging-mempool/test-paging-mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 97f5b77209..0e03e2e4a0 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -208,7 +208,7 @@ static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
         if ( errs[i] )
         {
             rc = -1;
-            fail("    Fail: check mark unable to map gfn %05lx: %d\n",
+            fail("    Fail: check mark unable to map gfn %05"PRI_xen_pfn": %d\n",
                  gfns[i], errs[i]);
             continue;
         }
@@ -216,7 +216,7 @@ static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
         if ( *mark == exp )
             continue;
 
-        fail("    Fail: check mark: gfn %05lx expecting %08x (%u), got %08x (%u)\n",
+        fail("    Fail: check mark: gfn %05"PRI_xen_pfn" expecting %08x (%u), got %08x (%u)\n",
                gfns[i], exp, ~exp, *mark, ~*mark);
         rc = -1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 07:56:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 07:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316432.1585836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKkO-0005iT-32; Fri, 22 May 2026 07:56:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316432.1585836; Fri, 22 May 2026 07:56:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQKkO-0005iL-0Q; Fri, 22 May 2026 07:56:44 +0000
Received: by outflank-mailman (input) for mailman id 1316432;
 Fri, 22 May 2026 07:56:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQKkN-0005i8-FM
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 07:56:43 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKkN-000aYg-1R
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQKkN-000tOw-1K
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 07:56:43 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=2Jq78ShtOUIWY+roLkNpipmd+GUXOa6hkOpVPrwPQ4Q=; b=Gx+OiY/tS6z1pHB2K0mnxLBQnj
	QmecDWjOR7MCUMJFi8lgEWk1xTe19hP8bALqQJM2Ki4a3AlIuUFktNtBs15uU+sWrM2zcEM3twVNY
	3j4XjguVV57uKbGmxbR3j4WBR5ZxbFRMIikhb1bV6Zf3eGngt6gemw62wcKnndRjq/Aw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] gnttab: simplify (really: drop) gnttab_set_frame_gfn()
Message-Id: <E1wQKkN-000tOw-1K@xenbits.xenproject.org>
Date: Fri, 22 May 2026 07:56:43 +0000

commit eff88c4d35435fc56dcb07155e45bef16a56e892
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:21:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:21:14 2026 +0200

    gnttab: simplify (really: drop) gnttab_set_frame_gfn()
    
    It's not really doing anything for valid GFNs, which renders its one use
    site pretty pointless. The other isn't so much about setting anything, but
    rather about clearing.
    
    The main point here, however, is about Rafal spotting the double
    fetching of the GFN (first in gnttab_unpopulate_status_frames(), then
    again in gnttab_set_frame_gfn()). Re-purpose the macro parameter to pass
    in the already fetched GFN, while dropping the no longer used parameters.
    
    As the result is a mere wrapper around guest_physmap_remove_page(), drop
    the hook altogether.
    
    Suggested-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/include/asm/grant_table.h | 7 -------
 xen/arch/x86/include/asm/grant_table.h | 6 ------
 xen/common/grant_table.c               | 5 +----
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/include/asm/grant_table.h
index c47058a3a0..7661a95341 100644
--- a/xen/arch/arm/include/asm/grant_table.h
+++ b/xen/arch/arm/include/asm/grant_table.h
@@ -50,13 +50,6 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
 #define gnttab_dom0_frames()                                             \
     min_t(unsigned int, opt_max_grant_frames, PFN_DOWN(_etext - _stext))
 
-#define gnttab_set_frame_gfn(gt, st, idx, gfn, mfn)                      \
-    (gfn_eq(gfn, INVALID_GFN)                                            \
-     ? guest_physmap_remove_page((gt)->domain,                           \
-                                 gnttab_get_frame_gfn(gt, st, idx),      \
-                                 mfn, 0)                                 \
-     : 0)
-
 #define gnttab_get_frame_gfn(gt, st, idx) ({                             \
    (st) ? gnttab_status_gfn(NULL, gt, idx)                               \
         : gnttab_shared_gfn(NULL, gt, idx);                              \
diff --git a/xen/arch/x86/include/asm/grant_table.h b/xen/arch/x86/include/asm/grant_table.h
index 5c23cec90c..e939c9bacb 100644
--- a/xen/arch/x86/include/asm/grant_table.h
+++ b/xen/arch/x86/include/asm/grant_table.h
@@ -32,12 +32,6 @@ static inline int replace_grant_host_mapping(uint64_t addr, mfn_t frame,
     return replace_grant_pv_mapping(addr, frame, new_addr, flags);
 }
 
-#define gnttab_set_frame_gfn(gt, st, idx, gfn, mfn)                      \
-    (gfn_eq(gfn, INVALID_GFN)                                            \
-     ? guest_physmap_remove_page((gt)->domain,                           \
-                                 gnttab_get_frame_gfn(gt, st, idx),      \
-                                 mfn, 0)                                 \
-     : 0 /* Handled in add_to_physmap_one(). */)
 #define gnttab_get_frame_gfn(gt, st, idx) ({                             \
     mfn_t mfn_ = (st) ? gnttab_status_mfn(gt, idx)                       \
                       : gnttab_shared_mfn(gt, idx);                      \
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f516641eba..2dda1abd3f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1844,8 +1844,7 @@ gnttab_unpopulate_status_frames(struct domain *d, struct grant_table *gt)
         {
             int rc = gfn_eq(gfn, INVALID_GFN)
                      ? 0
-                     : gnttab_set_frame_gfn(gt, true, i, INVALID_GFN,
-                                            page_to_mfn(pg));
+                     : guest_physmap_remove_page(d, gfn, page_to_mfn(pg), 0);
 
             if ( rc )
             {
@@ -4285,8 +4284,6 @@ int gnttab_map_frame_begin(
          */
         if ( !get_page(pg, d) )
             rc = -EBUSY;
-        else if ( (rc = gnttab_set_frame_gfn(gt, status, idx, gfn, *mfn)) )
-            put_page(pg);
     }
 
     if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316466.1585840 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUA-00071O-NH; Fri, 22 May 2026 08:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316466.1585840; Fri, 22 May 2026 08:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUA-00071G-Kj; Fri, 22 May 2026 08:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1316466;
 Fri, 22 May 2026 08:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLU9-00071A-QE
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLU9-000c0W-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLU9-000ykB-2G
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5qOPb3a86Tdam4cUYNn+Fd1tGzj8Rafb75hnhNr0bHg=; b=LzOILQOz1d/pNO/gx5T37YzFfJ
	jfcl+KgZQuLkqr03t0S9wErAnpsOMV2QJjn7EUekECZWLP3AFgm/8+C/3FbY1C/nn5PrlQLEfvufw
	6d+A+t3qEa61IwhlDNbU3Gw2iWqyZGgSbs+wtTRUykQyhjRnsU/M6uslMcPSpaNtgSo8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: rtds: prevent extratime priority_level wraparound
Message-Id: <E1wQLU9-000ykB-2G@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:01 +0000

commit 410d44fcf3911679c19af24a9b4f3ddfb4788f42
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Fri May 22 08:13:59 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:13:59 2026 +0200

    xen/sched: rtds: prevent extratime priority_level wraparound
    
    In RTDS, burn_budget() increments priority_level for extratime units
    whenever cur_budget is exhausted. As priority_level is unsigned and was
    unbounded, it could eventually overflow to 0.
    
    A wrapped value of 0 is the highest RTDS priority, so an extratime unit
    could unexpectedly regain top priority and preempt units with active
    real-time reservations, violating EDF intent.
    
    Fix this by saturating priority_level at RTDS_MAX_PRIORITY_LEVEL instead
    of incrementing unconditionally. Budget refill semantics are unchanged.
    
    Normal behavior is unchanged. Once saturated, priority_level remains at
    the lowest priority until the next period update resets it.
    
    Fixes: 463b958317 (xen:rtds: towards work conserving RTDS)
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched/rt.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index b156f61afa..6109aa66c2 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -110,6 +110,12 @@
  */
 #define RTDS_MIN_BUDGET     (MICROSECS(10))
 
+/*
+ * Maximum extratime demotion level. Saturating at this value avoids
+ * unsigned wraparound back to 0 (highest scheduling priority).
+ */
+#define RTDS_MAX_PRIORITY_LEVEL (~0U)
+
 /*
  * UPDATE_LIMIT_SHIFT: a constant used in rt_update_deadline(). When finding
  * the next deadline, performing addition could be faster if the difference
@@ -976,7 +982,9 @@ burn_budget(const struct scheduler *ops, struct rt_unit *svc, s_time_t now)
     {
         if ( has_extratime(svc) )
         {
-            svc->priority_level++;
+            if ( svc->priority_level < RTDS_MAX_PRIORITY_LEVEL )
+                svc->priority_level++;
+
             svc->cur_budget = svc->budget;
         }
         else
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316467.1585844 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUL-000739-Ov; Fri, 22 May 2026 08:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316467.1585844; Fri, 22 May 2026 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUL-000731-M3; Fri, 22 May 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1316467;
 Fri, 22 May 2026 08:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLUK-00072p-0A
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUJ-000c0u-36
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUJ-000ynZ-2a
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=zZqcSx8hNcDvE5YKizLRgfFIWFgkCWdFbk1Q6Fp3Y7k=; b=EQv5/uSIvDDAX5pHYyzbc0vmNN
	xykLtMiPVxe4hU9O0AhGrKv4xOKr3l/z4H4Pv3l8JhAPyZDpV0eh9IshLHD5N3VmNoutofw/2kO1/
	VEYBRzvRr+wLhbvUCSUyTFDvz6myaxAq4ZcakRy6li+xFU405g6qFloDDcI0Or6hmAro=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: rtds: assert replq is empty on timer (re-)init
Message-Id: <E1wQLUJ-000ynZ-2a@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:11 +0000

commit 8969e435d44ace820c46c7540cc66e68e62b1249
Author:     Oleksii Moisieiev <oleksii_moisieiev@epam.com>
AuthorDate: Fri May 22 08:14:48 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:14:48 2026 +0200

    xen/sched: rtds: assert replq is empty on timer (re-)init
    
    In RTDS, removing the last eligible pCPU kills repl_timer. When a pCPU
    is later re-added, rt_switch_sched() reinitializes the timer object.
    
    cpupool_unassign_cpu_start() refuses to remove the last pCPU from a
    populated cpupool: if any domain is still alive while the system is
    active it returns -EBUSY, otherwise all domains are first moved to
    cpupool0. Consequently, by the time the killed-timer branch runs, no
    units remain in the pool and replq is guaranteed to be empty.
    
    Document this invariant by asserting list_empty(replq) right after
    init_timer(). This catches any future regression in cpupool semantics
    that would leave pending replenishment events behind across a
    TIMER_STATUS_killed -> init_timer() transition, where the timer would
    otherwise stay disarmed until an unrelated event reprogrammed it.
    
    Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/sched/rt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 6109aa66c2..4b637aa9db 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -749,6 +749,14 @@ rt_switch_sched(struct scheduler *new_ops, unsigned int cpu,
     {
         init_timer(&prv->repl_timer, repl_timer_handler, (void *)new_ops, cpu);
         dprintk(XENLOG_DEBUG, "RTDS: timer initialized on cpu %u\n", cpu);
+
+        /*
+         * cpupool_unassign_cpu_start() refuses to remove the last pCPU from
+         * a populated cpupool, so by the time this path runs (timer was
+         * killed because all RTDS pCPUs were removed) the pool must have
+         * been empty of domains, which implies replq is empty too.
+         */
+        ASSERT(list_empty(rt_replq(new_ops)));
     }
 
     sched_idle_unit(cpu)->priv = vdata;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316468.1585847 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUV-00076M-QC; Fri, 22 May 2026 08:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316468.1585847; Fri, 22 May 2026 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUV-00076F-NP; Fri, 22 May 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1316468;
 Fri, 22 May 2026 08:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLUU-000768-2t
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUU-000c12-0B
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUU-000ypV-03
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3yUVxvytk07hiTJucHOoxjOEi94Mu6QI615Yyym4+0I=; b=NjSm3+1WXWj1TKzrGVvp8jukbv
	euix4DSkvG5fu4pKIqiruTxif+PoQ3X0BkwTNN5pXMsMUs54c8d2bJdOfIxXAiK2zWQKB4qbzDEbB
	68ROfhlylgiF4wPLFlek+yWOXciDTunP+9weSQ1ys9bf+yI2D0n8srr3Uea74Pi7h430=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: strip debug info for intermediate linking steps
Message-Id: <E1wQLUU-000ypV-03@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:22 +0000

commit b74e973b961c7bc6c3aafb5c9165a2a2f17490f1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:15:55 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:15:55 2026 +0200

    x86: strip debug info for intermediate linking steps
    
    Linking debug info takes time, especially for xen.efi. At the same time
    symbol table contents aren't affected by presence / absence of debug info
    in the linked binaries (the ELF and COFF symbol tables would have extra
    section symbols, but tools/symbols omits those anyway).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 2d13e9d7e8..47dd6c50fe 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -127,13 +127,13 @@ CFLAGS-$(XEN_BUILD_EFI) += -DXEN_BUILD_EFI
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
 	$(MAKE) $(build)=$(@D) $(dot-target).0.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) --strip-debug \
 	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
 	$(MAKE) $(build)=$(@D) $(dot-target).1.o
-	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) --strip-debug \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
@@ -205,7 +205,7 @@ endif
 	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
-	                $(dot-target).0s.o $(note_file_option) \
+	                $(dot-target).0s.o $(note_file_option) --strip-debug \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
 		> $(dot-target).1r.S
@@ -215,7 +215,7 @@ endif
 		> $(dot-target).1s.S
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
-	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< \
+	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $<  --strip-debug \
 	                $(dot-target).1r.o $(dot-target).1s.o $(note_file_option) \
 	                -o $(dot-target).$(base).1 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).1) \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316469.1585851 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUf-00078g-Rc; Fri, 22 May 2026 08:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316469.1585851; Fri, 22 May 2026 08:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUf-00078Y-P4; Fri, 22 May 2026 08:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1316469;
 Fri, 22 May 2026 08:44:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLUe-00078Q-66
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUe-000c16-0T
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUe-000yr1-0L
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=fweeSKLGiKQ9hPqNX9p7bCeMHCuk8JxZWF8WkRn8DKg=; b=Ps4+guxfVJJWZ63ae4xQIEqZ2J
	iYB6RudXdCfqJSjA4qUh20E9ppuM55i3W5fO/HtuMDJ/7anKPRrjS5+jFhf2AU0b7XJ3N7YbRuLMO
	tqU0DqD3uyhm3YgC7RS+L79k7vp54+upGhAb0Zx44frAVF9/WSyCGuNopznJ5zv7zzKo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: do a 4th linking pass if necessary
Message-Id: <E1wQLUe-000yr1-0L@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:32 +0000

commit 35de7285d508d97e22aff18a9cdba21d52431e27
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:16:25 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:16:25 2026 +0200

    Arm: do a 4th linking pass if necessary
    
    The .rodata growth between 1st and 2nd linking passes may affect the
    number of stubs the linker wants to insert, which in turn affects the
    number of symbols. If symbol table sizes change after the 2nd linking
    pass, insert another one before the final one. (As a comment in Linux puts
    it, "In theory it's possible this results in even more stubs, but
    unlikely.")
    
    To use the $(compare-symbol-tables) macro in a shell "if", it needs
    slightly adjusting (and then wrapping to be run in a sub-shell).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Makefile      | 16 ++++++++++++++--
 xen/scripts/Kbuild.include |  2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 982c6c396a..84c4062b30 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -99,9 +99,21 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
-	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
+	if ! { $(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o) >/dev/null; }; \
+	then \
+		set -e; \
+		$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
+		    $(dot-target).2.o -o $(dot-target).2; \
+		$(NM) -pa --format=sysv $(dot-target).2 \
+			| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
+			> $(dot-target).3.S; \
+		$(MAKE) $(build)=$(@D) $(dot-target).3.o; \
+		$(call compare-symbol-tables, $(dot-target).2.o, $(dot-target).3.o); \
+	else \
+		ln -sf $(dot-target).2.o $(dot-target).3.o; \
+	fi
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).2.o -o $@
+	    $(dot-target).3.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index d5e36e7f55..41483513ac 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -65,7 +65,7 @@ define compare-symbol-tables
     $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \
     ln -f $(2) $(@D)/.cst.$$$$; \
     $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \
-    rm -f $(@D)/.cst.$$$$
+    rm -f $(@D)/.cst.$$$$; \
     diff -u $(1).sym $(2).sym
 endef
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316470.1585856 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUp-0007Ae-TO; Fri, 22 May 2026 08:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316470.1585856; Fri, 22 May 2026 08:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUp-0007AW-QV; Fri, 22 May 2026 08:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1316470;
 Fri, 22 May 2026 08:44:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLUo-0007AO-8s
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUo-000c1A-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUo-000ysO-0d
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6WBNNGoXjtk+K0Uv/+jhpjBeAd1Vga/jCiMVx4DdnPo=; b=jCfW68i72MkqS4VCUdI2f/Q7Cb
	hH76DpRqh2BZjV1ozA/j0ZoH4LYLF+zNu99p/gnubp1lxYIJYMzKBDCI1mE82ydB5ziDtiRSVHbPX
	Oe7awToabztCS2galuB6Y0TrMxZ4BvDcMwTRg2DF1bh++VQ0cxnzy6XBwNbyQ4qLL23I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: collect certain intermediate files as artifacts (part 2)
Message-Id: <E1wQLUo-000ysO-0d@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:42 +0000

commit 1615934e29589da368c1b7810f1054f4c69c4758
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:17:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:17:34 2026 +0200

    CI: collect certain intermediate files as artifacts (part 2)
    
    Build issues may also surface for analysis jobs. Collect intermediate
    files (if any) there as well. Include xen/.config too, since it's not
    otherwise collected.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/eclair_analysis/build.sh | 13 ++++++++++++-
 automation/gitlab-ci/analyze.yaml   |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/automation/eclair_analysis/build.sh b/automation/eclair_analysis/build.sh
index 122b93b805..3c13b27221 100755
--- a/automation/eclair_analysis/build.sh
+++ b/automation/eclair_analysis/build.sh
@@ -58,10 +58,21 @@ runtime_failures_docs() {
 (
   runtime_failures_docs
 
+  ret=0
+  mkdir -p intermediates
   make "-j${PROCESSORS}" "-l${PROCESSORS}.0"    \
        "CROSS_COMPILE=${CROSS_COMPILE}"         \
        "CC=${CC}"                               \
        "CXX=${CXX}"                             \
        "XEN_TARGET_ARCH=${XEN_TARGET_ARCH}"     \
-       -C xen
+       -C xen || ret=$?
+
+  # Preserve Xen intermediate files.  Some may be there only upon build failure.
+  for f in xen/.config xen/.xen-syms.* xen/.xen.efi.*; do
+      if [[ -f $f ]]; then
+          cp $f intermediates/
+      fi
+  done
+
+  exit $ret
 )
diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index b3f99f472d..9bf032931f 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -18,6 +18,7 @@
       - "${ECLAIR_OUTPUT_DIR}/*.txt"
       - '*.log'
       - '*.json'
+      - intermediates/
     reports:
       codequality: gl-code-quality-report.json
   rules:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316471.1585860 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUz-0007D7-Vw; Fri, 22 May 2026 08:44:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316471.1585860; Fri, 22 May 2026 08:44:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLUz-0007Cz-TM; Fri, 22 May 2026 08:44:53 +0000
Received: by outflank-mailman (input) for mailman id 1316471;
 Fri, 22 May 2026 08:44:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLUy-0007Cq-BH
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:44:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUy-000c1M-12
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLUy-000yvU-0w
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:44:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LUXTGrzDajXRg5y/rggBvIDlR6EkJp7n7Ziq0yc2+Aw=; b=la84eTvem/Fc9ddygmKZ3tUCO5
	b4qP2bvq8FlWS5miNaMXZsYEJOtI8nXjp9aoiZOwq9cL8fJpftfBMEAVdjyW92pxQqpH5ZogFoClN
	Wm51DmxKA7qaUteD++15bm01lIfR4enCN5d7KO6YPMWKXX5y6an7q8qryzJrSNaSWGIA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: split get_unsafe() invocations
Message-Id: <E1wQLUy-000yvU-0w@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:44:52 +0000

commit f71a3e1d3c1d219b0cf59bf4d019af2319bb23e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:18:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:18:38 2026 +0200

    x86/shadow: split get_unsafe() invocations
    
    Misra C:2012 rule 13.6 takes issue with is_hvm_vcpu() uses (deep) inside
    sizeof(), as used by get_unsafe(). While sh_linear_l1_table() doesn't
    involve is_hvm_vcpu(), the rule there kicks in for "call to function
    `__builtin_expect(long, long)' (unevaluated `nothrow' call effect)".
    Break out the address calculations.
    
    This, overall, turns out to also improve generated code (with gcc15 at
    least). No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 80cd3299fa..cc5e1c50d2 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2197,16 +2197,19 @@ static int cf_check sh_page_fault(
 #if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
     if ( (regs->error_code & PFEC_reserved_bit) )
     {
+        const shadow_l1e_t *psl1e;
+
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
         /* First, need to check that this isn't an out-of-sync
          * shadow l1e.  If it is, we fall back to the slow path, which
          * will sync it up again. */
         {
             shadow_l2e_t sl2e;
+            const shadow_l2e_t *psl2e = sh_linear_l2_table(v) +
+                                        shadow_l2_linear_offset(va);
             mfn_t gl1mfn;
-            if ( (get_unsafe(sl2e,
-                             (sh_linear_l2_table(v) +
-                              shadow_l2_linear_offset(va))) != 0)
+
+            if ( (get_unsafe(sl2e, psl2e) != 0)
                  || !(shadow_l2e_get_flags(sl2e) & _PAGE_PRESENT)
                  || !mfn_valid(gl1mfn = backpointer(mfn_to_page(
                                   shadow_l2e_get_mfn(sl2e))))
@@ -2222,9 +2225,8 @@ static int cf_check sh_page_fault(
 #endif /* SHOPT_OUT_OF_SYNC */
         /* The only reasons for reserved bits to be set in shadow entries
          * are the two "magic" shadow_l1e entries. */
-        if ( likely((get_unsafe(sl1e,
-                                (sh_linear_l1_table(v) +
-                                 shadow_l1_linear_offset(va))) == 0)
+        psl1e = sh_linear_l1_table(v) + shadow_l1_linear_offset(va);
+        if ( likely((get_unsafe(sl1e, psl1e) == 0)
                     && sh_l1e_is_magic(sl1e)) )
         {
 
@@ -2879,6 +2881,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 {
     mfn_t sl1mfn;
     shadow_l2e_t sl2e;
+    const shadow_l2e_t *psl2e;
 
     perfc_incr(shadow_invlpg);
 
@@ -2897,6 +2900,9 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 #if SHADOW_PAGING_LEVELS == 4
     {
         shadow_l3e_t sl3e;
+        const shadow_l3e_t *psl3e = sh_linear_l3_table(v) +
+                                    shadow_l3_linear_offset(linear);
+
         if ( !(shadow_l4e_get_flags(
                    sh_linear_l4_table(v)[shadow_l4_linear_offset(linear)])
                & _PAGE_PRESENT) )
@@ -2904,9 +2910,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
         /* This must still be a copy-from-unsafe because we don't have the
          * paging lock, and the higher-level shadows might disappear
          * under our feet. */
-        if ( get_unsafe(sl3e,
-                        (sh_linear_l3_table(v) +
-                         shadow_l3_linear_offset(linear))) != 0 )
+        if ( get_unsafe(sl3e, psl3e) != 0 )
         {
             perfc_incr(shadow_invlpg_fault);
             return false;
@@ -2925,9 +2929,8 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
 
     /* This must still be a copy-from-unsafe because we don't have the shadow
      * lock, and the higher-level shadows might disappear under our feet. */
-    if ( get_unsafe(sl2e,
-                    (sh_linear_l2_table(v) +
-                     shadow_l2_linear_offset(linear))) != 0 )
+    psl2e = sh_linear_l2_table(v) + shadow_l2_linear_offset(linear);
+    if ( get_unsafe(sl2e, psl2e) != 0 )
     {
         perfc_incr(shadow_invlpg_fault);
         return false;
@@ -2968,9 +2971,7 @@ static bool cf_check sh_invlpg(struct vcpu *v, unsigned long linear)
              * have the paging lock last time we checked, and the
              * higher-level shadows might have disappeared under our
              * feet. */
-            if ( get_unsafe(sl2e,
-                            (sh_linear_l2_table(v) +
-                             shadow_l2_linear_offset(linear))) != 0 )
+            if ( get_unsafe(sl2e, psl2e) != 0 )
             {
                 perfc_incr(shadow_invlpg_fault);
                 paging_unlock(d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316472.1585864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVA-0007FB-0x; Fri, 22 May 2026 08:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316472.1585864; Fri, 22 May 2026 08:45:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLV9-0007F3-Ug; Fri, 22 May 2026 08:45:03 +0000
Received: by outflank-mailman (input) for mailman id 1316472;
 Fri, 22 May 2026 08:45:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLV8-0007Ew-Ex
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:45:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLV8-000c1m-1O
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLV8-000yzt-1D
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PKEmyQxaOnLCA5DGg7n8RAwqaB8jqWW1U+synGCV/+g=; b=ko4moIvj3BslnicGRL6PGmOhHP
	CuzbD4RMp6UnPbrTyils5HkgikMnDflNNkqohWxitElUGw5eze6pHuqoR0tA2oANqKBXjUTocB24f
	GQANRGKOnH7wKpRluwmsu0dLG/b02ivd/n5D7gGbvlQkBO3G5NsZ0gNAP63HLoMFxJ/o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: avoid sizeof(this_cpu(...))
Message-Id: <E1wQLV8-000yzt-1D@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:45:02 +0000

commit 6621fa6708b8259c4b72bcb967a73fe1f4fb01ec
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:00 2026 +0200

    x86/shadow: avoid sizeof(this_cpu(...))
    
    Misra C:2012 rule 13.6 takes issue with RELOC_HIDE() uses inside sizeof(),
    as used by this_cpu(). Latch the address of the per-CPU variable into a
    local variable, and use that in the two sizeof().
    
    No difference in generated code for 2- and 4-level code. There's a small
    improvement for the 3-level case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index cc5e1c50d2..775cf4c39b 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2057,22 +2057,24 @@ static DEFINE_PER_CPU(guest_l1e_t, trace_emulate_write_val);
 static void cf_check trace_emulate_write_val(
     const void *ptr, unsigned long vaddr, const void *src, unsigned int bytes)
 {
-    if ( bytes > sizeof(this_cpu(trace_emulate_write_val)) )
-        bytes = sizeof(this_cpu(trace_emulate_write_val));
+    guest_l1e_t *pval = &this_cpu(trace_emulate_write_val);
+
+    if ( bytes > sizeof(*pval) )
+        bytes = sizeof(*pval);
 
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
-        memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
+        memcpy(pval, src, bytes);
     else if ( (vaddr & ~(GUEST_PTE_SIZE - 1)) ==
               this_cpu(trace_emulate_initial_va) )
     {
         TRACE_SHADOW_PATH_FLAG(TRCE_SFLAG_EMULATE_FULL_PT);
-        memcpy(&this_cpu(trace_emulate_write_val),
+        memcpy(pval,
                (typeof(ptr))((unsigned long)ptr & ~(GUEST_PTE_SIZE - 1)),
                GUEST_PTE_SIZE);
     }
 #else
-    memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
+    memcpy(pval, src, bytes);
 #endif
 }
 #endif /* CONFIG_TRACEBUFFER */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316473.1585868 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVK-0007HA-2X; Fri, 22 May 2026 08:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316473.1585868; Fri, 22 May 2026 08:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVJ-0007H2-W3; Fri, 22 May 2026 08:45:13 +0000
Received: by outflank-mailman (input) for mailman id 1316473;
 Fri, 22 May 2026 08:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLVI-0007Gw-Ht
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:45:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVI-000c4T-1g
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVI-000z2Y-1a
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=neatR0TuuYreqafBqvSKzSpEmTwIkR+nr8snU8xDmxk=; b=oifBaEiOva52gY1Wr+mfxNAfrF
	F64+zmNcWhAfRCYmTbWeT4AYz0MLnZPqbLLCbYDWHMIu0pxvzAgh4mqjmSGid4F5mzLsB6MNbqpL8
	pAGUrivaiuMh9WRqW+Pzhz2JwUsdIFAPul6mLgHGUlDm3e89AI+sYupzjY9y+HMEc3lw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/P2M: split a read_atomic() invocation
Message-Id: <E1wQLVI-000z2Y-1a@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:45:12 +0000

commit 91ea85ec1213bf3dbc052bd8b3710f9be7a71000
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:34 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:34 2026 +0200

    x86/P2M: split a read_atomic() invocation
    
    Misra C:2012 rule 13.6 takes issue with pfn_to_pdx() and mfn_x() uses
    (deep) inside sizeof(), as used by read_atomic(). Break out the MFN ->
    struct page_info * translation.
    
    No difference in generated code, except for a line number change.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/p2m.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index f5f9c0ac45..027b9ae69b 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1332,6 +1332,7 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn)
     p2m_access_t a;
     p2m_type_t ot;
     mfn_t omfn;
+    const struct page_info *pg;
     unsigned long pg_type;
 
     if ( !paging_mode_translate(p2m->domain) )
@@ -1345,7 +1346,8 @@ int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn)
     ASSERT(mfn_valid(omfn));
     /* Set the m2p entry to invalid only if there are no further type
      * refs to this page as shared */
-    pg_type = read_atomic(&(mfn_to_page(omfn)->u.inuse.type_info));
+    pg = mfn_to_page(omfn);
+    pg_type = read_atomic(&pg->u.inuse.type_info);
     if ( (pg_type & PGT_count_mask) == 0
          || (pg_type & PGT_type_mask) != PGT_shared_page )
         set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316474.1585872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVU-0007JA-3i; Fri, 22 May 2026 08:45:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316474.1585872; Fri, 22 May 2026 08:45:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVU-0007J2-16; Fri, 22 May 2026 08:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1316474;
 Fri, 22 May 2026 08:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLVS-0007Ir-KS
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:45:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVS-000c4a-1w
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVS-000z3T-1q
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=sX9BiAxo6RFGVFLLMuBVG38FC9UJ62HOQaN8qczQcpQ=; b=hwsZawXFyAqhAoS8rLYG6Pr9SW
	ulXs0PKkZh4RQtOU8kQdx87ViC3lEhbT21QBDDs8D++308mxRzzzb51fw9s6bj+MHw422ONSY5Pcb
	7H3nJc9qugUp+W9S3+NOhw/ZgRQHQ6kMNXD9LtLrL/TW3HvwTSOqllj1Fpyf2Jnfq8Uc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PV: split a get_unsafe() invocation
Message-Id: <E1wQLVS-000z3T-1q@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:45:22 +0000

commit bcbef3bdbd091adedd33044a4260fa8dab21fb8a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:19:54 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:19:54 2026 +0200

    x86/PV: split a get_unsafe() invocation
    
    Misra C:2012 rule 13.6 takes issue with the gdt_ldt_desc_ptr() call
    appearing (deep) inside sizeof(), as used by get_unsafe().
    
    No functional change intended.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/pv/emulate.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c
index a00d1c6c82..48052f9ac3 100644
--- a/xen/arch/x86/pv/emulate.c
+++ b/xen/arch/x86/pv/emulate.c
@@ -29,8 +29,14 @@ int pv_emul_read_descriptor(unsigned int sel, const struct vcpu *v,
           */
          ((sel & 4) && (sel >> 3) >= v->arch.pv.ldt_ents) )
         desc.b = desc.a = 0;
-    else if ( get_unsafe(desc, gdt_ldt_desc_ptr(sel)) )
-        return 0;
+    else
+    {
+        const seg_desc_t *pdesc = gdt_ldt_desc_ptr(sel);
+
+        if ( get_unsafe(desc, pdesc) )
+            return 0;
+    }
+
     if ( !insn_fetch )
         desc.b &= ~_SEGMENT_L;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316475.1585877 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVe-0007LM-5N; Fri, 22 May 2026 08:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316475.1585877; Fri, 22 May 2026 08:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVe-0007LE-2L; Fri, 22 May 2026 08:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1316475;
 Fri, 22 May 2026 08:45:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLVc-0007L8-N9
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:45:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVc-000c4e-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVc-000z4J-27
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=/cVUX6K0I4oCaP+/wnoMHGXimYFr58c9j3vBq3GeQDs=; b=FzdRUIF6C5GIh94DgEM4PQML4l
	WHRdd4U8Knn5iUK+2TUaFBVY34BE7sBg5SFgsBCrinW9Fm9XRvILGpBgRSAykx2QUueOe6r1u+eyt
	udX+yhhO58YKPJmmtr+biG22kzGMVqCS0B7VGpb2SG35fqe+VxMjW23UomdJWNCRHHhE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests: Fix paging-mempool xen_pfn_t format strings
Message-Id: <E1wQLVc-000z4J-27@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:45:32 +0000

commit 71f8fd5a644f6e2c4d443d8b564a8cc60b928ccb
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Fri May 22 08:20:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:20:44 2026 +0200

    tools/tests: Fix paging-mempool xen_pfn_t format strings
    
    xen_pfn_t is not an unsigned long on all architectures. In particular,
    Arm32 builds see it as a 64-bit type, so printing it with %lx triggers
    a -Werror=format build failure.
    
    Use PRI_xen_pfn for the GFN diagnostics instead.
    
    Fixes: 66c982a5d3614 ("tests/paging-mempool: Extend to test P2M relocation")
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/tests/paging-mempool/test-paging-mempool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/tests/paging-mempool/test-paging-mempool.c b/tools/tests/paging-mempool/test-paging-mempool.c
index 97f5b77209..0e03e2e4a0 100644
--- a/tools/tests/paging-mempool/test-paging-mempool.c
+++ b/tools/tests/paging-mempool/test-paging-mempool.c
@@ -208,7 +208,7 @@ static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
         if ( errs[i] )
         {
             rc = -1;
-            fail("    Fail: check mark unable to map gfn %05lx: %d\n",
+            fail("    Fail: check mark unable to map gfn %05"PRI_xen_pfn": %d\n",
                  gfns[i], errs[i]);
             continue;
         }
@@ -216,7 +216,7 @@ static int check_guest_marks(xen_pfn_t gfn, uint32_t mark_start, size_t count)
         if ( *mark == exp )
             continue;
 
-        fail("    Fail: check mark: gfn %05lx expecting %08x (%u), got %08x (%u)\n",
+        fail("    Fail: check mark: gfn %05"PRI_xen_pfn" expecting %08x (%u), got %08x (%u)\n",
                gfns[i], exp, ~exp, *mark, ~*mark);
         rc = -1;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 08:45:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 08:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316476.1585880 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVo-0007NJ-6T; Fri, 22 May 2026 08:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316476.1585880; Fri, 22 May 2026 08:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQLVo-0007NB-3m; Fri, 22 May 2026 08:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1316476;
 Fri, 22 May 2026 08:45:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQLVm-0007N4-QL
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 08:45:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVm-000c4k-2X
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQLVm-000z54-2P
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 08:45:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LCILyfhfNiFICkrVLiFBtbDTOKnmPvYqXVjxxQMiers=; b=hz+BoM893ltl11KSK57sy6NJDR
	iqwLkCHzWeNwmq5jDKScK2O5JQx2ZOcJ7GYrwOtCu2VUwYeEIOmLSbq84LqeVr0ZULb0HoWD6JEGA
	sLCCXXeohGLmPK2C+RIpUIsRRrvL+QdBD91/MO1dlXhnT2hF+M8mmzFon64php0gfipc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] gnttab: simplify (really: drop) gnttab_set_frame_gfn()
Message-Id: <E1wQLVm-000z54-2P@xenbits.xenproject.org>
Date: Fri, 22 May 2026 08:45:42 +0000

commit eff88c4d35435fc56dcb07155e45bef16a56e892
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 08:21:14 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 08:21:14 2026 +0200

    gnttab: simplify (really: drop) gnttab_set_frame_gfn()
    
    It's not really doing anything for valid GFNs, which renders its one use
    site pretty pointless. The other isn't so much about setting anything, but
    rather about clearing.
    
    The main point here, however, is about Rafal spotting the double
    fetching of the GFN (first in gnttab_unpopulate_status_frames(), then
    again in gnttab_set_frame_gfn()). Re-purpose the macro parameter to pass
    in the already fetched GFN, while dropping the no longer used parameters.
    
    As the result is a mere wrapper around guest_physmap_remove_page(), drop
    the hook altogether.
    
    Suggested-by: Rafal Wojtczuk <rafal.wojtczuk@7bulls.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/include/asm/grant_table.h | 7 -------
 xen/arch/x86/include/asm/grant_table.h | 6 ------
 xen/common/grant_table.c               | 5 +----
 3 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/include/asm/grant_table.h
index c47058a3a0..7661a95341 100644
--- a/xen/arch/arm/include/asm/grant_table.h
+++ b/xen/arch/arm/include/asm/grant_table.h
@@ -50,13 +50,6 @@ int replace_grant_host_mapping(uint64_t gpaddr, mfn_t frame,
 #define gnttab_dom0_frames()                                             \
     min_t(unsigned int, opt_max_grant_frames, PFN_DOWN(_etext - _stext))
 
-#define gnttab_set_frame_gfn(gt, st, idx, gfn, mfn)                      \
-    (gfn_eq(gfn, INVALID_GFN)                                            \
-     ? guest_physmap_remove_page((gt)->domain,                           \
-                                 gnttab_get_frame_gfn(gt, st, idx),      \
-                                 mfn, 0)                                 \
-     : 0)
-
 #define gnttab_get_frame_gfn(gt, st, idx) ({                             \
    (st) ? gnttab_status_gfn(NULL, gt, idx)                               \
         : gnttab_shared_gfn(NULL, gt, idx);                              \
diff --git a/xen/arch/x86/include/asm/grant_table.h b/xen/arch/x86/include/asm/grant_table.h
index 5c23cec90c..e939c9bacb 100644
--- a/xen/arch/x86/include/asm/grant_table.h
+++ b/xen/arch/x86/include/asm/grant_table.h
@@ -32,12 +32,6 @@ static inline int replace_grant_host_mapping(uint64_t addr, mfn_t frame,
     return replace_grant_pv_mapping(addr, frame, new_addr, flags);
 }
 
-#define gnttab_set_frame_gfn(gt, st, idx, gfn, mfn)                      \
-    (gfn_eq(gfn, INVALID_GFN)                                            \
-     ? guest_physmap_remove_page((gt)->domain,                           \
-                                 gnttab_get_frame_gfn(gt, st, idx),      \
-                                 mfn, 0)                                 \
-     : 0 /* Handled in add_to_physmap_one(). */)
 #define gnttab_get_frame_gfn(gt, st, idx) ({                             \
     mfn_t mfn_ = (st) ? gnttab_status_mfn(gt, idx)                       \
                       : gnttab_shared_mfn(gt, idx);                      \
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index f516641eba..2dda1abd3f 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1844,8 +1844,7 @@ gnttab_unpopulate_status_frames(struct domain *d, struct grant_table *gt)
         {
             int rc = gfn_eq(gfn, INVALID_GFN)
                      ? 0
-                     : gnttab_set_frame_gfn(gt, true, i, INVALID_GFN,
-                                            page_to_mfn(pg));
+                     : guest_physmap_remove_page(d, gfn, page_to_mfn(pg), 0);
 
             if ( rc )
             {
@@ -4285,8 +4284,6 @@ int gnttab_map_frame_begin(
          */
         if ( !get_page(pg, d) )
             rc = -EBUSY;
-        else if ( (rc = gnttab_set_frame_gfn(gt, status, idx, gfn, *mfn)) )
-            put_page(pg);
     }
 
     if ( rc )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 10:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 10:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316563.1585938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQN11-00033L-1Q; Fri, 22 May 2026 10:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316563.1585938; Fri, 22 May 2026 10:22:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQN10-00033D-Uk; Fri, 22 May 2026 10:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1316563;
 Fri, 22 May 2026 10:22:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQN10-000335-Bm
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 10:22:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQN10-000e5w-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQN10-001CJD-0c
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 10:22:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FpBBHdn420wtzwWn1OHWz1+6ChhKhJhd1FiA8IL7llU=; b=srMViHb1+abK69G3JQe/xTDqX2
	3XFR24aEio12u1R+wajyVxACDZcUUIqgzadSCrEtKfNBOeaZbdOfpQXDO9utOq1Q5a8LVeBsULIv6
	JnYFYlnnCgNqHye4uu24U7Hds+sXCTOJNk5vJfp2vFtdA3jS2VniglSQ/DC9VWPDrM6o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: address Misra C:2012 rule 8.3
Message-Id: <E1wQN10-001CJD-0c@xenbits.xenproject.org>
Date: Fri, 22 May 2026 10:22:02 +0000

commit 9c2e34b1a38dab43458804a2dcf859fd187d4671
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 12:17:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 12:17:24 2026 +0200

    x86/time: address Misra C:2012 rule 8.3
    
    Before we can enable scanning of time.c, it needs to be clean wrt blocking
    rules. Bring boot_tsc_stamp's definition in line with its declaration. For
    get_s_time_fixed() go a little farther and move it to the x86 header (the
    function only exists in x86) and do, along with correcting the parameter
    name, the u64 -> uint64_t a little more widely than strictly necessary.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/time.h | 2 ++
 xen/arch/x86/time.c             | 6 +++---
 xen/include/xen/time.h          | 1 -
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 44f995ff05..ed763ebc1b 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -13,6 +13,8 @@ static inline cycles_t get_cycles(void)
     return rdtsc_ordered();
 }
 
+s_time_t get_s_time_fixed(uint64_t at_tsc);
+
 unsigned long
 mktime (unsigned int year, unsigned int mon,
         unsigned int day, unsigned int hour,
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 6582235dcc..d339111239 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -95,7 +95,7 @@ static u32 pit_stamp32;
 static bool __read_mostly using_pit;
 
 /* Boot timestamp, filled in head.S */
-u64 __initdata boot_tsc_stamp;
+uint64_t __initdata boot_tsc_stamp;
 
 /* Per-socket TSC_ADJUST values, for secondary cores/threads to sync to. */
 static uint64_t *__read_mostly tsc_adjust;
@@ -1656,10 +1656,10 @@ static unsigned long get_wallclock_time(void)
  * System Time
  ***************************************************************************/
 
-s_time_t get_s_time_fixed(u64 at_tsc)
+s_time_t get_s_time_fixed(uint64_t at_tsc)
 {
     const struct cpu_time *t = &this_cpu(cpu_time);
-    u64 tsc, delta;
+    uint64_t tsc, delta;
 
     if ( at_tsc )
         tsc = at_tsc;
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 2185dd26a4..e9c0822e6f 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -33,7 +33,6 @@ struct vcpu;
 typedef int64_t s_time_t;
 #define PRI_stime PRId64
 
-s_time_t get_s_time_fixed(u64 at_tick);
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
 uint64_t get_localtime_us(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316564.1585942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQN1B-00037R-3a; Fri, 22 May 2026 10:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316564.1585942; Fri, 22 May 2026 10:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQN1B-00037J-13; Fri, 22 May 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1316564;
 Fri, 22 May 2026 10:22:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQN1A-00036v-BW
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 10:22:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQN1A-000e6N-13
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQN1A-001CKs-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 10:22:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=iWp8lFbTylNiti/avO6K5RfrSE+1wSxvWkcwpxsU5CQ=; b=wHQxQFrlOC89K8gca4agEjboCM
	hnS17uuFaeZPumZ4TSDY9I6noYUwIPqMWQBxsq+mwi1crnCBzw3Wl3umD2TT6cq6TjsviTjlC4Sq5
	H6ov08D2zfJGvgQH2Cha0unf2SwnQ/YAZ7ZIJU14PGDS4KRUVBtMOC6cLerJ0CWiF7R0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/time: don't exclude from Eclair scanning
Message-Id: <E1wQN1A-001CKs-0v@xenbits.xenproject.org>
Date: Fri, 22 May 2026 10:22:12 +0000

commit aaa34f23ac65b75c94d069e407a2698602f18d56
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 12:18:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 12:18:00 2026 +0200

    x86/time: don't exclude from Eclair scanning
    
    The justification is wrong, and the file hence shouldn't really be
    excluded.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index a187270c84..7d4b6f2948 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -213,11 +213,6 @@ const-qualified."
 -config=MC3A2.R8.3,reports+={deliberate, "any_area(^.*parameter `unused[0-9]*'.*$)"}
 -doc_end
 
--doc_begin="The following file is imported from Linux: ignore for now."
--file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
--config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
--doc_end
-
 -doc_begin="The following file is imported from Linux: ignore for now."
 -file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
 -config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 11:00:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 11:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316649.1586027 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQNbm-0005WM-Qo; Fri, 22 May 2026 11:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316649.1586027; Fri, 22 May 2026 11:00:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQNbm-0005Vy-O3; Fri, 22 May 2026 11:00:02 +0000
Received: by outflank-mailman (input) for mailman id 1316649;
 Fri, 22 May 2026 11:00:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQNbl-0005M5-T7
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 11:00:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQNbl-000er0-2g
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQNbl-001IXu-2M
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1n65YzuUrZpT5NnzA+bdmrN0nNgmkJMmiWQ7ownShUI=; b=Y6p36t8GvQHRkeUF+Ef2l5Y0Sf
	nF1Fs69qHZxrbga7puYUK/WoPXLiLh29neIesFVMFwwVNtS6e6F+kUHPm7VUBECuXuLbEAY7yh+xR
	QlaOzzbJIFVTgBz+O1e/MJ0QFnxISDo7xivEkkQ7nGkcdzCUnJjXuM3DXbyvDvG19bGo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] tools/libxl: Fix libxl_nocpuid.c build with json-c
Message-Id: <E1wQNbl-001IXu-2M@xenbits.xenproject.org>
Date: Fri, 22 May 2026 11:00:01 +0000

commit 16e9e6245c974717f3d4e34d04cbec01e5bc2709
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 16:53:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 12:57:45 2026 +0100

    tools/libxl: Fix libxl_nocpuid.c build with json-c
    
    libxl_nocpuid.c needs the same treatment as libxl_cpuid.c
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit ca7906501ee8d5d0744fbcfe092633559dedd7f5)
---
 tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c
index 0630959e76..ce334633b3 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,21 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    *jso_r = NULL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     return 0;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Fri May 22 11:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 11:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316704.1586057 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOIM-0006fC-LQ; Fri, 22 May 2026 11:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316704.1586057; Fri, 22 May 2026 11:44:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOIM-0006f4-Iu; Fri, 22 May 2026 11:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1316704;
 Fri, 22 May 2026 11:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQOIL-0006ey-LP
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 11:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOIL-000fdt-1n
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOIL-001PC0-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=XuXuVRznrrwnlZkHm+jba7RkzU4FHqLt7byEjedkvSM=; b=lgjyin+9xoU175E5PU2UhJqk6H
	yZ2Qn2PX8fwQwgUWtWwajxMUdrUXIDIsEXSpSkg8903wkx2VDaRetInj+VTOUpsxXDvWoDBbT3wvf
	VdfvqMA2An1Y3dyIyxQjs3szzmgy3DRM4q1OHb7GZeItunMjaanjnbz5jBBuYfx1P/BQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: address Misra C:2012 rule 8.3
Message-Id: <E1wQOIL-001PC0-1U@xenbits.xenproject.org>
Date: Fri, 22 May 2026 11:44:01 +0000

commit 9c2e34b1a38dab43458804a2dcf859fd187d4671
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 12:17:24 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 12:17:24 2026 +0200

    x86/time: address Misra C:2012 rule 8.3
    
    Before we can enable scanning of time.c, it needs to be clean wrt blocking
    rules. Bring boot_tsc_stamp's definition in line with its declaration. For
    get_s_time_fixed() go a little farther and move it to the x86 header (the
    function only exists in x86) and do, along with correcting the parameter
    name, the u64 -> uint64_t a little more widely than strictly necessary.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/x86/include/asm/time.h | 2 ++
 xen/arch/x86/time.c             | 6 +++---
 xen/include/xen/time.h          | 1 -
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/time.h b/xen/arch/x86/include/asm/time.h
index 44f995ff05..ed763ebc1b 100644
--- a/xen/arch/x86/include/asm/time.h
+++ b/xen/arch/x86/include/asm/time.h
@@ -13,6 +13,8 @@ static inline cycles_t get_cycles(void)
     return rdtsc_ordered();
 }
 
+s_time_t get_s_time_fixed(uint64_t at_tsc);
+
 unsigned long
 mktime (unsigned int year, unsigned int mon,
         unsigned int day, unsigned int hour,
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 6582235dcc..d339111239 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -95,7 +95,7 @@ static u32 pit_stamp32;
 static bool __read_mostly using_pit;
 
 /* Boot timestamp, filled in head.S */
-u64 __initdata boot_tsc_stamp;
+uint64_t __initdata boot_tsc_stamp;
 
 /* Per-socket TSC_ADJUST values, for secondary cores/threads to sync to. */
 static uint64_t *__read_mostly tsc_adjust;
@@ -1656,10 +1656,10 @@ static unsigned long get_wallclock_time(void)
  * System Time
  ***************************************************************************/
 
-s_time_t get_s_time_fixed(u64 at_tsc)
+s_time_t get_s_time_fixed(uint64_t at_tsc)
 {
     const struct cpu_time *t = &this_cpu(cpu_time);
-    u64 tsc, delta;
+    uint64_t tsc, delta;
 
     if ( at_tsc )
         tsc = at_tsc;
diff --git a/xen/include/xen/time.h b/xen/include/xen/time.h
index 2185dd26a4..e9c0822e6f 100644
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -33,7 +33,6 @@ struct vcpu;
 typedef int64_t s_time_t;
 #define PRI_stime PRId64
 
-s_time_t get_s_time_fixed(u64 at_tick);
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
 uint64_t get_localtime_us(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 11:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 11:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316705.1586062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOIW-0006h0-Mn; Fri, 22 May 2026 11:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316705.1586062; Fri, 22 May 2026 11:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOIW-0006gs-KF; Fri, 22 May 2026 11:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1316705;
 Fri, 22 May 2026 11:44:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQOIV-0006gk-Mx
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 11:44:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOIV-000feR-29
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOIV-001PDx-1x
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 11:44:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=S5qpSa9MAH+mfiLU4HyUDslQiFfa4KGwDmmxl0MxM3Q=; b=sQmugcze2kjP36C9GApq1eHGtu
	z4Yb24TvhrwhCtu+XNuXCHd83gaLpFoL6VOUBQztpw+O0p+p9O+5z1K4cqVi01lgVfxn8XX9uJ58b
	CTVptUU7lnItRL5UdDt1gIETgxxSr9/38yz1B+USVBJZxYuM1mMdFCG4BkP2o2tlrnlw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/time: don't exclude from Eclair scanning
Message-Id: <E1wQOIV-001PDx-1x@xenbits.xenproject.org>
Date: Fri, 22 May 2026 11:44:11 +0000

commit aaa34f23ac65b75c94d069e407a2698602f18d56
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 12:18:00 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 12:18:00 2026 +0200

    x86/time: don't exclude from Eclair scanning
    
    The justification is wrong, and the file hence shouldn't really be
    excluded.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index a187270c84..7d4b6f2948 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -213,11 +213,6 @@ const-qualified."
 -config=MC3A2.R8.3,reports+={deliberate, "any_area(^.*parameter `unused[0-9]*'.*$)"}
 -doc_end
 
--doc_begin="The following file is imported from Linux: ignore for now."
--file_tag+={adopted_time_r8_3,"^xen/arch/x86/time\\.c$"}
--config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_time_r8_3)))&&(any_area(any_loc(file(^xen/include/xen/time\\.h$)))||any_area(any_loc(file(^xen/arch/x86/include/asm/setup\\.h$))))"}
--doc_end
-
 -doc_begin="The following file is imported from Linux: ignore for now."
 -file_tag+={adopted_cpu_idle_r8_3,"^xen/arch/x86/acpi/cpu_idle\\.c$"}
 -config=MC3A2.R8.3,reports+={deliberate,"any_area(any_loc(file(adopted_cpu_idle_r8_3)))&&any_area(any_loc(file(^xen/include/xen/pmstat\\.h$)))"}
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 12:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 12:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316722.1586066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOt8-0004s6-A5; Fri, 22 May 2026 12:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316722.1586066; Fri, 22 May 2026 12:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQOt8-0004ry-7U; Fri, 22 May 2026 12:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1316722;
 Fri, 22 May 2026 12:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQOt7-0004rs-D6
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 12:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOt7-000gMb-11
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 12:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQOt7-001TDr-0s
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 12:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ME/s+PpPyg9aXIhnR+BDzQGxtJ1Ko+HsNYfoLtL65+E=; b=EoVSBYbw83mm3PG9gnOduHwMlt
	8AtOBwvEiMFDXnOSITQ5rNRGat6HGr9w3HkWf0zu3R++cyDYToOhkddDbRmI9nlG1qgPHUKXslG0W
	zz+XAoMfvXKuQkdMWfdZM3ed+QrIJ99NlK1VqJ4BTM/bkEJDhTr2KWamdXpr9GJfCd48=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] tools/libxl: Fix libxl_nocpuid.c build with json-c
Message-Id: <E1wQOt7-001TDr-0s@xenbits.xenproject.org>
Date: Fri, 22 May 2026 12:22:01 +0000

commit 16e9e6245c974717f3d4e34d04cbec01e5bc2709
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 16:53:46 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Tue May 19 12:57:45 2026 +0100

    tools/libxl: Fix libxl_nocpuid.c build with json-c
    
    libxl_nocpuid.c needs the same treatment as libxl_cpuid.c
    
    Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
    (cherry picked from commit ca7906501ee8d5d0744fbcfe092633559dedd7f5)
---
 tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c
index 0630959e76..ce334633b3 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,21 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    *jso_r = NULL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     return 0;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316794.1586133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPeZ-0000LQ-A2; Fri, 22 May 2026 13:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316794.1586133; Fri, 22 May 2026 13:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPeZ-0000LH-7L; Fri, 22 May 2026 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1316794;
 Fri, 22 May 2026 13:11:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPeY-0000LB-Af
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPeY-000hJe-0r
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPeY-001aEf-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DRMv4W/c4yX/nWnz6eer1/zFwM/DZVS7E96u9KTMLZU=; b=DXDLRYC5Y2HErRAYgUAXZL5S5x
	elYQMdUTfxkYh2FXB9hnH7jvjYvjCOYxd6IaNE0egAA+dKpCMaNDTd+vIdBZj45/dZ+jMRQjn2QAj
	gL6nFWUoGRLe0EfvMDk0czVl+9RL7eRFGAI+Cz8NbfqwTARi0efC0YQl2GAIcsBA0APU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: conditionalize / rename local variables
Message-Id: <E1wQPeY-001aEf-0j@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:02 +0000

commit 8c394de10267573ab4f2087faeba924f1597ed6e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:18:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:18:10 2026 +0200

    x86/shadow: conditionalize / rename local variables
    
    ... shadowing a function scope one in one case and the global _end[] in
    another, thus violating Misra C:2012 rule 5.3 ("An identifier declared in
    an inner scope shall not hide an identifier declared in an outer scope").
    No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 775cf4c39b..9e4992c6b1 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -857,13 +857,13 @@ do {                                                                       \
 /* 64-bit l2: touch all entries except for PAE compat guests. */
 #define FOREACH_PRESENT_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)      \
 do {                                                                        \
-    unsigned int _i, _end = SHADOW_L2_PAGETABLE_ENTRIES;                    \
+    unsigned int _i, _nr = SHADOW_L2_PAGETABLE_ENTRIES;                     \
     shadow_l2e_t *_sp = map_domain_page((_sl2mfn));                         \
     ASSERT_VALID_L2(mfn_to_page(_sl2mfn)->u.sh.type);                       \
     if ( is_pv_32bit_domain(_dom) /* implies !paging_mode_external */ &&    \
          mfn_to_page(_sl2mfn)->u.sh.type != SH_type_l2_64_shadow )          \
-        _end = COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(_dom);                    \
-    for ( _i = 0; _i < _end; ++_i )                                         \
+        _nr = COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(_dom);                     \
+    for ( _i = 0; _i < _nr; ++_i )                                          \
     {                                                                       \
         (_sl2e) = _sp + _i;                                                 \
         if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )               \
@@ -3352,7 +3352,9 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
 #if SHADOW_PAGING_LEVELS == 3
         {
             mfn_t smfn = pagetable_get_mfn(v->arch.paging.shadow.shadow_table[0]);
+#if GUEST_PAGING_LEVELS != 3
             unsigned int i;
+#endif
 
             for_each_shadow_table(v, i)
             {
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316796.1586137 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPek-0000Na-BP; Fri, 22 May 2026 13:11:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316796.1586137; Fri, 22 May 2026 13:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPek-0000NS-8h; Fri, 22 May 2026 13:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1316796;
 Fri, 22 May 2026 13:11:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPei-0000NI-Cg
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPei-000hJy-1A
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPei-001aG4-13
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0ct1PAsgvXDmmkIP6qTORPz+OK7dAaSeDNs43qGeQmo=; b=Ek88Uek2pf1730IEJo8F97R2cG
	T25ou7gHHM0u4B3E32F1k+U7oyrOQeqUQNLTy9BVZaLNjeMwg9cTj/n4D5ys1DB+rqC3Oaz+IGskA
	XoFDSTkTaPPfiOLSbDqWfqUiEAIB5LYvtKwWtubHCY9jPENmwwOk15Hd2x3gdmSEXO6g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: rename a parameter of shadow_l<N>_index()
Message-Id: <E1wQPei-001aG4-13@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:12 +0000

commit ef69700ea0c979eadb5e67eefabe312160bd5304
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:18:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:18:38 2026 +0200

    x86/shadow: rename a parameter of shadow_l<N>_index()
    
    ... shadowing a file scope one, thus violating Misra C:2012 rule 5.3
    ("An identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope").
    
    While there,
    - replace u32 by uint32_t,
    - reduce the number of cf_check by aliasing shadow_l<N>_index() to
      shadow_l1_index() for N > 1 and GUEST_PAGING_LEVELS > 2.
    
    No difference in generated code, except of course the removal of the
    duplicate function instances.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 9e4992c6b1..2990cee869 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -402,46 +402,39 @@ guest_index(const void *ptr)
     return (u32)((unsigned long)ptr & ~PAGE_MASK) / sizeof(guest_l1e_t);
 }
 
-static u32 cf_check shadow_l1_index(mfn_t *smfn, u32 guest_index)
+static uint32_t cf_check shadow_l1_index(mfn_t *smfn, uint32_t gidx)
 {
 #if (GUEST_PAGING_LEVELS == 2)
     ASSERT(mfn_to_page(*smfn)->u.sh.head);
-    if ( guest_index >= SHADOW_L1_PAGETABLE_ENTRIES )
+    if ( gidx >= SHADOW_L1_PAGETABLE_ENTRIES )
         *smfn = sh_next_page(*smfn);
-    return (guest_index % SHADOW_L1_PAGETABLE_ENTRIES);
+    return (gidx % SHADOW_L1_PAGETABLE_ENTRIES);
 #else
-    return guest_index;
+    return gidx;
 #endif
 }
 
-static u32 cf_check shadow_l2_index(mfn_t *smfn, u32 guest_index)
-{
 #if (GUEST_PAGING_LEVELS == 2)
+static uint32_t cf_check shadow_l2_index(mfn_t *smfn, uint32_t gidx)
+{
     int i;
     ASSERT(mfn_to_page(*smfn)->u.sh.head);
     // Because we use 2 shadow l2 entries for each guest entry, the number of
     // guest entries per shadow page is SHADOW_L2_PAGETABLE_ENTRIES/2
-    for ( i = 0; i < guest_index / (SHADOW_L2_PAGETABLE_ENTRIES / 2); i++ )
+    for ( i = 0; i < gidx / (SHADOW_L2_PAGETABLE_ENTRIES / 2); i++ )
         *smfn = sh_next_page(*smfn);
     // We multiply by two to get the index of the first of the two entries
     // used to shadow the specified guest entry.
-    return (guest_index % (SHADOW_L2_PAGETABLE_ENTRIES / 2)) * 2;
+    return (gidx % (SHADOW_L2_PAGETABLE_ENTRIES / 2)) * 2;
+}
 #else
-    return guest_index;
+#define shadow_l2_index shadow_l1_index
 #endif
-}
 
 #if GUEST_PAGING_LEVELS >= 4
 
-static u32 cf_check shadow_l3_index(mfn_t *smfn, u32 guest_index)
-{
-    return guest_index;
-}
-
-static u32 cf_check shadow_l4_index(mfn_t *smfn, u32 guest_index)
-{
-    return guest_index;
-}
+#define shadow_l3_index shadow_l1_index
+#define shadow_l4_index shadow_l1_index
 
 #endif // GUEST_PAGING_LEVELS >= 4
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316797.1586141 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPeu-0000Qp-Cp; Fri, 22 May 2026 13:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316797.1586141; Fri, 22 May 2026 13:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPeu-0000Qf-A7; Fri, 22 May 2026 13:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1316797;
 Fri, 22 May 2026 13:11:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPes-0000QY-Fv
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPes-000hK4-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPes-001aHJ-1O
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=LHVQuRvz4JqaKUhhqNQjwUbDKNfMs9gCopBOtlRlUgI=; b=JKovdaR+GJSg0BRjJ2kFz7U+O2
	j3gk+IT8ROsQeReQ6+eQ7Wrf9cOh4hvoUt5Rq9GdljR0o0twuejehFgobRt6W6vc+q6BnXhyP4MV6
	U+KBitpI6Vyc3Lias7F7qmkiyAi9YIpfWwQ79PUhc4/7Eklw7unx7ymn/0bfde3xqPCQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: address Misra C:2012 rule 16.2
Message-Id: <E1wQPes-001aHJ-1O@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:22 +0000

commit 16de5ab8f66996dcb1fcce2fd8657b6c6febd1c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:19:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:19:17 2026 +0200

    x86/mm: address Misra C:2012 rule 16.2
    
    ... ("A switch label shall only be used when the most closely-enclosing
    compound statement is the body of a `switch' statement"). Use a form of
    fall-through instead. No difference in generated code, except for some
    line number changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b2b03da52b..a158379e77 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2663,15 +2663,17 @@ static int validate_page(struct page_info *page, unsigned long type,
                  get_gpfn_from_mfn(mfn_x(page_to_mfn(page))),
                  type, page->count_info, page->u.inuse.type_info);
         if ( page != current->arch.old_guest_table )
-            page->u.inuse.type_info = 0;
-        else
         {
-            ASSERT((page->u.inuse.type_info &
-                    (PGT_count_mask | PGT_validated)) == 1);
-    case -ERESTART:
-            get_page_light(page);
-            page->u.inuse.type_info |= PGT_partial;
+            page->u.inuse.type_info = 0;
+            break;
         }
+
+        ASSERT((page->u.inuse.type_info &
+                (PGT_count_mask | PGT_validated)) == 1);
+        fallthrough;
+    case -ERESTART:
+        get_page_light(page);
+        page->u.inuse.type_info |= PGT_partial;
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316798.1586145 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPf4-0000To-Dy; Fri, 22 May 2026 13:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316798.1586145; Fri, 22 May 2026 13:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPf4-0000Tg-BQ; Fri, 22 May 2026 13:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1316798;
 Fri, 22 May 2026 13:11:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPf2-0000TZ-JW
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPf2-000hKA-1o
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPf2-001aJ3-1g
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=69sQ2A6303JmzskvRbsq/CllLAdG5dXcO386Ah8Du1I=; b=F7AWgiI0jOPSPRUqlvu9D9UkyG
	Ckb6fByo60Jv+AWzUg+WttvM1gi3Ah7WZz6ydIObn1O6FePJLNRelLzUyELXv99ktKLY6yfIaryS4
	0ZNcT9nN+uqcm0a2CbUkSBhvgVoxJg0QixiHuHKl4GSJzPtMV1dOHb1ABKjPo2VttKU8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/PV: address Misra C:2012 rule 16.2
Message-Id: <E1wQPf2-001aJ3-1g@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:32 +0000

commit 7d4a266fddfd1fb0ec36569ce22a7acb9a80db9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:19:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:19:46 2026 +0200

    x86/PV: address Misra C:2012 rule 16.2
    
    ... ("A switch label shall only be used when the most closely-enclosing
    compound statement is the body of a `switch' statement"). While I don't
    really like doing so, use a few "goto" instead. No change in generated
    code (somewhat to my surprise).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 48 +++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 6afbb79f0b..1a3e3012e2 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -896,7 +896,7 @@ static int cf_check read_msr(
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
     const struct cpu_policy *cp = currd->arch.cpu_policy;
-    bool vpmu_msr = false, warn = false;
+    bool warn = false;
     uint64_t tmp;
     int ret;
 
@@ -995,21 +995,21 @@ static int cf_check read_msr(
     case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
     case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
         if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
-        {
-            vpmu_msr = true;
-            /* fall through */
+            goto vpmu;
+        goto check_relaxed;
+
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.vendor &
-                              (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
-            {
-                if ( vpmu_do_rdmsr(reg, val) )
-                    break;
-                return X86EMUL_OKAY;
-            }
+        if ( boot_cpu_data.vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
+        {
+    vpmu:
+            if ( vpmu_do_rdmsr(reg, val) )
+                break;
+            return X86EMUL_OKAY;
         }
         /* fall through */
     default:
+    check_relaxed:
         if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, &tmp) )
         {
             *val = 0;
@@ -1048,7 +1048,6 @@ static int cf_check write_msr(
     const struct domain *currd = curr->domain;
     const struct cpu_policy *cp = currd->arch.cpu_policy;
     uint64_t temp = 0;
-    bool vpmu_msr = false;
     int ret;
 
     if ( (ret = guest_wrmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
@@ -1178,24 +1177,25 @@ static int cf_check write_msr(
     case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
     case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
         if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
-        {
-            vpmu_msr = true;
+            goto vpmu;
+        goto check_relaxed;
+
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.vendor &
-                              (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
-            {
-                if ( (vpmu_mode & XENPMU_MODE_ALL) &&
-                     !is_hardware_domain(currd) )
-                    return X86EMUL_OKAY;
-
-                if ( vpmu_do_wrmsr(reg, val) )
-                    break;
+        if ( boot_cpu_data.vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
+        {
+    vpmu:
+            if ( (vpmu_mode & XENPMU_MODE_ALL) &&
+                 !is_hardware_domain(currd) )
                 return X86EMUL_OKAY;
-            }
+
+            if ( vpmu_do_wrmsr(reg, val) )
+                break;
+            return X86EMUL_OKAY;
         }
         /* fall through */
     default:
+    check_relaxed:
         if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, &val) )
             return X86EMUL_OKAY;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316800.1586149 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPfE-0000WG-FO; Fri, 22 May 2026 13:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316800.1586149; Fri, 22 May 2026 13:11:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPfE-0000W7-Ck; Fri, 22 May 2026 13:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1316800;
 Fri, 22 May 2026 13:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPfC-0000Vs-Ls
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPfC-000hKE-25
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPfC-001aKn-1y
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=kfPVGISJP9OpBmDXLpE3Ly0kHuzwtSlp3Lr837ucsZM=; b=bGPa/htW5Xsp4aDa3MF0Y9DHd1
	qCLjKY/eyAwPjXipKHStLk8KcFEhEYHuT7OermGzmhkeg2uaZfNAo77A04HJ8r6WAOjaSpButnGfO
	HtUDPkqNgEDcEdjvUZIpBDBH/iH0obDICY71qYPbpdhiS2EPIkA3/Efc8pc+O4q9Fe0I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] crypto/vmac: adjust for Misra C:2012 rule 17.5
Message-Id: <E1wQPfC-001aKn-1y@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:42 +0000

commit f04da199a914cd73a00cd872626532642c2de809
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:20:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:20:20 2026 +0200

    crypto/vmac: adjust for Misra C:2012 rule 17.5
    
    ... ("The function argument corresponding to a parameter declared to have
    an array type shall have an appropriate number of elements"). Instead of
    casts, (ab)use unions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/crypto/vmac.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index c7aa1e9be3..bcb51913d7 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -926,41 +926,41 @@ uint64_t vmac(unsigned char m[],
 
 void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx)
 {
-    uint64_t in[2] = {0}, out[2];
+    union {
+        uint64_t q[2];
+        uint8_t b[16];
+    } in = {}, out;
     unsigned i;
     aes_key_setup(user_key, &ctx->cipher_key);
     
     /* Fill nh key */
-    ((unsigned char *)in)[0] = 0x80; 
+    in.b[0] = 0x80;
     for (i = 0; i < sizeof(ctx->nhkey)/8; i+=2) {
-        aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-        ctx->nhkey[i  ] = get64BE(out);
-        ctx->nhkey[i+1] = get64BE(out+1);
-        ((unsigned char *)in)[15] += 1;
+        aes_encryption(in.b, out.b, &ctx->cipher_key);
+        ctx->nhkey[i  ] = get64BE(out.q);
+        ctx->nhkey[i+1] = get64BE(out.q + 1);
+        in.b[15] += 1;
     }
 
     /* Fill poly key */
-    ((unsigned char *)in)[0] = 0xC0; 
-    in[1] = 0;
+    in.b[0] = 0xC0;
+    in.q[1] = 0;
     for (i = 0; i < sizeof(ctx->polykey)/8; i+=2) {
-        aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-        ctx->polytmp[i  ] = ctx->polykey[i  ] = get64BE(out) & mpoly;
-        ctx->polytmp[i+1] = ctx->polykey[i+1] = get64BE(out+1) & mpoly;
-        ((unsigned char *)in)[15] += 1;
+        aes_encryption(in.b, out.b, &ctx->cipher_key);
+        ctx->polytmp[i  ] = ctx->polykey[i  ] = get64BE(out.q) & mpoly;
+        ctx->polytmp[i+1] = ctx->polykey[i+1] = get64BE(out.q + 1) & mpoly;
+        in.b[15] += 1;
     }
 
     /* Fill ip key */
-    ((unsigned char *)in)[0] = 0xE0;
-    in[1] = 0;
+    in.b[0] = 0xE0;
+    in.q[1] = 0;
     for (i = 0; i < sizeof(ctx->l3key)/8; i+=2) {
         do {
-            aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-            ctx->l3key[i  ] = get64BE(out);
-            ctx->l3key[i+1] = get64BE(out+1);
-            ((unsigned char *)in)[15] += 1;
+            aes_encryption(in.b, out.b, &ctx->cipher_key);
+            ctx->l3key[i  ] = get64BE(out.q);
+            ctx->l3key[i+1] = get64BE(out.q + 1);
+            in.b[15] += 1;
         } while (ctx->l3key[i] >= p64 || ctx->l3key[i+1] >= p64);
     }
     
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316801.1586153 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPfO-0000YI-H7; Fri, 22 May 2026 13:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316801.1586153; Fri, 22 May 2026 13:11:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQPfO-0000Y8-E9; Fri, 22 May 2026 13:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1316801;
 Fri, 22 May 2026 13:11:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQPfM-0000Y1-Om
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:11:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPfM-000hKK-2N
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQPfM-001aMU-2G
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:11:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ZgjNpJyd1b4prxMl66a3wFlg/vqZIFtTTN841NTqGCk=; b=tnabvEO8rvT7UJOr/AyVfYSe43
	DJD94dsUxDLNqfPG87zDMp1G+whrvBrRkPC52Mf3P5podbgM8IUyzJy8y70lqgyyllbtQpFaD2ul7
	sGdF6Dn6mAvtmkvGZ1R62gdxKqJpqithM1uMx4HmmT7nmsAv7oioqs+S5NzHG7ekc4JM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/gnttab: Fix TOCTOU race in gnttab_set_version()
Message-Id: <E1wQPfM-001aMU-2G@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:11:52 +0000

commit c0e548d9206b3a281f9d30a2670be543fb383223
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Fri May 22 13:32:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:32:44 2026 +0200

    xen/gnttab: Fix TOCTOU race in gnttab_set_version()
    
    Move first read of gt->gt_version inside the critical region of the
    rwlock, otherwise concurrent gnttab operations (silly as they would be)
    may get mutually confused as to the actual current version.
    
    Fixes: c1488502c949("grant-tables: do not fail attempts to...")
    Reported-by: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2dda1abd3f..ac9fed6001 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3184,11 +3184,12 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     if ( op.version == 2 && gt->max_version == 1 )
         goto out; /* Behave as before set_version was introduced. */
 
+    grant_write_lock(gt);
+
     res = 0;
     if ( gt->gt_version == op.version )
-        goto out;
+        goto out_unlock;
 
-    grant_write_lock(gt);
     /*
      * Make sure that the grant table isn't currently in use when we
      * change the version number, except for the first 8 entries which
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 13:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 13:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316869.1586202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQAV-00089k-RW; Fri, 22 May 2026 13:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316869.1586202; Fri, 22 May 2026 13:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQAV-00089c-Or; Fri, 22 May 2026 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1316869;
 Fri, 22 May 2026 13:44:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQAT-00089W-TK
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 13:44:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQAT-000huG-2Y
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQAT-001e8Y-2F
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 13:44:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5CKXRFZqUsGx82FkFYhzTSrZeKvzgOfbtxVo/85wxgA=; b=2hICVqzNkHdAhCsPEUlH9oSV8P
	ufSt/rCJ7moMEZe7ni3Kf7//61YOK1C7pRMeri+3Bp4hhbYw2eEwluAaP9imwk7Xd27SCehxm6QPE
	S9BSWC2kkQMJHIFmIvpgwozA3vQ57CKg027WPkefyPXuGKB8kI5yxdDTJuD3kjrjOSZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv32: Fix bogus CR2 in pagefault for gate emulation
Message-Id: <E1wQQAT-001e8Y-2F@xenbits.xenproject.org>
Date: Fri, 22 May 2026 13:44:01 +0000

commit 03878fba4af14fab942c2ce8ed2d6d18c204a603
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Fri May 22 14:33:16 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 22 14:33:44 2026 +0100

    x86/pv32: Fix bogus CR2 in pagefault for gate emulation
    
    __{put,get}_guest() returns -EFAULT on access faults which causes
    the injected CR2 to be off by 14 bytes (as EFAULT is 14) which is
    incorrect.
    
    Fix the computation by relying on __copy_{from,to}_guest_pv() which
    reports the number of remaining bytes instead of a negative errno,
    such that we can compute the offset properly.
    
    Fixes: 70ad570b2799 ("x86/64: paravirt 32-on-64 call gate support")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-gate-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index c2c699fbff..d0f7f06e01 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -286,12 +286,14 @@ void pv_emulate_gate_op(struct cpu_user_regs *regs)
     if ( !jump )
     {
         unsigned int ss, esp, *stkp;
+        uint32_t value;
         int rc;
 #define push(item) do \
         { \
+            value = (item); \
             --stkp; \
             esp -= 4; \
-            rc = __put_guest(item, stkp); \
+            rc = __copy_to_guest_pv(stkp, &value, sizeof(value)); \
             if ( rc ) \
             { \
                 pv_inject_page_fault(PFEC_write_access, \
@@ -359,7 +361,7 @@ void pv_emulate_gate_op(struct cpu_user_regs *regs)
                     unsigned int parm;
 
                     --ustkp;
-                    rc = __get_guest(parm, ustkp);
+                    rc = __copy_from_guest_pv(&parm, ustkp, sizeof(parm));
                     if ( rc )
                     {
                         pv_inject_page_fault(0, (unsigned long)(ustkp + 1) - rc);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316881.1586216 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQPz-0003Cz-5N; Fri, 22 May 2026 14:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316881.1586216; Fri, 22 May 2026 14:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQPz-0003Cc-1d; Fri, 22 May 2026 14:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1316881;
 Fri, 22 May 2026 14:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQPy-00031K-63
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQPy-000iJb-0E
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQPy-001fTi-06
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=DUA0LoN5M1rBe6QdRNEAO5UrlxdXobHG9qpHQrey33w=; b=z3PrnIVnvgO/sFxA7+qLAYCFal
	wHfMEllaGPznSMlD36RnWmUhWP3eheNm+9147HS97aB0eyrgqgmrRInW/GpmtNSrP0uARrIAdHwYA
	vhF2lRSnzCvghLG5HhgBE0rYeB3JkrixLQ50bOXfNULWxv8/z2FWJi0rbVp20xVifjks=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: conditionalize / rename local variables
Message-Id: <E1wQQPy-001fTi-06@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:02 +0000

commit 8c394de10267573ab4f2087faeba924f1597ed6e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:18:10 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:18:10 2026 +0200

    x86/shadow: conditionalize / rename local variables
    
    ... shadowing a function scope one in one case and the global _end[] in
    another, thus violating Misra C:2012 rule 5.3 ("An identifier declared in
    an inner scope shall not hide an identifier declared in an outer scope").
    No difference in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 775cf4c39b..9e4992c6b1 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -857,13 +857,13 @@ do {                                                                       \
 /* 64-bit l2: touch all entries except for PAE compat guests. */
 #define FOREACH_PRESENT_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)      \
 do {                                                                        \
-    unsigned int _i, _end = SHADOW_L2_PAGETABLE_ENTRIES;                    \
+    unsigned int _i, _nr = SHADOW_L2_PAGETABLE_ENTRIES;                     \
     shadow_l2e_t *_sp = map_domain_page((_sl2mfn));                         \
     ASSERT_VALID_L2(mfn_to_page(_sl2mfn)->u.sh.type);                       \
     if ( is_pv_32bit_domain(_dom) /* implies !paging_mode_external */ &&    \
          mfn_to_page(_sl2mfn)->u.sh.type != SH_type_l2_64_shadow )          \
-        _end = COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(_dom);                    \
-    for ( _i = 0; _i < _end; ++_i )                                         \
+        _nr = COMPAT_L2_PAGETABLE_FIRST_XEN_SLOT(_dom);                     \
+    for ( _i = 0; _i < _nr; ++_i )                                          \
     {                                                                       \
         (_sl2e) = _sp + _i;                                                 \
         if ( shadow_l2e_get_flags(*(_sl2e)) & _PAGE_PRESENT )               \
@@ -3352,7 +3352,9 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
 #if SHADOW_PAGING_LEVELS == 3
         {
             mfn_t smfn = pagetable_get_mfn(v->arch.paging.shadow.shadow_table[0]);
+#if GUEST_PAGING_LEVELS != 3
             unsigned int i;
+#endif
 
             for_each_shadow_table(v, i)
             {
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316882.1586219 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQ9-0003sr-5o; Fri, 22 May 2026 14:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316882.1586219; Fri, 22 May 2026 14:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQ9-0003sj-36; Fri, 22 May 2026 14:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1316882;
 Fri, 22 May 2026 14:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQQ8-0003sb-AL
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQ8-000iMO-0j
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQ8-001fVG-0Q
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KcGNaOGjJ9CNmvu9QlISEk4U839VHm6G1Ge0Hm6/l7k=; b=wkwXpqnWyYai/Kh/YytcIeJ+v0
	Os28ot6wPvzWIwnnejhWswOYcfiL8tbRp+rVJdmVb6Ae5pIhGLGT0GLv2v4Fnuh2+C2OIZEwj7Cil
	QLEDphZ9Uaqbrr7T6/4ZgQYj/8lbvy5pQ9faipCShx0VxEoYX3Nabqm3vKjmjEnRGYLc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: rename a parameter of shadow_l<N>_index()
Message-Id: <E1wQQQ8-001fVG-0Q@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:12 +0000

commit ef69700ea0c979eadb5e67eefabe312160bd5304
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:18:38 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:18:38 2026 +0200

    x86/shadow: rename a parameter of shadow_l<N>_index()
    
    ... shadowing a file scope one, thus violating Misra C:2012 rule 5.3
    ("An identifier declared in an inner scope shall not hide an identifier
    declared in an outer scope").
    
    While there,
    - replace u32 by uint32_t,
    - reduce the number of cf_check by aliasing shadow_l<N>_index() to
      shadow_l1_index() for N > 1 and GUEST_PAGING_LEVELS > 2.
    
    No difference in generated code, except of course the removal of the
    duplicate function instances.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 9e4992c6b1..2990cee869 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -402,46 +402,39 @@ guest_index(const void *ptr)
     return (u32)((unsigned long)ptr & ~PAGE_MASK) / sizeof(guest_l1e_t);
 }
 
-static u32 cf_check shadow_l1_index(mfn_t *smfn, u32 guest_index)
+static uint32_t cf_check shadow_l1_index(mfn_t *smfn, uint32_t gidx)
 {
 #if (GUEST_PAGING_LEVELS == 2)
     ASSERT(mfn_to_page(*smfn)->u.sh.head);
-    if ( guest_index >= SHADOW_L1_PAGETABLE_ENTRIES )
+    if ( gidx >= SHADOW_L1_PAGETABLE_ENTRIES )
         *smfn = sh_next_page(*smfn);
-    return (guest_index % SHADOW_L1_PAGETABLE_ENTRIES);
+    return (gidx % SHADOW_L1_PAGETABLE_ENTRIES);
 #else
-    return guest_index;
+    return gidx;
 #endif
 }
 
-static u32 cf_check shadow_l2_index(mfn_t *smfn, u32 guest_index)
-{
 #if (GUEST_PAGING_LEVELS == 2)
+static uint32_t cf_check shadow_l2_index(mfn_t *smfn, uint32_t gidx)
+{
     int i;
     ASSERT(mfn_to_page(*smfn)->u.sh.head);
     // Because we use 2 shadow l2 entries for each guest entry, the number of
     // guest entries per shadow page is SHADOW_L2_PAGETABLE_ENTRIES/2
-    for ( i = 0; i < guest_index / (SHADOW_L2_PAGETABLE_ENTRIES / 2); i++ )
+    for ( i = 0; i < gidx / (SHADOW_L2_PAGETABLE_ENTRIES / 2); i++ )
         *smfn = sh_next_page(*smfn);
     // We multiply by two to get the index of the first of the two entries
     // used to shadow the specified guest entry.
-    return (guest_index % (SHADOW_L2_PAGETABLE_ENTRIES / 2)) * 2;
+    return (gidx % (SHADOW_L2_PAGETABLE_ENTRIES / 2)) * 2;
+}
 #else
-    return guest_index;
+#define shadow_l2_index shadow_l1_index
 #endif
-}
 
 #if GUEST_PAGING_LEVELS >= 4
 
-static u32 cf_check shadow_l3_index(mfn_t *smfn, u32 guest_index)
-{
-    return guest_index;
-}
-
-static u32 cf_check shadow_l4_index(mfn_t *smfn, u32 guest_index)
-{
-    return guest_index;
-}
+#define shadow_l3_index shadow_l1_index
+#define shadow_l4_index shadow_l1_index
 
 #endif // GUEST_PAGING_LEVELS >= 4
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316883.1586223 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQJ-0003uy-7N; Fri, 22 May 2026 14:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316883.1586223; Fri, 22 May 2026 14:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQJ-0003uo-4Z; Fri, 22 May 2026 14:00:23 +0000
Received: by outflank-mailman (input) for mailman id 1316883;
 Fri, 22 May 2026 14:00:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQQI-0003ui-CF
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQI-000iMY-17
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQI-001fXO-0y
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Y6L2UGqOfjvi/QscdXojJnZMkBPcl2zzoflkdAjLwe4=; b=GpAP8WO1UDYteBmvFCar4n6GJ1
	dDKh6JS2906uuqEZw9l9VGxg+RFQ8Zx/l2xNKNts/jH7rJMm8uy2dBx4smHWWAC7YCNdw8YvbqpjI
	JZXgyD/Bvk1obetHFlibB30R8AGtU01u4HB+5Z/wuJiw4rkVEWVLo+iz3y06WmtUPp/E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: address Misra C:2012 rule 16.2
Message-Id: <E1wQQQI-001fXO-0y@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:22 +0000

commit 16de5ab8f66996dcb1fcce2fd8657b6c6febd1c6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:19:17 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:19:17 2026 +0200

    x86/mm: address Misra C:2012 rule 16.2
    
    ... ("A switch label shall only be used when the most closely-enclosing
    compound statement is the body of a `switch' statement"). Use a form of
    fall-through instead. No difference in generated code, except for some
    line number changes.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index b2b03da52b..a158379e77 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2663,15 +2663,17 @@ static int validate_page(struct page_info *page, unsigned long type,
                  get_gpfn_from_mfn(mfn_x(page_to_mfn(page))),
                  type, page->count_info, page->u.inuse.type_info);
         if ( page != current->arch.old_guest_table )
-            page->u.inuse.type_info = 0;
-        else
         {
-            ASSERT((page->u.inuse.type_info &
-                    (PGT_count_mask | PGT_validated)) == 1);
-    case -ERESTART:
-            get_page_light(page);
-            page->u.inuse.type_info |= PGT_partial;
+            page->u.inuse.type_info = 0;
+            break;
         }
+
+        ASSERT((page->u.inuse.type_info &
+                (PGT_count_mask | PGT_validated)) == 1);
+        fallthrough;
+    case -ERESTART:
+        get_page_light(page);
+        page->u.inuse.type_info |= PGT_partial;
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316884.1586226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQT-0003ww-8j; Fri, 22 May 2026 14:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316884.1586226; Fri, 22 May 2026 14:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQT-0003wn-5z; Fri, 22 May 2026 14:00:33 +0000
Received: by outflank-mailman (input) for mailman id 1316884;
 Fri, 22 May 2026 14:00:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQQS-0003wf-Fn
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQS-000iMc-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQS-001fY4-1J
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6JV7sb7gvVWTLo2vjPxRHYRNUGTLgQOqdG2OH2frMCI=; b=SjYHoxoFv92mcpSaoQRkemNqQG
	rQ+zRjz3JCoeUiSVuTI4thErTcRdkhsc84cVoZa0EAzu7qkJST4/NCRQ8lZZZWKmKelGvK76KSKjG
	FmddrVFfEJ1phrjNaP3KfVXjPRDUEJcgIfuyaRBSDBNfZJka6AeuuYyyw+6c9hnG68DA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PV: address Misra C:2012 rule 16.2
Message-Id: <E1wQQQS-001fY4-1J@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:32 +0000

commit 7d4a266fddfd1fb0ec36569ce22a7acb9a80db9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:19:46 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:19:46 2026 +0200

    x86/PV: address Misra C:2012 rule 16.2
    
    ... ("A switch label shall only be used when the most closely-enclosing
    compound statement is the body of a `switch' statement"). While I don't
    really like doing so, use a few "goto" instead. No change in generated
    code (somewhat to my surprise).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 48 +++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 6afbb79f0b..1a3e3012e2 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -896,7 +896,7 @@ static int cf_check read_msr(
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
     const struct cpu_policy *cp = currd->arch.cpu_policy;
-    bool vpmu_msr = false, warn = false;
+    bool warn = false;
     uint64_t tmp;
     int ret;
 
@@ -995,21 +995,21 @@ static int cf_check read_msr(
     case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
     case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
         if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
-        {
-            vpmu_msr = true;
-            /* fall through */
+            goto vpmu;
+        goto check_relaxed;
+
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.vendor &
-                              (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
-            {
-                if ( vpmu_do_rdmsr(reg, val) )
-                    break;
-                return X86EMUL_OKAY;
-            }
+        if ( boot_cpu_data.vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
+        {
+    vpmu:
+            if ( vpmu_do_rdmsr(reg, val) )
+                break;
+            return X86EMUL_OKAY;
         }
         /* fall through */
     default:
+    check_relaxed:
         if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, &tmp) )
         {
             *val = 0;
@@ -1048,7 +1048,6 @@ static int cf_check write_msr(
     const struct domain *currd = curr->domain;
     const struct cpu_policy *cp = currd->arch.cpu_policy;
     uint64_t temp = 0;
-    bool vpmu_msr = false;
     int ret;
 
     if ( (ret = guest_wrmsr(curr, reg, val)) != X86EMUL_UNHANDLEABLE )
@@ -1178,24 +1177,25 @@ static int cf_check write_msr(
     case MSR_CORE_PERF_FIXED_CTR0 ... MSR_CORE_PERF_FIXED_CTR2:
     case MSR_CORE_PERF_FIXED_CTR_CTRL ... MSR_CORE_PERF_GLOBAL_OVF_CTRL:
         if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
-        {
-            vpmu_msr = true;
+            goto vpmu;
+        goto check_relaxed;
+
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.vendor &
-                              (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
-            {
-                if ( (vpmu_mode & XENPMU_MODE_ALL) &&
-                     !is_hardware_domain(currd) )
-                    return X86EMUL_OKAY;
-
-                if ( vpmu_do_wrmsr(reg, val) )
-                    break;
+        if ( boot_cpu_data.vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON) )
+        {
+    vpmu:
+            if ( (vpmu_mode & XENPMU_MODE_ALL) &&
+                 !is_hardware_domain(currd) )
                 return X86EMUL_OKAY;
-            }
+
+            if ( vpmu_do_wrmsr(reg, val) )
+                break;
+            return X86EMUL_OKAY;
         }
         /* fall through */
     default:
+    check_relaxed:
         if ( currd->arch.msr_relaxed && !rdmsr_safe(reg, &val) )
             return X86EMUL_OKAY;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316885.1586231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQd-0003zB-Ai; Fri, 22 May 2026 14:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316885.1586231; Fri, 22 May 2026 14:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQd-0003z2-7U; Fri, 22 May 2026 14:00:43 +0000
Received: by outflank-mailman (input) for mailman id 1316885;
 Fri, 22 May 2026 14:00:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQQc-0003yw-IP
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQc-000iMi-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQc-001fYn-1e
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WLVbZjeVgeevwQvHc1FEw5IAElzRKdwUa1RYC8MilWY=; b=0LEbYtH4Z4tkZ4bsHY70ZZMaqq
	VmV5EpKlBzeN9yta1z1CF4lWROpFiEjOVpMqNnTJeNWXuYTgBE96hPb//eHJrK5yK3TySATsj+W4M
	sZTWHbXZiDew9FBrApJWMKWVZH78dvfBFwE9eKGQqPGHCGl8B1PF0q6imSJlObXcduuo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] crypto/vmac: adjust for Misra C:2012 rule 17.5
Message-Id: <E1wQQQc-001fYn-1e@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:42 +0000

commit f04da199a914cd73a00cd872626532642c2de809
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 22 13:20:20 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:20:20 2026 +0200

    crypto/vmac: adjust for Misra C:2012 rule 17.5
    
    ... ("The function argument corresponding to a parameter declared to have
    an array type shall have an appropriate number of elements"). Instead of
    casts, (ab)use unions.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/crypto/vmac.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index c7aa1e9be3..bcb51913d7 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -926,41 +926,41 @@ uint64_t vmac(unsigned char m[],
 
 void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx)
 {
-    uint64_t in[2] = {0}, out[2];
+    union {
+        uint64_t q[2];
+        uint8_t b[16];
+    } in = {}, out;
     unsigned i;
     aes_key_setup(user_key, &ctx->cipher_key);
     
     /* Fill nh key */
-    ((unsigned char *)in)[0] = 0x80; 
+    in.b[0] = 0x80;
     for (i = 0; i < sizeof(ctx->nhkey)/8; i+=2) {
-        aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-        ctx->nhkey[i  ] = get64BE(out);
-        ctx->nhkey[i+1] = get64BE(out+1);
-        ((unsigned char *)in)[15] += 1;
+        aes_encryption(in.b, out.b, &ctx->cipher_key);
+        ctx->nhkey[i  ] = get64BE(out.q);
+        ctx->nhkey[i+1] = get64BE(out.q + 1);
+        in.b[15] += 1;
     }
 
     /* Fill poly key */
-    ((unsigned char *)in)[0] = 0xC0; 
-    in[1] = 0;
+    in.b[0] = 0xC0;
+    in.q[1] = 0;
     for (i = 0; i < sizeof(ctx->polykey)/8; i+=2) {
-        aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-        ctx->polytmp[i  ] = ctx->polykey[i  ] = get64BE(out) & mpoly;
-        ctx->polytmp[i+1] = ctx->polykey[i+1] = get64BE(out+1) & mpoly;
-        ((unsigned char *)in)[15] += 1;
+        aes_encryption(in.b, out.b, &ctx->cipher_key);
+        ctx->polytmp[i  ] = ctx->polykey[i  ] = get64BE(out.q) & mpoly;
+        ctx->polytmp[i+1] = ctx->polykey[i+1] = get64BE(out.q + 1) & mpoly;
+        in.b[15] += 1;
     }
 
     /* Fill ip key */
-    ((unsigned char *)in)[0] = 0xE0;
-    in[1] = 0;
+    in.b[0] = 0xE0;
+    in.q[1] = 0;
     for (i = 0; i < sizeof(ctx->l3key)/8; i+=2) {
         do {
-            aes_encryption((unsigned char *)in, (unsigned char *)out,
-                                                         &ctx->cipher_key);
-            ctx->l3key[i  ] = get64BE(out);
-            ctx->l3key[i+1] = get64BE(out+1);
-            ((unsigned char *)in)[15] += 1;
+            aes_encryption(in.b, out.b, &ctx->cipher_key);
+            ctx->l3key[i  ] = get64BE(out.q);
+            ctx->l3key[i+1] = get64BE(out.q + 1);
+            in.b[15] += 1;
         } while (ctx->l3key[i] >= p64 || ctx->l3key[i+1] >= p64);
     }
     
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 14:00:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 14:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1316886.1586235 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQn-00040y-BW; Fri, 22 May 2026 14:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1316886.1586235; Fri, 22 May 2026 14:00:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQQQn-00040q-8u; Fri, 22 May 2026 14:00:53 +0000
Received: by outflank-mailman (input) for mailman id 1316886;
 Fri, 22 May 2026 14:00:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQQQm-00040k-N7
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 14:00:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQm-000iMo-2D
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQQQm-001fZM-1u
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 14:00:52 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=gZE9+P6Uo/nbv7eI9bAVJgoQBnIxiPrj5xlusScrjDA=; b=bbyPmD7JWp3rKe0a9oZVbiY2hO
	gUiJMTB8OiOKB3t399Y7ZbHyB7+1WVMx5mc+SCpohGZDpWnBJWxsQFj2TU3nshESHYZfwKRAjgtUT
	f5tegbyd40KAcwAJGmvXUv7j7db4Sxe148khE8juNLJeeQhVVKGWALiVhpAUE2BvyzfI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/gnttab: Fix TOCTOU race in gnttab_set_version()
Message-Id: <E1wQQQm-001fZM-1u@xenbits.xenproject.org>
Date: Fri, 22 May 2026 14:00:52 +0000

commit c0e548d9206b3a281f9d30a2670be543fb383223
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Fri May 22 13:32:44 2026 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 22 13:32:44 2026 +0200

    xen/gnttab: Fix TOCTOU race in gnttab_set_version()
    
    Move first read of gt->gt_version inside the critical region of the
    rwlock, otherwise concurrent gnttab operations (silly as they would be)
    may get mutually confused as to the actual current version.
    
    Fixes: c1488502c949("grant-tables: do not fail attempts to...")
    Reported-by: Oleksandr Tyshchenko <Oleksandr_Tyshchenko@epam.com>
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/grant_table.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2dda1abd3f..ac9fed6001 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3184,11 +3184,12 @@ gnttab_set_version(XEN_GUEST_HANDLE_PARAM(gnttab_set_version_t) uop)
     if ( op.version == 2 && gt->max_version == 1 )
         goto out; /* Behave as before set_version was introduced. */
 
+    grant_write_lock(gt);
+
     res = 0;
     if ( gt->gt_version == op.version )
-        goto out;
+        goto out_unlock;
 
-    grant_write_lock(gt);
     /*
      * Make sure that the grant table isn't currently in use when we
      * change the version number, except for the first 8 entries which
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 22 16:00:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 22 May 2026 16:00:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1317066.1586347 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQSI7-0005SJ-Ux; Fri, 22 May 2026 16:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1317066.1586347; Fri, 22 May 2026 16:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wQSI7-0005Rv-S1; Fri, 22 May 2026 16:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1317066;
 Fri, 22 May 2026 16:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wQSI6-0004yr-8a
 for xen-changelog@lists.xenproject.org; Fri, 22 May 2026 16:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQSI6-000kxJ-0Y
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 16:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wQSI6-001pME-0M
 for xen-changelog@lists.xenproject.org;
 Fri, 22 May 2026 16:00:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yXoj4H3TxZaglTX1qXYtD0wKeYiZs6RfomcZndSfxmI=; b=ZO7P9zaWJNB0fVfB9mCRkBbGvT
	/A10hTPmTMqbb3kAYdgA9e7ELbiELZCxOtJ1tHGTtMoHK3OLpXtObmo+uacB9Fjivj2lFwpVKcEfx
	/e/dtoQHS0sQij7lL4ICy1YA8W0I7bxJwhMAR5f7HT4ma0pf2j4vm1ShYb/99ABtmOzA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv32: Fix bogus CR2 in pagefault for gate emulation
Message-Id: <E1wQSI6-001pME-0M@xenbits.xenproject.org>
Date: Fri, 22 May 2026 16:00:02 +0000

commit 03878fba4af14fab942c2ce8ed2d6d18c204a603
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Fri May 22 14:33:16 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 22 14:33:44 2026 +0100

    x86/pv32: Fix bogus CR2 in pagefault for gate emulation
    
    __{put,get}_guest() returns -EFAULT on access faults which causes
    the injected CR2 to be off by 14 bytes (as EFAULT is 14) which is
    incorrect.
    
    Fix the computation by relying on __copy_{from,to}_guest_pv() which
    reports the number of remaining bytes instead of a negative errno,
    such that we can compute the offset properly.
    
    Fixes: 70ad570b2799 ("x86/64: paravirt 32-on-64 call gate support")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/pv/emul-gate-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index c2c699fbff..d0f7f06e01 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -286,12 +286,14 @@ void pv_emulate_gate_op(struct cpu_user_regs *regs)
     if ( !jump )
     {
         unsigned int ss, esp, *stkp;
+        uint32_t value;
         int rc;
 #define push(item) do \
         { \
+            value = (item); \
             --stkp; \
             esp -= 4; \
-            rc = __put_guest(item, stkp); \
+            rc = __copy_to_guest_pv(stkp, &value, sizeof(value)); \
             if ( rc ) \
             { \
                 pv_inject_page_fault(PFEC_write_access, \
@@ -359,7 +361,7 @@ void pv_emulate_gate_op(struct cpu_user_regs *regs)
                     unsigned int parm;
 
                     --ustkp;
-                    rc = __get_guest(parm, ustkp);
+                    rc = __copy_from_guest_pv(&parm, ustkp, sizeof(parm));
                     if ( rc )
                     {
                         pv_inject_page_fault(0, (unsigned long)(ustkp + 1) - rc);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 25 14:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 14:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319305.1586981 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1G-0000JF-Hb; Mon, 25 May 2026 14:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319305.1586981; Mon, 25 May 2026 14:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1G-0000J7-Eo; Mon, 25 May 2026 14:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1319305;
 Mon, 25 May 2026 14:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRW1F-0000J1-N4
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 14:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1F-005jWd-23
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1F-007XXR-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6FTloYsHX1aamfVaj7mm9wgLxMT3r3VIk9ALcAj1oSE=; b=q4tTqniNkTtDdGWFWq3pzQgda5
	ToxisunqTe1tV/CyZQvTvMoXsOvR1m52DRTzXfAzqXBIxhrvfgBKz2V4QaORC0YO9DfZ6G7BQO9SS
	cYm5jNbuhL2p+zy3J5iSBPxEQBFoF/QY6lsY5spXzaMgRmM7gqjjj3Yn6DbdB6XzWnyw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: llc-coloring: clear color count on parse failure
Message-Id: <E1wRW1F-007XXR-1t@xenbits.xenproject.org>
Date: Mon, 25 May 2026 14:11:01 +0000

commit 16558646c8464ee32891096bf2d962b7e7213769
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 21 21:41:21 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 12:49:54 2026 +0200

    xen/common: llc-coloring: clear color count on parse failure
    
    parse_color_config() updates the caller-provided color count while
    parsing. If parsing later fails, leave the count at zero so callers
    do not consume a partially parsed configuration.
    
    The bug is reachable in practice: cmdline_parse() ignores the -EINVAL
    from a custom_param callback, so boot continues with the partial
    xen_num_colors / dom0_num_colors that llc_coloring_init() and
    dom0_set_llc_colors() then consume.
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/llc-coloring.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 6dc614739a..2606cb0977 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -79,7 +79,7 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         if ( end >= NR_LLC_COLORS || start > end ||
              (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
-            return -EINVAL;
+            goto fail;
 
         /* Colors are range checked in check_colors() */
         for ( color = start; color <= end; color++ )
@@ -91,7 +91,14 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
             break;
     }
 
-    return *s ? -EINVAL : 0;
+    if ( *s )
+        goto fail;
+
+    return 0;
+
+ fail:
+    *num_colors = 0;
+    return -EINVAL;
 }
 
 static int __init parse_dom0_colors(const char *s)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 25 14:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 14:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319306.1586984 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1Q-0000Kt-Im; Mon, 25 May 2026 14:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319306.1586984; Mon, 25 May 2026 14:11:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1Q-0000Kl-GD; Mon, 25 May 2026 14:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1319306;
 Mon, 25 May 2026 14:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRW1P-0000Kb-P8
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 14:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1P-005jWl-2P
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1P-007XY7-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=0CfglVPd4+xRg/b4FOJ1jtKw6ZGiD8lxrg2ApBgTHNY=; b=v3KtzdEZPyGLMxeB3dvULgOPk+
	pqeIRUW+j5J8E5ovi3UHJ4s/g6SjdDeHRQRAJ3ft9acBGkeR/dgSKt9M9jVUixsfZyEv/RPj92RsG
	Oh9DMp++guXmN5LAoymtEI22Fxu0DpX2G8H+ttiwfP8VtncPybSFTrjWkDzHzXvjAK5c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/common: llc-coloring: reject empty color tokens
Message-Id: <E1wRW1P-007XY7-2E@xenbits.xenproject.org>
Date: Mon, 25 May 2026 14:11:11 +0000

commit 174381dfbc5f4b470d872ad2d9ee9ca035b8bc37
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 21 21:41:22 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 12:49:54 2026 +0200

    xen/common: llc-coloring: reject empty color tokens
    
    parse_color_config() currently accepts delimiters where a color value
    is expected because simple_strtoul() returns zero without advancing the
    input pointer. This makes strings such as ",2-6", "-10,19-20" or
    "1,,2" look as if an empty value was color 0.
    
    Also fix the DT color parsing error message by adding the missing
    newline and including the domain ID, matching the style of the color
    validation error below.
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/llc-coloring.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 2606cb0977..b5de5787c1 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -64,14 +64,21 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
 
     while ( *s != '\0' )
     {
+        const char *endp;
         unsigned int color, start, end;
 
-        start = simple_strtoul(s, &s, 0);
+        start = simple_strtoul(s, &endp, 0);
+        if ( endp == s )
+            goto fail;
+        s = endp;
 
         if ( *s == '-' )    /* Range */
         {
             s++;
-            end = simple_strtoul(s, &s, 0);
+            end = simple_strtoul(s, &endp, 0);
+            if ( endp == s )
+                goto fail;
+            s = endp;
         }
         else                /* Single value */
             end = start;
@@ -334,7 +341,7 @@ int __init domain_set_llc_colors_from_str(struct domain *d, const char *str)
     err = parse_color_config(str, colors, max_nr_colors, &num_colors);
     if ( err )
     {
-        printk(XENLOG_ERR "Error parsing LLC color configuration");
+        printk(XENLOG_ERR "%pd: error parsing LLC color configuration\n", d);
         xfree(colors);
         return err;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 25 14:11:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 14:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319307.1586989 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1a-0000Ne-Kc; Mon, 25 May 2026 14:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319307.1586989; Mon, 25 May 2026 14:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRW1a-0000NW-Hf; Mon, 25 May 2026 14:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1319307;
 Mon, 25 May 2026 14:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRW1Z-0000Mq-SH
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 14:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1Z-005jXA-2j
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRW1Z-007XZe-2Z
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 14:11:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=WRkIFivThxXutBbunaNEmXByVdAcbIekntBBFqlhAIg=; b=hObEaVm9nre6+Zn51Ono3YP2Md
	mSlM1lgi3q7bwNb+hGyGvo2J8RTnXDL5EMVnAybwbxRmkFVGgrYoEnf6GRaTXqbB+4DT8ERhur26D
	jOohWGoBxYFAkq5QXKV5H72VRBwijwAVyeUyy/XVjQuzdoe29JoIUFZVo8I+jh4APdJk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v3: Preserve ARE_NS when disabling the distributor
Message-Id: <E1wRW1Z-007XZe-2Z@xenbits.xenproject.org>
Date: Mon, 25 May 2026 14:11:21 +0000

commit e63ba93511b33c0d3bb8cc5870f946f41e1d2655
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue May 19 17:31:54 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 16:06:35 2026 +0200

    xen/arm: gic-v3: Preserve ARE_NS when disabling the distributor
    
    gicv3_dist_init() disables the distributor before reprogramming the
    global interrupt state. It used to do this by writing 0 to GICD_CTLR.
    
    On a system where firmware has already enabled Non-secure affinity
    routing, a zero write clears the Non-secure view's GICD_CTLR.ARE_NS bit.
    Arm IHI 0069H.b, section 2.3.3 ("Changing affinity routing enables"),
    states that changing GICD_CTLR.ARE_NS from 1 to 0 is UNPREDICTABLE. The
    GICD_CTLR register description in section 12.9.4 carries the same rule
    for the ARE_NS field.
    
    Preserve ARE_NS while clearing the group enable bits. If firmware left
    ARE_NS clear, the value written is still 0, preserving the existing
    initialization flow.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/gic-v3.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index dfd5d44603..194a984f0b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -749,12 +749,17 @@ static void __init gicv3_dist_espi_init_aff(uint64_t affinity) { }
 static void __init gicv3_dist_init(void)
 {
     uint32_t type;
+    uint32_t ctlr;
     uint64_t affinity;
     unsigned int nr_lines;
     int i;
 
-    /* Disable the distributor */
-    writel_relaxed(0, GICD + GICD_CTLR);
+    /*
+     * Disable the distributor without clearing ARE_NS. The GIC architecture
+     * makes changing ARE_NS from 1 to 0 UNPREDICTABLE.
+     */
+    ctlr = readl_relaxed(GICD + GICD_CTLR);
+    writel_relaxed(ctlr & GICD_CTLR_ARE_NS, GICD + GICD_CTLR);
 
     type = readl_relaxed(GICD + GICD_TYPER);
     nr_lines = 32 * ((type & GICD_TYPE_LINES) + 1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon May 25 15:00:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 15:00:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319319.1586993 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWmh-0006Ce-QS; Mon, 25 May 2026 15:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319319.1586993; Mon, 25 May 2026 15:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWmh-0006CK-Nj; Mon, 25 May 2026 15:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1319319;
 Mon, 25 May 2026 15:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRWmg-0005r2-15
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 15:00:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWmf-005kUO-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWmf-007aRl-32
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=yQ4TVnmgoXcYyaJnWoe/eaxVNZR1aoateVTO0v/RtTE=; b=JdCIaFlhND+IumRHdFr/9ms64j
	BiJvwCKpPtoGTAm9DUPVg29o7cL3Elj05om37RANxWYl5WphlTatP9WyaSW7Mqa9439anmxMM7ssJ
	Rt1Y1WGxUNTOpTVPcjnApvV5gw5o4IPw19fd02Y3Wj2sNgvY9Q3Y9+jR2EUR/JzNmy/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: llc-coloring: clear color count on parse failure
Message-Id: <E1wRWmf-007aRl-32@xenbits.xenproject.org>
Date: Mon, 25 May 2026 15:00:01 +0000

commit 16558646c8464ee32891096bf2d962b7e7213769
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 21 21:41:21 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 12:49:54 2026 +0200

    xen/common: llc-coloring: clear color count on parse failure
    
    parse_color_config() updates the caller-provided color count while
    parsing. If parsing later fails, leave the count at zero so callers
    do not consume a partially parsed configuration.
    
    The bug is reachable in practice: cmdline_parse() ignores the -EINVAL
    from a custom_param callback, so boot continues with the partial
    xen_num_colors / dom0_num_colors that llc_coloring_init() and
    dom0_set_llc_colors() then consume.
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/llc-coloring.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 6dc614739a..2606cb0977 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -79,7 +79,7 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
         if ( end >= NR_LLC_COLORS || start > end ||
              (end - start) >= (UINT_MAX - *num_colors) ||
              (*num_colors + (end - start)) >= max_num_colors )
-            return -EINVAL;
+            goto fail;
 
         /* Colors are range checked in check_colors() */
         for ( color = start; color <= end; color++ )
@@ -91,7 +91,14 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
             break;
     }
 
-    return *s ? -EINVAL : 0;
+    if ( *s )
+        goto fail;
+
+    return 0;
+
+ fail:
+    *num_colors = 0;
+    return -EINVAL;
 }
 
 static int __init parse_dom0_colors(const char *s)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 25 15:00:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 15:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319320.1586997 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWmq-0006hw-Re; Mon, 25 May 2026 15:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319320.1586997; Mon, 25 May 2026 15:00:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWmq-0006ho-P2; Mon, 25 May 2026 15:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1319320;
 Mon, 25 May 2026 15:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRWmq-0006hZ-3e
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 15:00:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWmq-005kWq-0H
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWmq-007aT2-09
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KfajfANUUYRbUhcdb5JCRQ+hSVFUIWqCJsU2jA/iHwM=; b=0QVOVKdu6grWYmF40EX3ye/UVR
	okhSeXERorfnxuj1vbma27i7gnVHlm7IsiB77pEJKubRiFYLNsOiR+ivR+IMetZOCux/ExPocHcGZ
	HN6zWFXxXqVjonviNzL1eDitLgoY0klu3iFGcVLRi2MnU3WJDLYIIxaemWqJhwsQS+gk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/common: llc-coloring: reject empty color tokens
Message-Id: <E1wRWmq-007aT2-09@xenbits.xenproject.org>
Date: Mon, 25 May 2026 15:00:12 +0000

commit 174381dfbc5f4b470d872ad2d9ee9ca035b8bc37
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Thu May 21 21:41:22 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 12:49:54 2026 +0200

    xen/common: llc-coloring: reject empty color tokens
    
    parse_color_config() currently accepts delimiters where a color value
    is expected because simple_strtoul() returns zero without advancing the
    input pointer. This makes strings such as ",2-6", "-10,19-20" or
    "1,,2" look as if an empty value was color 0.
    
    Also fix the DT color parsing error message by adding the missing
    newline and including the domain ID, matching the style of the color
    validation error below.
    
    Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Denis Mukhin <dmukhin@ford.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/common/llc-coloring.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/common/llc-coloring.c b/xen/common/llc-coloring.c
index 2606cb0977..b5de5787c1 100644
--- a/xen/common/llc-coloring.c
+++ b/xen/common/llc-coloring.c
@@ -64,14 +64,21 @@ static int __init parse_color_config(const char *buf, unsigned int colors[],
 
     while ( *s != '\0' )
     {
+        const char *endp;
         unsigned int color, start, end;
 
-        start = simple_strtoul(s, &s, 0);
+        start = simple_strtoul(s, &endp, 0);
+        if ( endp == s )
+            goto fail;
+        s = endp;
 
         if ( *s == '-' )    /* Range */
         {
             s++;
-            end = simple_strtoul(s, &s, 0);
+            end = simple_strtoul(s, &endp, 0);
+            if ( endp == s )
+                goto fail;
+            s = endp;
         }
         else                /* Single value */
             end = start;
@@ -334,7 +341,7 @@ int __init domain_set_llc_colors_from_str(struct domain *d, const char *str)
     err = parse_color_config(str, colors, max_nr_colors, &num_colors);
     if ( err )
     {
-        printk(XENLOG_ERR "Error parsing LLC color configuration");
+        printk(XENLOG_ERR "%pd: error parsing LLC color configuration\n", d);
         xfree(colors);
         return err;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon May 25 15:00:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 25 May 2026 15:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1319321.1587001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWn0-0006kR-T5; Mon, 25 May 2026 15:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1319321.1587001; Mon, 25 May 2026 15:00:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wRWn0-0006kJ-QO; Mon, 25 May 2026 15:00:22 +0000
Received: by outflank-mailman (input) for mailman id 1319321;
 Mon, 25 May 2026 15:00:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wRWn0-0006jx-8o
 for xen-changelog@lists.xenproject.org; Mon, 25 May 2026 15:00:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWn0-005kXD-0m
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wRWn0-007aVY-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 25 May 2026 15:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=03vwYvXcwB8OS/i7HbiPowtfV+SSvW6eftvHiggir9g=; b=YrZRsuE+oj0NGeSsIHAzIfkuhK
	UCOqf3z4mhlAzonPJfwDptatSRHdOPFv1xPdMG9Cr7D4O4u5iQpw3sPmmDzxYD4a/Xel3LhR8XWvq
	hsvwKmDWi9D4sIpbofe9I+AUlKHGNVZKGM0Kvh00/fE4M7YWodNUD3xuVpdAABVNzVtU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: Preserve ARE_NS when disabling the distributor
Message-Id: <E1wRWn0-007aVY-0R@xenbits.xenproject.org>
Date: Mon, 25 May 2026 15:00:22 +0000

commit e63ba93511b33c0d3bb8cc5870f946f41e1d2655
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Tue May 19 17:31:54 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Mon May 25 16:06:35 2026 +0200

    xen/arm: gic-v3: Preserve ARE_NS when disabling the distributor
    
    gicv3_dist_init() disables the distributor before reprogramming the
    global interrupt state. It used to do this by writing 0 to GICD_CTLR.
    
    On a system where firmware has already enabled Non-secure affinity
    routing, a zero write clears the Non-secure view's GICD_CTLR.ARE_NS bit.
    Arm IHI 0069H.b, section 2.3.3 ("Changing affinity routing enables"),
    states that changing GICD_CTLR.ARE_NS from 1 to 0 is UNPREDICTABLE. The
    GICD_CTLR register description in section 12.9.4 carries the same rule
    for the ARE_NS field.
    
    Preserve ARE_NS while clearing the group enable bits. If firmware left
    ARE_NS clear, the value written is still 0, preserving the existing
    initialization flow.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/gic-v3.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index dfd5d44603..194a984f0b 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -749,12 +749,17 @@ static void __init gicv3_dist_espi_init_aff(uint64_t affinity) { }
 static void __init gicv3_dist_init(void)
 {
     uint32_t type;
+    uint32_t ctlr;
     uint64_t affinity;
     unsigned int nr_lines;
     int i;
 
-    /* Disable the distributor */
-    writel_relaxed(0, GICD + GICD_CTLR);
+    /*
+     * Disable the distributor without clearing ARE_NS. The GIC architecture
+     * makes changing ARE_NS from 1 to 0 UNPREDICTABLE.
+     */
+    ctlr = readl_relaxed(GICD + GICD_CTLR);
+    writel_relaxed(ctlr & GICD_CTLR_ARE_NS, GICD + GICD_CTLR);
 
     type = readl_relaxed(GICD + GICD_TYPER);
     nr_lines = 32 * ((type & GICD_TYPE_LINES) + 1);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 27 08:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 08:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320382.1587678 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9rv-0007R9-MI; Wed, 27 May 2026 08:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320382.1587678; Wed, 27 May 2026 08:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9rv-0007Qx-JR; Wed, 27 May 2026 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1320382;
 Wed, 27 May 2026 08:44:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wS9ru-0007Qr-8q
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 08:44:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9ru-008wqs-0a
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9ru-00CM0K-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:02 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Tr2N3bwAzja1etxFh81jcIyjXFK83Sb3Ivmrks8qq7s=; b=5eN2JvZMyUXtdxuuQiRvy6EUAV
	wraQdOLgcXzZw2k0wp1duowbCkSdySoVdWpsEH/tqOt1Ylm8MK0TjS+e+O0fBuV0sRbKuQbt3XGjG
	A2RBOi6AFNZIeIfLJHOeTTnTA+KRHfuIW7/Qd/A5pTAmh4efI0f0Np0PRsN0YWCMvV5w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: scan CLIDR Ctype fields upwards when probing LLC
Message-Id: <E1wS9ru-00CM0K-0S@xenbits.xenproject.org>
Date: Wed, 27 May 2026 08:44:02 +0000

commit 2fca0ebcd1879f4b1eb6dba830e9c1447d8fb449
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon May 25 14:47:35 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:53:10 2026 +0200

    xen/arm: scan CLIDR Ctype fields upwards when probing LLC
    
    get_llc_way_size() currently scans CLIDR_EL1 Ctype fields from the
    highest level downwards and stops at the first unified cache it finds.
    
    However, CLIDR_EL1 describes the cache hierarchy from Ctype1 upwards.
    Arm ARM DDI 0487J.a, D19.2.27 says that once software has seen a
    Ctype value of 0b000 while reading from Ctype1 upwards, no caches
    manageable by the architected set/way maintenance instructions exist at
    further-out levels, and the higher Ctype fields must be ignored.
    
    The current reverse scan can therefore select a unified cache level from
    a Ctype field above the first no-cache level. Such a field is not part of
    the architecturally described CLIDR/CCSIDR cache hierarchy and should not
    be used for selecting the CCSIDR level.
    
    Scan Ctype fields from L1 upwards, stop at the first no-cache level, and
    keep the outermost unified cache observed before that point.
    
    This preserves the result for regular cache hierarchies, while avoiding
    selection of an architecturally ignored Ctype field.
    
    Fixes: f4985fce6f0b ("xen/arm: add initial support for LLC coloring on arm64")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/llc-coloring.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/llc-coloring.c b/xen/arch/arm/llc-coloring.c
index 6f78817c57..f7b69f629f 100644
--- a/xen/arch/arm/llc-coloring.c
+++ b/xen/arch/arm/llc-coloring.c
@@ -22,22 +22,32 @@ unsigned int __init get_llc_way_size(void)
     register_t id_aa64mmfr2_el1 = READ_SYSREG(ID_AA64MMFR2_EL1);
     uint32_t ccsidr_numsets_shift = CCSIDR_NUMSETS_SHIFT;
     uint32_t ccsidr_numsets_mask = CCSIDR_NUMSETS_MASK;
-    unsigned int n, line_size, num_sets;
-
-    for ( n = CLIDR_CTYPEn_LEVELS; n != 0; n-- )
+    unsigned int n, line_size, num_sets, llc_level = 0;
+
+    /*
+     * CLIDR_EL1 Ctype fields are interpreted from Ctype1 upwards. Once a
+     * no-cache level is seen, higher Ctype fields are architecturally ignored
+     * for the CLIDR/CCSIDR set/way manageable cache hierarchy.
+     *
+     * Keep the outermost unified cache before that point.
+     */
+    for ( n = 1; n <= CLIDR_CTYPEn_LEVELS; n++ )
     {
         uint8_t ctype_n = (clidr_el1 >> CLIDR_CTYPEn_SHIFT(n)) &
                            CLIDR_CTYPEn_MASK;
 
+        if ( ctype_n == 0b000 )
+            break;
+
         /* Unified cache (see Arm ARM DDI 0487J.a D19.2.27) */
         if ( ctype_n == 0b100 )
-            break;
+            llc_level = n;
     }
 
-    if ( n == 0 )
+    if ( !llc_level )
         return 0;
 
-    WRITE_SYSREG((n - 1) << CSSELR_LEVEL_SHIFT, CSSELR_EL1);
+    WRITE_SYSREG((llc_level - 1) << CSSELR_LEVEL_SHIFT, CSSELR_EL1);
     isb();
 
     ccsidr_el1 = READ_SYSREG(CCSIDR_EL1);
@@ -56,7 +66,7 @@ unsigned int __init get_llc_way_size(void)
     num_sets = ((ccsidr_el1 >> ccsidr_numsets_shift) & ccsidr_numsets_mask) + 1;
 
     printk(XENLOG_INFO "LLC found: L%u (line size: %u bytes, sets num: %u)\n",
-           n, line_size, num_sets);
+           llc_level, line_size, num_sets);
 
     /* Restore value in CSSELR_EL1 */
     WRITE_SYSREG(csselr_el1, CSSELR_EL1);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 27 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320383.1587681 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9s5-0007Sg-ND; Wed, 27 May 2026 08:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320383.1587681; Wed, 27 May 2026 08:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9s5-0007SY-Kk; Wed, 27 May 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1320383;
 Wed, 27 May 2026 08:44:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wS9s4-0007SI-Bt
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 08:44:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9s4-008wqw-15
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9s4-00CM2a-0m
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=xMIeg80vjUfdEqvb1bWC5ScZmP4nH5e58D/O3HkRKhA=; b=sxe3IXC6zuRE3EVDGiY7VGzr9v
	w8nGvXXXfoL3M+6BvlAfgIF+iMWZ3rBKzOcoKW3pqOc9bYWgOTjlvBbblwiRuyEa8iwdYJxvGLsu1
	DG6yj9/PhHnW2QTw/lsSdk2OMGyFv4O338gsZBLaYulmKIvKdHO9k6r2y07oluWBvGtE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: propagate vGIC vCPU init failures
Message-Id: <E1wS9s4-00CM2a-0m@xenbits.xenproject.org>
Date: Wed, 27 May 2026 08:44:12 +0000

commit 961cc8cc0febcd8b2e515c7896a076a3246d06b1
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Wed May 27 03:18:50 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:54:48 2026 +0200

    xen/arm: propagate vGIC vCPU init failures
    
    The vGIC per-vCPU init callback can fail. In particular, GICv3 rejects
    a vCPU when the domain's redistributor layout has no MMIO slot covering
    that vCPU. However, the generic vGIC init path ignored the callback
    return value, so vcpu_create() could succeed with an invalid vGICv3
    per-vCPU state.
    
    This can be reproduced on FVP Base RevC by exposing a 2 MiB GICv3
    redistributor region to Dom0 and booting Xen with:
    
        maxcpus=1 dom0_max_vcpus=64
    
    The host GICv3 redistributor range is:
    
        region 0: 0x0000002f100000 - 0x0000002f300000
    
    With Xen's guest redistributor frame size of 128 KiB, that range covers
    16 guest redistributors. vCPU16 and above have no corresponding
    redistributor slot.
    
    Before this fix, Xen detected the missing redistributors:
    
        d0: Unable to find a re-distributor for VCPU 16
        ...
        d0: Unable to find a re-distributor for VCPU 63
    
    but ignored the error and continued as if the secondary vCPUs had been
    created correctly. Dom0 then saw 64 possible CPUs and could hang during
    secondary CPU bring-up:
    
        smp: Bringing up secondary CPUs ...
        d0v15: vGICR: SGI: unhandled word write ... to ICACTIVER0
    
    Propagate the vGIC vcpu_init() error so the caller can stop creating
    secondary vCPUs. With this fix, Dom0 construction reports:
    
        d0: Unable to find a re-distributor for VCPU 16
        Failed to allocate d0v16
    
    and the guest continues booting with the vCPUs created before the
    failure:
    
        smp: Brought up 1 node, 16 CPUs
    
    Free the private IRQ rank allocated by vcpu_vgic_init() on this error
    path. The caller will still run the generic vCPU creation cleanup, but
    XFREE() clears the pointer so that cleanup remains idempotent.
    
    Also fix the host-layout redistributor region count for the case where
    the requested vCPU count is larger than the capacity of all host
    redistributor regions. The old code always stored i + 1 after the loop.
    That is correct when the loop stops inside a valid region because the
    requested vCPU count is covered. If the loop exits after consuming all
    hardware regions, i is already equal to the number of allocated regions,
    so i + 1 records one region too many.
    
    In the same FVP setup, that off-by-one made Xen describe host-layout
    GICR state beyond the populated redistributor region list. Dom0 then
    accessed the GICR MMIO window described in its device tree, but Xen could
    not match the access to a valid emulated redistributor frame. During
    debugging this was seen as an unexpected vGICR access followed by a
    guest panic:
    
        d0v0: vGICR: unknown gpa read address 000000002f10ffe8
        pc : gic_iterate_rdists+0x4c/0x104
        Kernel panic - not syncing: Attempted to kill the idle task!
    
    Keep the existing construct_domain() policy used by Dom0 and dom0less
    domain construction: a failure to create a secondary vCPU stops the
    secondary vCPU creation loop, but does not fail the whole domain
    construction.
    
    Fixes: ea37fd21110b ("xen/arm: split vgic driver into generic and vgic-v2 driver")
    Fixes: 54ec59f6b0b3 ("xen/arm: vgic-v3: Don't create empty re-distributor regions")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/vgic-v3.c | 2 +-
 xen/arch/arm/vgic.c    | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 77517c3030..c1c4d6f71e 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1834,7 +1834,7 @@ static int vgic_v3_domain_init(struct domain *d)
          * not match the number of pCPUs). Update the number of regions to
          * avoid exposing unused region as they will not get emulated.
          */
-        d->arch.vgic.nr_regions = i + 1;
+        d->arch.vgic.nr_regions = min(i + 1U, vgic_v3_hw.nr_rdist_regions);
 
         d->arch.vgic.intid_bits = vgic_v3_hw.intid_bits;
     }
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 6647071ad4..e5aca17dcb 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -368,7 +368,7 @@ void domain_vgic_free(struct domain *d)
 
 int vcpu_vgic_init(struct vcpu *v)
 {
-    int i;
+    int i, ret;
 
     v->arch.vgic.private_irqs = xzalloc(struct vgic_irq_rank);
     if ( v->arch.vgic.private_irqs == NULL )
@@ -377,7 +377,12 @@ int vcpu_vgic_init(struct vcpu *v)
     /* SGIs/PPIs are always routed to this VCPU */
     vgic_rank_init(v->arch.vgic.private_irqs, 0, v->vcpu_id);
 
-    v->domain->arch.vgic.handler->vcpu_init(v);
+    ret = v->domain->arch.vgic.handler->vcpu_init(v);
+    if ( ret )
+    {
+        XFREE(v->arch.vgic.private_irqs);
+        return ret;
+    }
 
     memset(&v->arch.vgic.pending_irqs, 0, sizeof(v->arch.vgic.pending_irqs));
     for (i = 0; i < 32; i++)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 27 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320384.1587687 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9sF-0007Ux-PB; Wed, 27 May 2026 08:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320384.1587687; Wed, 27 May 2026 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wS9sF-0007Up-M2; Wed, 27 May 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1320384;
 Wed, 27 May 2026 08:44:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wS9sE-0007Uh-Fm
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 08:44:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9sE-008wr5-1T
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wS9sE-00CM50-1G
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 08:44:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=18Uf+rQ3weWvCVldzXqhpdQ2WGWzah+LAqWxOmlYlFU=; b=Pyiq0uB9BpNaqVj7iY3nyt/gOF
	8zly2E1j2wv1C3r3KJ78lLgf3OD8MXmS7clcVHK0+RpNdbMCv4eBBytvkDPJhbqRRgkFPvXQA1lP1
	y/da8kGBWL0YRom0cwF5XhJNpnKegRtLrp9Pzk/78Aaosq0rfhCcakSBcc+qNhfJsYbA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] docs/arm: Document GICv3 vCPU limit for host-layout domains
Message-Id: <E1wS9sE-00CM50-1G@xenbits.xenproject.org>
Date: Wed, 27 May 2026 08:44:22 +0000

commit f8523357f016f8e726d220b4c34079021d3360fc
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Wed May 27 03:18:51 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:56:26 2026 +0200

    docs/arm: Document GICv3 vCPU limit for host-layout domains
    
    The number of vCPUs requested for a boot-time Arm domain is not bounded
    solely by Xen's generic domain limits. For GICv3 domains using the host
    memory layout, Xen can only create vCPUs whose virtual redistributor
    frame is covered by redistributor MMIO regions exposed for that layout.
    
    This can affect the hardware domain and direct-mapped domains. Document
    the GICv3-specific limit in the `cpus` property description in the Arm
    device-tree booting guide. Also add a generic domain-limit caveat to the
    `dom0_max_vcpus` command-line documentation.
    
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 docs/misc/arm/device-tree/booting.txt | 9 +++++++++
 docs/misc/xen-command-line.pandoc     | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index f73839df09..bcb06bc796 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -162,6 +162,15 @@ with the following properties:
 
     An integer specifying the number of vcpus to allocate to the guest.
 
+    The resulting number of vcpus is still subject to Xen's generic and
+    architecture-specific domain limits. On Arm GICv3 systems, each vcpu
+    needs a virtual redistributor frame. Domains using the host GIC layout,
+    such as the hardware domain or direct-mapped domains, can only use vcpus
+    whose virtual redistributor frame is covered by the redistributor MMIO
+    regions exposed for that layout. If the requested number of vcpus exceeds
+    that limit, Xen will create fewer vcpus than requested, stopping at the
+    first vcpu whose virtual redistributor frame is not covered.
+
 - llc-colors
     A string specifying the LLC color configuration for the guest.
     Refer to docs/misc/cache_coloring.rst for syntax. This option is applicable
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d46d5b2152..8c89b7852c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1000,6 +1000,9 @@ For example, with `dom0_max_vcpus=4-8`:
 >      8    |  8
 >     10    |  8
 
+The resulting number of Dom0 VCPUs is still subject to Xen's generic
+and architecture-specific domain limits.
+
 ### dom0_mem (ARM)
 > `= <size>`
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 27 09:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 09:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320400.1587715 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdM-0005hS-AO; Wed, 27 May 2026 09:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320400.1587715; Wed, 27 May 2026 09:33:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdM-0005hK-7Y; Wed, 27 May 2026 09:33:04 +0000
Received: by outflank-mailman (input) for mailman id 1320400;
 Wed, 27 May 2026 09:33:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSAdK-0005hE-4N
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 09:33:02 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAdK-008xls-07
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAdJ-00CRRZ-3B
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7xSH+QXxTmDnCYyB0j9IWlP+sHQU34qPeWEkrDE6GoE=; b=dKbhrNiQ/vHh3zgkfyrFeOMaP6
	QyeaW/Y5Er6WMlN1OqPShV2ZOATMy7P+Qb/oDcjryfu+jl7jqh0c1iAK0OcSMvDgsakG6IKu09OLK
	OVn3uS3JMl/lK7tZz9hvx5BXYb1bDVzuB7RSs1oBinrLYtPlBylHlSes70tssdNmXxeE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: scan CLIDR Ctype fields upwards when probing LLC
Message-Id: <E1wSAdJ-00CRRZ-3B@xenbits.xenproject.org>
Date: Wed, 27 May 2026 09:33:01 +0000

commit 2fca0ebcd1879f4b1eb6dba830e9c1447d8fb449
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Mon May 25 14:47:35 2026 +0300
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:53:10 2026 +0200

    xen/arm: scan CLIDR Ctype fields upwards when probing LLC
    
    get_llc_way_size() currently scans CLIDR_EL1 Ctype fields from the
    highest level downwards and stops at the first unified cache it finds.
    
    However, CLIDR_EL1 describes the cache hierarchy from Ctype1 upwards.
    Arm ARM DDI 0487J.a, D19.2.27 says that once software has seen a
    Ctype value of 0b000 while reading from Ctype1 upwards, no caches
    manageable by the architected set/way maintenance instructions exist at
    further-out levels, and the higher Ctype fields must be ignored.
    
    The current reverse scan can therefore select a unified cache level from
    a Ctype field above the first no-cache level. Such a field is not part of
    the architecturally described CLIDR/CCSIDR cache hierarchy and should not
    be used for selecting the CCSIDR level.
    
    Scan Ctype fields from L1 upwards, stop at the first no-cache level, and
    keep the outermost unified cache observed before that point.
    
    This preserves the result for regular cache hierarchies, while avoiding
    selection of an architecturally ignored Ctype field.
    
    Fixes: f4985fce6f0b ("xen/arm: add initial support for LLC coloring on arm64")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/llc-coloring.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/arch/arm/llc-coloring.c b/xen/arch/arm/llc-coloring.c
index 6f78817c57..f7b69f629f 100644
--- a/xen/arch/arm/llc-coloring.c
+++ b/xen/arch/arm/llc-coloring.c
@@ -22,22 +22,32 @@ unsigned int __init get_llc_way_size(void)
     register_t id_aa64mmfr2_el1 = READ_SYSREG(ID_AA64MMFR2_EL1);
     uint32_t ccsidr_numsets_shift = CCSIDR_NUMSETS_SHIFT;
     uint32_t ccsidr_numsets_mask = CCSIDR_NUMSETS_MASK;
-    unsigned int n, line_size, num_sets;
-
-    for ( n = CLIDR_CTYPEn_LEVELS; n != 0; n-- )
+    unsigned int n, line_size, num_sets, llc_level = 0;
+
+    /*
+     * CLIDR_EL1 Ctype fields are interpreted from Ctype1 upwards. Once a
+     * no-cache level is seen, higher Ctype fields are architecturally ignored
+     * for the CLIDR/CCSIDR set/way manageable cache hierarchy.
+     *
+     * Keep the outermost unified cache before that point.
+     */
+    for ( n = 1; n <= CLIDR_CTYPEn_LEVELS; n++ )
     {
         uint8_t ctype_n = (clidr_el1 >> CLIDR_CTYPEn_SHIFT(n)) &
                            CLIDR_CTYPEn_MASK;
 
+        if ( ctype_n == 0b000 )
+            break;
+
         /* Unified cache (see Arm ARM DDI 0487J.a D19.2.27) */
         if ( ctype_n == 0b100 )
-            break;
+            llc_level = n;
     }
 
-    if ( n == 0 )
+    if ( !llc_level )
         return 0;
 
-    WRITE_SYSREG((n - 1) << CSSELR_LEVEL_SHIFT, CSSELR_EL1);
+    WRITE_SYSREG((llc_level - 1) << CSSELR_LEVEL_SHIFT, CSSELR_EL1);
     isb();
 
     ccsidr_el1 = READ_SYSREG(CCSIDR_EL1);
@@ -56,7 +66,7 @@ unsigned int __init get_llc_way_size(void)
     num_sets = ((ccsidr_el1 >> ccsidr_numsets_shift) & ccsidr_numsets_mask) + 1;
 
     printk(XENLOG_INFO "LLC found: L%u (line size: %u bytes, sets num: %u)\n",
-           n, line_size, num_sets);
+           llc_level, line_size, num_sets);
 
     /* Restore value in CSSELR_EL1 */
     WRITE_SYSREG(csselr_el1, CSSELR_EL1);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 27 09:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 09:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320401.1587718 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdV-0005jF-BR; Wed, 27 May 2026 09:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320401.1587718; Wed, 27 May 2026 09:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdV-0005j5-8o; Wed, 27 May 2026 09:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1320401;
 Wed, 27 May 2026 09:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSAdU-0005iu-7N
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 09:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAdU-008xlw-0d
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAdU-00CRVt-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:12 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=9CpKBp2gcp5wVrbU/ksPVcRm/hnz8cAlTOSOjoUQxTU=; b=dCzCigRI9TDxN58p9lIeflcWB3
	RNajBnrCbZhv9tS7q0bbZ++3pxgZ2dLZng/JIP1nz6N1E7YwBJq0ITvFQ8Ax0LPrxQ2VFMLymOGTT
	o/LY4LMX6Rvk9bvLtzC6Q2nNDyUCFknsgK0iL9z1XH8cCdD/Ow/z3FySe1Xqf44+VNg0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: propagate vGIC vCPU init failures
Message-Id: <E1wSAdU-00CRVt-0I@xenbits.xenproject.org>
Date: Wed, 27 May 2026 09:33:12 +0000

commit 961cc8cc0febcd8b2e515c7896a076a3246d06b1
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Wed May 27 03:18:50 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:54:48 2026 +0200

    xen/arm: propagate vGIC vCPU init failures
    
    The vGIC per-vCPU init callback can fail. In particular, GICv3 rejects
    a vCPU when the domain's redistributor layout has no MMIO slot covering
    that vCPU. However, the generic vGIC init path ignored the callback
    return value, so vcpu_create() could succeed with an invalid vGICv3
    per-vCPU state.
    
    This can be reproduced on FVP Base RevC by exposing a 2 MiB GICv3
    redistributor region to Dom0 and booting Xen with:
    
        maxcpus=1 dom0_max_vcpus=64
    
    The host GICv3 redistributor range is:
    
        region 0: 0x0000002f100000 - 0x0000002f300000
    
    With Xen's guest redistributor frame size of 128 KiB, that range covers
    16 guest redistributors. vCPU16 and above have no corresponding
    redistributor slot.
    
    Before this fix, Xen detected the missing redistributors:
    
        d0: Unable to find a re-distributor for VCPU 16
        ...
        d0: Unable to find a re-distributor for VCPU 63
    
    but ignored the error and continued as if the secondary vCPUs had been
    created correctly. Dom0 then saw 64 possible CPUs and could hang during
    secondary CPU bring-up:
    
        smp: Bringing up secondary CPUs ...
        d0v15: vGICR: SGI: unhandled word write ... to ICACTIVER0
    
    Propagate the vGIC vcpu_init() error so the caller can stop creating
    secondary vCPUs. With this fix, Dom0 construction reports:
    
        d0: Unable to find a re-distributor for VCPU 16
        Failed to allocate d0v16
    
    and the guest continues booting with the vCPUs created before the
    failure:
    
        smp: Brought up 1 node, 16 CPUs
    
    Free the private IRQ rank allocated by vcpu_vgic_init() on this error
    path. The caller will still run the generic vCPU creation cleanup, but
    XFREE() clears the pointer so that cleanup remains idempotent.
    
    Also fix the host-layout redistributor region count for the case where
    the requested vCPU count is larger than the capacity of all host
    redistributor regions. The old code always stored i + 1 after the loop.
    That is correct when the loop stops inside a valid region because the
    requested vCPU count is covered. If the loop exits after consuming all
    hardware regions, i is already equal to the number of allocated regions,
    so i + 1 records one region too many.
    
    In the same FVP setup, that off-by-one made Xen describe host-layout
    GICR state beyond the populated redistributor region list. Dom0 then
    accessed the GICR MMIO window described in its device tree, but Xen could
    not match the access to a valid emulated redistributor frame. During
    debugging this was seen as an unexpected vGICR access followed by a
    guest panic:
    
        d0v0: vGICR: unknown gpa read address 000000002f10ffe8
        pc : gic_iterate_rdists+0x4c/0x104
        Kernel panic - not syncing: Attempted to kill the idle task!
    
    Keep the existing construct_domain() policy used by Dom0 and dom0less
    domain construction: a failure to create a secondary vCPU stops the
    secondary vCPU creation loop, but does not fail the whole domain
    construction.
    
    Fixes: ea37fd21110b ("xen/arm: split vgic driver into generic and vgic-v2 driver")
    Fixes: 54ec59f6b0b3 ("xen/arm: vgic-v3: Don't create empty re-distributor regions")
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/vgic-v3.c | 2 +-
 xen/arch/arm/vgic.c    | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 77517c3030..c1c4d6f71e 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1834,7 +1834,7 @@ static int vgic_v3_domain_init(struct domain *d)
          * not match the number of pCPUs). Update the number of regions to
          * avoid exposing unused region as they will not get emulated.
          */
-        d->arch.vgic.nr_regions = i + 1;
+        d->arch.vgic.nr_regions = min(i + 1U, vgic_v3_hw.nr_rdist_regions);
 
         d->arch.vgic.intid_bits = vgic_v3_hw.intid_bits;
     }
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 6647071ad4..e5aca17dcb 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -368,7 +368,7 @@ void domain_vgic_free(struct domain *d)
 
 int vcpu_vgic_init(struct vcpu *v)
 {
-    int i;
+    int i, ret;
 
     v->arch.vgic.private_irqs = xzalloc(struct vgic_irq_rank);
     if ( v->arch.vgic.private_irqs == NULL )
@@ -377,7 +377,12 @@ int vcpu_vgic_init(struct vcpu *v)
     /* SGIs/PPIs are always routed to this VCPU */
     vgic_rank_init(v->arch.vgic.private_irqs, 0, v->vcpu_id);
 
-    v->domain->arch.vgic.handler->vcpu_init(v);
+    ret = v->domain->arch.vgic.handler->vcpu_init(v);
+    if ( ret )
+    {
+        XFREE(v->arch.vgic.private_irqs);
+        return ret;
+    }
 
     memset(&v->arch.vgic.pending_irqs, 0, sizeof(v->arch.vgic.pending_irqs));
     for (i = 0; i < 32; i++)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 27 09:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 09:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320402.1587723 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdf-0005ls-E0; Wed, 27 May 2026 09:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320402.1587723; Wed, 27 May 2026 09:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSAdf-0005lk-BR; Wed, 27 May 2026 09:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1320402;
 Wed, 27 May 2026 09:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSAde-0005la-AD
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 09:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAde-008xm0-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSAde-00CRWg-0o
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 09:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=EFMjEpH/iQ1kh8twJhAoUkva/THyllyK4fin0RZfDls=; b=jGxRXZbmVbxYq64UjV5VWA2dc/
	ho5V13VgVUmupAOpYg0w8+i0/Rpw0NLyZlwqkzaiHpjem0/9Nx5BqHeOX17ePeIDo8yj/G9fok8Lo
	c2Z5mTK5U4T2zEZzQmCXaFX9eyicdfmmMTexyCYgF6EwAt1T2hqHmke5dHw6s0/4eCTU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] docs/arm: Document GICv3 vCPU limit for host-layout domains
Message-Id: <E1wSAde-00CRWg-0o@xenbits.xenproject.org>
Date: Wed, 27 May 2026 09:33:22 +0000

commit f8523357f016f8e726d220b4c34079021d3360fc
Author:     Mykola Kvach <mykola_kvach@epam.com>
AuthorDate: Wed May 27 03:18:51 2026 +0200
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 08:56:26 2026 +0200

    docs/arm: Document GICv3 vCPU limit for host-layout domains
    
    The number of vCPUs requested for a boot-time Arm domain is not bounded
    solely by Xen's generic domain limits. For GICv3 domains using the host
    memory layout, Xen can only create vCPUs whose virtual redistributor
    frame is covered by redistributor MMIO regions exposed for that layout.
    
    This can affect the hardware domain and direct-mapped domains. Document
    the GICv3-specific limit in the `cpus` property description in the Arm
    device-tree booting guide. Also add a generic domain-limit caveat to the
    `dom0_max_vcpus` command-line documentation.
    
    Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 docs/misc/arm/device-tree/booting.txt | 9 +++++++++
 docs/misc/xen-command-line.pandoc     | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/docs/misc/arm/device-tree/booting.txt b/docs/misc/arm/device-tree/booting.txt
index f73839df09..bcb06bc796 100644
--- a/docs/misc/arm/device-tree/booting.txt
+++ b/docs/misc/arm/device-tree/booting.txt
@@ -162,6 +162,15 @@ with the following properties:
 
     An integer specifying the number of vcpus to allocate to the guest.
 
+    The resulting number of vcpus is still subject to Xen's generic and
+    architecture-specific domain limits. On Arm GICv3 systems, each vcpu
+    needs a virtual redistributor frame. Domains using the host GIC layout,
+    such as the hardware domain or direct-mapped domains, can only use vcpus
+    whose virtual redistributor frame is covered by the redistributor MMIO
+    regions exposed for that layout. If the requested number of vcpus exceeds
+    that limit, Xen will create fewer vcpus than requested, stopping at the
+    first vcpu whose virtual redistributor frame is not covered.
+
 - llc-colors
     A string specifying the LLC color configuration for the guest.
     Refer to docs/misc/cache_coloring.rst for syntax. This option is applicable
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d46d5b2152..8c89b7852c 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -1000,6 +1000,9 @@ For example, with `dom0_max_vcpus=4-8`:
 >      8    |  8
 >     10    |  8
 
+The resulting number of Dom0 VCPUs is still subject to Xen's generic
+and architecture-specific domain limits.
+
 ### dom0_mem (ARM)
 > `= <size>`
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed May 27 12:00:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 12:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320441.1587744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSCvb-0006i1-Ky; Wed, 27 May 2026 12:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320441.1587744; Wed, 27 May 2026 12:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSCvb-0006he-Ha; Wed, 27 May 2026 12:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1320441;
 Wed, 27 May 2026 12:00:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSCvZ-0006O5-UD
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 12:00:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSCvZ-0090aL-2f
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 12:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSCvZ-00Ch3d-2X
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 12:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cffSJVeq5aQipbMtfeCn1hG2wnci/6y3BEmBxsD4+NY=; b=nwVxQ6mSSBhheandlWRJ8A/h6n
	Kl5PSXo0LihOTkVvlWQnL7q/L4Xl0PhYIGgFQGiUzBP9agFksemjAl19bRZoeKpLeloiWm9puBMi7
	SpCUWDUd8YgpFs7D8SeGSDYKad8GMe33pTvXwiy7TSI09CcDCzKcIg35Y6+C1HJjQ7a8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: gic-v3: Fix redistributor wakeup polling
Message-Id: <E1wSCvZ-00Ch3d-2X@xenbits.xenproject.org>
Date: Wed, 27 May 2026 12:00:01 +0000

commit 941fdfc03e109a28ca9cfe71c111a1ef6cb9ed12
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Mon May 18 08:05:24 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 13:38:29 2026 +0200

    xen/arm: gic-v3: Fix redistributor wakeup polling
    
    gicv3_enable_redist() clears GICR_WAKER.ProcessorSleep and then waits for
    GICR_WAKER.ChildrenAsleep to clear, as required after waking a
    redistributor.
    
    However, the polling loop currently uses "while ( timeout )". Since
    timeout is initially false, the loop runs only once unless the timeout
    path has already been reached. As a result, Xen can continue before the
    redistributor has completed wakeup.
    
    Use an unconditional loop, matching the surrounding timeout/break pattern,
    so the code polls until either ChildrenAsleep is clear or the deadline is
    reached.
    
    While there, also fix the timeout message. This path polls
    GICR_WAKER.ChildrenAsleep, not an RWP bit, so "RWP timeout" is misleading.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/gic-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 194a984f0b..17ff85ef5d 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -837,11 +837,11 @@ static int gicv3_enable_redist(void)
         }
         cpu_relax();
         udelay(1);
-    } while ( timeout );
+    } while ( 1 );
 
     if ( timeout )
     {
-        dprintk(XENLOG_ERR, "GICv3: Redist enable RWP timeout\n");
+        dprintk(XENLOG_ERR, "GICv3: Redist wakeup timeout\n");
         return 1;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed May 27 14:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 27 May 2026 14:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1320563.1587845 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSEyM-0003vN-Aq; Wed, 27 May 2026 14:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1320563.1587845; Wed, 27 May 2026 14:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSEyM-0003vF-8J; Wed, 27 May 2026 14:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1320563;
 Wed, 27 May 2026 14:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSEyL-0003v9-Lk
 for xen-changelog@lists.xenproject.org; Wed, 27 May 2026 14:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSEyL-0093Bh-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 14:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSEyL-00Cttx-1X
 for xen-changelog@lists.xenproject.org;
 Wed, 27 May 2026 14:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=cD0f3SYMTChaYhkTROwVKhxnsk/1jxM40yALJfjFRMA=; b=oT+ZT4PxtmrHMfwBq7zYMUW5LR
	rXA2SNBrCWyllJ95r2QxYRbwnFkIjdOfgJbUhC/oNsKQYkWuBldsMbdLsDgbPqqye6iW0w3QfghUT
	o7h7s2JERmFbX4ootdIm6E3RgxvwQlkyz/PCkhG7GDn0SCaxBYjZeSJtHz85laIEbGw0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: gic-v3: Fix redistributor wakeup polling
Message-Id: <E1wSEyL-00Cttx-1X@xenbits.xenproject.org>
Date: Wed, 27 May 2026 14:11:01 +0000

commit 941fdfc03e109a28ca9cfe71c111a1ef6cb9ed12
Author:     Luca Fancellu <luca.fancellu@arm.com>
AuthorDate: Mon May 18 08:05:24 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Wed May 27 13:38:29 2026 +0200

    xen/arm: gic-v3: Fix redistributor wakeup polling
    
    gicv3_enable_redist() clears GICR_WAKER.ProcessorSleep and then waits for
    GICR_WAKER.ChildrenAsleep to clear, as required after waking a
    redistributor.
    
    However, the polling loop currently uses "while ( timeout )". Since
    timeout is initially false, the loop runs only once unless the timeout
    path has already been reached. As a result, Xen can continue before the
    redistributor has completed wakeup.
    
    Use an unconditional loop, matching the surrounding timeout/break pattern,
    so the code polls until either ChildrenAsleep is clear or the deadline is
    reached.
    
    While there, also fix the timeout message. This path polls
    GICR_WAKER.ChildrenAsleep, not an RWP bit, so "RWP timeout" is misleading.
    
    Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
    Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
    Reviewed-by: Mykola Kvach <mykola_kvach@epam.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/gic-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 194a984f0b..17ff85ef5d 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -837,11 +837,11 @@ static int gicv3_enable_redist(void)
         }
         cpu_relax();
         udelay(1);
-    } while ( timeout );
+    } while ( 1 );
 
     if ( timeout )
     {
-        dprintk(XENLOG_ERR, "GICv3: Redist enable RWP timeout\n");
+        dprintk(XENLOG_ERR, "GICv3: Redist wakeup timeout\n");
         return 1;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 28 15:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 15:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321486.1588231 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYc-0001bh-Oo; Thu, 28 May 2026 15:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321486.1588231; Thu, 28 May 2026 15:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYc-0001bZ-M4; Thu, 28 May 2026 15:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1321486;
 Thu, 28 May 2026 15:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wScYb-0001bT-Pi
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 15:22:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYb-00AjeX-2K
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYb-00FcdB-2C
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=KSwDfyz4NzMoh+VolhmxNaJ2fT4kWCzPtpCvKxf3pM0=; b=mGXyz435FANa2RNin+vCMdCBPs
	RnefUAmGyt6/jj0s916P7Fg4RL0SIKhLuqsuf5QDovOUzEAZqiw2tOzxssBR/WeGBJ3Xu9+LFiLTc
	QN93Ug0WbOuuL4ACUJB4iuds2jzTGNYusYEEZ5hFVCaCCynFcgOJ4Qky0PpLumOr+sYs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/pv: Provide better SYSCALL backwards compatibility in FRED mode
Message-Id: <E1wScYb-00FcdB-2C@xenbits.xenproject.org>
Date: Thu, 28 May 2026 15:22:01 +0000

commit c5a4b9125bed42d1947a48058119cd335294164b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Mar 24 13:46:10 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    x86/pv: Provide better SYSCALL backwards compatibility in FRED mode
    
    In FRED mode, the SYSCALL instruction does not modify %rcx/%r11.  All current
    software using SYSCALL expects the pre-FRED behaviour and spills %rcx/%r11
    around the invocation, which is why FRED not doing this goes largely
    unnoticed.
    
    However, consider the following migration scenario:
    
     * VM suspends.  Hypercall, so SYSCALL, %rcx/%r11 left unmodified
     * VM moves to a non-FRED system
     * Xen resumes the VM with a real SYSRET instruction
    
    Instead of resuming at the instruction following the SYSCALL instruction, the
    VM is resumed at whatever dead value was in %rcx.
    
    In FRED mode, manually adjust %rcx/%r11 when SYSCALL is used and when SYSRET
    would have been used.
    
    Regarding the choice of instructions in eretu_exit_to_guest(), a branch would
    be a context dependent 50/50 split (i.e. increased chance of mispredict), and
    only saves one instruction.  The CMOVs read the same cacheline that ERETU is
    about to process, so are as close to free as we can reasonably get.
    
    Fixes: 76193ef47d91 ("x86/pv: System call handling in FRED mode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c             |  2 ++
 xen/arch/x86/x86_64/entry-fred.S | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 855147d7f3..1774966305 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2411,6 +2411,8 @@ void asmlinkage entry_from_pv(struct cpu_user_regs *regs)
 
             regs->ssx = l ? FLAT_KERNEL_SS   : FLAT_USER_SS32;
             regs->csx = l ? FLAT_KERNEL_CS64 : FLAT_USER_CS32;
+            regs->rcx = regs->rip;
+            regs->r11 = regs->rflags;
 
             if ( guest_kernel_mode(curr, regs) )
                 pv_hypercall(regs);
diff --git a/xen/arch/x86/x86_64/entry-fred.S b/xen/arch/x86/x86_64/entry-fred.S
index 2fa57beb93..e9c84423da 100644
--- a/xen/arch/x86/x86_64/entry-fred.S
+++ b/xen/arch/x86/x86_64/entry-fred.S
@@ -4,6 +4,7 @@
 
 #include <asm/asm_defns.h>
 #include <asm/page.h>
+#include <asm/processor.h>
 
         .section .text.entry, "ax", @progbits
 
@@ -26,7 +27,16 @@ FUNC(entry_FRED_R3, 4096)
 END(entry_FRED_R3)
 
 FUNC(eretu_exit_to_guest)
-        POP_GPRS
+        /*
+         * PV guests aren't aware of FRED.  If Xen in IDT mode would have used
+         * a SYSRET instruction, preserve the legacy behaviour for %rcx/%r11
+         */
+        testb   $TRAP_syscall >> 8, UREGS_entry_vector + 1(%rsp)
+
+        POP_GPRS /* Preserves flags */
+
+        cmovnz  EFRAME_rip(%rsp), %rcx
+        cmovnz  EFRAME_eflags(%rsp), %r11
 
         /*
          * Exceptions here are handled by redirecting either to
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 28 15:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 15:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321487.1588234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYm-0001f9-Q9; Thu, 28 May 2026 15:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321487.1588234; Thu, 28 May 2026 15:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYm-0001f2-NV; Thu, 28 May 2026 15:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1321487;
 Thu, 28 May 2026 15:22:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wScYl-0001e6-Rr
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 15:22:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYl-00Ajem-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYl-00Fce6-2Y
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=tHlCIbGibBCJ0exa6GRPt7n+73cWOMtBG9HixkdhS08=; b=MDQJkPJoApOqNV3Wm/Tekcq66N
	g3XpRJh3L871oWcv/pxbETroHRiQfLyK/q7yE/je1Tb4n21YHwqP2jYa1e6a0UQ87LiKDSg3nHtIV
	7RMRG8sbsrIEuT9e2rhnxmAtbmXGKc0/gaqM/vtjYjnDLHJd9hcO5yXnKqFUYAkxYGag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/sched: remove stale file path comments in common/sched directory
Message-Id: <E1wScYl-00Fce6-2Y@xenbits.xenproject.org>
Date: Thu, 28 May 2026 15:22:11 +0000

commit 6e48abe2f0774c0e081ff93b1f342f3759b2405c
Author:     Furkan Caliskan <frn1furkan10@gmail.com>
AuthorDate: Tue May 26 10:52:36 2026 +0300
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    xen/sched: remove stale file path comments in common/sched directory
    
    Commit 6cb4b01c03 ("xen/sched: move schedulers and cpupool coding to
    dedicated directory") moved the scheduler files from xen/common/ to
    xen/common/sched and renamed some of them, but did not update the
    in-file path comments at the top of each file.
    
    Remove the comments rather than updating them, as they are redundant
    information already conveyed by the filename itself.
    
    Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
    Suggested-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c     | 1 -
 xen/common/sched/boot-cpupool.c | 2 --
 xen/common/sched/compat.c       | 5 -----
 xen/common/sched/core.c         | 1 -
 xen/common/sched/cpupool.c      | 1 -
 xen/common/sched/credit.c       | 1 -
 xen/common/sched/credit2.c      | 1 -
 xen/common/sched/null.c         | 2 --
 8 files changed, 14 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index d8a5380557..32c596a23c 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -1,5 +1,4 @@
 /******************************************************************************
- * sched_arinc653.c
  *
  * An ARINC653-compatible scheduling algorithm for use in Xen.
  *
diff --git a/xen/common/sched/boot-cpupool.c b/xen/common/sched/boot-cpupool.c
index 03be73efdd..3ffe1f26bd 100644
--- a/xen/common/sched/boot-cpupool.c
+++ b/xen/common/sched/boot-cpupool.c
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * xen/common/boot_cpupools.c
- *
  * Code to create cpupools at boot time.
  *
  * Copyright (C) 2022 Arm Ltd.
diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
index a02204ec9a..d598c858f0 100644
--- a/xen/common/sched/compat.c
+++ b/xen/common/sched/compat.c
@@ -1,8 +1,3 @@
-/****************************************************************************
- * schedule.c
- *
- */
-
 #ifndef __COMMON_SCHED_COMPAT_C__
 #define __COMMON_SCHED_COMPAT_C__
 
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index a57d5dd929..8e2b75bc35 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -4,7 +4,6 @@
  * (C) 2004      - Mark Williamson - Intel Research Cambridge
  ****************************************************************************
  *
- *        File: common/schedule.c
  *      Author: Rolf Neugebauer & Keir Fraser
  *              Updated for generic API by Mark Williamson
  *
diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index f5459c2779..081e1053eb 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -1,5 +1,4 @@
 /******************************************************************************
- * cpupool.c
  * 
  * Generic cpupool-handling functions.
  *
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index e9a91d11c3..07656a57e9 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -2,7 +2,6 @@
  * (C) 2005-2006 - Emmanuel Ackaouy - XenSource Inc.
  ****************************************************************************
  *
- *        File: common/csched_credit.c
  *      Author: Emmanuel Ackaouy
  *
  * Description: Credit-based SMP CPU scheduler
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 75316d42b7..77475ee363 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3,7 +3,6 @@
  * (C) 2009 - George Dunlap - Citrix Systems R&D UK, Ltd
  ****************************************************************************
  *
- *        File: common/sched_credit2.c
  *      Author: George Dunlap
  *
  * Description: Credit-based SMP CPU scheduler
diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index c8e327e3cd..952bb47444 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -1,6 +1,4 @@
 /*
- * xen/common/sched_null.c
- *
  *  Copyright (c) 2017, Dario Faggioli, Citrix Ltd
  *
  * This program is free software; you can redistribute it and/or
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 28 15:22:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 15:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321488.1588239 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYw-0001iY-Ri; Thu, 28 May 2026 15:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321488.1588239; Thu, 28 May 2026 15:22:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScYw-0001iQ-P1; Thu, 28 May 2026 15:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1321488;
 Thu, 28 May 2026 15:22:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wScYv-0001iK-Uu
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 15:22:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYv-00Ajf9-2z
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScYv-00FcfG-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Cs8XAuGAEHgr2W1M3pYqLRb3FSLAEJxFAcOcTWxrDLs=; b=eOCbDb0B5I6orwnBKUs1KbTc1/
	H07ROKihE42erQ/IUl+45Ee89lQjdsydMLjL5P5yoWRiMf/EjbbTIBJkr4IVGO+3WZlEy0IHsfsTM
	Ujb/dxaxd+yqV6sqknI61pGBe45WQt2s0NJwtEDoUb96NlYjLcbSIqu3XUoQ6OpezkbA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/efi: Fix boot from a device without a file system
Message-Id: <E1wScYv-00FcfG-2r@xenbits.xenproject.org>
Date: Thu, 28 May 2026 15:22:21 +0000

commit 880e40b187aa7c50cb32b20498aeed622f0062c7
Author:     Szymon Acedański <accek@invisiblethingslab.com>
AuthorDate: Mon May 25 19:37:03 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    xen/efi: Fix boot from a device without a file system
    
    When netbooting a unified Xen kernel image (via GRUB chainloader),
    the resulting loaded_image->DeviceHandle does not support
    SIMPLE_FILE_SYSTEM_PROTOCOL.
    
    Instead of crashing via noreturn PrintErrMesg() in get_parent_handle(),
    we defer calling this function until filesystem access is needed.
    This way when booting UKI, get_parent_handle() is not called at all.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Suggested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Szymon Acedański <accek@invisiblethingslab.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/arm/efi/efi-boot.h | 12 +++++----
 xen/arch/x86/efi/efi-boot.h |  9 ++++---
 xen/common/efi/boot.c       | 66 ++++++++++++++++++++++++++++-----------------
 3 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index ea59de47e7..069cc68b0a 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -403,7 +403,7 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 }
 
 static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
+                                           EFI_FILE_HANDLE *dir_handle,
                                            const char *section)
 {
     union string name;
@@ -419,8 +419,11 @@ static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, section, "dtb");
         if ( name.s )
         {
+            CHAR16 *fname;
+
             split_string(name.s);
-            read_file(dir_handle, s2w(&name), &dtbfile, NULL);
+            ensure_dir_handle(image, dir_handle, &fname);
+            read_file(*dir_handle, s2w(&name), &dtbfile, NULL);
             efi_bs->FreePool(name.w);
         }
     }
@@ -430,7 +433,7 @@ static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
 }
 
 static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
+                                          EFI_FILE_HANDLE *dir_handle,
                                           const char *section)
 {
 }
@@ -665,8 +668,7 @@ static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
     file_info->name_len = name_len;
 
     /* Get the file system interface. */
-    if ( !*dir_handle )
-        *dir_handle = get_parent_handle(loaded_image, &fname);
+    ensure_dir_handle(loaded_image, dir_handle, &fname);
 
     /* Load the binary in memory */
     read_file(*dir_handle, s2w(&module_name), &module_binary, NULL);
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 42a2c46b5e..d738b839ee 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -284,13 +284,13 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 }
 
 static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
+                                           EFI_FILE_HANDLE *dir_handle,
                                            const char *section)
 {
 }
 
 static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
+                                          EFI_FILE_HANDLE *dir_handle,
                                           const char *section)
 {
     union string name;
@@ -304,9 +304,12 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, "global", "ucode");
     if ( name.s )
     {
+        CHAR16 *fname;
+
         microcode_set_module(mbi.mods_count);
         split_string(name.s);
-        read_file(dir_handle, s2w(&name), &ucode, NULL);
+        ensure_dir_handle(image, dir_handle, &fname);
+        read_file(*dir_handle, s2w(&name), &ucode, NULL);
         efi_bs->FreePool(name.w);
     }
 }
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9ea2183c0b..2971ea8696 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -547,6 +547,17 @@ static EFI_FILE_HANDLE __init get_parent_handle(const EFI_LOADED_IMAGE *loaded_i
     return dir_handle;
 }
 
+static void __init ensure_dir_handle(const EFI_LOADED_IMAGE *loaded_image,
+                                     EFI_FILE_HANDLE *dir_handle,
+                                     CHAR16 **file_name)
+{
+    if ( *dir_handle )
+        return;
+    *dir_handle = get_parent_handle(loaded_image, file_name);
+    if ( !*dir_handle )
+        blexit(L"Cannot load files without a usable file system");
+}
+
 static CHAR16 *__init point_tail(CHAR16 *fn)
 {
     CHAR16 *tail = NULL;
@@ -838,12 +849,11 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     if ( !name )
         PrintErrMesg(L"No filename", EFI_OUT_OF_RESOURCES);
 
+    BUG_ON(!dir_handle);
+
     what = L"Open";
-    if ( dir_handle )
-        ret = dir_handle->Open(dir_handle, &FileHandle, name,
-                               EFI_FILE_MODE_READ, 0);
-    else
-        ret = EFI_NOT_FOUND;
+    ret = dir_handle->Open(dir_handle, &FileHandle, name,
+                           EFI_FILE_MODE_READ, 0);
     if ( file == &cfg && ret == EFI_NOT_FOUND )
         return false;
     if ( EFI_ERROR(ret) )
@@ -1514,7 +1524,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
     if ( use_cfg_file )
     {
-        EFI_FILE_HANDLE dir_handle;
+        EFI_FILE_HANDLE dir_handle = NULL;
         EFI_HANDLE gop_handle;
         UINTN depth, cols, rows;
 
@@ -1526,31 +1536,33 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         gop = efi_get_gop(&gop_handle);
 
-        /* Get the file system interface. */
-        dir_handle = get_parent_handle(loaded_image, &file_name);
-
         /* Read and parse the config file. */
         if ( read_section(loaded_image, L"config", &cfg, NULL) )
             PrintStr(L"Using builtin config file\r\n");
-        else if ( !cfg_file_name && file_name )
+        else
         {
-            CHAR16 *tail;
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
 
-            while ( (tail = point_tail(file_name)) != NULL )
+            if ( !cfg_file_name )
             {
-                wstrcpy(tail, L".cfg");
-                if ( read_file(dir_handle, file_name, &cfg, NULL) )
-                    break;
-                *tail = 0;
+                CHAR16 *tail;
+
+                while ( (tail = point_tail(file_name)) != NULL )
+                {
+                    wstrcpy(tail, L".cfg");
+                    if ( read_file(dir_handle, file_name, &cfg, NULL) )
+                        break;
+                    *tail = 0;
+                }
+                if ( !tail )
+                    blexit(L"No configuration file found.");
+                PrintStr(L"Using configuration file '");
+                PrintStr(file_name);
+                PrintStr(L"'\r\n");
             }
-            if ( !tail )
-                blexit(L"No configuration file found.");
-            PrintStr(L"Using configuration file '");
-            PrintStr(file_name);
-            PrintStr(L"'\r\n");
+            else if ( !read_file(dir_handle, cfg_file_name, &cfg, NULL) )
+                blexit(L"Configuration file not found.");
         }
-        else if ( !read_file(dir_handle, cfg_file_name, &cfg, NULL) )
-            blexit(L"Configuration file not found.");
         pre_parse(&cfg);
 
         if ( section.w )
@@ -1567,6 +1579,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             if ( !name.s )
                 break;
             free_cfg();
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1578,13 +1591,14 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             efi_bs->FreePool(name.w);
         }
 
-        efi_arch_cfg_file_early(loaded_image, dir_handle, section.s);
+        efi_arch_cfg_file_early(loaded_image, &dir_handle, section.s);
 
         option_str = name.s ? split_string(name.s) : NULL;
 
         if ( !read_section(loaded_image, L"kernel", &kernel, option_str) &&
              name.s )
         {
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
             read_file(dir_handle, s2w(&name), &kernel, option_str);
             efi_bs->FreePool(name.w);
         }
@@ -1599,6 +1613,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, section.s, "ramdisk");
             if ( name.s )
             {
+                ensure_dir_handle(loaded_image, &dir_handle, &file_name);
                 read_file(dir_handle, s2w(&name), &ramdisk, NULL);
                 efi_bs->FreePool(name.w);
             }
@@ -1609,6 +1624,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, section.s, "xsm");
             if ( name.s )
             {
+                ensure_dir_handle(loaded_image, &dir_handle, &file_name);
                 read_file(dir_handle, s2w(&name), &xsm, NULL);
                 efi_bs->FreePool(name.w);
             }
@@ -1634,7 +1650,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             }
         }
 
-        efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
+        efi_arch_cfg_file_late(loaded_image, &dir_handle, section.s);
 
         free_cfg();
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 28 15:22:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 15:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321489.1588242 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScZ6-0001kX-Su; Thu, 28 May 2026 15:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321489.1588242; Thu, 28 May 2026 15:22:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wScZ6-0001kQ-QN; Thu, 28 May 2026 15:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1321489;
 Thu, 28 May 2026 15:22:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wScZ6-0001kJ-2N
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 15:22:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScZ6-00AjfD-08
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wScZ5-00FcgB-3B
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 15:22:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=OYQaXjQFjkr9S3BdCOfRrw3m4gEL7Df8JudZI13HDWw=; b=CSKBipwkdSeSM1SzbewxdAe80H
	PRyAdtG+S+a8DZiQusjnf5IC0O+g0YSCeuRbn4PzJtUfpvFQVISuG+QccPWciTvKbHLLdNz382PDJ
	bR3VtuhEO4YNmnj5N7nF2AFDNv5ENyjkp22esbG5bmTpoGFyjY+c/hMNWIkojz5/TMZw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools: Fix fallout from DOMID_ANY ABI breakage
Message-Id: <E1wScZ5-00FcgB-3B@xenbits.xenproject.org>
Date: Thu, 28 May 2026 15:22:31 +0000

commit 50a21ee067598546c6e174cf6d684add0625ff2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 27 17:28:39 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    tools: Fix fallout from DOMID_ANY ABI breakage
    
    Commit 23e2479ff9de ("xen/domain: introduce DOMID_ANY") broke at least:
    
     * xenstored domains
     * The Python bindings
     * The Ocaml bindings (i.e XAPI, and therefore XenServer/XCP-ng)
    
    by causing Xen to reject 0 (the wildcard sentinel since the start of Xen) and
    DOMID_INVALID (since 4.21) without adjusting the callers of xc_domain_create().
    
    Under other circumstances I'd revert, but xenstored has gained a dependent use
    of DOMID_ANY.
    
    Fix up the remaining in-tree callers of xc_domain_create(), which covers
    init-xenstore-domain and the python bindings.
    
    The Ocaml C bindings, like libxc itself, expose this ABI detail to their
    caller, but in this case the caller is still internal to the bindings as a
    whole.  Adjust the default value in the internal transformation, adding
    domid_any for legibility.
    
    Leave a very clear message in CHANGELOG.md that all external callers need
    altering.
    
    Fixes: 23e2479ff9de ("xen/domain: introduce DOMID_ANY")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Pau Ruiz Safont <pau.safont@vates.tech>
---
 CHANGELOG.md                         | 4 ++++
 tools/helpers/init-xenstore-domain.c | 2 +-
 tools/ocaml/libs/xc/xenctrl.ml       | 4 +++-
 tools/python/xen/lowlevel/xc/xc.c    | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 25f5a192ed..1db3efc486 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - Users of XEN_DOMCTL_createdomain/xc_domain_create() must now pass DOMID_ANY
+   to obtain an automatically allocated domid.  The prior sentinel values (0
+   since the start of Xen, and DOMID_INVALID since Xen 4.21) now no longer
+   represent a wildcard input.
  - On x86:
    - Enable pf-fixup option by default for PVH dom0.
 
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 01ca667d25..2be5831a57 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -21,7 +21,7 @@
 
 #define LAPIC_BASE_ADDRESS  0xfee00000UL
 
-static uint32_t domid = ~0;
+static uint32_t domid = DOMID_ANY;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 97108b9d86..147afa62c2 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -208,7 +208,9 @@ let with_intf f =
 external domain_create_stub: handle -> domid -> domctl_create_config -> domid
   = "stub_xc_domain_create"
 
-let domain_create handle ?(domid=0) config =
+let domid_any = 0x7ff5 (* DOMID_ANY from public/xen.h *)
+
+let domain_create handle ?(domid=domid_any) config =
   domain_create_stub handle domid config
 
 external domain_sethandle: handle -> domid -> string -> unit
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 9feb12ae2b..a94f01d40b 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -118,7 +118,7 @@ static PyObject *pyxc_domain_create(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
 {
-    uint32_t dom = 0, target = 0, max_grant_version = 2;
+    uint32_t dom = DOMID_ANY, target = 0, max_grant_version = 2;
     int      ret;
     size_t   i;
     PyObject *pyhandle = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu May 28 16:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 16:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321584.1588277 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfL-0003yC-6u; Thu, 28 May 2026 16:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321584.1588277; Thu, 28 May 2026 16:33:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfL-0003y3-3o; Thu, 28 May 2026 16:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1321584;
 Thu, 28 May 2026 16:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSdfJ-0003xx-Uc
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 16:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfJ-00AlQQ-2s
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfJ-00FipS-2k
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7DGV+3kveb6zUn8AlfbcI6mJDB6JADM0Zr6KsBR40nM=; b=nTmFo9dwL3PxA035uurSkVRfhV
	fIaihj0GqgF4G+GRNtSyhF9le8N6rfsHfhZXEfwpQMJVkcmx01ZfFI1oo+yaW6ouueM/xPiDDd/sf
	654c4a8ZLbwIO5kGBlGJZpOiJ86V/Lny3iwK5qz14z2LUAxsZMdW+o6RpTVmA3IA+L28=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/pv: Provide better SYSCALL backwards compatibility in FRED mode
Message-Id: <E1wSdfJ-00FipS-2k@xenbits.xenproject.org>
Date: Thu, 28 May 2026 16:33:01 +0000

commit c5a4b9125bed42d1947a48058119cd335294164b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Mar 24 13:46:10 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    x86/pv: Provide better SYSCALL backwards compatibility in FRED mode
    
    In FRED mode, the SYSCALL instruction does not modify %rcx/%r11.  All current
    software using SYSCALL expects the pre-FRED behaviour and spills %rcx/%r11
    around the invocation, which is why FRED not doing this goes largely
    unnoticed.
    
    However, consider the following migration scenario:
    
     * VM suspends.  Hypercall, so SYSCALL, %rcx/%r11 left unmodified
     * VM moves to a non-FRED system
     * Xen resumes the VM with a real SYSRET instruction
    
    Instead of resuming at the instruction following the SYSCALL instruction, the
    VM is resumed at whatever dead value was in %rcx.
    
    In FRED mode, manually adjust %rcx/%r11 when SYSCALL is used and when SYSRET
    would have been used.
    
    Regarding the choice of instructions in eretu_exit_to_guest(), a branch would
    be a context dependent 50/50 split (i.e. increased chance of mispredict), and
    only saves one instruction.  The CMOVs read the same cacheline that ERETU is
    about to process, so are as close to free as we can reasonably get.
    
    Fixes: 76193ef47d91 ("x86/pv: System call handling in FRED mode")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c             |  2 ++
 xen/arch/x86/x86_64/entry-fred.S | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 855147d7f3..1774966305 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2411,6 +2411,8 @@ void asmlinkage entry_from_pv(struct cpu_user_regs *regs)
 
             regs->ssx = l ? FLAT_KERNEL_SS   : FLAT_USER_SS32;
             regs->csx = l ? FLAT_KERNEL_CS64 : FLAT_USER_CS32;
+            regs->rcx = regs->rip;
+            regs->r11 = regs->rflags;
 
             if ( guest_kernel_mode(curr, regs) )
                 pv_hypercall(regs);
diff --git a/xen/arch/x86/x86_64/entry-fred.S b/xen/arch/x86/x86_64/entry-fred.S
index 2fa57beb93..e9c84423da 100644
--- a/xen/arch/x86/x86_64/entry-fred.S
+++ b/xen/arch/x86/x86_64/entry-fred.S
@@ -4,6 +4,7 @@
 
 #include <asm/asm_defns.h>
 #include <asm/page.h>
+#include <asm/processor.h>
 
         .section .text.entry, "ax", @progbits
 
@@ -26,7 +27,16 @@ FUNC(entry_FRED_R3, 4096)
 END(entry_FRED_R3)
 
 FUNC(eretu_exit_to_guest)
-        POP_GPRS
+        /*
+         * PV guests aren't aware of FRED.  If Xen in IDT mode would have used
+         * a SYSRET instruction, preserve the legacy behaviour for %rcx/%r11
+         */
+        testb   $TRAP_syscall >> 8, UREGS_entry_vector + 1(%rsp)
+
+        POP_GPRS /* Preserves flags */
+
+        cmovnz  EFRAME_rip(%rsp), %rcx
+        cmovnz  EFRAME_eflags(%rsp), %r11
 
         /*
          * Exceptions here are handled by redirecting either to
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 28 16:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 16:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321585.1588281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfV-00040e-9h; Thu, 28 May 2026 16:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321585.1588281; Thu, 28 May 2026 16:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfV-00040V-6u; Thu, 28 May 2026 16:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1321585;
 Thu, 28 May 2026 16:33:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSdfU-00040F-12
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 16:33:12 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfU-00AlQU-00
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfT-00Firh-35
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ofcY42hE/m1CteQB0VB5oYIhw5ZSIFUAgFhEGjRS314=; b=u9/TN7BY1SIsSHElPVw/TYATTb
	d+EwiPjts1YfCtl//dUr2oTyYJAaTkfiRLHrlSMAu212aw5j0NTWgicdjExwU+IG0bPL+ZQWAqMgU
	dmOtOAaHsCF9y7xhBC18dfNHjIrjry41sOyxmujM29et2jANKqflUsfaij78kvoZAoc4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/sched: remove stale file path comments in common/sched directory
Message-Id: <E1wSdfT-00Firh-35@xenbits.xenproject.org>
Date: Thu, 28 May 2026 16:33:11 +0000

commit 6e48abe2f0774c0e081ff93b1f342f3759b2405c
Author:     Furkan Caliskan <frn1furkan10@gmail.com>
AuthorDate: Tue May 26 10:52:36 2026 +0300
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    xen/sched: remove stale file path comments in common/sched directory
    
    Commit 6cb4b01c03 ("xen/sched: move schedulers and cpupool coding to
    dedicated directory") moved the scheduler files from xen/common/ to
    xen/common/sched and renamed some of them, but did not update the
    in-file path comments at the top of each file.
    
    Remove the comments rather than updating them, as they are redundant
    information already conveyed by the filename itself.
    
    Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
    Suggested-by: Juergen Gross <jgross@suse.com>
    Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Acked-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/common/sched/arinc653.c     | 1 -
 xen/common/sched/boot-cpupool.c | 2 --
 xen/common/sched/compat.c       | 5 -----
 xen/common/sched/core.c         | 1 -
 xen/common/sched/cpupool.c      | 1 -
 xen/common/sched/credit.c       | 1 -
 xen/common/sched/credit2.c      | 1 -
 xen/common/sched/null.c         | 2 --
 8 files changed, 14 deletions(-)

diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c
index d8a5380557..32c596a23c 100644
--- a/xen/common/sched/arinc653.c
+++ b/xen/common/sched/arinc653.c
@@ -1,5 +1,4 @@
 /******************************************************************************
- * sched_arinc653.c
  *
  * An ARINC653-compatible scheduling algorithm for use in Xen.
  *
diff --git a/xen/common/sched/boot-cpupool.c b/xen/common/sched/boot-cpupool.c
index 03be73efdd..3ffe1f26bd 100644
--- a/xen/common/sched/boot-cpupool.c
+++ b/xen/common/sched/boot-cpupool.c
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * xen/common/boot_cpupools.c
- *
  * Code to create cpupools at boot time.
  *
  * Copyright (C) 2022 Arm Ltd.
diff --git a/xen/common/sched/compat.c b/xen/common/sched/compat.c
index a02204ec9a..d598c858f0 100644
--- a/xen/common/sched/compat.c
+++ b/xen/common/sched/compat.c
@@ -1,8 +1,3 @@
-/****************************************************************************
- * schedule.c
- *
- */
-
 #ifndef __COMMON_SCHED_COMPAT_C__
 #define __COMMON_SCHED_COMPAT_C__
 
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index a57d5dd929..8e2b75bc35 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -4,7 +4,6 @@
  * (C) 2004      - Mark Williamson - Intel Research Cambridge
  ****************************************************************************
  *
- *        File: common/schedule.c
  *      Author: Rolf Neugebauer & Keir Fraser
  *              Updated for generic API by Mark Williamson
  *
diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index f5459c2779..081e1053eb 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -1,5 +1,4 @@
 /******************************************************************************
- * cpupool.c
  * 
  * Generic cpupool-handling functions.
  *
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index e9a91d11c3..07656a57e9 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -2,7 +2,6 @@
  * (C) 2005-2006 - Emmanuel Ackaouy - XenSource Inc.
  ****************************************************************************
  *
- *        File: common/csched_credit.c
  *      Author: Emmanuel Ackaouy
  *
  * Description: Credit-based SMP CPU scheduler
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 75316d42b7..77475ee363 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -3,7 +3,6 @@
  * (C) 2009 - George Dunlap - Citrix Systems R&D UK, Ltd
  ****************************************************************************
  *
- *        File: common/sched_credit2.c
  *      Author: George Dunlap
  *
  * Description: Credit-based SMP CPU scheduler
diff --git a/xen/common/sched/null.c b/xen/common/sched/null.c
index c8e327e3cd..952bb47444 100644
--- a/xen/common/sched/null.c
+++ b/xen/common/sched/null.c
@@ -1,6 +1,4 @@
 /*
- * xen/common/sched_null.c
- *
  *  Copyright (c) 2017, Dario Faggioli, Citrix Ltd
  *
  * This program is free software; you can redistribute it and/or
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 28 16:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 16:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321586.1588284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdff-00042s-Am; Thu, 28 May 2026 16:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321586.1588284; Thu, 28 May 2026 16:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdff-00042k-8D; Thu, 28 May 2026 16:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1321586;
 Thu, 28 May 2026 16:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSdfe-00042b-4c
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 16:33:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfe-00AlQo-0M
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfe-00Fisg-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=7HqG4wojJfIclPiSBfPJ469fIEeVsg1rtC5d3R+oRbg=; b=B055i8fL50J9aKd+GAXr0le4Vf
	XQCup3qemGooKDPIduWQkznv94Dvxk3vz6jAstd1yS8GR7O4W+DeYtr3xFN0klNFXJcZe79cgj5eC
	u1H3DuWE5jb7i8BJfrjxqK9F1JwRmmXp0SBrornr8k+eC0mvdghKCowhyLLmYcKI7hDc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/efi: Fix boot from a device without a file system
Message-Id: <E1wSdfe-00Fisg-0D@xenbits.xenproject.org>
Date: Thu, 28 May 2026 16:33:22 +0000

commit 880e40b187aa7c50cb32b20498aeed622f0062c7
Author:     Szymon Acedański <accek@invisiblethingslab.com>
AuthorDate: Mon May 25 19:37:03 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    xen/efi: Fix boot from a device without a file system
    
    When netbooting a unified Xen kernel image (via GRUB chainloader),
    the resulting loaded_image->DeviceHandle does not support
    SIMPLE_FILE_SYSTEM_PROTOCOL.
    
    Instead of crashing via noreturn PrintErrMesg() in get_parent_handle(),
    we defer calling this function until filesystem access is needed.
    This way when booting UKI, get_parent_handle() is not called at all.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Suggested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Signed-off-by: Szymon Acedański <accek@invisiblethingslab.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 xen/arch/arm/efi/efi-boot.h | 12 +++++----
 xen/arch/x86/efi/efi-boot.h |  9 ++++---
 xen/common/efi/boot.c       | 66 ++++++++++++++++++++++++++++-----------------
 3 files changed, 54 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/efi/efi-boot.h b/xen/arch/arm/efi/efi-boot.h
index ea59de47e7..069cc68b0a 100644
--- a/xen/arch/arm/efi/efi-boot.h
+++ b/xen/arch/arm/efi/efi-boot.h
@@ -403,7 +403,7 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 }
 
 static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
+                                           EFI_FILE_HANDLE *dir_handle,
                                            const char *section)
 {
     union string name;
@@ -419,8 +419,11 @@ static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, section, "dtb");
         if ( name.s )
         {
+            CHAR16 *fname;
+
             split_string(name.s);
-            read_file(dir_handle, s2w(&name), &dtbfile, NULL);
+            ensure_dir_handle(image, dir_handle, &fname);
+            read_file(*dir_handle, s2w(&name), &dtbfile, NULL);
             efi_bs->FreePool(name.w);
         }
     }
@@ -430,7 +433,7 @@ static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
 }
 
 static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
+                                          EFI_FILE_HANDLE *dir_handle,
                                           const char *section)
 {
 }
@@ -665,8 +668,7 @@ static int __init allocate_module_file(const EFI_LOADED_IMAGE *loaded_image,
     file_info->name_len = name_len;
 
     /* Get the file system interface. */
-    if ( !*dir_handle )
-        *dir_handle = get_parent_handle(loaded_image, &fname);
+    ensure_dir_handle(loaded_image, dir_handle, &fname);
 
     /* Load the binary in memory */
     read_file(*dir_handle, s2w(&module_name), &module_binary, NULL);
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index 42a2c46b5e..d738b839ee 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -284,13 +284,13 @@ static void __init noreturn efi_arch_post_exit_boot(void)
 }
 
 static void __init efi_arch_cfg_file_early(const EFI_LOADED_IMAGE *image,
-                                           EFI_FILE_HANDLE dir_handle,
+                                           EFI_FILE_HANDLE *dir_handle,
                                            const char *section)
 {
 }
 
 static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
-                                          EFI_FILE_HANDLE dir_handle,
+                                          EFI_FILE_HANDLE *dir_handle,
                                           const char *section)
 {
     union string name;
@@ -304,9 +304,12 @@ static void __init efi_arch_cfg_file_late(const EFI_LOADED_IMAGE *image,
         name.s = get_value(&cfg, "global", "ucode");
     if ( name.s )
     {
+        CHAR16 *fname;
+
         microcode_set_module(mbi.mods_count);
         split_string(name.s);
-        read_file(dir_handle, s2w(&name), &ucode, NULL);
+        ensure_dir_handle(image, dir_handle, &fname);
+        read_file(*dir_handle, s2w(&name), &ucode, NULL);
         efi_bs->FreePool(name.w);
     }
 }
diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 9ea2183c0b..2971ea8696 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -547,6 +547,17 @@ static EFI_FILE_HANDLE __init get_parent_handle(const EFI_LOADED_IMAGE *loaded_i
     return dir_handle;
 }
 
+static void __init ensure_dir_handle(const EFI_LOADED_IMAGE *loaded_image,
+                                     EFI_FILE_HANDLE *dir_handle,
+                                     CHAR16 **file_name)
+{
+    if ( *dir_handle )
+        return;
+    *dir_handle = get_parent_handle(loaded_image, file_name);
+    if ( !*dir_handle )
+        blexit(L"Cannot load files without a usable file system");
+}
+
 static CHAR16 *__init point_tail(CHAR16 *fn)
 {
     CHAR16 *tail = NULL;
@@ -838,12 +849,11 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name,
     if ( !name )
         PrintErrMesg(L"No filename", EFI_OUT_OF_RESOURCES);
 
+    BUG_ON(!dir_handle);
+
     what = L"Open";
-    if ( dir_handle )
-        ret = dir_handle->Open(dir_handle, &FileHandle, name,
-                               EFI_FILE_MODE_READ, 0);
-    else
-        ret = EFI_NOT_FOUND;
+    ret = dir_handle->Open(dir_handle, &FileHandle, name,
+                           EFI_FILE_MODE_READ, 0);
     if ( file == &cfg && ret == EFI_NOT_FOUND )
         return false;
     if ( EFI_ERROR(ret) )
@@ -1514,7 +1524,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
     if ( use_cfg_file )
     {
-        EFI_FILE_HANDLE dir_handle;
+        EFI_FILE_HANDLE dir_handle = NULL;
         EFI_HANDLE gop_handle;
         UINTN depth, cols, rows;
 
@@ -1526,31 +1536,33 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
 
         gop = efi_get_gop(&gop_handle);
 
-        /* Get the file system interface. */
-        dir_handle = get_parent_handle(loaded_image, &file_name);
-
         /* Read and parse the config file. */
         if ( read_section(loaded_image, L"config", &cfg, NULL) )
             PrintStr(L"Using builtin config file\r\n");
-        else if ( !cfg_file_name && file_name )
+        else
         {
-            CHAR16 *tail;
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
 
-            while ( (tail = point_tail(file_name)) != NULL )
+            if ( !cfg_file_name )
             {
-                wstrcpy(tail, L".cfg");
-                if ( read_file(dir_handle, file_name, &cfg, NULL) )
-                    break;
-                *tail = 0;
+                CHAR16 *tail;
+
+                while ( (tail = point_tail(file_name)) != NULL )
+                {
+                    wstrcpy(tail, L".cfg");
+                    if ( read_file(dir_handle, file_name, &cfg, NULL) )
+                        break;
+                    *tail = 0;
+                }
+                if ( !tail )
+                    blexit(L"No configuration file found.");
+                PrintStr(L"Using configuration file '");
+                PrintStr(file_name);
+                PrintStr(L"'\r\n");
             }
-            if ( !tail )
-                blexit(L"No configuration file found.");
-            PrintStr(L"Using configuration file '");
-            PrintStr(file_name);
-            PrintStr(L"'\r\n");
+            else if ( !read_file(dir_handle, cfg_file_name, &cfg, NULL) )
+                blexit(L"Configuration file not found.");
         }
-        else if ( !read_file(dir_handle, cfg_file_name, &cfg, NULL) )
-            blexit(L"Configuration file not found.");
         pre_parse(&cfg);
 
         if ( section.w )
@@ -1567,6 +1579,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             if ( !name.s )
                 break;
             free_cfg();
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
             if ( !read_file(dir_handle, s2w(&name), &cfg, NULL) )
             {
                 PrintStr(L"Chained configuration file '");
@@ -1578,13 +1591,14 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             efi_bs->FreePool(name.w);
         }
 
-        efi_arch_cfg_file_early(loaded_image, dir_handle, section.s);
+        efi_arch_cfg_file_early(loaded_image, &dir_handle, section.s);
 
         option_str = name.s ? split_string(name.s) : NULL;
 
         if ( !read_section(loaded_image, L"kernel", &kernel, option_str) &&
              name.s )
         {
+            ensure_dir_handle(loaded_image, &dir_handle, &file_name);
             read_file(dir_handle, s2w(&name), &kernel, option_str);
             efi_bs->FreePool(name.w);
         }
@@ -1599,6 +1613,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, section.s, "ramdisk");
             if ( name.s )
             {
+                ensure_dir_handle(loaded_image, &dir_handle, &file_name);
                 read_file(dir_handle, s2w(&name), &ramdisk, NULL);
                 efi_bs->FreePool(name.w);
             }
@@ -1609,6 +1624,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             name.s = get_value(&cfg, section.s, "xsm");
             if ( name.s )
             {
+                ensure_dir_handle(loaded_image, &dir_handle, &file_name);
                 read_file(dir_handle, s2w(&name), &xsm, NULL);
                 efi_bs->FreePool(name.w);
             }
@@ -1634,7 +1650,7 @@ void EFIAPI __init noreturn efi_start(EFI_HANDLE ImageHandle,
             }
         }
 
-        efi_arch_cfg_file_late(loaded_image, dir_handle, section.s);
+        efi_arch_cfg_file_late(loaded_image, &dir_handle, section.s);
 
         free_cfg();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu May 28 16:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 28 May 2026 16:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1321587.1588289 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfq-00044o-Cl; Thu, 28 May 2026 16:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1321587.1588289; Thu, 28 May 2026 16:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wSdfq-00044g-9q; Thu, 28 May 2026 16:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1321587;
 Thu, 28 May 2026 16:33:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wSdfo-00044Z-7a
 for xen-changelog@lists.xenproject.org; Thu, 28 May 2026 16:33:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfo-00AlQs-0e
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wSdfo-00Fiu2-0Y
 for xen-changelog@lists.xenproject.org;
 Thu, 28 May 2026 16:33:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FgcsD8/Nkf+y2MlxnBNGE5lodb0ewnm1ghAzfa/923g=; b=ZaLj9M0b9Q6wKWc1TsdXcXS+13
	qVWr7vtFGokk41Pc5voqihgcbZWC+wdaLPcejf01L8hvEay77wYGX0uYppU/mSzam+jmehCKGvpQR
	EBrHwu1Mj4ezGoD4xlr6/kz4xrSjQVnA71D1OQeIiGSx5SDuN0yabFc21TYUXz5E9Rb8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools: Fix fallout from DOMID_ANY ABI breakage
Message-Id: <E1wSdfo-00Fiu2-0Y@xenbits.xenproject.org>
Date: Thu, 28 May 2026 16:33:32 +0000

commit 50a21ee067598546c6e174cf6d684add0625ff2f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 27 17:28:39 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Thu May 28 16:19:16 2026 +0100

    tools: Fix fallout from DOMID_ANY ABI breakage
    
    Commit 23e2479ff9de ("xen/domain: introduce DOMID_ANY") broke at least:
    
     * xenstored domains
     * The Python bindings
     * The Ocaml bindings (i.e XAPI, and therefore XenServer/XCP-ng)
    
    by causing Xen to reject 0 (the wildcard sentinel since the start of Xen) and
    DOMID_INVALID (since 4.21) without adjusting the callers of xc_domain_create().
    
    Under other circumstances I'd revert, but xenstored has gained a dependent use
    of DOMID_ANY.
    
    Fix up the remaining in-tree callers of xc_domain_create(), which covers
    init-xenstore-domain and the python bindings.
    
    The Ocaml C bindings, like libxc itself, expose this ABI detail to their
    caller, but in this case the caller is still internal to the bindings as a
    whole.  Adjust the default value in the internal transformation, adding
    domid_any for legibility.
    
    Leave a very clear message in CHANGELOG.md that all external callers need
    altering.
    
    Fixes: 23e2479ff9de ("xen/domain: introduce DOMID_ANY")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Pau Ruiz Safont <pau.safont@vates.tech>
---
 CHANGELOG.md                         | 4 ++++
 tools/helpers/init-xenstore-domain.c | 2 +-
 tools/ocaml/libs/xc/xenctrl.ml       | 4 +++-
 tools/python/xen/lowlevel/xc/xc.c    | 2 +-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 25f5a192ed..1db3efc486 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ## [4.22.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - Users of XEN_DOMCTL_createdomain/xc_domain_create() must now pass DOMID_ANY
+   to obtain an automatically allocated domid.  The prior sentinel values (0
+   since the start of Xen, and DOMID_INVALID since Xen 4.21) now no longer
+   represent a wildcard input.
  - On x86:
    - Enable pf-fixup option by default for PVH dom0.
 
diff --git a/tools/helpers/init-xenstore-domain.c b/tools/helpers/init-xenstore-domain.c
index 01ca667d25..2be5831a57 100644
--- a/tools/helpers/init-xenstore-domain.c
+++ b/tools/helpers/init-xenstore-domain.c
@@ -21,7 +21,7 @@
 
 #define LAPIC_BASE_ADDRESS  0xfee00000UL
 
-static uint32_t domid = ~0;
+static uint32_t domid = DOMID_ANY;
 static char *kernel;
 static char *ramdisk;
 static char *flask;
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 97108b9d86..147afa62c2 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -208,7 +208,9 @@ let with_intf f =
 external domain_create_stub: handle -> domid -> domctl_create_config -> domid
   = "stub_xc_domain_create"
 
-let domain_create handle ?(domid=0) config =
+let domid_any = 0x7ff5 (* DOMID_ANY from public/xen.h *)
+
+let domain_create handle ?(domid=domid_any) config =
   domain_create_stub handle domid config
 
 external domain_sethandle: handle -> domid -> string -> unit
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 9feb12ae2b..a94f01d40b 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -118,7 +118,7 @@ static PyObject *pyxc_domain_create(XcObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
 {
-    uint32_t dom = 0, target = 0, max_grant_version = 2;
+    uint32_t dom = DOMID_ANY, target = 0, max_grant_version = 2;
     int      ret;
     size_t   i;
     PyObject *pyhandle = NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri May 29 23:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 May 2026 23:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322789.1588988 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6M3-0006Z0-1E; Fri, 29 May 2026 23:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322789.1588988; Fri, 29 May 2026 23:11:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6M2-0006Ys-UD; Fri, 29 May 2026 23:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1322789;
 Fri, 29 May 2026 23:11:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT6M1-0006Ym-Lr
 for xen-changelog@lists.xenproject.org; Fri, 29 May 2026 23:11:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6M1-00CfHz-1u
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6M1-000v26-1m
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uq+5jvJbz0eN7Y9GUxKmtML1dp6YovEicH+0gHFpuHU=; b=dn6Sofg9t0cyanwCcXNmaFg483
	lF2KDi5vBFSVBNn47QTwN3sxCYxNK4cYllkXV5BbWpmV+nPuRwbWXYPXT2bglCvfDDWh+T0to7qdl
	OX7tFBdQM1gIc6QVFDCUqrMD4TG/SeELJjSkecvd0yH7kssYUtAGYoIRXJe94vGlj2KE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Adjust test needs[] to ensure binaries/ is non-root
Message-Id: <E1wT6M1-000v26-1m@xenbits.xenproject.org>
Date: Fri, 29 May 2026 23:11:01 +0000

commit 2ca218af23221975d25ed69709f6b108ff34773a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 20:10:25 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Adjust test needs[] to ensure binaries/ is non-root
    
    The binaries/ directory is a composition from the artefacts, and also used as
    a working directory for most of the tests.  If the very first artefact is from
    a root container, then the test must also be a root container to use it as a
    working directory.
    
    For arm64, the existing linux-arm64 artefact suffices.  For arm32, pull in the
    microcode-x86 artefact as it's the smallest available.  This bodge can be
    removed when all build containers have become non-root.
    
    For the qemu-xtf-dom0less-arm64-*-xen-version jobs, use *arm64-test-needs
    ahead of alpine-3.18-gcc-* (as it's a root container), and to deduplicate
    the *-export dependency.
    
    This will allow us to change containers to being non-root one at a time,
    rather than all in one go.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/gitlab-ci/test.yaml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 8770c523e2..517af17324 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -15,6 +15,12 @@
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
+  # Bodge to ensure binaries/ is non-root.  Can be any artefact which comes
+  # from a non-root container, and microcode-x86 is the smallest.  Remove when
+  # all build containers have become non-root.
+  - project: $ARTIFACTS_REPO
+    job: microcode-x86
+    ref: $ARTIFACTS_BRANCH
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
@@ -569,16 +575,16 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   script:
     - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
+    - *arm64-test-needs
     - alpine-3.18-gcc-arm64
-    - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   extends: .qemu-arm64
   script:
     - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
+    - *arm64-test-needs
     - alpine-3.18-gcc-debug-arm64
-    - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-smoke-dom0-arm32-gcc:
   extends: .qemu-arm32
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 29 23:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 May 2026 23:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322790.1588991 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MD-0006aR-1v; Fri, 29 May 2026 23:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322790.1588991; Fri, 29 May 2026 23:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MC-0006aK-Vg; Fri, 29 May 2026 23:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1322790;
 Fri, 29 May 2026 23:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT6MB-0006Zw-Np
 for xen-changelog@lists.xenproject.org; Fri, 29 May 2026 23:11:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6MB-00CfI3-2H
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6MB-000v3J-25
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=L+lnXHXxxWLcDfojn9wfEVxWbLJS3uCMWIRPfTV0GgE=; b=dL9yNAyxbWaMPWrfldjl+Mv02s
	Yq4yZiJSbXyOrrC6S5CZ7Ic+lKdjaYVH6wcz3oxt7z0XZKnxGLmf3B3LUaO/QrMoNxZkEWs2s72mK
	/ZOO2sbUgxnPqO7YOyMO4l83xtRWNIM5i+xkY1PNsfV78Xo3eUFDtqNx+OKONhgtGt1E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Refresh the Debian 12 arm32 cross compile container
Message-Id: <E1wT6MB-000v3J-25@xenbits.xenproject.org>
Date: Fri, 29 May 2026 23:11:11 +0000

commit 81c9fa421dbcc745a61b42a3e6d67bc7a134ef4a
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Tue Oct 22 16:55:02 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Refresh the Debian 12 arm32 cross compile container
    
    Rework the container to user heredocs for readability, derive from
    bookworm-slim and use apt-get --no-install-recommends to keep the size down.
    
    Convert it to being a non-root container.  Add checkpolicy as FLASK is an
    available build option for arm32 under Randconfig testing.
    
    Rename the CI jobs to debian-12-arm32-* to follow the naming scheme of all the
    other CI jobs.
    
    No functional change.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 .../build/debian/12-arm64v8-arm32.dockerfile       | 32 ++++++++++++++++++++++
 .../debian/bookworm-arm64v8-arm32-gcc.dockerfile   | 24 ----------------
 automation/gitlab-ci/build.yaml                    | 24 ++++++++--------
 automation/gitlab-ci/test.yaml                     | 14 +++++-----
 automation/scripts/containerize                    |  2 +-
 5 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/automation/build/debian/12-arm64v8-arm32.dockerfile b/automation/build/debian/12-arm64v8-arm32.dockerfile
new file mode 100644
index 0000000000..a4d70f1111
--- /dev/null
+++ b/automation/build/debian/12-arm64v8-arm32.dockerfile
@@ -0,0 +1,32 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+        gcc-arm-linux-gnueabihf
+    )
+
+    apt-get --yes --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile b/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
deleted file mode 100644
index 95b3f04283..0000000000
--- a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
+++ /dev/null
@@ -1,24 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-ENV CROSS_COMPILE /usr/bin/arm-linux-gnueabihf-
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        flex \
-        bison \
-        git \
-        gcc-arm-linux-gnueabihf \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 7f5b5938e8..2189ee0b9e 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -360,52 +360,52 @@ debian-13-riscv64-gcc-debug:
 
 # Arm32 cross-build
 
-debian-bookworm-gcc-arm32:
+debian-12-arm32-gcc:
   extends: .gcc-arm32-cross-build
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-debug:
+debian-12-arm32-gcc-debug:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-randconfig:
+debian-12-arm32-gcc-randconfig:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     RANDCONFIG: y
 
-debian-bookworm-gcc-arm32-debug-staticmem:
+debian-12-arm32-gcc-debug-staticmem:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_EXPERT=y
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
-debian-bookworm-gcc-arm32-debug-earlyprintk:
+debian-12-arm32-gcc-debug-earlyprintk:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
-debian-bookworm-gcc-arm32-debug-mpu:
+debian-12-arm32-gcc-debug-mpu:
   extends: .gcc-arm32-cross-build-debug
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_XEN_START_ADDRESS=0x0
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 517af17324..e1d6bb5056 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -600,7 +600,7 @@ qemu-smoke-dom0less-arm32-gcc:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32
+    - debian-12-arm32-gcc
 
 qemu-smoke-dom0less-arm32-gcc-debug:
   extends: .qemu-arm32
@@ -608,7 +608,7 @@ qemu-smoke-dom0less-arm32-gcc-debug:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
   extends: .qemu-arm32
@@ -616,7 +616,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug-staticmem
+    - debian-12-arm32-gcc-debug-staticmem
 
 qemu-smoke-dom0less-arm32-gcc-debug-gzip:
   extends: .qemu-arm32
@@ -624,7 +624,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-gzip:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-without-dom0:
   extends: .qemu-arm32
@@ -632,7 +632,7 @@ qemu-smoke-dom0less-arm32-gcc-without-dom0:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32
+    - debian-12-arm32-gcc
 
 qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
   extends: .qemu-arm32
@@ -640,7 +640,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-debug-earlyprintk:
   extends: .qemu-arm32
@@ -648,7 +648,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-earlyprintk:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh earlyprintk 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug-earlyprintk
+    - debian-12-arm32-gcc-debug-earlyprintk
 
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index ad3e237270..ef3b97b655 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -38,7 +38,7 @@ case "_${CONTAINER}" in
     _bookworm|_bookworm-x86_64) CONTAINER="${BASE}/debian:12-x86_64" ;;
     _trixie-x86_64|_) CONTAINER="${BASE}/debian:13-x86_64" ;;
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
-    _bookworm-arm64v8-arm32-gcc) CONTAINER="${BASE}/debian:bookworm-arm64v8-arm32-gcc" ;;
+    _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 29 23:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 May 2026 23:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322791.1588995 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MN-0006co-3t; Fri, 29 May 2026 23:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322791.1588995; Fri, 29 May 2026 23:11:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MN-0006cg-0y; Fri, 29 May 2026 23:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1322791;
 Fri, 29 May 2026 23:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT6ML-0006cX-RP
 for xen-changelog@lists.xenproject.org; Fri, 29 May 2026 23:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6ML-00CfI9-2d
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6ML-000v5C-2V
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:21 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=5eKzsgUcOMIh3m/CuHgT3N6aX2DCK4olGlcqlWI6X1c=; b=NnrRo23mShuI86qkEgcDjU/ciz
	aJI5wqthfUPJ8uKoXwMlFqxtwUweinrbuhdFUxr+WXmeoJBwXbrgNfriL17Cx5Gx46/WdC+Yoxig9
	HyOsF5SBc9hBNsv0F1Ll9/pbQfjEGl6EX/z4qF81He/UPU7NqkXvU+R728JWUaPqBlwU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Refresh the Debian 12 arm64 container
Message-Id: <E1wT6ML-000v5C-2V@xenbits.xenproject.org>
Date: Fri, 29 May 2026 23:11:21 +0000

commit 4d8aa53ed1edd235c8369007ca0096f4a3f12c4f
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Fri Oct 18 13:40:35 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Refresh the Debian 12 arm64 container
    
    Rework the container to user heredocs for readability, derive from
    bookworm-slim and use apt-get --no-install-recommends to keep the size down.
    
    Additionally:
    
     * Make it a non-root container.
     * Drop libext2fs-dev which is an x86-only dependency.
     * Add libncurses5-dev for xentop and zlib1g-dev which was missing from the
       libxenguest decompressors.
     * As there's no ninja, the container can no loger build QEMU so drop
       libglib2.0-dev and libpixman-1-dev too.
     * Swap libyajl-dev for libjson-c-dev given the deprecation of the former.
    
    Rename the job to debian-12-arm64-* to follow the naming scheme of all the
    other CI jobs.
    
    This reduces the size of the debian:12-arm64v8 from 2.25GB down to 1.62GB.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/build/debian/12-arm64v8.dockerfile      | 69 ++++++++++++++++++++++
 .../build/debian/bookworm-arm64v8.dockerfile       | 55 -----------------
 automation/gitlab-ci/build.yaml                    |  8 +--
 automation/gitlab-ci/test.yaml                     |  4 +-
 automation/scripts/containerize                    |  2 +-
 5 files changed, 76 insertions(+), 62 deletions(-)

diff --git a/automation/build/debian/12-arm64v8.dockerfile b/automation/build/debian/12-arm64v8.dockerfile
new file mode 100644
index 0000000000..c0e08a010f
--- /dev/null
+++ b/automation/build/debian/12-arm64v8.dockerfile
@@ -0,0 +1,69 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+
+        # Tools (general)
+        ca-certificates
+        cpio
+        git-core
+        pkg-config
+        wget
+        # libxenguest dombuilder
+        libbz2-dev
+        liblzma-dev
+        liblzo2-dev
+        libzstd-dev
+        zlib1g-dev
+        # libacpi
+        acpica-tools
+        # libxl
+        libfdt-dev
+        libjson-c-dev
+        uuid-dev
+        # xentop
+        libncurses5-dev
+        # Python bindings
+        python3-dev
+        python3-setuptools
+        # Golang bindings
+        golang-go
+        # Ocaml bindings/oxenstored
+        ocaml-nox
+        ocaml-findlib
+
+        # for test phase, qemu-* jobs
+        busybox-static
+        curl
+        device-tree-compiler
+        expect
+        file
+        ovmf
+        u-boot-qemu
+        u-boot-tools
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile
deleted file mode 100644
index da8ae75125..0000000000
--- a/automation/build/debian/bookworm-arm64v8.dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        zlib1g-dev \
-        libncurses5-dev \
-        python3-dev \
-        python3-setuptools \
-        uuid-dev \
-        libyajl-dev \
-        libaio-dev \
-        libglib2.0-dev \
-        clang \
-        libpixman-1-dev \
-        pkg-config \
-        flex \
-        bison \
-        acpica-tools \
-        libfdt-dev \
-        bin86 \
-        bcc \
-        liblzma-dev \
-        libnl-3-dev \
-        ocaml-nox \
-        libfindlib-ocaml-dev \
-        markdown \
-        transfig \
-        pandoc \
-        checkpolicy \
-        wget \
-        git \
-        nasm \
-        # for test phase, qemu-smoke-* jobs
-        u-boot-qemu \
-        u-boot-tools \
-        device-tree-compiler \
-        curl \
-        cpio \
-        busybox-static \
-        expect \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 2189ee0b9e..128b5f45cb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -414,15 +414,15 @@ debian-12-arm32-gcc-debug-mpu:
 
 # Arm builds
 
-debian-bookworm-gcc-arm64:
+debian-12-arm64-gcc:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
-debian-bookworm-gcc-debug-arm64:
+debian-12-arm64-gcc-debug:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index e1d6bb5056..982fd86db0 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -37,7 +37,7 @@
 .qemu-arm64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm64.log
   artifacts:
     paths:
@@ -50,7 +50,7 @@
 .qemu-arm32:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm32.log
   artifacts:
     paths:
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index ef3b97b655..bda06054eb 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -39,7 +39,7 @@ case "_${CONTAINER}" in
     _trixie-x86_64|_) CONTAINER="${BASE}/debian:13-x86_64" ;;
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
     _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
-    _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
+    _bookworm-arm64v8) CONTAINER="${BASE}/debian:12-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 29 23:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 May 2026 23:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322792.1588999 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MX-0006f2-56; Fri, 29 May 2026 23:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322792.1588999; Fri, 29 May 2026 23:11:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6MX-0006eu-2L; Fri, 29 May 2026 23:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1322792;
 Fri, 29 May 2026 23:11:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT6MV-0006eo-UK
 for xen-changelog@lists.xenproject.org; Fri, 29 May 2026 23:11:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6MV-00CfID-2w
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6MV-000v5n-2o
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:31 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=jBZvgP8lIJpMd9r9ZbVcJTspEstwE2ei0ukj6EqcgH4=; b=hEZ1n+msrLi+HcYm+X35qQjFIT
	P9YTv1+ePOpFRaCvREzT/fwSvO7ipHhvFfpAI8kOBtIBi+JBKBBnPtfFNh1IYbUVTK0A1YdSQsg78
	MxUB+V93KFw+emlAxKCEDxmkXKPT78pzwuJln8ZenVw6QpWRdUtMyUZvi5/dL3cbb9Yc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Add a Debian 13 (Trixie) arm64 container
Message-Id: <E1wT6MV-000v5n-2o@xenbits.xenproject.org>
Date: Fri, 29 May 2026 23:11:31 +0000

commit eac95d129db499cbc7dd7fbf60995160a616f6fe
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 20:48:44 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Add a Debian 13 (Trixie) arm64 container
    
    Exactly as per the Bookworm container, but additionally with the ipxe-qemu and
    qemu-system-aarch64 packages.  These will be used to remove the export jobs.
    
    Switch qemu-arm{32,64} test jobs to use this container, and add two new build
    tests.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/build/debian/13-arm64v8.dockerfile | 71 +++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml               | 10 ++++
 automation/gitlab-ci/test.yaml                |  4 +-
 automation/scripts/containerize               |  1 +
 4 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/automation/build/debian/13-arm64v8.dockerfile b/automation/build/debian/13-arm64v8.dockerfile
new file mode 100644
index 0000000000..b9062ee8b4
--- /dev/null
+++ b/automation/build/debian/13-arm64v8.dockerfile
@@ -0,0 +1,71 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:trixie-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+
+        # Tools (general)
+        ca-certificates
+        cpio
+        git-core
+        pkg-config
+        wget
+        # libxenguest dombuilder
+        libbz2-dev
+        liblzma-dev
+        liblzo2-dev
+        libzstd-dev
+        zlib1g-dev
+        # libacpi
+        acpica-tools
+        # libxl
+        libfdt-dev
+        libjson-c-dev
+        uuid-dev
+        # xentop
+        libncurses5-dev
+        # Python bindings
+        python3-dev
+        python3-setuptools
+        # Golang bindings
+        golang-go
+        # Ocaml bindings/oxenstored
+        ocaml-nox
+        ocaml-findlib
+
+        # for test phase, qemu-* jobs
+        busybox-static
+        curl
+        device-tree-compiler
+        expect
+        file
+        ipxe-qemu
+        ovmf
+        qemu-system-aarch64
+        u-boot-qemu
+        u-boot-tools
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 128b5f45cb..a1acf2e827 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -424,6 +424,16 @@ debian-12-arm64-gcc-debug:
   variables:
     CONTAINER: debian:12-arm64v8
 
+debian-13-arm64-gcc:
+  extends: .gcc-arm64-build
+  variables:
+    CONTAINER: debian:13-arm64v8
+
+debian-13-arm64-gcc-debug:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: debian:13-arm64v8
+
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
   <<: *build-test
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 982fd86db0..008deef98d 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -37,7 +37,7 @@
 .qemu-arm64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:12-arm64v8
+    CONTAINER: debian:13-arm64v8
     LOGFILE: qemu-smoke-arm64.log
   artifacts:
     paths:
@@ -50,7 +50,7 @@
 .qemu-arm32:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:12-arm64v8
+    CONTAINER: debian:13-arm64v8
     LOGFILE: qemu-smoke-arm32.log
   artifacts:
     paths:
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index bda06054eb..8bd2a847aa 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -41,6 +41,7 @@ case "_${CONTAINER}" in
     _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:12-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
+    _trixie-arm64v8) CONTAINER="${BASE}/debian:13-arm64v8" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
     _xenial) CONTAINER="${BASE}/ubuntu:16.04-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri May 29 23:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 29 May 2026 23:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322793.1589003 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6Mh-0006hY-8h; Fri, 29 May 2026 23:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322793.1589003; Fri, 29 May 2026 23:11:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT6Mh-0006hM-5S; Fri, 29 May 2026 23:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1322793;
 Fri, 29 May 2026 23:11:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT6Mg-0006hE-1O
 for xen-changelog@lists.xenproject.org; Fri, 29 May 2026 23:11:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6Mg-00CfIH-02
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT6Mf-000v6B-36
 for xen-changelog@lists.xenproject.org;
 Fri, 29 May 2026 23:11:41 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=6G/FV0xB7LwyVSqYdvffTMhDTjvgggyu2/895b41Cg8=; b=EgS1tocFYMgdSbjDK22FbZEemR
	Iilh0xI3blQTCARjajo5Z4k0fQkTgs5zDuidvAVi9DxUEpDykqT9TYLekeR3mULR9pqnu09MW3C5G
	eTynBgAM4eB8y6Yer/zsTl3yHNyVAQqZjCEAkA4iqpcUGezkaOEkm8d/yCQMjRNdq0oA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Switch qemu-arm* jobs to using the distro provided QEMU
Message-Id: <E1wT6Mf-000v6B-36@xenbits.xenproject.org>
Date: Fri, 29 May 2026 23:11:41 +0000

commit 3c0c177ff9043c48f936fa5f8127132719c113af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Sep 11 00:02:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Switch qemu-arm* jobs to using the distro provided QEMU
    
    This removes qemu-system-aarch64-6.0.0-*-export and fixes the outstanding
    TODOs about efi-virtio.rom, now that the QEMU in use has it's /usr/share/
    properly packaged.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/gitlab-ci/build.yaml                    | 33 ----------
 automation/gitlab-ci/test.yaml                     |  2 -
 automation/scripts/include/xtf-arm64               |  7 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh        |  6 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh        |  6 +-
 automation/scripts/qemu-smoke-dom0less-arm32.sh    |  6 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh    |  6 +-
 .../qemu-system-aarch64/6.0.0-arm64v8.dockerfile   | 77 ----------------------
 8 files changed, 10 insertions(+), 133 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a1acf2e827..0e5fb26c85 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -266,39 +266,6 @@
   variables:
     <<: *gcc
 
-## Test artifacts common
-
-.test-jobs-artifact-common:
-  stage: build
-  needs: []
-  rules:
-    - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
-      when: on_success
-
-# Arm test artifacts
-
-qemu-system-aarch64-6.0.0-arm64-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
-  script:
-    - mkdir binaries && cp /qemu-system-aarch64 binaries/qemu-system-aarch64
-  artifacts:
-    paths:
-      - binaries/qemu-system-aarch64
-  tags:
-    - arm64
-
-qemu-system-aarch64-6.0.0-arm32-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
-  script:
-    - mkdir binaries && cp /qemu-system-arm binaries/qemu-system-arm
-  artifacts:
-    paths:
-      - binaries/qemu-system-arm
-  tags:
-    - arm64
-
 # Jobs below this line
 
 # Build jobs needed for tests
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 008deef98d..1722800c15 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -12,7 +12,6 @@
   - project: $ARTIFACTS_REPO
     job: alpine-3.18-arm64-rootfs
     ref: $ARTIFACTS_BRANCH
-  - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
   # Bodge to ensure binaries/ is non-root.  Can be any artefact which comes
@@ -21,7 +20,6 @@
   - project: $ARTIFACTS_REPO
     job: microcode-x86
     ref: $ARTIFACTS_BRANCH
-  - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
   - project: $ARTIFACTS_REPO
diff --git a/automation/scripts/include/xtf-arm64 b/automation/scripts/include/xtf-arm64
index 1a318b7aa0..5d851af788 100644
--- a/automation/scripts/include/xtf-arm64
+++ b/automation/scripts/include/xtf-arm64
@@ -7,7 +7,7 @@
 function xtf_arch_prepare()
 {
     export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}"
-    export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
     export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
     export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=dtuart}"
     export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}"
@@ -18,9 +18,6 @@ function xtf_arch_prepare()
 # Perform arch-specific XTF environment setup.
 function xtf_arch_setup()
 {
-    # QEMU looks for "efi-virtio.rom" even if it is unneeded
-    curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-
     # Crude check for local testing
     if [ ! -d imagebuilder ]; then
         git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
@@ -47,7 +44,7 @@ EOF
     cp ${XTF_BINARY} ${WORKDIR}/xtf-test
 
     # Generate virt-gicv2.dtb
-    ${WORKDIR}/qemu-system-aarch64 \
+    ${QEMU_PREFIX}qemu-system-aarch64 \
         -machine virtualization=true \
         -cpu cortex-a57 \
         -machine type=virt \
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 58797f7d30..5dc348c71a 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -39,9 +39,7 @@ cp ../zImage ./root
 find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
 cd ..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./qemu-system-arm \
+qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -77,7 +75,7 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 rm -f ${serial_log}
-export TEST_CMD="./qemu-system-arm \
+export TEST_CMD="qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 05962bdc02..1d673f1842 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -57,9 +57,7 @@ chmod +x etc/local.d/xen.start
 find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
+qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
    -m 2048 -smp 2 -display none \
@@ -90,7 +88,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 
 # Run the test
 rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 627d890a39..20e43b4f04 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -78,9 +78,7 @@ chmod +x init
 find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
 cd ..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./qemu-system-arm \
+qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -130,7 +128,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 # Run the test
 rm -f ${serial_log}
-export TEST_CMD="./qemu-system-arm \
+export TEST_CMD="qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 05c4a6acbb..a9e99f1ae3 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -78,9 +78,7 @@ if [[ "${test_variant}" == "gicv3" ]]; then
     domU_check="echo \"${passed}\""
 fi
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
+qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
    -m 2048 -smp 2 -display none \
@@ -203,7 +201,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 
 # Run the test
 rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
diff --git a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
deleted file mode 100644
index e9f5576be7..0000000000
--- a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
+++ /dev/null
@@ -1,77 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV QEMU_VERSION=6.0.0
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        curl \
-        python3 \
-        ninja-build \
-        pkg-config \
-        libglib2.0-dev \
-        libpixman-1-dev \
-        && \
-    \
-    curl -fsSLO https://download.qemu.org/qemu-"$QEMU_VERSION".tar.xz && \
-    tar xvJf qemu-"$QEMU_VERSION".tar.xz && \
-    cd qemu-"$QEMU_VERSION" && \
-    ./configure                \
-        --target-list=arm-softmmu,aarch64-softmmu \
-        --enable-system        \
-        --disable-blobs        \
-        --disable-bsd-user     \
-        --disable-debug-info   \
-        --disable-glusterfs    \
-        --disable-gtk          \
-        --disable-guest-agent  \
-        --disable-linux-user   \
-        --disable-sdl          \
-        --disable-spice        \
-        --disable-tpm          \
-        --disable-vhost-net    \
-        --disable-vhost-scsi   \
-        --disable-vhost-user   \
-        --disable-vhost-vsock  \
-        --disable-virtfs       \
-        --disable-vnc          \
-        --disable-werror       \
-        --disable-xen          \
-        --disable-safe-stack   \
-        --disable-libssh       \
-        --disable-opengl       \
-        --disable-tools        \
-        --disable-virglrenderer  \
-        --disable-stack-protector  \
-        --disable-containers   \
-        --disable-replication  \
-        --disable-cloop        \
-        --disable-dmg          \
-        --disable-vvfat        \
-        --disable-vdi          \
-        --disable-parallels    \
-        --disable-qed          \
-        --disable-bochs        \
-        --disable-qom-cast-debug  \
-        --disable-vhost-vdpa   \
-        --disable-vhost-kernel \
-        --disable-qcow1        \
-        --disable-live-block-migration \
-    && \
-    make -j$(nproc) && \
-    cp ./build/qemu-system-aarch64 / && \
-    cp ./build/qemu-system-arm / && \
-    cd /build && \
-    rm -rf qemu-"$QEMU_VERSION"* && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat May 30 00:00:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 30 May 2026 00:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322800.1589008 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77T-0004Y4-Kc; Sat, 30 May 2026 00:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322800.1589008; Sat, 30 May 2026 00:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77T-0004XS-Et; Sat, 30 May 2026 00:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1322800;
 Sat, 30 May 2026 00:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT77R-0003vg-VP
 for xen-changelog@lists.xenproject.org; Sat, 30 May 2026 00:00:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77R-00CgNE-2m
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77R-000zDg-2f
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:01 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=1dptCR7HG3OLCw8rA4hM1ZH+rGhlVuFJcOSOuMC3LmE=; b=Wp1eZ4GbeW+RYrU9WC8oLLD7aj
	TRmhvs/HE9APlJNHQbbywLjtOjvKc1YVp/ndYVsDXnPu8sR1L7RCkyG5mMRtpIu5dKTROzh1QoHKx
	JqPQwj/MEkZ1c+Q/2f98zdXWP8BT2nI1ep8XPVETqwwdfQB1PzkhnT0VURWxlQ1Ha7Es=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Adjust test needs[] to ensure binaries/ is non-root
Message-Id: <E1wT77R-000zDg-2f@xenbits.xenproject.org>
Date: Sat, 30 May 2026 00:00:01 +0000

commit 2ca218af23221975d25ed69709f6b108ff34773a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 20:10:25 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Adjust test needs[] to ensure binaries/ is non-root
    
    The binaries/ directory is a composition from the artefacts, and also used as
    a working directory for most of the tests.  If the very first artefact is from
    a root container, then the test must also be a root container to use it as a
    working directory.
    
    For arm64, the existing linux-arm64 artefact suffices.  For arm32, pull in the
    microcode-x86 artefact as it's the smallest available.  This bodge can be
    removed when all build containers have become non-root.
    
    For the qemu-xtf-dom0less-arm64-*-xen-version jobs, use *arm64-test-needs
    ahead of alpine-3.18-gcc-* (as it's a root container), and to deduplicate
    the *-export dependency.
    
    This will allow us to change containers to being non-root one at a time,
    rather than all in one go.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/gitlab-ci/test.yaml | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 8770c523e2..517af17324 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -15,6 +15,12 @@
   - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
+  # Bodge to ensure binaries/ is non-root.  Can be any artefact which comes
+  # from a non-root container, and microcode-x86 is the smallest.  Remove when
+  # all build containers have become non-root.
+  - project: $ARTIFACTS_REPO
+    job: microcode-x86
+    ref: $ARTIFACTS_BRANCH
   - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
@@ -569,16 +575,16 @@ qemu-xtf-dom0less-arm64-gcc-hyp-xen-version:
   script:
     - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
+    - *arm64-test-needs
     - alpine-3.18-gcc-arm64
-    - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-xtf-dom0less-arm64-gcc-debug-hyp-xen-version:
   extends: .qemu-arm64
   script:
     - ./automation/scripts/qemu-xtf.sh arm64 mmu64le hyp-xen-version 2>&1 | tee ${LOGFILE}
   needs:
+    - *arm64-test-needs
     - alpine-3.18-gcc-debug-arm64
-    - qemu-system-aarch64-6.0.0-arm64-export
 
 qemu-smoke-dom0-arm32-gcc:
   extends: .qemu-arm32
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat May 30 00:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 30 May 2026 00:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322801.1589012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77d-0005Kl-KB; Sat, 30 May 2026 00:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322801.1589012; Sat, 30 May 2026 00:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77d-0005Kd-GM; Sat, 30 May 2026 00:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1322801;
 Sat, 30 May 2026 00:00:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT77b-0005K7-Vq
 for xen-changelog@lists.xenproject.org; Sat, 30 May 2026 00:00:11 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77b-00CgqZ-35
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77b-000zHr-2x
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:11 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=V1mK+X9eDF5kNmmCp//xUAdoTy+w62E+fY4kSIcmI/M=; b=3nBbjiyeerkfPqbBVW5A/qvTqY
	io7ePiCgcFoqcFEtDG8UTtjrbvsqQcubzoUBFJ/KVNUU94Gfj26O/cbh+K3hYaEYJbKsJXSDrFkOG
	/ngn1Cwv/SPii2+OBP+Iw+r0fun7Wx3KvKMX3ufnY/SbP0nMlc7ieLkxrbku2XrvQvI0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Refresh the Debian 12 arm32 cross compile container
Message-Id: <E1wT77b-000zHr-2x@xenbits.xenproject.org>
Date: Sat, 30 May 2026 00:00:11 +0000

commit 81c9fa421dbcc745a61b42a3e6d67bc7a134ef4a
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Tue Oct 22 16:55:02 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Refresh the Debian 12 arm32 cross compile container
    
    Rework the container to user heredocs for readability, derive from
    bookworm-slim and use apt-get --no-install-recommends to keep the size down.
    
    Convert it to being a non-root container.  Add checkpolicy as FLASK is an
    available build option for arm32 under Randconfig testing.
    
    Rename the CI jobs to debian-12-arm32-* to follow the naming scheme of all the
    other CI jobs.
    
    No functional change.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 .../build/debian/12-arm64v8-arm32.dockerfile       | 32 ++++++++++++++++++++++
 .../debian/bookworm-arm64v8-arm32-gcc.dockerfile   | 24 ----------------
 automation/gitlab-ci/build.yaml                    | 24 ++++++++--------
 automation/gitlab-ci/test.yaml                     | 14 +++++-----
 automation/scripts/containerize                    |  2 +-
 5 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/automation/build/debian/12-arm64v8-arm32.dockerfile b/automation/build/debian/12-arm64v8-arm32.dockerfile
new file mode 100644
index 0000000000..a4d70f1111
--- /dev/null
+++ b/automation/build/debian/12-arm64v8-arm32.dockerfile
@@ -0,0 +1,32 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+        gcc-arm-linux-gnueabihf
+    )
+
+    apt-get --yes --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile b/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
deleted file mode 100644
index 95b3f04283..0000000000
--- a/automation/build/debian/bookworm-arm64v8-arm32-gcc.dockerfile
+++ /dev/null
@@ -1,24 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-ENV CROSS_COMPILE /usr/bin/arm-linux-gnueabihf-
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        flex \
-        bison \
-        git \
-        gcc-arm-linux-gnueabihf \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 7f5b5938e8..2189ee0b9e 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -360,52 +360,52 @@ debian-13-riscv64-gcc-debug:
 
 # Arm32 cross-build
 
-debian-bookworm-gcc-arm32:
+debian-12-arm32-gcc:
   extends: .gcc-arm32-cross-build
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-debug:
+debian-12-arm32-gcc-debug:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
 
-debian-bookworm-gcc-arm32-randconfig:
+debian-12-arm32-gcc-randconfig:
   extends: .gcc-arm32-cross-build
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     RANDCONFIG: y
 
-debian-bookworm-gcc-arm32-debug-staticmem:
+debian-12-arm32-gcc-debug-staticmem:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_EXPERT=y
       CONFIG_UNSUPPORTED=y
       CONFIG_STATIC_MEMORY=y
 
-debian-bookworm-gcc-arm32-debug-earlyprintk:
+debian-12-arm32-gcc-debug-earlyprintk:
   extends: .gcc-arm32-cross-build-debug
   <<: *build-test
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_EARLY_UART_CHOICE_PL011=y
       CONFIG_EARLY_UART_BASE_ADDRESS=0x9000000
 
-debian-bookworm-gcc-arm32-debug-mpu:
+debian-12-arm32-gcc-debug-mpu:
   extends: .gcc-arm32-cross-build-debug
   variables:
-    CONTAINER: debian:bookworm-arm64v8-arm32-gcc
+    CONTAINER: debian:12-arm64v8-arm32
     HYPERVISOR_ONLY: y
     EXTRA_XEN_CONFIG: |
       CONFIG_XEN_START_ADDRESS=0x0
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 517af17324..e1d6bb5056 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -600,7 +600,7 @@ qemu-smoke-dom0less-arm32-gcc:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32
+    - debian-12-arm32-gcc
 
 qemu-smoke-dom0less-arm32-gcc-debug:
   extends: .qemu-arm32
@@ -608,7 +608,7 @@ qemu-smoke-dom0less-arm32-gcc-debug:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
   extends: .qemu-arm32
@@ -616,7 +616,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-staticmem:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh static-mem 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug-staticmem
+    - debian-12-arm32-gcc-debug-staticmem
 
 qemu-smoke-dom0less-arm32-gcc-debug-gzip:
   extends: .qemu-arm32
@@ -624,7 +624,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-gzip:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh gzip 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-without-dom0:
   extends: .qemu-arm32
@@ -632,7 +632,7 @@ qemu-smoke-dom0less-arm32-gcc-without-dom0:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32
+    - debian-12-arm32-gcc
 
 qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
   extends: .qemu-arm32
@@ -640,7 +640,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-without-dom0:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh without-dom0 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug
+    - debian-12-arm32-gcc-debug
 
 qemu-smoke-dom0less-arm32-gcc-debug-earlyprintk:
   extends: .qemu-arm32
@@ -648,7 +648,7 @@ qemu-smoke-dom0less-arm32-gcc-debug-earlyprintk:
     - ./automation/scripts/qemu-smoke-dom0less-arm32.sh earlyprintk 2>&1 | tee ${LOGFILE}
   needs:
     - *arm32-test-needs
-    - debian-bookworm-gcc-arm32-debug-earlyprintk
+    - debian-12-arm32-gcc-debug-earlyprintk
 
 qemu-alpine-x86_64-gcc:
   extends: .qemu-x86-64
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index ad3e237270..ef3b97b655 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -38,7 +38,7 @@ case "_${CONTAINER}" in
     _bookworm|_bookworm-x86_64) CONTAINER="${BASE}/debian:12-x86_64" ;;
     _trixie-x86_64|_) CONTAINER="${BASE}/debian:13-x86_64" ;;
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
-    _bookworm-arm64v8-arm32-gcc) CONTAINER="${BASE}/debian:bookworm-arm64v8-arm32-gcc" ;;
+    _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat May 30 00:00:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 30 May 2026 00:00:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322802.1589014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77n-0005PO-TY; Sat, 30 May 2026 00:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322802.1589014; Sat, 30 May 2026 00:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77n-0005PG-Qq; Sat, 30 May 2026 00:00:23 +0000
Received: by outflank-mailman (input) for mailman id 1322802;
 Sat, 30 May 2026 00:00:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT77m-0005P9-2T
 for xen-changelog@lists.xenproject.org; Sat, 30 May 2026 00:00:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77m-00Cgzj-09
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77m-000zJ2-02
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:22 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=rvbnYL7K9jUE6jNfNHn3C+H0EhW/MIzFha1eWglKOm8=; b=FWfcfX1epJ8i3++dIqNfrDdaw9
	Joz0CD0hpN25rnPks4/LgUuvVQTjDiuFuOvbG8Y9IHgDKWGvtxD/0ovlUZ61CRrX10vzArrAGxwce
	/LrHAw/kq1g8w6Huwh+Li4mOhwL1n64+QlCr5h8gKIN93lWqetR/YAuC/9TNmYKTzcxs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Refresh the Debian 12 arm64 container
Message-Id: <E1wT77m-000zJ2-02@xenbits.xenproject.org>
Date: Sat, 30 May 2026 00:00:22 +0000

commit 4d8aa53ed1edd235c8369007ca0096f4a3f12c4f
Author:     Javi Merino <javi.merino@cloud.com>
AuthorDate: Fri Oct 18 13:40:35 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Refresh the Debian 12 arm64 container
    
    Rework the container to user heredocs for readability, derive from
    bookworm-slim and use apt-get --no-install-recommends to keep the size down.
    
    Additionally:
    
     * Make it a non-root container.
     * Drop libext2fs-dev which is an x86-only dependency.
     * Add libncurses5-dev for xentop and zlib1g-dev which was missing from the
       libxenguest decompressors.
     * As there's no ninja, the container can no loger build QEMU so drop
       libglib2.0-dev and libpixman-1-dev too.
     * Swap libyajl-dev for libjson-c-dev given the deprecation of the former.
    
    Rename the job to debian-12-arm64-* to follow the naming scheme of all the
    other CI jobs.
    
    This reduces the size of the debian:12-arm64v8 from 2.25GB down to 1.62GB.
    
    Signed-off-by: Javi Merino <javi.merino@cloud.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/build/debian/12-arm64v8.dockerfile      | 69 ++++++++++++++++++++++
 .../build/debian/bookworm-arm64v8.dockerfile       | 55 -----------------
 automation/gitlab-ci/build.yaml                    |  8 +--
 automation/gitlab-ci/test.yaml                     |  4 +-
 automation/scripts/containerize                    |  2 +-
 5 files changed, 76 insertions(+), 62 deletions(-)

diff --git a/automation/build/debian/12-arm64v8.dockerfile b/automation/build/debian/12-arm64v8.dockerfile
new file mode 100644
index 0000000000..c0e08a010f
--- /dev/null
+++ b/automation/build/debian/12-arm64v8.dockerfile
@@ -0,0 +1,69 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+
+        # Tools (general)
+        ca-certificates
+        cpio
+        git-core
+        pkg-config
+        wget
+        # libxenguest dombuilder
+        libbz2-dev
+        liblzma-dev
+        liblzo2-dev
+        libzstd-dev
+        zlib1g-dev
+        # libacpi
+        acpica-tools
+        # libxl
+        libfdt-dev
+        libjson-c-dev
+        uuid-dev
+        # xentop
+        libncurses5-dev
+        # Python bindings
+        python3-dev
+        python3-setuptools
+        # Golang bindings
+        golang-go
+        # Ocaml bindings/oxenstored
+        ocaml-nox
+        ocaml-findlib
+
+        # for test phase, qemu-* jobs
+        busybox-static
+        curl
+        device-tree-compiler
+        expect
+        file
+        ovmf
+        u-boot-qemu
+        u-boot-tools
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile
deleted file mode 100644
index da8ae75125..0000000000
--- a/automation/build/debian/bookworm-arm64v8.dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        zlib1g-dev \
-        libncurses5-dev \
-        python3-dev \
-        python3-setuptools \
-        uuid-dev \
-        libyajl-dev \
-        libaio-dev \
-        libglib2.0-dev \
-        clang \
-        libpixman-1-dev \
-        pkg-config \
-        flex \
-        bison \
-        acpica-tools \
-        libfdt-dev \
-        bin86 \
-        bcc \
-        liblzma-dev \
-        libnl-3-dev \
-        ocaml-nox \
-        libfindlib-ocaml-dev \
-        markdown \
-        transfig \
-        pandoc \
-        checkpolicy \
-        wget \
-        git \
-        nasm \
-        # for test phase, qemu-smoke-* jobs
-        u-boot-qemu \
-        u-boot-tools \
-        device-tree-compiler \
-        curl \
-        cpio \
-        busybox-static \
-        expect \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 2189ee0b9e..128b5f45cb 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -414,15 +414,15 @@ debian-12-arm32-gcc-debug-mpu:
 
 # Arm builds
 
-debian-bookworm-gcc-arm64:
+debian-12-arm64-gcc:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
-debian-bookworm-gcc-debug-arm64:
+debian-12-arm64-gcc-debug:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index e1d6bb5056..982fd86db0 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -37,7 +37,7 @@
 .qemu-arm64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm64.log
   artifacts:
     paths:
@@ -50,7 +50,7 @@
 .qemu-arm32:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm32.log
   artifacts:
     paths:
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index ef3b97b655..bda06054eb 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -39,7 +39,7 @@ case "_${CONTAINER}" in
     _trixie-x86_64|_) CONTAINER="${BASE}/debian:13-x86_64" ;;
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
     _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
-    _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
+    _bookworm-arm64v8) CONTAINER="${BASE}/debian:12-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat May 30 00:00:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 30 May 2026 00:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322803.1589020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77x-0005VK-1Q; Sat, 30 May 2026 00:00:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322803.1589020; Sat, 30 May 2026 00:00:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT77w-0005VD-U7; Sat, 30 May 2026 00:00:32 +0000
Received: by outflank-mailman (input) for mailman id 1322803;
 Sat, 30 May 2026 00:00:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT77w-0005Rd-59
 for xen-changelog@lists.xenproject.org; Sat, 30 May 2026 00:00:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77w-00Cgzp-0R
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT77w-000zJW-0J
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:32 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=nb0a7J2uRnHSfIKn2TcCdmg7MWzBAMMapjRyZ/BJH4c=; b=r6qIUXX1AEaMneMB3azmC8HVgA
	NNjymzZGdW2djjbk5uLQVuCvZQKbAEKnfOMmC1gOIV1+Et39uDHt4klun7LAXwTLBRhK7G2KmDDJG
	LSoxS52O6HKyJC89P75vhYIJ3Uri9KtCeu3f3/YkSJPRIxdh0qJQXPQyt2K8/PYlVRHM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Add a Debian 13 (Trixie) arm64 container
Message-Id: <E1wT77w-000zJW-0J@xenbits.xenproject.org>
Date: Sat, 30 May 2026 00:00:32 +0000

commit eac95d129db499cbc7dd7fbf60995160a616f6fe
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 8 20:48:44 2026 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Add a Debian 13 (Trixie) arm64 container
    
    Exactly as per the Bookworm container, but additionally with the ipxe-qemu and
    qemu-system-aarch64 packages.  These will be used to remove the export jobs.
    
    Switch qemu-arm{32,64} test jobs to use this container, and add two new build
    tests.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/build/debian/13-arm64v8.dockerfile | 71 +++++++++++++++++++++++++++
 automation/gitlab-ci/build.yaml               | 10 ++++
 automation/gitlab-ci/test.yaml                |  4 +-
 automation/scripts/containerize               |  1 +
 4 files changed, 84 insertions(+), 2 deletions(-)

diff --git a/automation/build/debian/13-arm64v8.dockerfile b/automation/build/debian/13-arm64v8.dockerfile
new file mode 100644
index 0000000000..b9062ee8b4
--- /dev/null
+++ b/automation/build/debian/13-arm64v8.dockerfile
@@ -0,0 +1,71 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:trixie-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+
+        # Tools (general)
+        ca-certificates
+        cpio
+        git-core
+        pkg-config
+        wget
+        # libxenguest dombuilder
+        libbz2-dev
+        liblzma-dev
+        liblzo2-dev
+        libzstd-dev
+        zlib1g-dev
+        # libacpi
+        acpica-tools
+        # libxl
+        libfdt-dev
+        libjson-c-dev
+        uuid-dev
+        # xentop
+        libncurses5-dev
+        # Python bindings
+        python3-dev
+        python3-setuptools
+        # Golang bindings
+        golang-go
+        # Ocaml bindings/oxenstored
+        ocaml-nox
+        ocaml-findlib
+
+        # for test phase, qemu-* jobs
+        busybox-static
+        curl
+        device-tree-compiler
+        expect
+        file
+        ipxe-qemu
+        ovmf
+        qemu-system-aarch64
+        u-boot-qemu
+        u-boot-tools
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 128b5f45cb..a1acf2e827 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -424,6 +424,16 @@ debian-12-arm64-gcc-debug:
   variables:
     CONTAINER: debian:12-arm64v8
 
+debian-13-arm64-gcc:
+  extends: .gcc-arm64-build
+  variables:
+    CONTAINER: debian:13-arm64v8
+
+debian-13-arm64-gcc-debug:
+  extends: .gcc-arm64-build-debug
+  variables:
+    CONTAINER: debian:13-arm64v8
+
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
   <<: *build-test
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 982fd86db0..008deef98d 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -37,7 +37,7 @@
 .qemu-arm64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:12-arm64v8
+    CONTAINER: debian:13-arm64v8
     LOGFILE: qemu-smoke-arm64.log
   artifacts:
     paths:
@@ -50,7 +50,7 @@
 .qemu-arm32:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:12-arm64v8
+    CONTAINER: debian:13-arm64v8
     LOGFILE: qemu-smoke-arm32.log
   artifacts:
     paths:
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index bda06054eb..8bd2a847aa 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -41,6 +41,7 @@ case "_${CONTAINER}" in
     _bookworm-arm64v8-arm32) CONTAINER="${BASE}/debian:12-arm64v8-arm32" ;;
     _bookworm-arm64v8) CONTAINER="${BASE}/debian:12-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:12-arm64v8-cppcheck" ;;
+    _trixie-arm64v8) CONTAINER="${BASE}/debian:13-arm64v8" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
     _xenial) CONTAINER="${BASE}/ubuntu:16.04-x86_64" ;;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat May 30 00:00:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 30 May 2026 00:00:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1322804.1589022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT787-0005fH-1x; Sat, 30 May 2026 00:00:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1322804.1589022; Sat, 30 May 2026 00:00:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1wT786-0005f9-Vh; Sat, 30 May 2026 00:00:42 +0000
Received: by outflank-mailman (input) for mailman id 1322804;
 Sat, 30 May 2026 00:00:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1wT786-0005f3-8p
 for xen-changelog@lists.xenproject.org; Sat, 30 May 2026 00:00:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT786-00Cgzv-0l
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1wT786-000zK0-0c
 for xen-changelog@lists.xenproject.org;
 Sat, 30 May 2026 00:00:42 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=y5TvsbkGEzdB+jm5KdJd5wDSQ6jHu7qqs1LI/5i59YQ=; b=33r2B+Otkt9Nb/w5B93v5JFOtP
	qsVKk8n9lG20bnZbXM3j8e+h8JkAgNM0eTFYiprefwj1lXyj/WNvIxae6kIDEYimmO3bVhtO0te5q
	Uec0ZabEoV80AuC5NKsfbuKXTuTBHoNg7AGRN5l7kE6eQKsJTPpWGrnQwhUjNd4N9ZRU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Switch qemu-arm* jobs to using the distro provided QEMU
Message-Id: <E1wT786-000zK0-0c@xenbits.xenproject.org>
Date: Sat, 30 May 2026 00:00:42 +0000

commit 3c0c177ff9043c48f936fa5f8127132719c113af
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Sep 11 00:02:02 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri May 29 23:13:02 2026 +0100

    CI: Switch qemu-arm* jobs to using the distro provided QEMU
    
    This removes qemu-system-aarch64-6.0.0-*-export and fixes the outstanding
    TODOs about efi-virtio.rom, now that the QEMU in use has it's /usr/share/
    properly packaged.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 automation/gitlab-ci/build.yaml                    | 33 ----------
 automation/gitlab-ci/test.yaml                     |  2 -
 automation/scripts/include/xtf-arm64               |  7 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh        |  6 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh        |  6 +-
 automation/scripts/qemu-smoke-dom0less-arm32.sh    |  6 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh    |  6 +-
 .../qemu-system-aarch64/6.0.0-arm64v8.dockerfile   | 77 ----------------------
 8 files changed, 10 insertions(+), 133 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index a1acf2e827..0e5fb26c85 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -266,39 +266,6 @@
   variables:
     <<: *gcc
 
-## Test artifacts common
-
-.test-jobs-artifact-common:
-  stage: build
-  needs: []
-  rules:
-    - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
-      when: on_success
-
-# Arm test artifacts
-
-qemu-system-aarch64-6.0.0-arm64-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
-  script:
-    - mkdir binaries && cp /qemu-system-aarch64 binaries/qemu-system-aarch64
-  artifacts:
-    paths:
-      - binaries/qemu-system-aarch64
-  tags:
-    - arm64
-
-qemu-system-aarch64-6.0.0-arm32-export:
-  extends: .test-jobs-artifact-common
-  image: registry.gitlab.com/xen-project/xen/tests-artifacts/qemu-system-aarch64:6.0.0-arm64v8
-  script:
-    - mkdir binaries && cp /qemu-system-arm binaries/qemu-system-arm
-  artifacts:
-    paths:
-      - binaries/qemu-system-arm
-  tags:
-    - arm64
-
 # Jobs below this line
 
 # Build jobs needed for tests
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 008deef98d..1722800c15 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -12,7 +12,6 @@
   - project: $ARTIFACTS_REPO
     job: alpine-3.18-arm64-rootfs
     ref: $ARTIFACTS_BRANCH
-  - qemu-system-aarch64-6.0.0-arm64-export
 
 .arm32-test-needs: &arm32-test-needs
   # Bodge to ensure binaries/ is non-root.  Can be any artefact which comes
@@ -21,7 +20,6 @@
   - project: $ARTIFACTS_REPO
     job: microcode-x86
     ref: $ARTIFACTS_BRANCH
-  - qemu-system-aarch64-6.0.0-arm32-export
 
 .x86-64-test-needs: &x86-64-test-needs
   - project: $ARTIFACTS_REPO
diff --git a/automation/scripts/include/xtf-arm64 b/automation/scripts/include/xtf-arm64
index 1a318b7aa0..5d851af788 100644
--- a/automation/scripts/include/xtf-arm64
+++ b/automation/scripts/include/xtf-arm64
@@ -7,7 +7,7 @@
 function xtf_arch_prepare()
 {
     export FW_PREFIX="${FW_PREFIX:-/usr/lib/u-boot/qemu_arm64/}"
-    export QEMU_PREFIX="${QEMU_PREFIX:-${WORKDIR}/}"
+    export QEMU_PREFIX="${QEMU_PREFIX:-}"
     export XEN_BINARY="${XEN_BINARY:-${WORKDIR}/xen}"
     export XEN_CMDLINE="${XEN_CMDLINE:-loglvl=all noreboot console_timestamps=boot console=dtuart}"
     export XTF_SRC_BRANCH="${XTF_SRC_BRANCH:-xtf-arm}"
@@ -18,9 +18,6 @@ function xtf_arch_prepare()
 # Perform arch-specific XTF environment setup.
 function xtf_arch_setup()
 {
-    # QEMU looks for "efi-virtio.rom" even if it is unneeded
-    curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-
     # Crude check for local testing
     if [ ! -d imagebuilder ]; then
         git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
@@ -47,7 +44,7 @@ EOF
     cp ${XTF_BINARY} ${WORKDIR}/xtf-test
 
     # Generate virt-gicv2.dtb
-    ${WORKDIR}/qemu-system-aarch64 \
+    ${QEMU_PREFIX}qemu-system-aarch64 \
         -machine virtualization=true \
         -cpu cortex-a57 \
         -machine type=virt \
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 58797f7d30..5dc348c71a 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -39,9 +39,7 @@ cp ../zImage ./root
 find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
 cd ..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./qemu-system-arm \
+qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -77,7 +75,7 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 rm -f ${serial_log}
-export TEST_CMD="./qemu-system-arm \
+export TEST_CMD="qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 05962bdc02..1d673f1842 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -57,9 +57,7 @@ chmod +x etc/local.d/xen.start
 find . | cpio -R 0:0 -H newc -o | gzip >> ../dom0-rootfs.cpio.gz
 cd ../..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
+qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt \
    -m 2048 -smp 2 -display none \
@@ -90,7 +88,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 
 # Run the test
 rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 627d890a39..20e43b4f04 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -78,9 +78,7 @@ chmod +x init
 find . | cpio -R 0:0 -H newc -o | gzip > ../initrd.gz
 cd ..
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./qemu-system-arm \
+qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -130,7 +128,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 # Run the test
 rm -f ${serial_log}
-export TEST_CMD="./qemu-system-arm \
+export TEST_CMD="qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 05c4a6acbb..a9e99f1ae3 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -78,9 +78,7 @@ if [[ "${test_variant}" == "gicv3" ]]; then
     domU_check="echo \"${passed}\""
 fi
 
-# XXX QEMU looks for "efi-virtio.rom" even if it is unneeded
-curl -fsSLO https://github.com/qemu/qemu/raw/v5.2.0/pc-bios/efi-virtio.rom
-./binaries/qemu-system-aarch64 \
+qemu-system-aarch64 \
    -machine virtualization=true \
    -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
    -m 2048 -smp 2 -display none \
@@ -203,7 +201,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 
 # Run the test
 rm -f smoke.serial
-export TEST_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
diff --git a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile b/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
deleted file mode 100644
index e9f5576be7..0000000000
--- a/automation/tests-artifacts/qemu-system-aarch64/6.0.0-arm64v8.dockerfile
+++ /dev/null
@@ -1,77 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV QEMU_VERSION=6.0.0
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        curl \
-        python3 \
-        ninja-build \
-        pkg-config \
-        libglib2.0-dev \
-        libpixman-1-dev \
-        && \
-    \
-    curl -fsSLO https://download.qemu.org/qemu-"$QEMU_VERSION".tar.xz && \
-    tar xvJf qemu-"$QEMU_VERSION".tar.xz && \
-    cd qemu-"$QEMU_VERSION" && \
-    ./configure                \
-        --target-list=arm-softmmu,aarch64-softmmu \
-        --enable-system        \
-        --disable-blobs        \
-        --disable-bsd-user     \
-        --disable-debug-info   \
-        --disable-glusterfs    \
-        --disable-gtk          \
-        --disable-guest-agent  \
-        --disable-linux-user   \
-        --disable-sdl          \
-        --disable-spice        \
-        --disable-tpm          \
-        --disable-vhost-net    \
-        --disable-vhost-scsi   \
-        --disable-vhost-user   \
-        --disable-vhost-vsock  \
-        --disable-virtfs       \
-        --disable-vnc          \
-        --disable-werror       \
-        --disable-xen          \
-        --disable-safe-stack   \
-        --disable-libssh       \
-        --disable-opengl       \
-        --disable-tools        \
-        --disable-virglrenderer  \
-        --disable-stack-protector  \
-        --disable-containers   \
-        --disable-replication  \
-        --disable-cloop        \
-        --disable-dmg          \
-        --disable-vvfat        \
-        --disable-vdi          \
-        --disable-parallels    \
-        --disable-qed          \
-        --disable-bochs        \
-        --disable-qom-cast-debug  \
-        --disable-vhost-vdpa   \
-        --disable-vhost-kernel \
-        --disable-qcow1        \
-        --disable-live-block-migration \
-    && \
-    make -j$(nproc) && \
-    cp ./build/qemu-system-aarch64 / && \
-    cp ./build/qemu-system-arm / && \
-    cd /build && \
-    rm -rf qemu-"$QEMU_VERSION"* && \
-    apt-get autoremove -y && \
-    apt-get clean && \
-    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
--
generated by git-patchbot for /home/xen/git/xen.git#master


