From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218529.1527281 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrpe-0007tw-Ha; Mon, 02 Feb 2026 11:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218529.1527281; Mon, 02 Feb 2026 11: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 1vmrpe-0007tn-EG; Mon, 02 Feb 2026 11:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1218529;
 Mon, 02 Feb 2026 11: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 1vmrpd-0007th-Sn
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrpe-00GxCj-0O
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrpd-00DazH-2N
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=i1t5BtXy+tb9dgFse9rH3qOOehLC9KcxbnsxMpaw+zU=; b=EON3FiqI+4ZWmISWRjRnH7d296
	2l2gdDBJqD96qphnfHCRmlMLPqJ0TCPeuDRv3vs2/Bfoa+GZx0HImHiyMerFncRdm4iWhrmWgdwi5
	PelSEcr8Tlh/TcNvXZHF2InZaLNMurJMxAOPqJH8QPo+Sq44Bv32zHhCR4UtzBbFG+Tg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vmrpd-00DazH-2N@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:01 +0000

commit 45bb2789349b996bef19eeb098b6fe47a2b32f5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:03:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:03:05 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 2aa41306ca..c326538ebb 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -339,6 +339,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218530.1527284 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrpo-0007vW-IN; Mon, 02 Feb 2026 11:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218530.1527284; Mon, 02 Feb 2026 11: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 1vmrpo-0007vP-FZ; Mon, 02 Feb 2026 11:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1218530;
 Mon, 02 Feb 2026 11: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 1vmrpn-0007vD-TY
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrpo-00GxCt-0i
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrpn-00Db06-2i
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=OxEbfT3cL0xwyHthLr+BIHSZDYxV8YB2ttiCBqtfe9w=; b=vkCZUEJ2TVVOSvy8DnnTmGcHfg
	8aKghsyftKLpPpHPyFo41Gwf76olzfmysfU020/TWA1P/nZ+OZEIR7Y5gslJdcOT781kzkSjwtY5k
	xPKJebPj2cCWZJDIZjBO8faByFRgn9MX/421t0O9xFZpsPlrWpj0uvqFPHWjrTiqnQNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: check table sizes don't change between linking passes 2 and 3
Message-Id: <E1vmrpn-00Db06-2i@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:11 +0000

commit 1df11ccceb1a5baea6fd27e2933e94fdeeb69e5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:04:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:04:18 2026 +0100

    symbols: check table sizes don't change between linking passes 2 and 3
    
    While sizes (and possibly positions) of the symbol table related symbols
    (and as a result other ones) are expected to change from linking pass 1
    to pass 2, no such change should happen anymore from pass 2 to pass 3, or
    else the internally recorded symbol table wouldn't represent the ELF or
    PE/COFF ones.
    
    For comparing to be actually useful, i.e. most notably also covering the
    last of the arrays emitted, symbol sizes need establishing. Make use of
    the xen/linkage.h machinery to achieve that.
    
    Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Makefile      |  3 ++
 xen/scripts/Kbuild.include | 13 +++++++
 xen/tools/symbols.c        | 85 ++++++++++++++++++++++------------------------
 3 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 5bf3578983..477e3cbe7a 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -139,6 +139,7 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
+	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
@@ -221,6 +222,8 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(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)
+	$(call compare-symbol-tables, $(dot-target).1s.o, $(dot-target).2s.o)
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).2r.o $(dot-target).2s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index c2e4ec811b..d5e36e7f55 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -56,6 +56,19 @@ define filechk
 	fi
 endef
 
+###
+# Compare the symbol tables of two object files.  As diff's -I option isn't
+# standardized, the name difference of the two object files needs abstracting
+# out.
+define compare-symbol-tables
+    ln -f $(1) $(@D)/.cst.$$$$; \
+    $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \
+    ln -f $(2) $(@D)/.cst.$$$$; \
+    $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \
+    rm -f $(@D)/.cst.$$$$
+    diff -u $(1).sym $(2).sym
+endef
+
 # as-insn: Check whether assembler supports an instruction.
 # Usage: cflags-y += $(call as-insn,CC FLAGS,"insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 509394d5a4..7afe301d3c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -260,17 +260,26 @@ static void read_map(FILE *in)
 	}
 }
 
-static void output_label(char *label)
+static void output_label(const char *label, bool keep)
 {
-	if (symbol_prefix_char)
-		printf(".globl %c%s\n", symbol_prefix_char, label);
-	else
-		printf(".globl %s\n", label);
-	printf("\tALGN\n");
-	if (symbol_prefix_char)
-		printf("%c%s:\n", symbol_prefix_char, label);
-	else
-		printf("%s:\n", label);
+	static bool pending;
+
+	if (pending && !keep) {
+		printf("END(CURRENT)\n");
+		printf("#undef CURRENT\n\n");
+	}
+
+	pending = label;
+	if (!label)
+		return;
+
+	if (symbol_prefix_char) {
+		printf("DATA(%c%s, ALGN)\n", symbol_prefix_char, label);
+		printf("#define CURRENT %c%s\n", symbol_prefix_char, label);
+	} else {
+		printf("DATA(%s, ALGN)\n", label);
+		printf("#define CURRENT %s\n", label);
+	}
 }
 
 /* uncompress a compressed symbol. When this function is called, the best table
@@ -338,22 +347,22 @@ static void write_src(void)
 
 		return;
 	}
-	printf("#include <xen/config.h>\n");
+	printf("#include <xen/linkage.h>\n");
 	printf("#if BITS_PER_LONG == 64 && !defined(SYMBOLS_ORIGIN)\n");
 	printf("#define PTR .quad\n");
-	printf("#define ALGN .balign 8\n");
+	printf("#define ALGN 8\n");
 	printf("#else\n");
 	printf("#define PTR .long\n");
-	printf("#define ALGN .balign 4\n");
+	printf("#define ALGN 4\n");
 	printf("#endif\n");
 
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
 	printf("#define SYMBOLS_ORIGIN 0\n");
-	output_label("symbols_addresses");
+	output_label("symbols_addresses", false);
 	printf("#else\n");
-	output_label("symbols_offsets");
+	output_label("symbols_offsets", true);
 	printf("#endif\n");
 	for (i = 0, ends = 0; i < table_cnt; i++) {
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n", table[i].addr);
@@ -377,17 +386,15 @@ static void write_src(void)
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n",
 		       table[i].addr + table[i].size);
 	}
-	printf("\n");
 
-	output_label("symbols_num_addrs");
+	output_label("symbols_num_addrs", false);
 	printf("\t.long\t%d\n", table_cnt + ends);
-	printf("\n");
 
 	/* table of offset markers, that give the offset in the compressed stream
 	 * every 256 symbols */
 	markers = malloc(sizeof(*markers) * ((table_cnt + ends + 255) >> 8));
 
-	output_label("symbols_names");
+	output_label("symbols_names", false);
 	for (i = 0, off = 0, ends = 0; i < table_cnt; i++) {
 		if (((i + ends) & 0xFF) == 0)
 			markers[(i + ends) >> 8] = off;
@@ -411,15 +418,12 @@ static void write_src(void)
 		printf("\t.byte 0\n");
 		++off;
 	}
-	printf("\n");
 
-	output_label("symbols_markers");
+	output_label("symbols_markers", false);
 	for (i = 0; i < ((table_cnt + ends + 255) >> 8); i++)
 		printf("\t.long\t%d\n", markers[i]);
-	printf("\n");
 
-
-	output_label("symbols_token_table");
+	output_label("symbols_token_table", false);
 	off = 0;
 	for (i = 0; i < 256; i++) {
 		best_idx[i] = off;
@@ -427,34 +431,27 @@ static void write_src(void)
 		printf("\t.asciz\t\"%s\"\n", buf);
 		off += strlen(buf) + 1;
 	}
-	printf("\n");
 
-	output_label("symbols_token_index");
+	output_label("symbols_token_index", false);
 	for (i = 0; i < 256; i++)
 		printf("\t.short\t%d\n", best_idx[i]);
-	printf("\n");
-
-	if (!sort_by_name) {
-		free(markers);
-		return;
-	}
 
-	output_label("symbols_num_names");
-	printf("\t.long\t%d\n", table_cnt);
-	printf("\n");
+	if (sort_by_name) {
+		output_label("symbols_num_names", false);
+		printf("\t.long\t%d\n", table_cnt);
 
-	/* Sorted by original symbol names and type. */
-	qsort(table, table_cnt, sizeof(*table), compare_name_orig);
+		/* Sorted by original symbol names and type. */
+		qsort(table, table_cnt, sizeof(*table), compare_name_orig);
 
-	output_label("symbols_sorted_offsets");
-	/* A fixed sized array with two entries: offset in the
-	 * compressed stream (for symbol name), and offset in
-	 * symbols_addresses (or symbols_offset). */
-	for (i = 0; i < table_cnt; i++) {
-		printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
+		/* A fixed sized array with two entries: offset in the
+		 * compressed stream (for symbol name), and offset in
+		 * symbols_addresses (or symbols_offset). */
+		output_label("symbols_sorted_offsets", false);
+		for (i = 0; i < table_cnt; i++)
+			printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
 	}
-	printf("\n");
 
+	output_label(NULL, false);
 	free(markers);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218531.1527288 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrpy-0007y6-Jo; Mon, 02 Feb 2026 11:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218531.1527288; Mon, 02 Feb 2026 11: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 1vmrpy-0007xy-HB; Mon, 02 Feb 2026 11:11:22 +0000
Received: by outflank-mailman (input) for mailman id 1218531;
 Mon, 02 Feb 2026 11: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 1vmrpy-0007xn-0N
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrpy-00GxCx-11
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrpx-00Db3B-31
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=14eqe1iXJqog0O+oLL61Eh3uUPfxpBbn4sIw9MwiTag=; b=I/Q5mXobPUQD7H7FWZU4+4jmdC
	NuByT1aLoLqsUNkeN8DCyQ5F7bpKRo8HUXroaWtMzyVMNUItvmT7C+xmW0G1F+0junHqSe49qRcGZ
	n43hxK+keoOUnrCXIAz8CJAPjizNvrvFNj7IxYTKOZeuByymn3CMGzRPDmtz44Tmubek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add temporary stub for smp_send_event_check_mask()
Message-Id: <E1vmrpx-00Db3B-31@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:21 +0000

commit 4082de6d43885e9c16b794449e07e9256a08032f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Feb 2 09:05:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:05:03 2026 +0100

    xen/riscv: add temporary stub for smp_send_event_check_mask()
    
    RISC-V SMP support is not yet implemented, but smp_send_event_check_mask()
    is required by common code and vcpu_kick(), which is introduced later.
    Provide a temporary stub implementation that asserts the mask only targets
    CPU0.
    
    cpumask_subset() is used instead of cpumask_equal() because some callers
    (e.g. cpumask_raise_softirq() or cpu_raise_softirq_batch_finish()) may
    legitimately pass an empty mask, which would otherwise cause false
    failures.
    
    The BUG_ON() ensures that attempts to use this function with multiple CPUs
    are caught early once SMP support is introduced.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/smp.c   | 7 +++++++
 xen/arch/riscv/stubs.c | 5 -----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/smp.c b/xen/arch/riscv/smp.c
index 4ca6a4e892..d645364ea4 100644
--- a/xen/arch/riscv/smp.c
+++ b/xen/arch/riscv/smp.c
@@ -1,3 +1,4 @@
+#include <xen/cpumask.h>
 #include <xen/smp.h>
 
 /*
@@ -13,3 +14,9 @@
 struct pcpu_info pcpu_info[NR_CPUS] = { [0 ... NR_CPUS - 1] = {
     .processor_id = NR_CPUS,
 }};
+
+void smp_send_event_check_mask(const cpumask_t *mask)
+{
+    /* Catch missing implementation once SMP support is introduced */
+    BUG_ON(!cpumask_subset(mask, cpumask_of(0)));
+}
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 29bdb65afb..acbfde79b5 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -65,11 +65,6 @@ int arch_monitor_domctl_event(struct domain *d,
 
 /* smp.c */
 
-void smp_send_event_check_mask(const cpumask_t *mask)
-{
-    BUG_ON("unimplemented");
-}
-
 void smp_send_call_function_mask(const cpumask_t *mask)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218532.1527292 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrq9-00080D-LE; Mon, 02 Feb 2026 11:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218532.1527292; Mon, 02 Feb 2026 11: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 1vmrq9-000805-Ia; Mon, 02 Feb 2026 11:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1218532;
 Mon, 02 Feb 2026 11: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 1vmrq8-0007zy-3k
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrq8-00GxDL-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrq8-00Db4B-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=d4Rbe/ldR2QepWue69vxmTDhJnR8WzzASUjMjw2EEUg=; b=xQt4PfgZfXPNTya4ZgGg5hXjaq
	C7YwSW2jVVLWR2CPYfM7uZ1muPgxoMXlN4obmH/Jyob35wnWl89HXjEltJ89XQdotksqWV0tBlWeW
	RA2xvk557EzzLCOT9Na5AvIZVUVEeIp6dpvipqCHlIQPZrCGtOIwJJZaUb22LOzWYbL8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86emul: allow ->write_msr() to distinguish origins of writes
Message-Id: <E1vmrq8-00Db4B-0A@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:32 +0000

commit 163e49e4196098ec186bb584c49e7c4b727f94e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:05:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:05:45 2026 +0100

    x86emul: allow ->write_msr() to distinguish origins of writes
    
    Only explicit writes are subject to e.g. the checking of the MSR intercept
    bitmap, which extends to VM-event's hvm_monitor_msr(). Indicate, by way of
    a new boolean parameter, to the hook functions which variant it is.
    
    Fixes: 6eb43fcf8a0b ("x86emul: support SWAPGS")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 3 ++-
 xen/arch/x86/hvm/emulate.c                      | 8 +++++---
 xen/arch/x86/pv/emul-priv-op.c                  | 3 ++-
 xen/arch/x86/x86_emulate/0f01.c                 | 6 +++---
 xen/arch/x86/x86_emulate/x86_emulate.c          | 2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h          | 8 +++++---
 6 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index 28c4fb13c5..2b9b72df35 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -569,7 +569,8 @@ static int fuzz_read_msr(
 static int fuzz_write_msr(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     struct fuzz_state *s = ctxt->data;
     struct fuzz_corpus *c = s->corpus;
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index d56ef02baf..86b1f75356 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1705,7 +1705,8 @@ static int cf_check hvmemul_write_io_discard(
 static int cf_check hvmemul_write_msr_discard(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     return X86EMUL_OKAY;
 }
@@ -2427,9 +2428,10 @@ static int cf_check hvmemul_read_msr(
 static int cf_check hvmemul_write_msr(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
-    int rc = hvm_msr_write_intercept(reg, val, true);
+    int rc = hvm_msr_write_intercept(reg, val, explicit);
 
     if ( rc == X86EMUL_EXCEPTION )
         x86_emul_hw_exception(X86_EXC_GP, 0, ctxt);
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index c970e16152..1d9e57ad27 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -1038,7 +1038,8 @@ static int cf_check read_msr(
 }
 
 static int cf_check write_msr(
-    unsigned int reg, uint64_t val, struct x86_emulate_ctxt *ctxt)
+    unsigned int reg, uint64_t val, struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 1ba99609d6..6c10979dd6 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -40,7 +40,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
             fail_if(!ops->write_msr);
             rc = ops->write_msr(regs->ecx,
                                 ((uint64_t)regs->r(dx) << 32) | regs->eax,
-                                ctxt);
+                                ctxt, true);
             goto done;
         }
         generate_exception(X86_EXC_UD);
@@ -194,7 +194,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
              (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
                                  ctxt)) != X86EMUL_OKAY ||
              (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
-                                  ctxt)) != X86EMUL_OKAY )
+                                  ctxt, false)) != X86EMUL_OKAY )
             goto done;
         sreg.base = msr_val;
         if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
@@ -202,7 +202,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
         {
             /* Best effort unwind (i.e. no real error checking). */
             if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
-                                ctxt) == X86EMUL_EXCEPTION )
+                                ctxt, false) == X86EMUL_EXCEPTION )
                 x86_emul_reset_event(ctxt);
             goto done;
         }
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index d830aea430..7751a67130 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3814,7 +3814,7 @@ x86_emulate(
         fail_if(ops->write_msr == NULL);
         if ( (rc = ops->write_msr(_regs.ecx,
                                   ((uint64_t)_regs.r(dx) << 32) | _regs.eax,
-                                  ctxt)) != 0 )
+                                  ctxt, true)) != 0 )
             goto done;
         break;
 
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index d75658eba0..0fd20747dc 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -470,13 +470,15 @@ struct x86_emulate_ops
         struct x86_emulate_ctxt *ctxt);
 
     /*
-     * write_dr: Write to model-specific register.
-     *  @reg:   [IN ] Register to write.
+     * write_msr: Write to model-specific register.
+     *  @reg:      [IN ] Register to write.
+     *  @explicit: [IN ] Whether this is an explicit WRMSR or alike.
      */
     int (*write_msr)(
         unsigned int reg,
         uint64_t val,
-        struct x86_emulate_ctxt *ctxt);
+        struct x86_emulate_ctxt *ctxt,
+        bool explicit);
 
     /*
      * cache_op: Write-back and/or invalidate cache contents.
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218533.1527296 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrqJ-00082K-Mj; Mon, 02 Feb 2026 11:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218533.1527296; Mon, 02 Feb 2026 11: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 1vmrqJ-00082C-K5; Mon, 02 Feb 2026 11:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1218533;
 Mon, 02 Feb 2026 11: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 1vmrqI-00081y-6N
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrqI-00GxDS-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrqI-00Db4X-0S
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=miEUEYiBz67N6fh8XSEnqsV8o39vjYUmeuXC2oqXHro=; b=I3NKcxTEVeMr93DZ53J2lUwd43
	LYW0msdT9T+w2uPA/ORBWAGESoY++BeBwD8KgyUrBSjZZiV9+GvSQ+itTCyW+auFsOw+FIAQBeznh
	ihzHf6edXtAbAXQ1XwxQ/+2B48Nb5IZEk3FTODUGPgJfPuou9KG27g03pC2S1/Cden1E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vmrqI-00Db4X-0S@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:42 +0000

commit 74f984159f0065aa5c7a395ef04263f162b87e62
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:06:42 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:06:42 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 119337af5d..e1cb8a5944 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -436,6 +436,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218534.1527301 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrqT-00084h-Ot; Mon, 02 Feb 2026 11:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218534.1527301; Mon, 02 Feb 2026 11:11: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 1vmrqT-00084Z-LT; Mon, 02 Feb 2026 11:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1218534;
 Mon, 02 Feb 2026 11: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 1vmrqS-00084Q-9g
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11: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 1vmrqS-00GxDW-1x
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrqS-00Db5F-0k
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11: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=eyDb1afJhHHxP8Kz6P0uwu3x8Di+oiVFy1yQLCyh8DI=; b=i5xcpW0HMvc2Z9pw4vFd/YlxEl
	7QnAPFdxm/zqVLxHLHUMXWfiOPQzVCD09673KCtv/zZRVTAPbO5Q1oKp6ZcF/dA2eaj2YTq6w+vPX
	KDO893FIrf5oe7nWUn4Dub1OlMQo6MEQ38FkvRA/Ru778LX1rGPG5OplDP/zcdb8D228=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: determine whether a device has extended config space
Message-Id: <E1vmrqS-00Db5F-0k@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:11:52 +0000

commit 173787d191e1998dbccdbcf1cd65108039dff09b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:07:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:19:57 2026 +0100

    PCI: determine whether a device has extended config space
    
    Legacy PCI devices don't have any extended config space. Reading any part
    thereof may return all ones or other arbitrary data, e.g. in some cases
    base config space contents repeatedly.
    
    Logic follows Linux 6.19-rc's pci_cfg_space_size(), albeit leveraging our
    determination of device type; in particular some comments are taken
    verbatim from there. Like with Linux'es CONFIG_PCI_QUIRKS, only the alias
    detection logic is covered by the new "pci=no-quirks". The singular access
    at PCI_CFG_SPACE_SIZE is left unconditional.
    
    For Misra's sake the PCI_X_STATUS_533HMZ definition also needs amending.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.pandoc |  15 ++++--
 xen/arch/x86/physdev.c            |  18 +++++++
 xen/drivers/passthrough/pci.c     | 107 ++++++++++++++++++++++++++++++++++++++
 xen/include/xen/pci.h             |   9 ++++
 xen/include/xen/pci_regs.h        |   2 +-
 5 files changed, 147 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d29ab08423..c1f2def9f9 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2009,12 +2009,21 @@ Only effective if CONFIG_PARTIAL_EMULATION is enabled.
 behavior.**
 
 ### pci
-    = List of [ serr=<bool>, perr=<bool> ]
+    = List of [ serr=<bool>, perr=<bool>, quirks=<bool> ]
+
+* `serr` and `perr`
 
     Default: Signaling left as set by firmware.
 
-Override the firmware settings, and explicitly enable or disable the
-signalling of PCI System and Parity errors.
+  Override the firmware settings, and explicitly enable or disable the
+  signalling of PCI System and Parity errors.
+
+* `quirks`
+
+    Default: `on`
+
+  In its negative form, allows to suppress certain quirk workarounds, in case
+  they cause issues.
 
 ### pci-phantom
 > `=[<seg>:]<bus>:<device>,<stride>`
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 4dfa1c0191..f6014e2f49 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -22,6 +22,8 @@ int physdev_map_pirq(struct domain *d, int type, int *index, int *pirq_p,
                      struct msi_info *msi);
 int physdev_unmap_pirq(struct domain *d, int pirq);
 
+int cf_check physdev_check_pci_extcfg(struct pci_dev *pdev, void *arg);
+
 #include "x86_64/mmconfig.h"
 
 #ifndef COMPAT
@@ -160,6 +162,17 @@ int physdev_unmap_pirq(struct domain *d, int pirq)
 
     return ret;
 }
+
+int cf_check physdev_check_pci_extcfg(struct pci_dev *pdev, void *arg)
+{
+    const struct physdev_pci_mmcfg_reserved *info = arg;
+
+    ASSERT(pdev->seg == info->segment);
+    if ( pdev->bus >= info->start_bus && pdev->bus <= info->end_bus )
+        pci_check_extcfg(pdev);
+
+    return 0;
+}
 #endif /* COMPAT */
 
 ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -511,6 +524,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         ret = pci_mmcfg_reserved(info.address, info.segment,
                                  info.start_bus, info.end_bus, info.flags);
+
+        if ( !ret )
+            ret = pci_segment_iterate(info.segment, physdev_check_pci_extcfg,
+                                      &info);
+
         if ( !ret && has_vpci(currd) && (info.flags & XEN_PCI_MMCFG_RESERVED) )
         {
             /*
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index e1cb8a5944..464bb0fee4 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -183,6 +183,7 @@ custom_param("pci-phantom", parse_phantom_dev);
 
 static u16 __read_mostly command_mask;
 static u16 __read_mostly bridge_ctl_mask;
+static bool __ro_after_init opt_pci_quirks = true;
 
 static int __init cf_check parse_pci_param(const char *s)
 {
@@ -207,6 +208,8 @@ static int __init cf_check parse_pci_param(const char *s)
             cmd_mask = PCI_COMMAND_PARITY;
             brctl_mask = PCI_BRIDGE_CTL_PARITY;
         }
+        else if ( (val = parse_boolean("quirks", s, ss)) >= 0 )
+            opt_pci_quirks = val;
         else
             rc = -EINVAL;
 
@@ -422,6 +425,9 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
     }
 
     apply_quirks(pdev);
+
+    pci_check_extcfg(pdev);
+
     check_pdev(pdev);
 
     return pdev;
@@ -719,6 +725,11 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
 
                 list_add(&pdev->vf_list, &pf_pdev->vf_list);
             }
+
+            if ( !pdev->ext_cfg )
+                printk(XENLOG_WARNING
+                       "%pp: VF without extended config space?\n",
+                       &pdev->sbdf);
         }
     }
 
@@ -1042,6 +1053,79 @@ enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
     return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
 }
 
+void pci_check_extcfg(struct pci_dev *pdev)
+{
+    unsigned int pos;
+
+    pdev->ext_cfg = false;
+
+    switch ( pdev->type )
+    {
+    case DEV_TYPE_PCIe_ENDPOINT:
+    case DEV_TYPE_PCIe_BRIDGE:
+    case DEV_TYPE_PCI_HOST_BRIDGE:
+    case DEV_TYPE_PCIe2PCI_BRIDGE:
+    case DEV_TYPE_PCI2PCIe_BRIDGE:
+        break;
+
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    case DEV_TYPE_PCI:
+        pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_PCIX);
+        if ( !pos ||
+             !(pci_conf_read32(pdev->sbdf, pos + PCI_X_STATUS) &
+               (PCI_X_STATUS_266MHZ | PCI_X_STATUS_533MHZ)) )
+            return;
+        break;
+
+    default:
+        return;
+    }
+
+    /*
+     * Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices
+     * have 4096 bytes.  Even if the device is capable, that doesn't mean we
+     * can access it.  Maybe we don't have a way to generate extended config
+     * space accesses, or the device is behind a reverse Express bridge.  So
+     * we try reading the dword at PCI_CFG_SPACE_SIZE which must either be 0
+     * or a valid extended capability header.
+     */
+    if ( pci_conf_read32(pdev->sbdf, PCI_CFG_SPACE_SIZE) == 0xffffffffU )
+        return;
+
+    if ( opt_pci_quirks )
+    {
+        /*
+         * PCI Express to PCI/PCI-X Bridge Specification, rev 1.0, 4.1.4 says
+         * that when forwarding a type1 configuration request the bridge must
+         * check that the extended register address field is zero.  The bridge
+         * is not permitted to forward the transactions and must handle it as
+         * an Unsupported Request.  Some bridges do not follow this rule and
+         * simply drop the extended register bits, resulting in the standard
+         * config space being aliased, every 256 bytes across the entire
+         * configuration space.  Test for this condition by comparing the first
+         * dword of each potential alias to the vendor/device ID.
+         * Known offenders:
+         *   ASM1083/1085 PCIe-to-PCI Reversible Bridge (1b21:1080, rev 01 & 03)
+         *   AMD/ATI SBx00 PCI to PCI Bridge (1002:4384, rev 40)
+         */
+        unsigned int sig = pci_conf_read32(pdev->sbdf, PCI_VENDOR_ID);
+
+        for ( pos = PCI_CFG_SPACE_SIZE;
+              pos < PCI_CFG_SPACE_EXP_SIZE; pos += PCI_CFG_SPACE_SIZE )
+            if ( pci_conf_read32(pdev->sbdf, pos) != sig )
+                break;
+
+        if ( pos >= PCI_CFG_SPACE_EXP_SIZE )
+        {
+            printk(XENLOG_WARNING "%pp: extended config space aliases base one\n",
+                   &pdev->sbdf);
+            return;
+        }
+    }
+
+    pdev->ext_cfg = true;
+}
+
 /*
  * find the upstream PCIe-to-PCI/PCIX bridge or PCI legacy bridge
  * return 0: the device is integrated PCI device or PCIe
@@ -1842,6 +1926,29 @@ int pci_iterate_devices(int (*handler)(struct pci_dev *pdev, void *arg),
     return pci_segments_iterate(iterate_all, &iter) ?: iter.rc;
 }
 
+/* Iterate a single PCI segment, with locking but without preemption. */
+int pci_segment_iterate(unsigned int segment,
+                        int (*handler)(struct pci_dev *pdev, void *arg),
+                        void *arg)
+{
+    struct pci_seg *seg = get_pseg(segment);
+    struct segment_iter iter = {
+        .handler = handler,
+        .arg = arg,
+    };
+
+    if ( !seg )
+        return -ENODEV;
+
+    pcidevs_lock();
+
+    iter.rc = iterate_all(seg, &iter) ?: iter.rc;
+
+    pcidevs_unlock();
+
+    return iter.rc;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index d0521c5085..afb6bbf50d 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -126,6 +126,9 @@ struct pci_dev {
 
     nodeid_t node; /* NUMA node */
 
+    /* Whether the device has (accessible) extended config space. */
+    bool ext_cfg;
+
     /* Device to be quarantined, don't automatically re-assign to dom0 */
     bool quarantine;
 
@@ -242,6 +245,11 @@ void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
 int pci_iterate_devices(int (*handler)(struct pci_dev *pdev, void *arg),
                         void *arg);
 
+/* Iterate a single PCI segment, with locking but without preemption. */
+int pci_segment_iterate(unsigned int segment,
+                        int (*handler)(struct pci_dev *pdev, void *arg),
+                        void *arg);
+
 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg);
 uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg);
 uint32_t pci_conf_read32(pci_sbdf_t sbdf, unsigned int reg);
@@ -260,6 +268,7 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
                                    unsigned int *ttl);
 unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
                                unsigned int cap);
+void pci_check_extcfg(struct pci_dev *pdev);
 unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
                                      unsigned int cap);
 unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index 3b6963133d..8d6bbea3c9 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -381,7 +381,7 @@
 #define  PCI_X_STATUS_MAX_CUM	0x1c000000	/* Designed Max Cumulative Read Size */
 #define  PCI_X_STATUS_SPL_ERR	0x20000000	/* Rcvd Split Completion Error Msg */
 #define  PCI_X_STATUS_266MHZ	0x40000000	/* 266 MHz capable */
-#define  PCI_X_STATUS_533MHZ	0x80000000	/* 533 MHz capable */
+#define  PCI_X_STATUS_533MHZ	0x80000000U	/* 533 MHz capable */
 
 /* PCI Express capability registers */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218535.1527304 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrqd-00087H-Ro; Mon, 02 Feb 2026 11:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218535.1527304; Mon, 02 Feb 2026 11:12: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 1vmrqd-000879-On; Mon, 02 Feb 2026 11:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1218535;
 Mon, 02 Feb 2026 11:12: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 1vmrqc-000872-C3
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11:12: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 1vmrqc-00GxDo-2C
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrqc-00Db6G-12
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12: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=SaB/YhV6/dneIcoASEaXIj+SgzBp07sWRfWvXOYfdww=; b=uNvMM9SjQh6l67UJKQnh2wDkTk
	b0pltLrI2Juh9xYkFvCmYt2yeF8RYnvWNYNgXldONwJsqEluzXNG/Tle7vX5c3a6avjTX14/d0Gje
	JqB7PJqyBEZ2Jk+sImvpRbIQRpdMe6P9pQ1mPU+F12FYZW3ztfGwifouGDzltrP3i22g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI: don't look for ext-caps when there's no extended cfg space
Message-Id: <E1vmrqc-00Db6G-12@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:12:02 +0000

commit b1543cf5751b30fea77ecac2fe70b095c09f754d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:07:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    PCI: don't look for ext-caps when there's no extended cfg space
    
    Avoid interpreting as extended capabilities what may be about anything. In
    doing so, vPCI then also won't mis-interpret data from beyond base config
    space anymore.
    
    Fixes: 3b35911d709e ("Enable pci mmcfg and ATS for x86_64")
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/pci/pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index 572cb9b21c..084be3880c 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -113,6 +113,12 @@ unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
     int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
     unsigned int pos = max(start, PCI_CFG_SPACE_SIZE + 0U);
 
+    if ( !pdev->ext_cfg )
+    {
+        ASSERT(!start);
+        return 0;
+    }
+
     header = pci_conf_read32(pdev->sbdf, pos);
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:12:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218536.1527308 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrqn-00089N-Sy; Mon, 02 Feb 2026 11:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218536.1527308; Mon, 02 Feb 2026 11:12: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 1vmrqn-00089E-QI; Mon, 02 Feb 2026 11:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1218536;
 Mon, 02 Feb 2026 11:12: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 1vmrqm-000897-F4
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11:12: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 1vmrqm-00GxDs-2V
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrqm-00Db72-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12: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=cZfX23Zl1xEt3pCysq37pXrQEHtU5i6lvndYdwlIidE=; b=qvTsSWL3kgZPUpqPHG5j/i0dIi
	ldaShS5kSksgKZGHjryu1EyEPNe3keqqCF3v/9/22tR/UwQK0YzVPXlfIwBRYTQFymVXQtAD5G9D3
	XBNCbcmbbkYkwz8VmpNiX0eeL7PJJtcG4dLn/8lUTjFlSiGZYSIOWpy+b7ns0x425/FA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vPCI: really no ext-caps without extended config space
Message-Id: <E1vmrqm-00Db72-1I@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:12:12 +0000

commit 873c3db6d2ea6d03a4f61b36d5a285514eac302a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:08:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    vPCI: really no ext-caps without extended config space
    
    For DomU-s, whether to emulate accesses to the first 32 bits of extended
    config space as read-as-zero or read-as-all-ones depends on whether a
    device actually has extended config space. If it doesn't, read-as-zero
    isn't correct; not getting this right may confuse functions like Linux
    6.19-rc's pci_ext_cfg_is_aliased().
    
    For Dom0 this then simply allows dropping a later conditional.
    
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/header.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index aae663bbf5..739a5f610e 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -829,6 +829,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
 {
     unsigned int pos = PCI_CFG_SPACE_SIZE;
 
+    if ( !pdev->ext_cfg )
+        return 0;
+
     if ( !is_hardware_domain(pdev->domain) )
         /* Extended capabilities read as zero, write ignore for DomU */
         return vpci_add_register(pdev->vpci, vpci_read_val, NULL,
@@ -841,10 +844,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
 
         if ( header == 0xffffffffU )
         {
-            if ( pos != PCI_CFG_SPACE_SIZE )
-                printk(XENLOG_WARNING
-                       "%pd %pp: broken extended cap list, offset %#x\n",
-                       pdev->domain, &pdev->sbdf, pos);
+            printk(XENLOG_WARNING
+                   "%pd %pp: broken extended cap list, offset %#x\n",
+                   pdev->domain, &pdev->sbdf, pos);
             return 0;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 11:12:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 11:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218537.1527312 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmrqx-0008BY-V0; Mon, 02 Feb 2026 11:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218537.1527312; Mon, 02 Feb 2026 11:12: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 1vmrqx-0008BQ-SS; Mon, 02 Feb 2026 11:12:23 +0000
Received: by outflank-mailman (input) for mailman id 1218537;
 Mon, 02 Feb 2026 11:12: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 1vmrqw-0008BI-I4
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 11:12: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 1vmrqw-00GxDy-2m
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmrqw-00Db7W-1a
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 11:12: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=eFOYf+rMEki5i0btBjFzB0Fbce6tg4KW/8dTA0AawH0=; b=MK5oztutWHn+k65hLol6IyAYo6
	TlYaSyanvaJI+VmVfP8gcNhCNpfy83fxog2yZYn0d+N1T9HEqZ32m5zXv+XIjdnLlJNVnuTtK4y69
	v/SPCHRlemnlABDVCMJpdtn572eKi8QR6HLlj1hvWi6XpmrQJZt1QMOxnkYSSZJNG1tE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: route unhandled interrupts to do_unexpected_trap()
Message-Id: <E1vmrqw-00Db7W-1a@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 11:12:22 +0000

commit d0f94a0d400c8b2d37d037606f9fc5878757ce2e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Feb 2 09:09:26 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    xen/riscv: route unhandled interrupts to do_unexpected_trap()
    
    Currently, an interrupt cause which is not explicitly handled is silently
    ignored, and execution resumes without reporting the fault. This is
    incorrect and do_unexpected_trap() should be called in the case of
    unhandled interrupt.
    
    Fixes: a8b85fabf6090 ("xen/riscv: add external interrupt handling for hypervisor mode")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/traps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 84b5ab4142..34920f4e56 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -196,6 +196,7 @@ void do_trap(struct cpu_user_regs *cpu_regs)
         {
             /* Handle interrupt */
             unsigned long icause = cause & ~CAUSE_IRQ_FLAG;
+            bool intr_handled = true;
 
             switch ( icause )
             {
@@ -204,10 +205,12 @@ void do_trap(struct cpu_user_regs *cpu_regs)
                 break;
 
             default:
+                intr_handled = false;
                 break;
             }
 
-            break;
+            if ( intr_handled )
+                break;
         }
 
         do_unexpected_trap(cpu_regs);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218555.1527336 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmslj-00087y-Ff; Mon, 02 Feb 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 1218555.1527336; Mon, 02 Feb 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 1vmslj-00087q-D9; Mon, 02 Feb 2026 12:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1218555;
 Mon, 02 Feb 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 1vmsli-00087k-Bg
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 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 1vmsli-00GyVp-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsli-00Df6C-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 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=gIewShmjPA0FiVEs/zIXhcRXk8L1sxlhios2kr0I6K8=; b=vBSP4zNLO4KgQARauo2ljG4gdB
	GZK7lgSOjqLFc14eS/PAvW0yB+uDbj2WYQv9Bi7+q+6i6PntlZZ9ylO+aGo5m+QDtxm9c67dq3mye
	+oZHgMRWtuV27LNzqZ418N4+o7yDdYiXst0rBXm9SUZOdRGGc8P5wch+waOXIZT9x9DE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vmsli-00Df6C-0V@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:02 +0000

commit 45bb2789349b996bef19eeb098b6fe47a2b32f5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:03:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:03:05 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 2aa41306ca..c326538ebb 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -339,6 +339,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218556.1527340 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmslt-00089u-Hb; Mon, 02 Feb 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 1218556.1527340; Mon, 02 Feb 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 1vmslt-00089m-EW; Mon, 02 Feb 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1218556;
 Mon, 02 Feb 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 1vmsls-00089Z-Cl
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 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 1vmsls-00GyVy-2G
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsls-00Df7Y-0y
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 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=1mmDYgA+bUCgIs9OfaIJzqaefAubJZ3a66t98f16jUc=; b=cZqDdbZRaiuiiKX101YBMaEhYR
	ZD1fQ5wjUIq9Dh2NqjSdMT+9kULbX2HEG21WKSK3BsjquSEAGod791eT6nh7OunE+DelPHsL29wr0
	onUaiyp+hctL+gaUnte6bsHkisT5mCtAIMXDy9lG/5CXZBXXrlruz+XRf3ueQOpdYegs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: check table sizes don't change between linking passes 2 and 3
Message-Id: <E1vmsls-00Df7Y-0y@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:12 +0000

commit 1df11ccceb1a5baea6fd27e2933e94fdeeb69e5f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:04:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:04:18 2026 +0100

    symbols: check table sizes don't change between linking passes 2 and 3
    
    While sizes (and possibly positions) of the symbol table related symbols
    (and as a result other ones) are expected to change from linking pass 1
    to pass 2, no such change should happen anymore from pass 2 to pass 3, or
    else the internally recorded symbol table wouldn't represent the ELF or
    PE/COFF ones.
    
    For comparing to be actually useful, i.e. most notably also covering the
    last of the arrays emitted, symbol sizes need establishing. Make use of
    the xen/linkage.h machinery to achieve that.
    
    Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/Makefile      |  3 ++
 xen/scripts/Kbuild.include | 13 +++++++
 xen/tools/symbols.c        | 85 ++++++++++++++++++++++------------------------
 3 files changed, 57 insertions(+), 44 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 5bf3578983..477e3cbe7a 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -139,6 +139,7 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
 		> $(dot-target).2.S
 	$(MAKE) $(build)=$(@D) $(dot-target).2.o
+	$(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(orphan-handling-y) $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
@@ -221,6 +222,8 @@ endif
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(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)
+	$(call compare-symbol-tables, $(dot-target).1s.o, $(dot-target).2s.o)
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
 	      $(dot-target).2r.o $(dot-target).2s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include
index c2e4ec811b..d5e36e7f55 100644
--- a/xen/scripts/Kbuild.include
+++ b/xen/scripts/Kbuild.include
@@ -56,6 +56,19 @@ define filechk
 	fi
 endef
 
+###
+# Compare the symbol tables of two object files.  As diff's -I option isn't
+# standardized, the name difference of the two object files needs abstracting
+# out.
+define compare-symbol-tables
+    ln -f $(1) $(@D)/.cst.$$$$; \
+    $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \
+    ln -f $(2) $(@D)/.cst.$$$$; \
+    $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \
+    rm -f $(@D)/.cst.$$$$
+    diff -u $(1).sym $(2).sym
+endef
+
 # as-insn: Check whether assembler supports an instruction.
 # Usage: cflags-y += $(call as-insn,CC FLAGS,"insn",option-yes,option-no)
 as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 509394d5a4..7afe301d3c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -260,17 +260,26 @@ static void read_map(FILE *in)
 	}
 }
 
-static void output_label(char *label)
+static void output_label(const char *label, bool keep)
 {
-	if (symbol_prefix_char)
-		printf(".globl %c%s\n", symbol_prefix_char, label);
-	else
-		printf(".globl %s\n", label);
-	printf("\tALGN\n");
-	if (symbol_prefix_char)
-		printf("%c%s:\n", symbol_prefix_char, label);
-	else
-		printf("%s:\n", label);
+	static bool pending;
+
+	if (pending && !keep) {
+		printf("END(CURRENT)\n");
+		printf("#undef CURRENT\n\n");
+	}
+
+	pending = label;
+	if (!label)
+		return;
+
+	if (symbol_prefix_char) {
+		printf("DATA(%c%s, ALGN)\n", symbol_prefix_char, label);
+		printf("#define CURRENT %c%s\n", symbol_prefix_char, label);
+	} else {
+		printf("DATA(%s, ALGN)\n", label);
+		printf("#define CURRENT %s\n", label);
+	}
 }
 
 /* uncompress a compressed symbol. When this function is called, the best table
@@ -338,22 +347,22 @@ static void write_src(void)
 
 		return;
 	}
-	printf("#include <xen/config.h>\n");
+	printf("#include <xen/linkage.h>\n");
 	printf("#if BITS_PER_LONG == 64 && !defined(SYMBOLS_ORIGIN)\n");
 	printf("#define PTR .quad\n");
-	printf("#define ALGN .balign 8\n");
+	printf("#define ALGN 8\n");
 	printf("#else\n");
 	printf("#define PTR .long\n");
-	printf("#define ALGN .balign 4\n");
+	printf("#define ALGN 4\n");
 	printf("#endif\n");
 
 	printf("\t.section .rodata, \"a\"\n");
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
 	printf("#define SYMBOLS_ORIGIN 0\n");
-	output_label("symbols_addresses");
+	output_label("symbols_addresses", false);
 	printf("#else\n");
-	output_label("symbols_offsets");
+	output_label("symbols_offsets", true);
 	printf("#endif\n");
 	for (i = 0, ends = 0; i < table_cnt; i++) {
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n", table[i].addr);
@@ -377,17 +386,15 @@ static void write_src(void)
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n",
 		       table[i].addr + table[i].size);
 	}
-	printf("\n");
 
-	output_label("symbols_num_addrs");
+	output_label("symbols_num_addrs", false);
 	printf("\t.long\t%d\n", table_cnt + ends);
-	printf("\n");
 
 	/* table of offset markers, that give the offset in the compressed stream
 	 * every 256 symbols */
 	markers = malloc(sizeof(*markers) * ((table_cnt + ends + 255) >> 8));
 
-	output_label("symbols_names");
+	output_label("symbols_names", false);
 	for (i = 0, off = 0, ends = 0; i < table_cnt; i++) {
 		if (((i + ends) & 0xFF) == 0)
 			markers[(i + ends) >> 8] = off;
@@ -411,15 +418,12 @@ static void write_src(void)
 		printf("\t.byte 0\n");
 		++off;
 	}
-	printf("\n");
 
-	output_label("symbols_markers");
+	output_label("symbols_markers", false);
 	for (i = 0; i < ((table_cnt + ends + 255) >> 8); i++)
 		printf("\t.long\t%d\n", markers[i]);
-	printf("\n");
 
-
-	output_label("symbols_token_table");
+	output_label("symbols_token_table", false);
 	off = 0;
 	for (i = 0; i < 256; i++) {
 		best_idx[i] = off;
@@ -427,34 +431,27 @@ static void write_src(void)
 		printf("\t.asciz\t\"%s\"\n", buf);
 		off += strlen(buf) + 1;
 	}
-	printf("\n");
 
-	output_label("symbols_token_index");
+	output_label("symbols_token_index", false);
 	for (i = 0; i < 256; i++)
 		printf("\t.short\t%d\n", best_idx[i]);
-	printf("\n");
-
-	if (!sort_by_name) {
-		free(markers);
-		return;
-	}
 
-	output_label("symbols_num_names");
-	printf("\t.long\t%d\n", table_cnt);
-	printf("\n");
+	if (sort_by_name) {
+		output_label("symbols_num_names", false);
+		printf("\t.long\t%d\n", table_cnt);
 
-	/* Sorted by original symbol names and type. */
-	qsort(table, table_cnt, sizeof(*table), compare_name_orig);
+		/* Sorted by original symbol names and type. */
+		qsort(table, table_cnt, sizeof(*table), compare_name_orig);
 
-	output_label("symbols_sorted_offsets");
-	/* A fixed sized array with two entries: offset in the
-	 * compressed stream (for symbol name), and offset in
-	 * symbols_addresses (or symbols_offset). */
-	for (i = 0; i < table_cnt; i++) {
-		printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
+		/* A fixed sized array with two entries: offset in the
+		 * compressed stream (for symbol name), and offset in
+		 * symbols_addresses (or symbols_offset). */
+		output_label("symbols_sorted_offsets", false);
+		for (i = 0; i < table_cnt; i++)
+			printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
 	}
-	printf("\n");
 
+	output_label(NULL, false);
 	free(markers);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218557.1527343 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsm3-0008CG-Ii; Mon, 02 Feb 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 1218557.1527343; Mon, 02 Feb 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 1vmsm3-0008C7-Fv; Mon, 02 Feb 2026 12:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1218557;
 Mon, 02 Feb 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 1vmsm2-0008C1-Hy
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 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 1vmsm2-00GyW5-2b
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsm2-00Df9B-1M
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 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=ljY9jFHBI1itVkDPmQ6trwPHeg8w2JEBLH4HsH/EfBk=; b=FZkQ7cswOkEHmArLad5bTvBpCy
	NX67AB7+Ok5jjHZfkD+Jh4w7yl/9qhN6cQ4L3mj2S1SzY2M7gF+Kd5lrRa5bK0NOIgV6gkKndP3UM
	w9SaEvOrCXPJwL1WwJoPQ/jSU79aZ0PBdkr/dMpikonsCWhzTj01uhRiIfG/g7oIiR5k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add temporary stub for smp_send_event_check_mask()
Message-Id: <E1vmsm2-00Df9B-1M@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:22 +0000

commit 4082de6d43885e9c16b794449e07e9256a08032f
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Feb 2 09:05:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:05:03 2026 +0100

    xen/riscv: add temporary stub for smp_send_event_check_mask()
    
    RISC-V SMP support is not yet implemented, but smp_send_event_check_mask()
    is required by common code and vcpu_kick(), which is introduced later.
    Provide a temporary stub implementation that asserts the mask only targets
    CPU0.
    
    cpumask_subset() is used instead of cpumask_equal() because some callers
    (e.g. cpumask_raise_softirq() or cpu_raise_softirq_batch_finish()) may
    legitimately pass an empty mask, which would otherwise cause false
    failures.
    
    The BUG_ON() ensures that attempts to use this function with multiple CPUs
    are caught early once SMP support is introduced.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/smp.c   | 7 +++++++
 xen/arch/riscv/stubs.c | 5 -----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/riscv/smp.c b/xen/arch/riscv/smp.c
index 4ca6a4e892..d645364ea4 100644
--- a/xen/arch/riscv/smp.c
+++ b/xen/arch/riscv/smp.c
@@ -1,3 +1,4 @@
+#include <xen/cpumask.h>
 #include <xen/smp.h>
 
 /*
@@ -13,3 +14,9 @@
 struct pcpu_info pcpu_info[NR_CPUS] = { [0 ... NR_CPUS - 1] = {
     .processor_id = NR_CPUS,
 }};
+
+void smp_send_event_check_mask(const cpumask_t *mask)
+{
+    /* Catch missing implementation once SMP support is introduced */
+    BUG_ON(!cpumask_subset(mask, cpumask_of(0)));
+}
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index 29bdb65afb..acbfde79b5 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -65,11 +65,6 @@ int arch_monitor_domctl_event(struct domain *d,
 
 /* smp.c */
 
-void smp_send_event_check_mask(const cpumask_t *mask)
-{
-    BUG_ON("unimplemented");
-}
-
 void smp_send_call_function_mask(const cpumask_t *mask)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218558.1527348 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsmD-0008EN-Jv; Mon, 02 Feb 2026 12:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218558.1527348; Mon, 02 Feb 2026 12: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 1vmsmD-0008EF-HH; Mon, 02 Feb 2026 12:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1218558;
 Mon, 02 Feb 2026 12: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 1vmsmC-0008E8-Pw
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12: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 1vmsmC-00GyWV-3B
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsmC-00DfAN-1k
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12: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=BMpvE53zFA2816R1bzuTXqRV04YVzWdkZ6NZHPebBWw=; b=sJYf0o65AZr46n3t9PdUObKXMi
	ZIvVqJs4m/QqagBEgVyVXWoIRz/3iP85572XhKcTvsB5gM/tQZSVHSXs4+a5nebQGj+OPajKVcCsI
	1jszzSJksQW3ghDdCFYLgL7XJazopKW8CN410rqRts1g53L90YgWZCU2hOZszX5l9VMU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86emul: allow ->write_msr() to distinguish origins of writes
Message-Id: <E1vmsmC-00DfAN-1k@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:32 +0000

commit 163e49e4196098ec186bb584c49e7c4b727f94e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:05:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:05:45 2026 +0100

    x86emul: allow ->write_msr() to distinguish origins of writes
    
    Only explicit writes are subject to e.g. the checking of the MSR intercept
    bitmap, which extends to VM-event's hvm_monitor_msr(). Indicate, by way of
    a new boolean parameter, to the hook functions which variant it is.
    
    Fixes: 6eb43fcf8a0b ("x86emul: support SWAPGS")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 3 ++-
 xen/arch/x86/hvm/emulate.c                      | 8 +++++---
 xen/arch/x86/pv/emul-priv-op.c                  | 3 ++-
 xen/arch/x86/x86_emulate/0f01.c                 | 6 +++---
 xen/arch/x86/x86_emulate/x86_emulate.c          | 2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h          | 8 +++++---
 6 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
index 28c4fb13c5..2b9b72df35 100644
--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -569,7 +569,8 @@ static int fuzz_read_msr(
 static int fuzz_write_msr(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     struct fuzz_state *s = ctxt->data;
     struct fuzz_corpus *c = s->corpus;
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index d56ef02baf..86b1f75356 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -1705,7 +1705,8 @@ static int cf_check hvmemul_write_io_discard(
 static int cf_check hvmemul_write_msr_discard(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     return X86EMUL_OKAY;
 }
@@ -2427,9 +2428,10 @@ static int cf_check hvmemul_read_msr(
 static int cf_check hvmemul_write_msr(
     unsigned int reg,
     uint64_t val,
-    struct x86_emulate_ctxt *ctxt)
+    struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
-    int rc = hvm_msr_write_intercept(reg, val, true);
+    int rc = hvm_msr_write_intercept(reg, val, explicit);
 
     if ( rc == X86EMUL_EXCEPTION )
         x86_emul_hw_exception(X86_EXC_GP, 0, ctxt);
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index c970e16152..1d9e57ad27 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -1038,7 +1038,8 @@ static int cf_check read_msr(
 }
 
 static int cf_check write_msr(
-    unsigned int reg, uint64_t val, struct x86_emulate_ctxt *ctxt)
+    unsigned int reg, uint64_t val, struct x86_emulate_ctxt *ctxt,
+    bool explicit)
 {
     struct vcpu *curr = current;
     const struct domain *currd = curr->domain;
diff --git a/xen/arch/x86/x86_emulate/0f01.c b/xen/arch/x86/x86_emulate/0f01.c
index 1ba99609d6..6c10979dd6 100644
--- a/xen/arch/x86/x86_emulate/0f01.c
+++ b/xen/arch/x86/x86_emulate/0f01.c
@@ -40,7 +40,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
             fail_if(!ops->write_msr);
             rc = ops->write_msr(regs->ecx,
                                 ((uint64_t)regs->r(dx) << 32) | regs->eax,
-                                ctxt);
+                                ctxt, true);
             goto done;
         }
         generate_exception(X86_EXC_UD);
@@ -194,7 +194,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
              (rc = ops->read_msr(MSR_SHADOW_GS_BASE, &msr_val,
                                  ctxt)) != X86EMUL_OKAY ||
              (rc = ops->write_msr(MSR_SHADOW_GS_BASE, sreg.base,
-                                  ctxt)) != X86EMUL_OKAY )
+                                  ctxt, false)) != X86EMUL_OKAY )
             goto done;
         sreg.base = msr_val;
         if ( (rc = ops->write_segment(x86_seg_gs, &sreg,
@@ -202,7 +202,7 @@ int x86emul_0f01(struct x86_emulate_state *s,
         {
             /* Best effort unwind (i.e. no real error checking). */
             if ( ops->write_msr(MSR_SHADOW_GS_BASE, msr_val,
-                                ctxt) == X86EMUL_EXCEPTION )
+                                ctxt, false) == X86EMUL_EXCEPTION )
                 x86_emul_reset_event(ctxt);
             goto done;
         }
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index d830aea430..7751a67130 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3814,7 +3814,7 @@ x86_emulate(
         fail_if(ops->write_msr == NULL);
         if ( (rc = ops->write_msr(_regs.ecx,
                                   ((uint64_t)_regs.r(dx) << 32) | _regs.eax,
-                                  ctxt)) != 0 )
+                                  ctxt, true)) != 0 )
             goto done;
         break;
 
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index d75658eba0..0fd20747dc 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -470,13 +470,15 @@ struct x86_emulate_ops
         struct x86_emulate_ctxt *ctxt);
 
     /*
-     * write_dr: Write to model-specific register.
-     *  @reg:   [IN ] Register to write.
+     * write_msr: Write to model-specific register.
+     *  @reg:      [IN ] Register to write.
+     *  @explicit: [IN ] Whether this is an explicit WRMSR or alike.
      */
     int (*write_msr)(
         unsigned int reg,
         uint64_t val,
-        struct x86_emulate_ctxt *ctxt);
+        struct x86_emulate_ctxt *ctxt,
+        bool explicit);
 
     /*
      * cache_op: Write-back and/or invalidate cache contents.
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218559.1527352 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsmN-0008GW-LO; Mon, 02 Feb 2026 12:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218559.1527352; Mon, 02 Feb 2026 12: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 1vmsmN-0008GM-Ii; Mon, 02 Feb 2026 12:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1218559;
 Mon, 02 Feb 2026 12: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 1vmsmM-0008GF-Qo
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12: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 1vmsmN-00GyWc-0Q
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsmM-00DfAq-2H
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12: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=TDv7jBzq9X4DBGn4TBTAGK+oaWXAnRS9801/dTt/dnM=; b=BQL0qCU8OHOVhLr+JXpEume5uN
	pPOX33AOgGrosiJJg+sqg9yqQi0gGnxztCXGhv3F1+uDis1f9Z3mlk2SZpdGn3aGlFNMwUbBe4zcN
	mkUDbmxcEPMAxneoJN4LyLFVc7iCh8nFfAbJlkO9YHXuAMea+x8bmQmzjSZ3EmzYlYXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vmsmM-00DfAq-2H@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:42 +0000

commit 74f984159f0065aa5c7a395ef04263f162b87e62
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:06:42 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 09:06:42 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 119337af5d..e1cb8a5944 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -436,6 +436,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218560.1527355 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsmX-0008Iu-Mz; Mon, 02 Feb 2026 12:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218560.1527355; Mon, 02 Feb 2026 12:11: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 1vmsmX-0008In-KA; Mon, 02 Feb 2026 12:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1218560;
 Mon, 02 Feb 2026 12: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 1vmsmW-0008Ih-Td
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12: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 1vmsmX-00GyWg-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsmW-00DfC4-2l
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12: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=V1RxHOBe0GSDTDPMMNwoRhwA2J+7qN64n2ZT4C1zH6k=; b=ubVRZq9DK/n9lgMkx0HMiWq3DU
	k+QWht0COp6lycqaBi3WOgiF4mymcmUA0gMBJVTQdauCw40OPqFwTQrILDlLHZnY2PTF8z+obWPVw
	24vH14T/ZHd/SlMetAgt/nB/ecOXUj7bkU4kIxKBG0GG14TVfokQAAGUSnIrAV3gU8aM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: determine whether a device has extended config space
Message-Id: <E1vmsmW-00DfC4-2l@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:11:52 +0000

commit 173787d191e1998dbccdbcf1cd65108039dff09b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:07:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:19:57 2026 +0100

    PCI: determine whether a device has extended config space
    
    Legacy PCI devices don't have any extended config space. Reading any part
    thereof may return all ones or other arbitrary data, e.g. in some cases
    base config space contents repeatedly.
    
    Logic follows Linux 6.19-rc's pci_cfg_space_size(), albeit leveraging our
    determination of device type; in particular some comments are taken
    verbatim from there. Like with Linux'es CONFIG_PCI_QUIRKS, only the alias
    detection logic is covered by the new "pci=no-quirks". The singular access
    at PCI_CFG_SPACE_SIZE is left unconditional.
    
    For Misra's sake the PCI_X_STATUS_533HMZ definition also needs amending.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 docs/misc/xen-command-line.pandoc |  15 ++++--
 xen/arch/x86/physdev.c            |  18 +++++++
 xen/drivers/passthrough/pci.c     | 107 ++++++++++++++++++++++++++++++++++++++
 xen/include/xen/pci.h             |   9 ++++
 xen/include/xen/pci_regs.h        |   2 +-
 5 files changed, 147 insertions(+), 4 deletions(-)

diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index d29ab08423..c1f2def9f9 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2009,12 +2009,21 @@ Only effective if CONFIG_PARTIAL_EMULATION is enabled.
 behavior.**
 
 ### pci
-    = List of [ serr=<bool>, perr=<bool> ]
+    = List of [ serr=<bool>, perr=<bool>, quirks=<bool> ]
+
+* `serr` and `perr`
 
     Default: Signaling left as set by firmware.
 
-Override the firmware settings, and explicitly enable or disable the
-signalling of PCI System and Parity errors.
+  Override the firmware settings, and explicitly enable or disable the
+  signalling of PCI System and Parity errors.
+
+* `quirks`
+
+    Default: `on`
+
+  In its negative form, allows to suppress certain quirk workarounds, in case
+  they cause issues.
 
 ### pci-phantom
 > `=[<seg>:]<bus>:<device>,<stride>`
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index 4dfa1c0191..f6014e2f49 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -22,6 +22,8 @@ int physdev_map_pirq(struct domain *d, int type, int *index, int *pirq_p,
                      struct msi_info *msi);
 int physdev_unmap_pirq(struct domain *d, int pirq);
 
+int cf_check physdev_check_pci_extcfg(struct pci_dev *pdev, void *arg);
+
 #include "x86_64/mmconfig.h"
 
 #ifndef COMPAT
@@ -160,6 +162,17 @@ int physdev_unmap_pirq(struct domain *d, int pirq)
 
     return ret;
 }
+
+int cf_check physdev_check_pci_extcfg(struct pci_dev *pdev, void *arg)
+{
+    const struct physdev_pci_mmcfg_reserved *info = arg;
+
+    ASSERT(pdev->seg == info->segment);
+    if ( pdev->bus >= info->start_bus && pdev->bus <= info->end_bus )
+        pci_check_extcfg(pdev);
+
+    return 0;
+}
 #endif /* COMPAT */
 
 ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -511,6 +524,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         ret = pci_mmcfg_reserved(info.address, info.segment,
                                  info.start_bus, info.end_bus, info.flags);
+
+        if ( !ret )
+            ret = pci_segment_iterate(info.segment, physdev_check_pci_extcfg,
+                                      &info);
+
         if ( !ret && has_vpci(currd) && (info.flags & XEN_PCI_MMCFG_RESERVED) )
         {
             /*
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index e1cb8a5944..464bb0fee4 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -183,6 +183,7 @@ custom_param("pci-phantom", parse_phantom_dev);
 
 static u16 __read_mostly command_mask;
 static u16 __read_mostly bridge_ctl_mask;
+static bool __ro_after_init opt_pci_quirks = true;
 
 static int __init cf_check parse_pci_param(const char *s)
 {
@@ -207,6 +208,8 @@ static int __init cf_check parse_pci_param(const char *s)
             cmd_mask = PCI_COMMAND_PARITY;
             brctl_mask = PCI_BRIDGE_CTL_PARITY;
         }
+        else if ( (val = parse_boolean("quirks", s, ss)) >= 0 )
+            opt_pci_quirks = val;
         else
             rc = -EINVAL;
 
@@ -422,6 +425,9 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
     }
 
     apply_quirks(pdev);
+
+    pci_check_extcfg(pdev);
+
     check_pdev(pdev);
 
     return pdev;
@@ -719,6 +725,11 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
 
                 list_add(&pdev->vf_list, &pf_pdev->vf_list);
             }
+
+            if ( !pdev->ext_cfg )
+                printk(XENLOG_WARNING
+                       "%pp: VF without extended config space?\n",
+                       &pdev->sbdf);
         }
     }
 
@@ -1042,6 +1053,79 @@ enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn)
     return pos ? DEV_TYPE_PCIe_ENDPOINT : DEV_TYPE_PCI;
 }
 
+void pci_check_extcfg(struct pci_dev *pdev)
+{
+    unsigned int pos;
+
+    pdev->ext_cfg = false;
+
+    switch ( pdev->type )
+    {
+    case DEV_TYPE_PCIe_ENDPOINT:
+    case DEV_TYPE_PCIe_BRIDGE:
+    case DEV_TYPE_PCI_HOST_BRIDGE:
+    case DEV_TYPE_PCIe2PCI_BRIDGE:
+    case DEV_TYPE_PCI2PCIe_BRIDGE:
+        break;
+
+    case DEV_TYPE_LEGACY_PCI_BRIDGE:
+    case DEV_TYPE_PCI:
+        pos = pci_find_cap_offset(pdev->sbdf, PCI_CAP_ID_PCIX);
+        if ( !pos ||
+             !(pci_conf_read32(pdev->sbdf, pos + PCI_X_STATUS) &
+               (PCI_X_STATUS_266MHZ | PCI_X_STATUS_533MHZ)) )
+            return;
+        break;
+
+    default:
+        return;
+    }
+
+    /*
+     * Regular PCI devices have 256 bytes, but PCI-X 2 and PCI Express devices
+     * have 4096 bytes.  Even if the device is capable, that doesn't mean we
+     * can access it.  Maybe we don't have a way to generate extended config
+     * space accesses, or the device is behind a reverse Express bridge.  So
+     * we try reading the dword at PCI_CFG_SPACE_SIZE which must either be 0
+     * or a valid extended capability header.
+     */
+    if ( pci_conf_read32(pdev->sbdf, PCI_CFG_SPACE_SIZE) == 0xffffffffU )
+        return;
+
+    if ( opt_pci_quirks )
+    {
+        /*
+         * PCI Express to PCI/PCI-X Bridge Specification, rev 1.0, 4.1.4 says
+         * that when forwarding a type1 configuration request the bridge must
+         * check that the extended register address field is zero.  The bridge
+         * is not permitted to forward the transactions and must handle it as
+         * an Unsupported Request.  Some bridges do not follow this rule and
+         * simply drop the extended register bits, resulting in the standard
+         * config space being aliased, every 256 bytes across the entire
+         * configuration space.  Test for this condition by comparing the first
+         * dword of each potential alias to the vendor/device ID.
+         * Known offenders:
+         *   ASM1083/1085 PCIe-to-PCI Reversible Bridge (1b21:1080, rev 01 & 03)
+         *   AMD/ATI SBx00 PCI to PCI Bridge (1002:4384, rev 40)
+         */
+        unsigned int sig = pci_conf_read32(pdev->sbdf, PCI_VENDOR_ID);
+
+        for ( pos = PCI_CFG_SPACE_SIZE;
+              pos < PCI_CFG_SPACE_EXP_SIZE; pos += PCI_CFG_SPACE_SIZE )
+            if ( pci_conf_read32(pdev->sbdf, pos) != sig )
+                break;
+
+        if ( pos >= PCI_CFG_SPACE_EXP_SIZE )
+        {
+            printk(XENLOG_WARNING "%pp: extended config space aliases base one\n",
+                   &pdev->sbdf);
+            return;
+        }
+    }
+
+    pdev->ext_cfg = true;
+}
+
 /*
  * find the upstream PCIe-to-PCI/PCIX bridge or PCI legacy bridge
  * return 0: the device is integrated PCI device or PCIe
@@ -1842,6 +1926,29 @@ int pci_iterate_devices(int (*handler)(struct pci_dev *pdev, void *arg),
     return pci_segments_iterate(iterate_all, &iter) ?: iter.rc;
 }
 
+/* Iterate a single PCI segment, with locking but without preemption. */
+int pci_segment_iterate(unsigned int segment,
+                        int (*handler)(struct pci_dev *pdev, void *arg),
+                        void *arg)
+{
+    struct pci_seg *seg = get_pseg(segment);
+    struct segment_iter iter = {
+        .handler = handler,
+        .arg = arg,
+    };
+
+    if ( !seg )
+        return -ENODEV;
+
+    pcidevs_lock();
+
+    iter.rc = iterate_all(seg, &iter) ?: iter.rc;
+
+    pcidevs_unlock();
+
+    return iter.rc;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index d0521c5085..afb6bbf50d 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -126,6 +126,9 @@ struct pci_dev {
 
     nodeid_t node; /* NUMA node */
 
+    /* Whether the device has (accessible) extended config space. */
+    bool ext_cfg;
+
     /* Device to be quarantined, don't automatically re-assign to dom0 */
     bool quarantine;
 
@@ -242,6 +245,11 @@ void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
 int pci_iterate_devices(int (*handler)(struct pci_dev *pdev, void *arg),
                         void *arg);
 
+/* Iterate a single PCI segment, with locking but without preemption. */
+int pci_segment_iterate(unsigned int segment,
+                        int (*handler)(struct pci_dev *pdev, void *arg),
+                        void *arg);
+
 uint8_t pci_conf_read8(pci_sbdf_t sbdf, unsigned int reg);
 uint16_t pci_conf_read16(pci_sbdf_t sbdf, unsigned int reg);
 uint32_t pci_conf_read32(pci_sbdf_t sbdf, unsigned int reg);
@@ -260,6 +268,7 @@ unsigned int pci_find_next_cap_ttl(pci_sbdf_t sbdf, unsigned int pos,
                                    unsigned int *ttl);
 unsigned int pci_find_next_cap(pci_sbdf_t sbdf, unsigned int pos,
                                unsigned int cap);
+void pci_check_extcfg(struct pci_dev *pdev);
 unsigned int pci_find_ext_capability(const struct pci_dev *pdev,
                                      unsigned int cap);
 unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index 3b6963133d..8d6bbea3c9 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -381,7 +381,7 @@
 #define  PCI_X_STATUS_MAX_CUM	0x1c000000	/* Designed Max Cumulative Read Size */
 #define  PCI_X_STATUS_SPL_ERR	0x20000000	/* Rcvd Split Completion Error Msg */
 #define  PCI_X_STATUS_266MHZ	0x40000000	/* 266 MHz capable */
-#define  PCI_X_STATUS_533MHZ	0x80000000	/* 533 MHz capable */
+#define  PCI_X_STATUS_533MHZ	0x80000000U	/* 533 MHz capable */
 
 /* PCI Express capability registers */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218561.1527360 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsmh-0008LW-QI; Mon, 02 Feb 2026 12:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218561.1527360; Mon, 02 Feb 2026 12:12: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 1vmsmh-0008LO-Nj; Mon, 02 Feb 2026 12:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1218561;
 Mon, 02 Feb 2026 12:12: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 1vmsmg-0008LI-W9
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12:12: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 1vmsmh-00GyWy-0z
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsmg-00DfDO-32
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12: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=qYxLYCp707NcAPbm33HFvvUHaLQQwNko7EFSoSl8Hls=; b=l8X47jZL9QfMeyCpHXEKnHwjbV
	GwcoS9/xxUG9ROU8J7CHhcmgc1vQ6pbD+tM1mJPivqnOAzD97e37bExkFN8eiO3/7PZnrR2hng59a
	phkp6ECOo2MIjGdAJwRLjFNqJy17xVJyp2/0Vc/cyf3O6Ajh40YHtyvIZLuNA++xdHTQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI: don't look for ext-caps when there's no extended cfg space
Message-Id: <E1vmsmg-00DfDO-32@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:12:02 +0000

commit b1543cf5751b30fea77ecac2fe70b095c09f754d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:07:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    PCI: don't look for ext-caps when there's no extended cfg space
    
    Avoid interpreting as extended capabilities what may be about anything. In
    doing so, vPCI then also won't mis-interpret data from beyond base config
    space anymore.
    
    Fixes: 3b35911d709e ("Enable pci mmcfg and ATS for x86_64")
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/pci/pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index 572cb9b21c..084be3880c 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -113,6 +113,12 @@ unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
     int ttl = 480; /* 3840 bytes, minimum 8 bytes per capability */
     unsigned int pos = max(start, PCI_CFG_SPACE_SIZE + 0U);
 
+    if ( !pdev->ext_cfg )
+    {
+        ASSERT(!start);
+        return 0;
+    }
+
     header = pci_conf_read32(pdev->sbdf, pos);
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:12:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218562.1527364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsmr-0008Na-Ri; Mon, 02 Feb 2026 12:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218562.1527364; Mon, 02 Feb 2026 12:12: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 1vmsmr-0008NS-P7; Mon, 02 Feb 2026 12:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1218562;
 Mon, 02 Feb 2026 12:12: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 1vmsmr-0008NK-2t
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12:12: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 1vmsmr-00GyX2-1G
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsmr-00DfE6-05
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12: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=7DvUTWyJ3lzJ0hCu1zobqKmmQjwar1PrEHdXQ2R0rq4=; b=XPFtPgw/CW6yGu5ULcceXOwuTQ
	0VNl94OUFH9xGHoTVqT45zfmmGmrOGLGCw6HbXOIiAdAjFCsn/189218dDrlmtI7vWeze7xD2ZzMc
	fnbgL9VmtGtBfOiws1UFE9vGcCHrjNsMhsoF+7K1jJvfp5uxF5jrYAYVuD31dBK4iHWU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vPCI: really no ext-caps without extended config space
Message-Id: <E1vmsmr-00DfE6-05@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:12:13 +0000

commit 873c3db6d2ea6d03a4f61b36d5a285514eac302a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 2 09:08:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    vPCI: really no ext-caps without extended config space
    
    For DomU-s, whether to emulate accesses to the first 32 bits of extended
    config space as read-as-zero or read-as-all-ones depends on whether a
    device actually has extended config space. If it doesn't, read-as-zero
    isn't correct; not getting this right may confuse functions like Linux
    6.19-rc's pci_ext_cfg_is_aliased().
    
    For Dom0 this then simply allows dropping a later conditional.
    
    Fixes: a845b50c12f3 ("vpci/header: Emulate extended capability list for dom0")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/header.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index aae663bbf5..739a5f610e 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -829,6 +829,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
 {
     unsigned int pos = PCI_CFG_SPACE_SIZE;
 
+    if ( !pdev->ext_cfg )
+        return 0;
+
     if ( !is_hardware_domain(pdev->domain) )
         /* Extended capabilities read as zero, write ignore for DomU */
         return vpci_add_register(pdev->vpci, vpci_read_val, NULL,
@@ -841,10 +844,9 @@ static int vpci_init_ext_capability_list(const struct pci_dev *pdev)
 
         if ( header == 0xffffffffU )
         {
-            if ( pos != PCI_CFG_SPACE_SIZE )
-                printk(XENLOG_WARNING
-                       "%pd %pp: broken extended cap list, offset %#x\n",
-                       pdev->domain, &pdev->sbdf, pos);
+            printk(XENLOG_WARNING
+                   "%pd %pp: broken extended cap list, offset %#x\n",
+                   pdev->domain, &pdev->sbdf, pos);
             return 0;
         }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 12:12:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 12:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218563.1527367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmsn1-0008Pj-TF; Mon, 02 Feb 2026 12:12:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218563.1527367; Mon, 02 Feb 2026 12:12: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 1vmsn1-0008Pc-QZ; Mon, 02 Feb 2026 12:12:23 +0000
Received: by outflank-mailman (input) for mailman id 1218563;
 Mon, 02 Feb 2026 12:12: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 1vmsn1-0008PW-5C
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 12:12: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 1vmsn1-00GyX6-1V
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmsn1-00DfFl-0L
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 12:12: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=O+PNmAoDMsQMRwVloQ96La5zeKs2I4XZ6G7MN1vb9XM=; b=x91rCTy6eZoMYnRnXtnWFPzUun
	JdZ0LCUOrG8Ts1wAWtNiVu3XeGvnghnHszKNYzUL07tcsvsp3eHfjVyISpmjiKNNJDm44BONn1CBP
	ggtqndRtBsuGXxfSty32XOM8qhX+h+5z0qzyPEZ/7CUiSR2cCcig6KyiN+kI7fQ9GSsI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: route unhandled interrupts to do_unexpected_trap()
Message-Id: <E1vmsn1-00DfFl-0L@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 12:12:23 +0000

commit d0f94a0d400c8b2d37d037606f9fc5878757ce2e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Mon Feb 2 09:09:26 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 2 10:20:54 2026 +0100

    xen/riscv: route unhandled interrupts to do_unexpected_trap()
    
    Currently, an interrupt cause which is not explicitly handled is silently
    ignored, and execution resumes without reporting the fault. This is
    incorrect and do_unexpected_trap() should be called in the case of
    unhandled interrupt.
    
    Fixes: a8b85fabf6090 ("xen/riscv: add external interrupt handling for hypervisor mode")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/traps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 84b5ab4142..34920f4e56 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -196,6 +196,7 @@ void do_trap(struct cpu_user_regs *cpu_regs)
         {
             /* Handle interrupt */
             unsigned long icause = cause & ~CAUSE_IRQ_FLAG;
+            bool intr_handled = true;
 
             switch ( icause )
             {
@@ -204,10 +205,12 @@ void do_trap(struct cpu_user_regs *cpu_regs)
                 break;
 
             default:
+                intr_handled = false;
                 break;
             }
 
-            break;
+            if ( intr_handled )
+                break;
         }
 
         do_unexpected_trap(cpu_regs);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218614.1527432 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmuOM-0006lE-Mb; Mon, 02 Feb 2026 13:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218614.1527432; Mon, 02 Feb 2026 13: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 1vmuOM-0006l6-Jw; Mon, 02 Feb 2026 13:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1218614;
 Mon, 02 Feb 2026 13: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 1vmuOM-0006l0-0e
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 13: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 1vmuOM-00H0PN-12
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmuOL-00DqOl-32
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13: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=bQ0o3Z3gIdnD6kChOhcMnlQ8ZFCMzIwcXnr5T4zckSY=; b=ZXZyb66Pgb5hbDfwu3inaQgjVO
	izlnpF1Y71PbDlp2HXZsV6fV9b0GssrHVKwZS/wsTNeBMM45J1NgU81oZb09zzQvjzCebncvgfxGs
	r55X1ngswnwqdZPcM+S3s2hmYUZTpFMM6c5zHVWi50OUVYG+o3DjPzlbcnCJ3DKGe8U8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/rebar: Implement cleanup function for Rebar
Message-Id: <E1vmuOL-00DqOl-32@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 13:55:01 +0000

commit ee459aeac096cf30fa0da7ebf769b572cac81b6e
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:13 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:27 2026 +0100

    vpci/rebar: Implement cleanup function for Rebar
    
    When Rebar initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement Rebar cleanup hook that will be called to
    cleanup Rebar related handlers and free it's associated data when
    initialization fails.
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/rebar.c | 63 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 54 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/vpci/rebar.c b/xen/drivers/vpci/rebar.c
index 63510c337a..4d22f08af3 100644
--- a/xen/drivers/vpci/rebar.c
+++ b/xen/drivers/vpci/rebar.c
@@ -49,6 +49,58 @@ static void cf_check rebar_ctrl_write(const struct pci_dev *pdev,
     bar->guest_addr = bar->addr;
 }
 
+static int cf_check cleanup_rebar(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    uint32_t ctrl;
+    unsigned int nbars;
+    unsigned int rebar_offset = pci_find_ext_capability(pdev,
+                                                        PCI_EXT_CAP_ID_REBAR);
+
+    if ( !hide )
+        return 0;
+
+    ctrl = pci_conf_read32(pdev->sbdf, rebar_offset + PCI_REBAR_CTRL(0));
+    nbars = MASK_EXTR(ctrl, PCI_REBAR_CTRL_NBAR_MASK);
+
+    rc = vpci_remove_registers(pdev->vpci, rebar_offset + PCI_REBAR_CAP(0),
+                               PCI_REBAR_CTRL(nbars - 1));
+    if ( rc )
+    {
+        printk(XENLOG_ERR "%pd %pp: fail to remove Rebar handlers rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+        ASSERT_UNREACHABLE();
+        return rc;
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports Rebar by default. So here let the control register of Rebar
+     * be Read-Only is to ensure Rebar disabled.
+     */
+    for ( unsigned int i = 0; i < nbars; i++ )
+    {
+        rc = vpci_add_register(pdev->vpci, vpci_hw_read32, NULL,
+                               rebar_offset + PCI_REBAR_CTRL(i), 4, NULL);
+        if ( rc )
+        {
+            printk(XENLOG_ERR
+                   "%pd %pp: fail to add Rebar ctrl handler rc=%d\n",
+                   pdev->domain, &pdev->sbdf, rc);
+            return rc;
+        }
+    }
+
+    return 0;
+}
+
 static int cf_check init_rebar(struct pci_dev *pdev)
 {
     uint32_t ctrl;
@@ -97,14 +149,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
         {
             printk(XENLOG_ERR "%pd %pp: BAR%u fail to add reg of REBAR_CTRL rc=%d\n",
                    pdev->domain, &pdev->sbdf, index, rc);
-            /*
-             * Ideally we would hide the ReBar capability on error, but code
-             * for doing so still needs to be written. Use continue instead
-             * to keep any already setup register hooks, as returning an
-             * error will cause the hardware domain to get unmediated access
-             * to all device registers.
-             */
-            continue;
+            return rc;
         }
 
         bar->resizable_sizes =
@@ -118,7 +163,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
 
     return 0;
 }
-REGISTER_VPCI_EXTCAP(REBAR, init_rebar, NULL);
+REGISTER_VPCI_EXTCAP(REBAR, init_rebar, cleanup_rebar);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 13:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 13:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218615.1527436 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmuOW-0006n9-OA; Mon, 02 Feb 2026 13:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218615.1527436; Mon, 02 Feb 2026 13: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 1vmuOW-0006n1-LM; Mon, 02 Feb 2026 13:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1218615;
 Mon, 02 Feb 2026 13: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 1vmuOW-0006mt-5Q
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 13: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 1vmuOW-00H0RQ-1W
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmuOW-00DqQC-08
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13: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=g3Ya7Gwkl5uEq1JfN7PAvhiMf2d+aHm3o3UmB9dTbyA=; b=JTSOBZhAaNDRaBh/W5ifyxAC0k
	3M34PhisewxTJjIAkl+zutNY+09hrjIvuRp7NHhDKIB0weqsshj68B4yF+R0RaniAX4M08m2L3lEQ
	3ZQpX2FWDFWRAlxejaE+LdO1GYE1xy8iXUisEjw8cvf2qalQH60xY8x8Jo+b37rDAJWw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/msi: Implement cleanup function for MSI
Message-Id: <E1vmuOW-00DqQC-08@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 13:55:12 +0000

commit fa475aa88c2610c38b74574d70646bb9f195f2af
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:14 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:31 2026 +0100

    vpci/msi: Implement cleanup function for MSI
    
    When MSI initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement MSI cleanup hook that will be called to
    cleanup MSI related handlers and free it's associated data when
    initialization fails.
    
    Since cleanup function of MSI is implemented, delete the open-code
    in vpci_deassign_device().
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msi.c  | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-
 xen/drivers/vpci/vpci.c |  1 -
 2 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index c3eba4e148..737770ffa3 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -193,6 +193,66 @@ static void cf_check mask_write(
     msi->mask = val;
 }
 
+static int cf_check cleanup_msi(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    unsigned int end;
+    struct vpci *vpci = pdev->vpci;
+    const unsigned int msi_pos = pdev->msi_pos;
+    const unsigned int ctrl = msi_control_reg(msi_pos);
+
+    if ( !hide )
+    {
+        XFREE(vpci->msi);
+        return 0;
+    }
+
+    if ( vpci->msi )
+    {
+        uint16_t control = pci_conf_read16(pdev->sbdf, ctrl);
+        bool address64 = is_64bit_address(control);
+
+        if ( is_mask_bit_support(control) )
+            end = msi_pending_bits_reg(msi_pos, address64);
+        else
+            /*
+            * "-2" here is to cut the reserved 2 bytes of Message Data when
+            * there is no masking support.
+            */
+            end = msi_mask_bits_reg(msi_pos, address64) - 2;
+
+        rc = vpci_remove_registers(vpci, ctrl, end - ctrl);
+        if ( rc )
+        {
+            printk(XENLOG_ERR "%pd %pp: fail to remove MSI handlers rc=%d\n",
+                pdev->domain, &pdev->sbdf, rc);
+            ASSERT_UNREACHABLE();
+            return rc;
+        }
+
+        XFREE(vpci->msi);
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports MSI by default. So here let the control register of MSI
+     * be Read-Only is to ensure MSI disabled.
+     */
+    rc = vpci_add_register(vpci, vpci_hw_read16, NULL, ctrl, 2, NULL);
+    if ( rc )
+        printk(XENLOG_ERR "%pd %pp: fail to add MSI ctrl handler rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+
+    return rc;
+}
+
 static int cf_check init_msi(struct pci_dev *pdev)
 {
     unsigned int pos = pdev->msi_pos;
@@ -270,7 +330,7 @@ static int cf_check init_msi(struct pci_dev *pdev)
 
     return 0;
 }
-REGISTER_VPCI_CAP(MSI, init_msi, NULL);
+REGISTER_VPCI_CAP(MSI, init_msi, cleanup_msi);
 
 void vpci_dump_msi(void)
 {
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d76b81e04b..063adbab9a 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -368,7 +368,6 @@ void vpci_deassign_device(struct pci_dev *pdev)
         rangeset_destroy(pdev->vpci->header.bars[i].mem);
 
     xfree(pdev->vpci->msix);
-    xfree(pdev->vpci->msi);
     xfree(pdev->vpci);
     pdev->vpci = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 13:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 13:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218616.1527439 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmuOh-0006pP-PL; Mon, 02 Feb 2026 13:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218616.1527439; Mon, 02 Feb 2026 13: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 1vmuOh-0006pH-Mk; Mon, 02 Feb 2026 13:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1218616;
 Mon, 02 Feb 2026 13: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 1vmuOg-0006p9-94
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 13: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 1vmuOg-00H0RW-1s
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmuOg-00DqRi-0c
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 13: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=DKyFyaIDImuu7kPX51icALp249mTBPYCDhfoUW6rmlQ=; b=Guz84bFPN7dRX1E6YSHx7ZwILW
	nzPw5zygsojSntga64NBh/HxejdjwqGzO4JwIq16qwi2DeqJz+0YVz5AH25N/DFOBQvCxiTm+GPot
	cokNDBD2Fh1WvO1GXI1rXznEBjpQewsEVa1bcZi/3vi3YepD6TTEaw5bvWjBQVB6Zc+g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/msix: Implement cleanup function for MSI-X
Message-Id: <E1vmuOg-00DqRi-0c@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 13:55:22 +0000

commit 5a733e438f3c8de07c165d9db31e5b37ee39f012
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:15 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:32 2026 +0100

    vpci/msix: Implement cleanup function for MSI-X
    
    When MSI-X initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement MSI-X cleanup hook that will be called
    to cleanup MSI-X related handlers and free it's associated data when
    initialization fails.
    
    Since cleanup function of MSI-X is implemented, delete the open-code
    in vpci_deassign_device().
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
 xen/drivers/vpci/vpci.c |  8 --------
 2 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 032e471bb1..516282205a 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -656,6 +656,55 @@ int vpci_make_msix_hole(const struct pci_dev *pdev)
     return 0;
 }
 
+static int cf_check cleanup_msix(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    struct vpci *vpci = pdev->vpci;
+    const unsigned int msix_pos = pdev->msix_pos;
+
+    if ( vpci->msix )
+    {
+        list_del(&vpci->msix->next);
+        for ( unsigned int i = 0; i < ARRAY_SIZE(vpci->msix->table); i++ )
+            if ( vpci->msix->table[i] )
+                iounmap(vpci->msix->table[i]);
+
+        XFREE(vpci->msix);
+    }
+
+    if ( !hide )
+        return 0;
+
+    rc = vpci_remove_registers(vpci, msix_control_reg(msix_pos), 2);
+    if ( rc )
+    {
+        printk(XENLOG_ERR "%pd %pp: fail to remove MSIX handlers rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+        ASSERT_UNREACHABLE();
+        return rc;
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports MSIX by default. So here let the control register of MSIX
+     * be Read-Only is to ensure MSIX disabled.
+     */
+    rc = vpci_add_register(vpci, vpci_hw_read16, NULL,
+                           msix_control_reg(msix_pos), 2, NULL);
+    if ( rc )
+        printk(XENLOG_ERR "%pd %pp: fail to add MSIX ctrl handler rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+
+    return rc;
+}
+
 static int cf_check init_msix(struct pci_dev *pdev)
 {
     struct domain *d = pdev->domain;
@@ -751,7 +800,7 @@ static int cf_check init_msix(struct pci_dev *pdev)
      */
     return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_CAP(MSIX, init_msix, NULL);
+REGISTER_VPCI_CAP(MSIX, init_msix, cleanup_msix);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 063adbab9a..f66f50c8ba 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -356,18 +356,10 @@ void vpci_deassign_device(struct pci_dev *pdev)
         xfree(r);
     }
     spin_unlock(&pdev->vpci->lock);
-    if ( pdev->vpci->msix )
-    {
-        list_del(&pdev->vpci->msix->next);
-        for ( i = 0; i < ARRAY_SIZE(pdev->vpci->msix->table); i++ )
-            if ( pdev->vpci->msix->table[i] )
-                iounmap(pdev->vpci->msix->table[i]);
-    }
 
     for ( i = 0; i < ARRAY_SIZE(pdev->vpci->header.bars); i++ )
         rangeset_destroy(pdev->vpci->header.bars[i].mem);
 
-    xfree(pdev->vpci->msix);
     xfree(pdev->vpci);
     pdev->vpci = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 14:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 14:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218671.1527504 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmvKR-0000Ky-7r; Mon, 02 Feb 2026 14:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218671.1527504; Mon, 02 Feb 2026 14: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 1vmvKR-0000Kq-56; Mon, 02 Feb 2026 14:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1218671;
 Mon, 02 Feb 2026 14: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 1vmvKQ-0000Kk-80
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 14: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 1vmvKQ-00H1Xi-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmvKQ-00DvK4-0S
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14: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=Or6KDjGe6M3KJVwmH93inUaP7ZytDbjMONptMqNPyy4=; b=vgiaprikQ7fNA+lucJZv7B+E/E
	qpw7q8RzRNbtFMx/w6nm+VaCvjd4hsXkJhvq0YW46xQPMyMZ8YuLfqrENGsQQpZ2BSnqflVvPakl0
	5tvegGn9HLms4u4CPQL5HhvjH3vvSxP56ggtlWtvLulzaT1qGk7cETMHiisg/UTf6iMA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/rebar: Implement cleanup function for Rebar
Message-Id: <E1vmvKQ-00DvK4-0S@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 14:55:02 +0000

commit ee459aeac096cf30fa0da7ebf769b572cac81b6e
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:13 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:27 2026 +0100

    vpci/rebar: Implement cleanup function for Rebar
    
    When Rebar initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement Rebar cleanup hook that will be called to
    cleanup Rebar related handlers and free it's associated data when
    initialization fails.
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/rebar.c | 63 +++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 54 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/vpci/rebar.c b/xen/drivers/vpci/rebar.c
index 63510c337a..4d22f08af3 100644
--- a/xen/drivers/vpci/rebar.c
+++ b/xen/drivers/vpci/rebar.c
@@ -49,6 +49,58 @@ static void cf_check rebar_ctrl_write(const struct pci_dev *pdev,
     bar->guest_addr = bar->addr;
 }
 
+static int cf_check cleanup_rebar(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    uint32_t ctrl;
+    unsigned int nbars;
+    unsigned int rebar_offset = pci_find_ext_capability(pdev,
+                                                        PCI_EXT_CAP_ID_REBAR);
+
+    if ( !hide )
+        return 0;
+
+    ctrl = pci_conf_read32(pdev->sbdf, rebar_offset + PCI_REBAR_CTRL(0));
+    nbars = MASK_EXTR(ctrl, PCI_REBAR_CTRL_NBAR_MASK);
+
+    rc = vpci_remove_registers(pdev->vpci, rebar_offset + PCI_REBAR_CAP(0),
+                               PCI_REBAR_CTRL(nbars - 1));
+    if ( rc )
+    {
+        printk(XENLOG_ERR "%pd %pp: fail to remove Rebar handlers rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+        ASSERT_UNREACHABLE();
+        return rc;
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports Rebar by default. So here let the control register of Rebar
+     * be Read-Only is to ensure Rebar disabled.
+     */
+    for ( unsigned int i = 0; i < nbars; i++ )
+    {
+        rc = vpci_add_register(pdev->vpci, vpci_hw_read32, NULL,
+                               rebar_offset + PCI_REBAR_CTRL(i), 4, NULL);
+        if ( rc )
+        {
+            printk(XENLOG_ERR
+                   "%pd %pp: fail to add Rebar ctrl handler rc=%d\n",
+                   pdev->domain, &pdev->sbdf, rc);
+            return rc;
+        }
+    }
+
+    return 0;
+}
+
 static int cf_check init_rebar(struct pci_dev *pdev)
 {
     uint32_t ctrl;
@@ -97,14 +149,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
         {
             printk(XENLOG_ERR "%pd %pp: BAR%u fail to add reg of REBAR_CTRL rc=%d\n",
                    pdev->domain, &pdev->sbdf, index, rc);
-            /*
-             * Ideally we would hide the ReBar capability on error, but code
-             * for doing so still needs to be written. Use continue instead
-             * to keep any already setup register hooks, as returning an
-             * error will cause the hardware domain to get unmediated access
-             * to all device registers.
-             */
-            continue;
+            return rc;
         }
 
         bar->resizable_sizes =
@@ -118,7 +163,7 @@ static int cf_check init_rebar(struct pci_dev *pdev)
 
     return 0;
 }
-REGISTER_VPCI_EXTCAP(REBAR, init_rebar, NULL);
+REGISTER_VPCI_EXTCAP(REBAR, init_rebar, cleanup_rebar);
 
 /*
  * Local variables:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 14:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 14:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218672.1527508 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmvKb-0000NW-AI; Mon, 02 Feb 2026 14:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218672.1527508; Mon, 02 Feb 2026 14: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 1vmvKb-0000NO-7e; Mon, 02 Feb 2026 14:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1218672;
 Mon, 02 Feb 2026 14: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 1vmvKa-0000NE-AZ
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 14: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 1vmvKa-00H1Zn-1y
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmvKa-00DvKf-0m
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14: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=Z32IKMmzLzAWN1ZFiMhSFUIKO6iVo18qWLibeR6icyM=; b=BBfEAoVBgnEkbH8Nza/WUoXmru
	3pTf0HI94sgRbtkLd3sqybRPiQAWGYcfm7es1Yh9+HSNqlkzZrIOqTb9KTef24AHzT5cGroIrpRGA
	emaoz0mCwty4i6vPO3osD0tlBN2LvhFjXn3e4pzcBNlH+SjKOQnxjiu10EJrlSenUTZ0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/msi: Implement cleanup function for MSI
Message-Id: <E1vmvKa-00DvKf-0m@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 14:55:12 +0000

commit fa475aa88c2610c38b74574d70646bb9f195f2af
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:14 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:31 2026 +0100

    vpci/msi: Implement cleanup function for MSI
    
    When MSI initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement MSI cleanup hook that will be called to
    cleanup MSI related handlers and free it's associated data when
    initialization fails.
    
    Since cleanup function of MSI is implemented, delete the open-code
    in vpci_deassign_device().
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msi.c  | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-
 xen/drivers/vpci/vpci.c |  1 -
 2 files changed, 61 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/vpci/msi.c b/xen/drivers/vpci/msi.c
index c3eba4e148..737770ffa3 100644
--- a/xen/drivers/vpci/msi.c
+++ b/xen/drivers/vpci/msi.c
@@ -193,6 +193,66 @@ static void cf_check mask_write(
     msi->mask = val;
 }
 
+static int cf_check cleanup_msi(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    unsigned int end;
+    struct vpci *vpci = pdev->vpci;
+    const unsigned int msi_pos = pdev->msi_pos;
+    const unsigned int ctrl = msi_control_reg(msi_pos);
+
+    if ( !hide )
+    {
+        XFREE(vpci->msi);
+        return 0;
+    }
+
+    if ( vpci->msi )
+    {
+        uint16_t control = pci_conf_read16(pdev->sbdf, ctrl);
+        bool address64 = is_64bit_address(control);
+
+        if ( is_mask_bit_support(control) )
+            end = msi_pending_bits_reg(msi_pos, address64);
+        else
+            /*
+            * "-2" here is to cut the reserved 2 bytes of Message Data when
+            * there is no masking support.
+            */
+            end = msi_mask_bits_reg(msi_pos, address64) - 2;
+
+        rc = vpci_remove_registers(vpci, ctrl, end - ctrl);
+        if ( rc )
+        {
+            printk(XENLOG_ERR "%pd %pp: fail to remove MSI handlers rc=%d\n",
+                pdev->domain, &pdev->sbdf, rc);
+            ASSERT_UNREACHABLE();
+            return rc;
+        }
+
+        XFREE(vpci->msi);
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports MSI by default. So here let the control register of MSI
+     * be Read-Only is to ensure MSI disabled.
+     */
+    rc = vpci_add_register(vpci, vpci_hw_read16, NULL, ctrl, 2, NULL);
+    if ( rc )
+        printk(XENLOG_ERR "%pd %pp: fail to add MSI ctrl handler rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+
+    return rc;
+}
+
 static int cf_check init_msi(struct pci_dev *pdev)
 {
     unsigned int pos = pdev->msi_pos;
@@ -270,7 +330,7 @@ static int cf_check init_msi(struct pci_dev *pdev)
 
     return 0;
 }
-REGISTER_VPCI_CAP(MSI, init_msi, NULL);
+REGISTER_VPCI_CAP(MSI, init_msi, cleanup_msi);
 
 void vpci_dump_msi(void)
 {
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index d76b81e04b..063adbab9a 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -368,7 +368,6 @@ void vpci_deassign_device(struct pci_dev *pdev)
         rangeset_destroy(pdev->vpci->header.bars[i].mem);
 
     xfree(pdev->vpci->msix);
-    xfree(pdev->vpci->msi);
     xfree(pdev->vpci);
     pdev->vpci = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 14:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 14:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1218673.1527513 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vmvKm-0000Qm-C2; Mon, 02 Feb 2026 14:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1218673.1527513; Mon, 02 Feb 2026 14: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 1vmvKm-0000Qe-92; Mon, 02 Feb 2026 14:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1218673;
 Mon, 02 Feb 2026 14: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 1vmvKk-0000QW-D6
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 14: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 1vmvKk-00H1Zr-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vmvKk-00DvLp-13
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 14: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=KerG1JD/xQhu01rCTZhe7njSi5J1C/kbR/rZBum8Jr0=; b=n1X2C4mdlX9N0zAhM6NfVmOFG8
	nbrbQM+LG1qoB1pGjQIDMVDD4hfSJRzNsmZvti3+U2KBPa7CKgsh6FZuhTmqccreALX6DnOA6nY/S
	zWzwkvWolFVa8Xs323BXaackRjqqUVFWl1SsBol4LMNXbmVMy7BfpEsxcjdXtPuj3GxE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/msix: Implement cleanup function for MSI-X
Message-Id: <E1vmvKk-00DvLp-13@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 14:55:22 +0000

commit 5a733e438f3c8de07c165d9db31e5b37ee39f012
Author:     Jiqian Chen <Jiqian.Chen@amd.com>
AuthorDate: Mon Dec 8 16:18:15 2025 +0800
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Mon Feb 2 13:05:32 2026 +0100

    vpci/msix: Implement cleanup function for MSI-X
    
    When MSI-X initialization fails, vPCI hides the capability, but
    removing handlers and datas won't be performed until the device is
    deassigned. So, implement MSI-X cleanup hook that will be called
    to cleanup MSI-X related handlers and free it's associated data when
    initialization fails.
    
    Since cleanup function of MSI-X is implemented, delete the open-code
    in vpci_deassign_device().
    
    Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
 xen/drivers/vpci/vpci.c |  8 --------
 2 files changed, 50 insertions(+), 9 deletions(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 032e471bb1..516282205a 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -656,6 +656,55 @@ int vpci_make_msix_hole(const struct pci_dev *pdev)
     return 0;
 }
 
+static int cf_check cleanup_msix(const struct pci_dev *pdev, bool hide)
+{
+    int rc;
+    struct vpci *vpci = pdev->vpci;
+    const unsigned int msix_pos = pdev->msix_pos;
+
+    if ( vpci->msix )
+    {
+        list_del(&vpci->msix->next);
+        for ( unsigned int i = 0; i < ARRAY_SIZE(vpci->msix->table); i++ )
+            if ( vpci->msix->table[i] )
+                iounmap(vpci->msix->table[i]);
+
+        XFREE(vpci->msix);
+    }
+
+    if ( !hide )
+        return 0;
+
+    rc = vpci_remove_registers(vpci, msix_control_reg(msix_pos), 2);
+    if ( rc )
+    {
+        printk(XENLOG_ERR "%pd %pp: fail to remove MSIX handlers rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+        ASSERT_UNREACHABLE();
+        return rc;
+    }
+
+    /*
+     * Unprivileged domains have a deny by default register access policy, no
+     * need to add any further handlers for them.
+     */
+    if ( !is_hardware_domain(pdev->domain) )
+        return 0;
+
+    /*
+     * The driver may not traverse the capability list and think device
+     * supports MSIX by default. So here let the control register of MSIX
+     * be Read-Only is to ensure MSIX disabled.
+     */
+    rc = vpci_add_register(vpci, vpci_hw_read16, NULL,
+                           msix_control_reg(msix_pos), 2, NULL);
+    if ( rc )
+        printk(XENLOG_ERR "%pd %pp: fail to add MSIX ctrl handler rc=%d\n",
+               pdev->domain, &pdev->sbdf, rc);
+
+    return rc;
+}
+
 static int cf_check init_msix(struct pci_dev *pdev)
 {
     struct domain *d = pdev->domain;
@@ -751,7 +800,7 @@ static int cf_check init_msix(struct pci_dev *pdev)
      */
     return vpci_make_msix_hole(pdev);
 }
-REGISTER_VPCI_CAP(MSIX, init_msix, NULL);
+REGISTER_VPCI_CAP(MSIX, init_msix, cleanup_msix);
 
 /*
  * Local variables:
diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
index 063adbab9a..f66f50c8ba 100644
--- a/xen/drivers/vpci/vpci.c
+++ b/xen/drivers/vpci/vpci.c
@@ -356,18 +356,10 @@ void vpci_deassign_device(struct pci_dev *pdev)
         xfree(r);
     }
     spin_unlock(&pdev->vpci->lock);
-    if ( pdev->vpci->msix )
-    {
-        list_del(&pdev->vpci->msix->next);
-        for ( i = 0; i < ARRAY_SIZE(pdev->vpci->msix->table); i++ )
-            if ( pdev->vpci->msix->table[i] )
-                iounmap(pdev->vpci->msix->table[i]);
-    }
 
     for ( i = 0; i < ARRAY_SIZE(pdev->vpci->header.bars); i++ )
         rangeset_destroy(pdev->vpci->header.bars[i].mem);
 
-    xfree(pdev->vpci->msix);
     xfree(pdev->vpci);
     pdev->vpci = NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219061.1527926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Mx-0000L6-Ss; Mon, 02 Feb 2026 21:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219061.1527926; Mon, 02 Feb 2026 21: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 1vn1Mx-0000Ky-Q0; Mon, 02 Feb 2026 21:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1219061;
 Mon, 02 Feb 2026 21: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 1vn1Mw-0000Ks-4p
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1Mw-00H947-1L
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1Mw-00EO3W-06
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=CTDa0njIW0BAbGYdStZfQuJn/wlU0gF9yiW16oBL1ow=; b=YrZSn6AoLzb1qTzEWM5Dmv83Zp
	Jx2Ew5P82SSDD1HbMpxvQRtyrqwwgbFsh9SQVoV0SNab4Y9ORe5vcS5GjKq+7kIEH0pzBmp++bu90
	3fVwxFt/b0B/uZwt8LOIAC3boEcnEshr7i6k5at46uaCetH6kC3JcUCopjwQX8GWk1T0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: add FF-A v1.2 function IDs
Message-Id: <E1vn1Mw-00EO3W-06@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:02 +0000

commit a9eb6c6269cb912f8378ae7eef9b6ea99ebbbabc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:18 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add FF-A v1.2 function IDs
    
    Bring the FF-A headers up to the v1.2 baseline and fix the function-number
    range used for ABI discovery:
    
    - update FFA_FNUM_MAX_VALUE so the FF-A function-number window covers the
      full v1.2 range, and derive the ABI bitmap bounds from
      FFA_FNUM_MIN_VALUE/FFA_FNUM_MAX_VALUE instead of hard-coding
      FFA_ERROR/FFA_MSG_SEND2
    - define the new v1.2 function IDs; CONSOLE_LOG_32/64 and
      PARTITION_INFO_GET_REGS are added for ABI discovery even though they are
      not implemented yet
    - extend the firmware ABI table to probe RUN and
      MSG_SEND_DIRECT_REQ2/RESP2
    - while there, fix an off-by-one in ffa_fw_supports_fid(): the computed bit
      index must be strictly smaller than FFA_ABI_BITMAP_SIZE, so use >= in the
      bounds check
    - Also fix comment as call IDs reserved for FF-A are from 0x60 to 0xEF
    
    Keep FFA_MY_VERSION at 1.1 for now; we only advertise v1.2 once the
    implementation is fully compliant.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/include/asm/tee/ffa.h |  3 ++-
 xen/arch/arm/tee/ffa.c             |  4 ++++
 xen/arch/arm/tee/ffa_private.h     | 21 +++++++++++++--------
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/asm/tee/ffa.h
index 24cd4d99c8..7acb541d1f 100644
--- a/xen/arch/arm/include/asm/tee/ffa.h
+++ b/xen/arch/arm/include/asm/tee/ffa.h
@@ -15,8 +15,9 @@
 #include <asm/smccc.h>
 #include <asm/types.h>
 
+/* FF-A Function ID range (AArch32 function number field) as of FF-A v1.2 */
 #define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
-#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
+#define FFA_FNUM_MAX_VALUE              _AC(0x8E,U)
 
 static inline bool is_ffa_fid(uint32_t fid)
 {
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 1d0239cf69..2b4e24750d 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -11,6 +11,8 @@
  *               https://developer.arm.com/documentation/den0077/a
  * FF-A-1.1-REL0: FF-A specification version 1.1 available at
  *                https://developer.arm.com/documentation/den0077/e
+ * FF-A-1.2-REL0: FF-A specification version 1.2 available at
+ *                https://developer.arm.com/documentation/den0077/j
  * TEEC-1.0C: TEE Client API Specification version 1.0c available at
  *            https://globalplatform.org/specs-library/tee-client-api-specification/
  *
@@ -102,6 +104,8 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_32),
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_64),
     FW_ABI(FFA_MSG_SEND2),
+    FW_ABI(FFA_MSG_SEND_DIRECT_REQ2),
+    FW_ABI(FFA_RUN),
 };
 
 /*
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 6dbdb200d8..8d01da0009 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -15,6 +15,7 @@
 #include <xen/spinlock.h>
 #include <xen/time.h>
 #include <xen/types.h>
+#include <asm/tee/ffa.h>
 
 /* Error codes */
 #define FFA_RET_OK                      0
@@ -42,6 +43,7 @@
 
 #define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
 #define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
+#define FFA_VERSION_1_2         MAKE_FFA_VERSION(1, 2)
 /* The minimal FF-A version of the SPMC that can be supported */
 #define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
 
@@ -270,21 +272,24 @@
 #define FFA_RX_ACQUIRE                  0x84000084U
 #define FFA_SPM_ID_GET                  0x84000085U
 #define FFA_MSG_SEND2                   0x84000086U
+#define FFA_CONSOLE_LOG_32              0x8400008AU
+#define FFA_CONSOLE_LOG_64              0xC400008AU
+#define FFA_PARTITION_INFO_GET_REGS     0x8400008BU
+#define FFA_MSG_SEND_DIRECT_REQ2        0xC400008DU
+#define FFA_MSG_SEND_DIRECT_RESP2       0xC400008EU
 
 /**
  * Encoding of features supported or not by the fw in a bitmap:
- * - Function IDs are going from 0x60 to 0xFF
+ * - Function IDs are going from 0x60 to 0xEF in SMCCC standard
  * - A function can be supported in 32 and/or 64bit
  * The bitmap has one bit for each function in 32 and 64 bit.
  */
 #define FFA_ABI_ID(id)        ((id) & ARM_SMCCC_FUNC_MASK)
 #define FFA_ABI_CONV(id)      (((id) >> ARM_SMCCC_CONV_SHIFT) & BIT(0,U))
 
-#define FFA_ABI_MIN           FFA_ABI_ID(FFA_ERROR)
-#define FFA_ABI_MAX           FFA_ABI_ID(FFA_MSG_SEND2)
-
-#define FFA_ABI_BITMAP_SIZE   (2 * (FFA_ABI_MAX - FFA_ABI_MIN + 1))
-#define FFA_ABI_BITNUM(id)    ((FFA_ABI_ID(id) - FFA_ABI_MIN) << 1 | \
+#define FFA_ABI_BITMAP_SIZE   (2 * (FFA_FNUM_MAX_VALUE - FFA_FNUM_MIN_VALUE \
+                               + 1))
+#define FFA_ABI_BITNUM(id)    ((FFA_ABI_ID(id) - FFA_FNUM_MIN_VALUE) << 1 | \
                                FFA_ABI_CONV(id))
 
 /* Constituent memory region descriptor */
@@ -549,9 +554,9 @@ static inline int32_t ffa_hyp_rx_release(void)
 
 static inline bool ffa_fw_supports_fid(uint32_t fid)
 {
-    BUILD_BUG_ON(FFA_ABI_MIN > FFA_ABI_MAX);
+    BUILD_BUG_ON(FFA_FNUM_MIN_VALUE > FFA_FNUM_MAX_VALUE);
 
-    if ( FFA_ABI_BITNUM(fid) > FFA_ABI_BITMAP_SIZE)
+    if ( FFA_ABI_BITNUM(fid) >= FFA_ABI_BITMAP_SIZE)
         return false;
     return test_bit(FFA_ABI_BITNUM(fid), ffa_fw_abi_supported);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219062.1527930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1N7-0000ML-Uq; Mon, 02 Feb 2026 21:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219062.1527930; Mon, 02 Feb 2026 21: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 1vn1N7-0000ME-RT; Mon, 02 Feb 2026 21:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1219062;
 Mon, 02 Feb 2026 21: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 1vn1N6-0000M8-71
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1N6-00H94B-1e
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1N6-00EO4E-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=eSA6PUMBgFuybQHJHpUTLZ3K8/Y1Zdapc6XLeiM1cMQ=; b=EG5MauUGtg8A/dvViT/1GYEf42
	1Axraerv+k8FnJA66Wj4NZt9mxgHqWxcgbQQvj6FZrV/en/80EEuBeMiJ8Y7gzj53iMdUMKpzhwNQ
	GvSgsnk8o4FZOu5OvMf1ff1YOlkxZhyU1h/QvqkQ7YWC0D+2FD9PEPy3ZnlfKsnyqLGk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: per-VM FFA_VERSION negotiation state
Message-Id: <E1vn1N6-00EO4E-0R@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:12 +0000

commit ad2d3a7dafbaf73b2a0b0354ddcf44ce2ac90176
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:19 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: per-VM FFA_VERSION negotiation state
    
    Track FF-A version negotiation per VM and enforce that no FF-A ABI
    (other than FFA_VERSION) is processed before a guest has selected a
    version.
    
    Each ffa_ctx gains a dedicated guest_vers_lock, a negotiated version
    (guest_vers) and a guest_vers_tmp:
    - guest_vers is the version negotiated or 0 if no version has been
      negotiated. This must be used with ACCESS_ONCE when reading it without
      the spinlock taken.
    - guest_vers_tmp stores the version currently requested by a VM.
    
    The version requested is the one actually negotiated once a call
    different from FFA_VERSION is done to allow several attempts and as
    requested by FF-A specification.
    We always return our implementation version FFA_MY_VERSION, even if the
    version requested was different, as requested by FF-A specification.
    
    Any call other than FFA_VERSION is rejected until a version has been
    requested.
    
    Update all places in the code where guest_vers is used to use
    ACCESS_ONCE.
    
    This prevents partially initialised contexts from using the mediator
    and complies with the FF-A 1.2 FFA_VERSION semantics.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 101 +++++++++++++++++++++++++++++++---------
 xen/arch/arm/tee/ffa_msg.c      |   2 +-
 xen/arch/arm/tee/ffa_partinfo.c |   4 +-
 xen/arch/arm/tee/ffa_private.h  |  27 ++++++++---
 xen/arch/arm/tee/ffa_shm.c      |   3 +-
 5 files changed, 106 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2b4e24750d..aadd6c21e7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -158,31 +158,38 @@ static bool ffa_abi_supported(uint32_t id)
     return !ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
 }
 
-static void handle_version(struct cpu_user_regs *regs)
+static bool ffa_negotiate_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    uint32_t vers = get_user_reg(regs, 1);
-    uint32_t old_vers;
+    uint32_t fid = get_user_reg(regs, 0);
+    uint32_t in_vers = get_user_reg(regs, 1);
+    uint32_t out_vers = FFA_MY_VERSION;
 
-    /*
-     * Guest will use the version it requested if it is our major and minor
-     * lower or equals to ours. If the minor is greater, our version will be
-     * used.
-     * In any case return our version to the caller.
-     */
-    if ( FFA_VERSION_MAJOR(vers) == FFA_MY_VERSION_MAJOR )
+    spin_lock(&ctx->guest_vers_lock);
+
+    /* If negotiation already published, continue without handling. */
+    if ( ACCESS_ONCE(ctx->guest_vers) )
+        goto out_continue;
+
+    if ( fid != FFA_VERSION )
     {
-        spin_lock(&ctx->lock);
-        old_vers = ctx->guest_vers;
+        if ( !ctx->guest_vers_tmp )
+        {
+            out_vers = 0;
+            goto out_handled;
+        }
 
-        if ( FFA_VERSION_MINOR(vers) > FFA_MY_VERSION_MINOR )
-            ctx->guest_vers = FFA_MY_VERSION;
-        else
-            ctx->guest_vers = vers;
-        spin_unlock(&ctx->lock);
+        /*
+         * A successful FFA_VERSION call does not freeze negotiation. Guests
+         * are allowed to issue multiple FFA_VERSION attempts (e.g. probing
+         * several minor versions). Negotiation becomes final only when a
+         * non-VERSION ABI is invoked, as required by the FF-A specification.
+         * Finalize negotiation: publish guest_vers once, then never change.
+         */
+        ACCESS_ONCE(ctx->guest_vers) = ctx->guest_vers_tmp;
 
-        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && !old_vers )
+        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
         {
             /* One more VM with FF-A support available */
             inc_ffa_vm_count();
@@ -190,8 +197,48 @@ static void handle_version(struct cpu_user_regs *regs)
             list_add_tail(&ctx->ctx_list, &ffa_ctx_head);
             write_unlock(&ffa_ctx_list_rwlock);
         }
+
+        goto out_continue;
     }
-    ffa_set_regs(regs, FFA_MY_VERSION, 0, 0, 0, 0, 0, 0, 0);
+
+    /*
+     * guest_vers_tmp stores the version selected by the guest (lower minor may
+     * require reduced data structures). However, the value returned to the
+     * guest via FFA_VERSION is always FFA_MY_VERSION, the implementation
+     * version, as required by FF-A. The two values intentionally differ.
+     */
+
+    /*
+     * Return our highest implementation version on request different than our
+     * major and mark negotiated version as our implementation version.
+     */
+    if ( FFA_VERSION_MAJOR(in_vers) != FFA_MY_VERSION_MAJOR )
+    {
+        ctx->guest_vers_tmp = FFA_MY_VERSION;
+        goto out_handled;
+    }
+
+    /*
+     * Use our minor version if a greater minor was requested or the requested
+     * minor if it is lower than ours was requested.
+     */
+    if ( FFA_VERSION_MINOR(in_vers) > FFA_MY_VERSION_MINOR )
+        ctx->guest_vers_tmp = FFA_MY_VERSION;
+    else
+        ctx->guest_vers_tmp = in_vers;
+
+out_handled:
+    spin_unlock(&ctx->guest_vers_lock);
+    if ( out_vers )
+        ffa_set_regs(regs, out_vers, 0, 0, 0, 0, 0, 0, 0);
+    else
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+    return true;
+
+out_continue:
+    spin_unlock(&ctx->guest_vers_lock);
+
+    return false;
 }
 
 static void handle_features(struct cpu_user_regs *regs)
@@ -274,10 +321,17 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     if ( !ctx )
         return false;
 
+    /* A version must be negotiated first */
+    if ( !ACCESS_ONCE(ctx->guest_vers) )
+    {
+        if ( ffa_negotiate_version(regs) )
+            return true;
+    }
+
     switch ( fid )
     {
     case FFA_VERSION:
-        handle_version(regs);
+        ffa_set_regs(regs, FFA_MY_VERSION, 0, 0, 0, 0, 0, 0, 0);
         return true;
     case FFA_ID_GET:
         ffa_set_regs_success(regs, ffa_get_vm_id(d), 0);
@@ -371,6 +425,11 @@ static int ffa_domain_init(struct domain *d)
     d->arch.tee = ctx;
     ctx->teardown_d = d;
     INIT_LIST_HEAD(&ctx->shm_list);
+    spin_lock_init(&ctx->lock);
+    spin_lock_init(&ctx->guest_vers_lock);
+    ctx->guest_vers = 0;
+    ctx->guest_vers_tmp = 0;
+    INIT_LIST_HEAD(&ctx->ctx_list);
 
     ctx->ffa_id = ffa_get_vm_id(d);
     ctx->num_vcpus = d->max_vcpus;
@@ -452,7 +511,7 @@ static int ffa_domain_teardown(struct domain *d)
     if ( !ctx )
         return 0;
 
-    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && ctx->guest_vers )
+    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && ACCESS_ONCE(ctx->guest_vers) )
     {
         dec_ffa_vm_count();
         write_lock(&ffa_ctx_list_rwlock);
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index c20c5bec0f..2c2ebc9c5c 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -113,7 +113,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     }
 
     dst_ctx = dst_d->arch.tee;
-    if ( !dst_ctx->guest_vers )
+    if ( !ACCESS_ONCE(dst_ctx->guest_vers) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out_unlock;
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index fa56b1587e..ec5a53ed1c 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -238,7 +238,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
      * use the v1.0 structure size in the destination buffer.
      * Otherwise use the size of the highest version we support, here 1.1.
      */
-    if ( ctx->guest_vers == FFA_VERSION_1_0 )
+    if ( ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 )
         dst_size = sizeof(struct ffa_partition_info_1_0);
     else
         dst_size = sizeof(struct ffa_partition_info_1_1);
@@ -250,7 +250,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
          * FF-A v1.0 has w5 MBZ while v1.1 allows
          * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
          */
-        if ( ctx->guest_vers == FFA_VERSION_1_0 ||
+        if ( ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 ||
                 flags != FFA_PARTITION_INFO_GET_COUNT_FLAG )
         {
             ret = FFA_RET_INVALID_PARAMETERS;
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 8d01da0009..8ef2143447 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -355,12 +355,6 @@ struct ffa_ctx {
      * Global data accessed with lock locked.
      */
     spinlock_t lock;
-    /*
-     * FF-A version negotiated by the guest, only modifications to
-     * this field are done with the lock held as this is expected to
-     * be done once at init by a guest.
-     */
-    uint32_t guest_vers;
     /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
     unsigned int page_count;
     /* Number of allocated shared memory object */
@@ -368,6 +362,27 @@ struct ffa_ctx {
     /* Used shared memory objects, struct ffa_shm_mem */
     struct list_head shm_list;
 
+    /*
+     * FF-A version handling
+     * guest_vers is the single published negotiated version. It is 0 until
+     * negotiation completes, after which it is set once and never changes.
+     * Negotiation uses guest_vers_tmp under guest_vers_lock; when a
+     * non-VERSION ABI is invoked, Xen finalizes negotiation by publishing
+     * guest_vers using ACCESS_ONCE() store.
+     * Readers use ACCESS_ONCE(guest_vers) != 0 to detect availability and
+     * can consume guest_vers without barriers because it never changes once
+     * published.
+     */
+    spinlock_t guest_vers_lock;
+    /*
+     * Published negotiated version. Zero means "not negotiated yet".
+     * Once non-zero, it never changes.
+     * Must always be accessed using ACCESS_ONCE().
+     */
+    uint32_t guest_vers;
+    /* Temporary version used during negotiation under guest_vers_lock */
+    uint32_t guest_vers_tmp;
+
     /*
      * Rx buffer, accessed with rx_lock locked.
      * rx_is_free is used to serialize access.
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index d628c1b706..dad3da1922 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -495,7 +495,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
         goto out_unlock;
 
-    ret = read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &trans);
+    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), ctx->tx,
+                               frag_len, &trans);
     if ( ret )
         goto out_unlock;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219063.1527933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1NI-0000QT-0v; Mon, 02 Feb 2026 21:22:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219063.1527933; Mon, 02 Feb 2026 21: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 1vn1NH-0000QL-Uf; Mon, 02 Feb 2026 21:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1219063;
 Mon, 02 Feb 2026 21: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 1vn1NG-0000QF-9Q
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1NG-00H94G-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1NG-00EO4j-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=bJru4LVHQiF/AwTk9ZswaoNYMOxTwntqX4zM3xoCTAs=; b=fUQJdQE8VE4SllBIMMFlojrxs8
	noR6QuOFEiu7GGODLYcOiWVpYpBkt6MMOJ1cNTbTY61Rn6phvzPdy1BCll2wzVEyakgyrQ4Xn/bKa
	e5GW677r93GIsPSXAfbRDFCWtoVx1hwy6m4SpyVwA6Ij3LMY9iPUn4cMmW2IiRmP65Xw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix is_64bit init
Message-Id: <E1vn1NG-00EO4j-0j@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:22 +0000

commit 6e8c62d457ab920b2528c3a5381aef8caa1ff357
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:20 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: Fix is_64bit init
    
    is_64bit_domain(d) is not set during domain_init as the domain field is
    only set when loading the domain image which is done after executing
    domain_init.
    
    Fix the implementation to set is_64bit when version gets negotiated.
    is_64bit is only used during partition_info_get once a domain is added
    in the list of domains having ffa support. It must only be accessed when
    the rwlock is taken (which is the case).
    
    is_64bit must not be used without the rwlock taken and other places in
    the code needing to test 64bit support of the current domain will have
    to use calls to is_64bit_domain instead of the field from now on.
    
    Fixes: 09a201605f99 ("xen/arm: ffa: Introduce VM to VM support")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 9 ++++++++-
 xen/arch/arm/tee/ffa_private.h | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index aadd6c21e7..0f6f837378 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -180,6 +180,14 @@ static bool ffa_negotiate_version(struct cpu_user_regs *regs)
             goto out_handled;
         }
 
+        /*
+         * We cannot set is_64bit during domain init because the field is not
+         * yet initialized.
+         * This field is only used during partinfo_get with the rwlock taken
+         * so there is no ordering issue with guest_vers.
+         */
+        ctx->is_64bit = is_64bit_domain(d);
+
         /*
          * A successful FFA_VERSION call does not freeze negotiation. Guests
          * are allowed to issue multiple FFA_VERSION attempts (e.g. probing
@@ -433,7 +441,6 @@ static int ffa_domain_init(struct domain *d)
 
     ctx->ffa_id = ffa_get_vm_id(d);
     ctx->num_vcpus = d->max_vcpus;
-    ctx->is_64bit = is_64bit_domain(d);
 
     /*
      * ffa_domain_teardown() will be called if ffa_domain_init() returns an
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 8ef2143447..96794ecebe 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -344,6 +344,11 @@ struct ffa_ctx {
     /* FF-A Endpoint ID */
     uint16_t ffa_id;
     uint16_t num_vcpus;
+    /*
+     * Must only be accessed with the ffa_ctx_list_rwlock taken as it set
+     * when guest_vers is set and other accesses could see a partially set
+     * value.
+     */
     bool is_64bit;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219064.1527939 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1NR-0000TL-35; Mon, 02 Feb 2026 21:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219064.1527939; Mon, 02 Feb 2026 21: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 1vn1NQ-0000TD-WC; Mon, 02 Feb 2026 21:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1219064;
 Mon, 02 Feb 2026 21: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 1vn1NQ-0000T7-Cg
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1NQ-00H94K-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1NQ-00EO77-12
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=IUZ4xaK7VC8MUX+MEtGERQp++X3G+t6y0cyxfWYhOy8=; b=M/5iEHCxaZsrU6J0WfWhEm58iq
	lD0eBk1fy2cVFnXixo5S96Eo+/Rwx3j1FPnCUGJawi923lJ2Kpja0rQhlsgAZeOVJJka205WahlCU
	3jifHQfWjJqpsiR3ysP2OOpZfBMPLeaUW6Y202WehVnXZJ4boFkHtJer1Sj50hekXf+8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: harden RX/TX mapping
Message-Id: <E1vn1NQ-00EO77-12@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:32 +0000

commit a3075e2fda1d0b50340f95723f6c9720495c05a7
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:21 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: harden RX/TX mapping
    
    Harden the RX/TX mapping paths and keep signed FF-A return codes
    end-to-end.
    
    Reject zero-length mappings and insist on page-aligned RX/TX buffer
    addresses before touching the P2M. The unmap plumbing is switched to
    use the same signed helpers so dispatcher error handling is consistent
    across map and unmap operations.
    
    This avoids partially mapped or silently truncated buffers and makes the
    mediator behaviour match the FF-A error model more closely.
    
    Prevent concurrent usage of rx or tx buffer during map or unmap by
    holding the rx_lock and tx_lock.
    
    While there also introduce a domain_rxtx_init to properly initialize the
    rxtx buffers spinlocks.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |  4 +++
 xen/arch/arm/tee/ffa_private.h |  5 ++--
 xen/arch/arm/tee/ffa_rxtx.c    | 68 ++++++++++++++++++++++++++++++++++--------
 3 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 0f6f837378..497ada8264 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -451,6 +451,10 @@ static int ffa_domain_init(struct domain *d)
     if ( ret )
         return ret;
 
+    ret = ffa_rxtx_domain_init(d);
+    if ( ret )
+        return ret;
+
     return ffa_notif_domain_init(d);
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 96794ecebe..0bb5a84553 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -439,10 +439,11 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
 bool ffa_rxtx_init(void);
 void ffa_rxtx_destroy(void);
+int32_t ffa_rxtx_domain_init(struct domain *d);
 void ffa_rxtx_domain_destroy(struct domain *d);
-uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
+int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count);
-uint32_t ffa_handle_rxtx_unmap(void);
+int32_t ffa_handle_rxtx_unmap(void);
 int32_t ffa_rx_acquire(struct domain *d);
 int32_t ffa_rx_release(struct domain *d);
 
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index a40e5b32e3..5776693bb3 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -41,10 +41,10 @@ static int32_t ffa_rxtx_unmap(uint16_t id)
     return ffa_simple_call(FFA_RXTX_UNMAP, ((uint64_t)id) << 16, 0, 0, 0);
 }
 
-uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
+int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count)
 {
-    uint32_t ret = FFA_RET_INVALID_PARAMETERS;
+    int32_t ret = FFA_RET_INVALID_PARAMETERS;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct page_info *tx_pg;
@@ -66,20 +66,30 @@ uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         rx_addr &= UINT32_MAX;
     }
 
-    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
+    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT || !page_count )
     {
         printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
                page_count, FFA_MAX_RXTX_PAGE_COUNT);
         return FFA_RET_INVALID_PARAMETERS;
     }
 
+    if ( !IS_ALIGNED(tx_addr, FFA_PAGE_SIZE) ||
+         !IS_ALIGNED(rx_addr, FFA_PAGE_SIZE) )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    spin_lock(&ctx->rx_lock);
+    spin_lock(&ctx->tx_lock);
+
     /* Already mapped */
     if ( ctx->rx )
-        return FFA_RET_DENIED;
+    {
+        ret = FFA_RET_DENIED;
+        goto err_unlock_rxtx;
+    }
 
     tx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M_ALLOC);
     if ( !tx_pg )
-        return FFA_RET_INVALID_PARAMETERS;
+        goto err_unlock_rxtx;
 
     /* Only normal RW RAM for now */
     if ( t != p2m_ram_rw )
@@ -167,6 +177,10 @@ uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
     ctx->tx_pg = tx_pg;
     ctx->page_count = page_count;
     ctx->rx_is_free = true;
+
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
+
     return FFA_RET_OK;
 
 err_unmap_rx:
@@ -177,24 +191,32 @@ err_put_rx_pg:
     put_page(rx_pg);
 err_put_tx_pg:
     put_page(tx_pg);
+err_unlock_rxtx:
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
 
-static uint32_t  rxtx_unmap(struct domain *d)
+static int32_t rxtx_unmap(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
+    int32_t ret = FFA_RET_OK;
+
+    spin_lock(&ctx->rx_lock);
+    spin_lock(&ctx->tx_lock);
 
     if ( !ctx->page_count )
-        return FFA_RET_INVALID_PARAMETERS;
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto err_unlock_rxtx;
+    }
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        uint32_t ret;
-
         ret = ffa_rxtx_unmap(ffa_get_vm_id(d));
         if ( ret != FFA_RET_OK )
-            return ret;
+            goto err_unlock_rxtx;
     }
 
     unmap_domain_page_global(ctx->rx);
@@ -208,10 +230,14 @@ static uint32_t  rxtx_unmap(struct domain *d)
     ctx->page_count = 0;
     ctx->rx_is_free = false;
 
-    return FFA_RET_OK;
+err_unlock_rxtx:
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
+
+    return ret;
 }
 
-uint32_t ffa_handle_rxtx_unmap(void)
+int32_t ffa_handle_rxtx_unmap(void)
 {
     return rxtx_unmap(current->domain);
 }
@@ -272,6 +298,22 @@ out:
     return ret;
 }
 
+int32_t ffa_rxtx_domain_init(struct domain *d)
+{
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    spin_lock_init(&ctx->rx_lock);
+    spin_lock_init(&ctx->tx_lock);
+    ctx->rx = NULL;
+    ctx->tx = NULL;
+    ctx->rx_pg = NULL;
+    ctx->tx_pg = NULL;
+    ctx->page_count = 0;
+    ctx->rx_is_free = false;
+
+    return 0;
+}
+
 void ffa_rxtx_domain_destroy(struct domain *d)
 {
     rxtx_unmap(d);
@@ -298,7 +340,7 @@ void ffa_rxtx_destroy(void)
 
 bool ffa_rxtx_init(void)
 {
-    int e;
+    int32_t e;
 
     /* Firmware not there or not supporting */
     if ( !ffa_fw_supports_fid(FFA_RXTX_MAP_64) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219065.1527942 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Nb-0000VP-45; Mon, 02 Feb 2026 21:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219065.1527942; Mon, 02 Feb 2026 21:22: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 1vn1Nb-0000VG-1R; Mon, 02 Feb 2026 21:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1219065;
 Mon, 02 Feb 2026 21: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 1vn1Na-0000VA-FZ
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1Na-00H94l-2X
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1Na-00EO7s-1L
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=l30TGnVmQavS1MCOdydrphYbXdY8R1VMPulMQSBxCxk=; b=zJkxaTLrKp/uNzrPx3uCl+G15H
	gN71ZUGxMwnPcp6j3r9VY2PZRA+1uLp3PCDYDBCKwNUkiIOBs+esj6TCwzyH87qf2aPVnsRnudGOk
	VGeaIY+Ddu1o+316gzxA8CDSqVtm+6DaJ2I0dHxgJFAtWb4uaySMUNV60gUGLszuzpC8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: rework SPMC RX/TX buffer management
Message-Id: <E1vn1Na-00EO7s-1L@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:42 +0000

commit 9e9504ef32f54db77d25631f3ebcc02205388ac1
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:22 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: rework SPMC RX/TX buffer management
    
    Rework how Xen accesses the RX/TX buffers shared with the SPMC so that
    ownership and locking are handled centrally.
    
    Move the SPMC RX/TX buffer bases into ffa_rxtx.c as ffa_spmc_rx/ffa_spmc_tx,
    protect them with dedicated ffa_spmc_{rx,tx}_lock spinlocks and expose
    ffa_rxtx_spmc_{rx,tx}_{acquire,release}() helpers instead of the global
    ffa_rx/ffa_tx pointers and ffa_{rx,tx}_buffer_lock.
    
    The RX helpers now always issue FFA_RX_RELEASE when we are done
    consuming data from the SPMC, so partition-info enumeration and shared
    memory paths release the RX buffer on all exit paths. The RX/TX mapping
    code is updated to use the descriptor offsets (rx_region_offs and
    tx_region_offs) rather than hard-coded structure layout, and to use the
    TX acquire/release helpers instead of touching the TX buffer directly.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          |  22 ++-----
 xen/arch/arm/tee/ffa_partinfo.c |  40 ++++++-------
 xen/arch/arm/tee/ffa_private.h  |  18 +++---
 xen/arch/arm/tee/ffa_rxtx.c     | 126 +++++++++++++++++++++++++++++++---------
 xen/arch/arm/tee/ffa_shm.c      |  29 +++++----
 5 files changed, 149 insertions(+), 86 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 497ada8264..43af49d1c0 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -48,8 +48,8 @@
  *     notification for secure partitions
  *   - doesn't support notifications for Xen itself
  *
- * There are some large locked sections with ffa_tx_buffer_lock and
- * ffa_rx_buffer_lock. Especially the ffa_tx_buffer_lock spinlock used
+ * There are some large locked sections with ffa_spmc_tx_lock and
+ * ffa_spmc_rx_lock. Especially the ffa_spmc_tx_lock spinlock used
  * around share_shm() is a very large locked section which can let one VM
  * affect another VM.
  */
@@ -108,20 +108,6 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_RUN),
 };
 
-/*
- * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
- * number of pages used in each of these buffers.
- *
- * The RX buffer is protected from concurrent usage with ffa_rx_buffer_lock.
- * Note that the SPMC is also tracking the ownership of our RX buffer so
- * for calls which uses our RX buffer to deliver a result we must call
- * ffa_rx_release() to let the SPMC know that we're done with the buffer.
- */
-void *ffa_rx __read_mostly;
-void *ffa_tx __read_mostly;
-DEFINE_SPINLOCK(ffa_rx_buffer_lock);
-DEFINE_SPINLOCK(ffa_tx_buffer_lock);
-
 LIST_HEAD(ffa_ctx_head);
 /* RW Lock to protect addition/removal and reading in ffa_ctx_head */
 DEFINE_RWLOCK(ffa_ctx_list_rwlock);
@@ -617,7 +603,7 @@ static bool ffa_probe_fw(void)
                    ffa_fw_abi_needed[i].name);
     }
 
-    if ( !ffa_rxtx_init() )
+    if ( !ffa_rxtx_spmc_init() )
     {
         printk(XENLOG_ERR "ffa: Error during RXTX buffer init\n");
         goto err_no_fw;
@@ -631,7 +617,7 @@ static bool ffa_probe_fw(void)
     return true;
 
 err_rxtx_destroy:
-    ffa_rxtx_destroy();
+    ffa_rxtx_spmc_destroy();
 err_no_fw:
     ffa_fw_version = 0;
     bitmap_zero(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index ec5a53ed1c..145b869957 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -77,28 +77,24 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
 {
     int32_t ret;
     uint32_t src_size, real_sp_count;
-    void *src_buf = ffa_rx;
+    void *src_buf;
     uint32_t count = 0;
 
-    /* Do we have a RX buffer with the SPMC */
-    if ( !ffa_rx )
-        return FFA_RET_DENIED;
-
     /* We need to use the RX buffer to receive the list */
-    spin_lock(&ffa_rx_buffer_lock);
+    src_buf = ffa_rxtx_spmc_rx_acquire();
+    if ( !src_buf )
+        return FFA_RET_DENIED;
 
     ret = ffa_partition_info_get(uuid, 0, &real_sp_count, &src_size);
     if ( ret )
         goto out;
 
-    /* We now own the RX buffer */
-
     /* Validate the src_size we got */
     if ( src_size < sizeof(struct ffa_partition_info_1_0) ||
          src_size >= FFA_PAGE_SIZE )
     {
         ret = FFA_RET_NOT_SUPPORTED;
-        goto out_release;
+        goto out;
     }
 
     /*
@@ -114,7 +110,7 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
     if ( real_sp_count > (FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE) / src_size )
     {
         ret = FFA_RET_NOT_SUPPORTED;
-        goto out_release;
+        goto out;
     }
 
     for ( uint32_t sp_num = 0; sp_num < real_sp_count; sp_num++ )
@@ -127,7 +123,7 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
             if ( dst_buf > (end_buf - dst_size) )
             {
                 ret = FFA_RET_NO_MEMORY;
-                goto out_release;
+                goto out;
             }
 
             memcpy(dst_buf, src_buf, MIN(src_size, dst_size));
@@ -143,10 +139,8 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
 
     *sp_count = count;
 
-out_release:
-    ffa_hyp_rx_release();
 out:
-    spin_unlock(&ffa_rx_buffer_lock);
+    ffa_rxtx_spmc_rx_release();
     return ret;
 }
 
@@ -378,7 +372,7 @@ static void uninit_subscribers(void)
         XFREE(subscr_vm_destroyed);
 }
 
-static bool init_subscribers(uint16_t count, uint32_t fpi_size)
+static bool init_subscribers(void *buf, uint16_t count, uint32_t fpi_size)
 {
     uint16_t n;
     uint16_t c_pos;
@@ -395,7 +389,7 @@ static bool init_subscribers(uint16_t count, uint32_t fpi_size)
     subscr_vm_destroyed_count = 0;
     for ( n = 0; n < count; n++ )
     {
-        fpi = ffa_rx + n * fpi_size;
+        fpi = buf + n * fpi_size;
 
         /*
          * We need to have secure partitions using bit 15 set convention for
@@ -433,7 +427,7 @@ static bool init_subscribers(uint16_t count, uint32_t fpi_size)
 
     for ( c_pos = 0, d_pos = 0, n = 0; n < count; n++ )
     {
-        fpi = ffa_rx + n * fpi_size;
+        fpi = buf + n * fpi_size;
 
         if ( FFA_ID_IS_SECURE(fpi->id) )
         {
@@ -455,10 +449,14 @@ bool ffa_partinfo_init(void)
     uint32_t fpi_size;
     uint32_t count;
     int e;
+    void *spmc_rx;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
-         !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32) ||
-         !ffa_rx || !ffa_tx )
+         !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
+        return false;
+
+    spmc_rx = ffa_rxtx_spmc_rx_acquire();
+    if (!spmc_rx)
         return false;
 
     e = ffa_partition_info_get(NULL, 0, &count, &fpi_size);
@@ -475,10 +473,10 @@ bool ffa_partinfo_init(void)
         goto out;
     }
 
-    ret = init_subscribers(count, fpi_size);
+    ret = init_subscribers(spmc_rx, count, fpi_size);
 
 out:
-    ffa_hyp_rx_release();
+    ffa_rxtx_spmc_rx_release();
     return ret;
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 0bb5a84553..4c97041829 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -416,10 +416,6 @@ struct ffa_ctx {
     unsigned long *vm_destroy_bitmap;
 };
 
-extern void *ffa_rx;
-extern void *ffa_tx;
-extern spinlock_t ffa_rx_buffer_lock;
-extern spinlock_t ffa_tx_buffer_lock;
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
 
 extern struct list_head ffa_ctx_head;
@@ -437,8 +433,13 @@ int ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
-bool ffa_rxtx_init(void);
-void ffa_rxtx_destroy(void);
+bool ffa_rxtx_spmc_init(void);
+void ffa_rxtx_spmc_destroy(void);
+void *ffa_rxtx_spmc_rx_acquire(void);
+void ffa_rxtx_spmc_rx_release(void);
+void *ffa_rxtx_spmc_tx_acquire(void);
+void ffa_rxtx_spmc_tx_release(void);
+
 int32_t ffa_rxtx_domain_init(struct domain *d);
 void ffa_rxtx_domain_destroy(struct domain *d);
 int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
@@ -568,11 +569,6 @@ static inline int32_t ffa_simple_call(uint32_t fid, register_t a1,
     return ffa_get_ret_code(&resp);
 }
 
-static inline int32_t ffa_hyp_rx_release(void)
-{
-    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
-}
-
 static inline bool ffa_fw_supports_fid(uint32_t fid)
 {
     BUILD_BUG_ON(FFA_FNUM_MIN_VALUE > FFA_FNUM_MAX_VALUE);
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 5776693bb3..63203b22b8 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -30,6 +30,20 @@ struct ffa_endpoint_rxtx_descriptor_1_1 {
     uint32_t tx_region_offs;
 };
 
+/*
+ * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
+ * number of pages used in each of these buffers.
+ * Each buffer has its own lock to protect from concurrent usage.
+ *
+ * Note that the SPMC is also tracking the ownership of our RX buffer so
+ * for calls which uses our RX buffer to deliver a result we must do an
+ * FFA_RX_RELEASE to let the SPMC know that we're done with the buffer.
+ */
+static void *ffa_spmc_rx __read_mostly;
+static void *ffa_spmc_tx __read_mostly;
+static DEFINE_SPINLOCK(ffa_spmc_rx_lock);
+static DEFINE_SPINLOCK(ffa_spmc_tx_lock);
+
 static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
                             uint32_t page_count)
 {
@@ -126,8 +140,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
                      sizeof(struct ffa_address_range) * 2 >
                      FFA_MAX_RXTX_PAGE_COUNT * FFA_PAGE_SIZE);
 
-        spin_lock(&ffa_tx_buffer_lock);
-        rxtx_desc = ffa_tx;
+        rxtx_desc = ffa_rxtx_spmc_tx_acquire();
+        if ( !rxtx_desc )
+            goto err_unmap_rx;
 
         /*
          * We have only one page for each so we pack everything:
@@ -144,7 +159,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
                                              address_range_array[1]);
 
         /* rx buffer */
-        mem_reg = ffa_tx + sizeof(*rxtx_desc);
+        mem_reg = (void *)rxtx_desc + rxtx_desc->rx_region_offs;
         mem_reg->total_page_count = 1;
         mem_reg->address_range_count = 1;
         mem_reg->reserved = 0;
@@ -154,7 +169,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         mem_reg->address_range_array[0].reserved = 0;
 
         /* tx buffer */
-        mem_reg = ffa_tx + rxtx_desc->tx_region_offs;
+        mem_reg = (void *)rxtx_desc + rxtx_desc->tx_region_offs;
         mem_reg->total_page_count = 1;
         mem_reg->address_range_count = 1;
         mem_reg->reserved = 0;
@@ -165,7 +180,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
         ret = ffa_rxtx_map(0, 0, 0);
 
-        spin_unlock(&ffa_tx_buffer_lock);
+        ffa_rxtx_spmc_tx_release();
 
         if ( ret != FFA_RET_OK )
             goto err_unmap_rx;
@@ -319,49 +334,108 @@ void ffa_rxtx_domain_destroy(struct domain *d)
     rxtx_unmap(d);
 }
 
-void ffa_rxtx_destroy(void)
+void *ffa_rxtx_spmc_rx_acquire(void)
+{
+    spin_lock(&ffa_spmc_rx_lock);
+
+    if ( ffa_spmc_rx )
+        return ffa_spmc_rx;
+
+    return NULL;
+}
+
+void ffa_rxtx_spmc_rx_release(void)
+{
+    int32_t ret;
+
+    ASSERT(spin_is_locked(&ffa_spmc_rx_lock));
+
+    /* Inform the SPMC that we are done with our RX buffer */
+    ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+    if ( ret != FFA_RET_OK )
+        printk(XENLOG_DEBUG "Error releasing SPMC RX buffer: %d\n", ret);
+
+    spin_unlock(&ffa_spmc_rx_lock);
+}
+
+void *ffa_rxtx_spmc_tx_acquire(void)
 {
-    bool need_unmap = ffa_tx && ffa_rx;
+    spin_lock(&ffa_spmc_tx_lock);
 
-    if ( ffa_tx )
+    if ( ffa_spmc_tx )
+        return ffa_spmc_tx;
+
+    return NULL;
+}
+
+void ffa_rxtx_spmc_tx_release(void)
+{
+    ASSERT(spin_is_locked(&ffa_spmc_tx_lock));
+
+    spin_unlock(&ffa_spmc_tx_lock);
+}
+
+void ffa_rxtx_spmc_destroy(void)
+{
+    bool need_unmap;
+
+    spin_lock(&ffa_spmc_rx_lock);
+    spin_lock(&ffa_spmc_tx_lock);
+    need_unmap = ffa_spmc_tx && ffa_spmc_rx;
+
+    if ( ffa_spmc_tx )
     {
-        free_xenheap_pages(ffa_tx, 0);
-        ffa_tx = NULL;
+        free_xenheap_pages(ffa_spmc_tx, 0);
+        ffa_spmc_tx = NULL;
     }
-    if ( ffa_rx )
+    if ( ffa_spmc_rx )
     {
-        free_xenheap_pages(ffa_rx, 0);
-        ffa_rx = NULL;
+        free_xenheap_pages(ffa_spmc_rx, 0);
+        ffa_spmc_rx = NULL;
     }
 
     if ( need_unmap )
         ffa_rxtx_unmap(0);
+
+    spin_unlock(&ffa_spmc_tx_lock);
+    spin_unlock(&ffa_spmc_rx_lock);
 }
 
-bool ffa_rxtx_init(void)
+bool ffa_rxtx_spmc_init(void)
 {
     int32_t e;
+    bool ret = false;
 
     /* Firmware not there or not supporting */
     if ( !ffa_fw_supports_fid(FFA_RXTX_MAP_64) )
         return false;
 
-    ffa_rx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
-    if ( !ffa_rx )
-        return false;
+    spin_lock(&ffa_spmc_rx_lock);
+    spin_lock(&ffa_spmc_tx_lock);
 
-    ffa_tx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
-    if ( !ffa_tx )
-        goto err;
+    ffa_spmc_rx = alloc_xenheap_pages(
+                            get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_spmc_rx )
+        goto exit;
 
-    e = ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
+    ffa_spmc_tx = alloc_xenheap_pages(
+                            get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_spmc_tx )
+        goto exit;
+
+    e = ffa_rxtx_map(__pa(ffa_spmc_tx), __pa(ffa_spmc_rx),
+                     FFA_RXTX_PAGE_COUNT);
     if ( e )
-        goto err;
+        goto exit;
+
+    ret = true;
 
-    return true;
+exit:
+    spin_unlock(&ffa_spmc_tx_lock);
+    spin_unlock(&ffa_spmc_rx_lock);
 
-err:
-    ffa_rxtx_destroy();
+    if ( !ret )
+        ffa_rxtx_spmc_destroy();
 
-    return false;
+    return ret;
 }
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index dad3da1922..e275d3769d 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -286,9 +286,8 @@ static void init_range(struct ffa_address_range *addr_range,
 }
 
 /*
- * This function uses the ffa_tx buffer to transmit the memory transaction
- * descriptor. The function depends ffa_tx_buffer_lock to be used to guard
- * the buffer from concurrent use.
+ * This function uses the ffa_spmc tx buffer to transmit the memory transaction
+ * descriptor.
  */
 static int share_shm(struct ffa_shm_mem *shm)
 {
@@ -298,17 +297,22 @@ static int share_shm(struct ffa_shm_mem *shm)
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
     const unsigned int region_count = 1;
-    void *buf = ffa_tx;
     uint32_t frag_len;
     uint32_t tot_len;
     paddr_t last_pa;
     unsigned int n;
     paddr_t pa;
+    int32_t ret;
+    void *buf;
 
-    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
     ASSERT(shm->page_count);
 
+    buf = ffa_rxtx_spmc_tx_acquire();
+    if ( !buf )
+        return FFA_RET_NOT_SUPPORTED;
+
     descr = buf;
+
     memset(descr, 0, sizeof(*descr));
     descr->sender_id = shm->sender_id;
     descr->handle = shm->handle;
@@ -340,7 +344,10 @@ static int share_shm(struct ffa_shm_mem *shm)
     tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
                                 region_descr->address_range_count);
     if ( tot_len > max_frag_len )
-        return FFA_RET_NOT_SUPPORTED;
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
 
     addr_range = region_descr->address_range_array;
     frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
@@ -360,7 +367,12 @@ static int share_shm(struct ffa_shm_mem *shm)
         init_range(addr_range, pa);
     }
 
-    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+
+out:
+    ffa_rxtx_spmc_tx_release();
+
+    return ret;
 }
 
 static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
@@ -579,10 +591,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
-    /* Note that share_shm() uses our tx buffer */
-    spin_lock(&ffa_tx_buffer_lock);
     ret = share_shm(shm);
-    spin_unlock(&ffa_tx_buffer_lock);
     if ( ret )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:22:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:22:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219066.1527946 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Nl-0000Y1-70; Mon, 02 Feb 2026 21:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219066.1527946; Mon, 02 Feb 2026 21: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 1vn1Nl-0000Xt-4O; Mon, 02 Feb 2026 21:22:53 +0000
Received: by outflank-mailman (input) for mailman id 1219066;
 Mon, 02 Feb 2026 21: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 1vn1Nk-0000Xn-IU
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1Nk-00H94p-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1Nk-00EO8Y-1d
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=JIYAxxly8ng4mQ6Kv7K9MbJEq/N1EkenMe3fZft/Oa4=; b=PM+QCaOOresFfwsS+xX9fno4HI
	3hxMTXsVPzBQirP4SunLsnszbB1bzZd6avIWNn/Q2ptzM7r6bfNhPjvPLXJOANvDD0pMe/o3ZHcBu
	iOGn/o39m/ooCuJzgswbBK8HtpGE8Qpcj8wN8hIHeOUW5CcBZDyPggaNZa+/yPIyTwUs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: rework VM RX/TX buffer management
Message-Id: <E1vn1Nk-00EO8Y-1d@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:22:52 +0000

commit 3528248b8c994ee77ad4e4ba884db0ecf235f067
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:23 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: rework VM RX/TX buffer management
    
    Rework access to VM RX/TX buffer to use acquire/release functions
    equivalent to the ones used for the SPMC RX/TX buffers and remove all
    direct access to ctx->tx or ctx->rx by giving back the buffer pointer
    and size back in acquire.
    
    This design ensures that rx or page_count is not accessed without the
    lock held and limit direct usage of the context rx/tx buffer info to
    ffa_rxtx.c
    
    Modify msg, partinfo and shm code to use the new RX/TX buffer
    acquire/release functions and remove all direct accesses to rx/tx and
    page_count so that any access is done only with the lock taken.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          |  2 +-
 xen/arch/arm/tee/ffa_msg.c      | 32 ++++++++++++++++--------------
 xen/arch/arm/tee/ffa_partinfo.c |  8 ++++----
 xen/arch/arm/tee/ffa_private.h  |  6 ++++--
 xen/arch/arm/tee/ffa_rxtx.c     | 43 +++++++++++++++++++++++++++++++++++------
 xen/arch/arm/tee/ffa_shm.c      | 18 ++++++++---------
 6 files changed, 72 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 43af49d1c0..69a5e1e876 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -345,7 +345,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         ffa_handle_partition_info_get(regs);
         return true;
     case FFA_RX_RELEASE:
-        e = ffa_rx_release(d);
+        e = ffa_rx_release(ctx);
         break;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 2c2ebc9c5c..d60eed6d88 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -94,6 +94,8 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     struct domain *dst_d;
     struct ffa_ctx *dst_ctx;
     struct ffa_part_msg_rxtx *dst_msg;
+    void *rx_buf;
+    size_t rx_size;
     int err;
     int32_t ret;
 
@@ -120,20 +122,19 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     }
 
     /* This also checks that destination has set a Rx buffer */
-    ret = ffa_rx_acquire(dst_d);
+    ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
     if ( ret )
         goto out_unlock;
 
     /* we need to have enough space in the destination buffer */
-    if ( (dst_ctx->page_count * FFA_PAGE_SIZE -
-          sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
+    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
     {
         ret = FFA_RET_NO_MEMORY;
-        ffa_rx_release(dst_d);
+        ffa_rx_release(dst_ctx);
         goto out_unlock;
     }
 
-    dst_msg = dst_ctx->rx;
+    dst_msg = rx_buf;
 
     /* prepare destination header */
     dst_msg->flags = 0;
@@ -142,7 +143,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     dst_msg->send_recv_id = src_msg->send_recv_id;
     dst_msg->msg_size = src_msg->msg_size;
 
-    memcpy(dst_ctx->rx + sizeof(struct ffa_part_msg_rxtx),
+    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx),
            src_buf + src_msg->msg_offset, src_msg->msg_size);
 
     /* receiver rx buffer will be released by the receiver*/
@@ -159,17 +160,20 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 {
     struct domain *src_d = current->domain;
     struct ffa_ctx *src_ctx = src_d->arch.tee;
+    const void *tx_buf;
+    size_t tx_size;
     struct ffa_part_msg_rxtx src_msg;
     uint16_t dst_id, src_id;
     int32_t ret;
 
     BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx) >= FFA_PAGE_SIZE);
 
-    if ( !spin_trylock(&src_ctx->tx_lock) )
-        return FFA_RET_BUSY;
+    ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
+    if ( ret != FFA_RET_OK )
+        return ret;
 
     /* create a copy of the message header */
-    memcpy(&src_msg, src_ctx->tx, sizeof(src_msg));
+    memcpy(&src_msg, tx_buf, sizeof(src_msg));
 
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
@@ -182,10 +186,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
     /* check source message fits in buffer */
     if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx) ||
-            src_msg.msg_size == 0 ||
-            src_msg.msg_offset > src_ctx->page_count * FFA_PAGE_SIZE ||
-            src_msg.msg_size > (src_ctx->page_count * FFA_PAGE_SIZE -
-                                src_msg.msg_offset) )
+            src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
+            src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
@@ -206,12 +208,12 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     else if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
         /* Message for a VM */
-        ret = ffa_msg_send2_vm(dst_id, src_ctx->tx, &src_msg);
+        ret = ffa_msg_send2_vm(dst_id, tx_buf, &src_msg);
     }
     else
         ret = FFA_RET_INVALID_PARAMETERS;
 
 out:
-    spin_unlock(&src_ctx->tx_lock);
+    ffa_tx_release(src_ctx);
     return ret;
 }
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 145b869957..16c905cb12 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -224,6 +224,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
         get_user_reg(regs, 4),
     };
     uint32_t dst_size = 0;
+    size_t buf_size;
     void *dst_buf, *end_buf;
     uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
 
@@ -268,12 +269,11 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
     }
 
     /* Get the RX buffer to write the list of partitions */
-    ret = ffa_rx_acquire(d);
+    ret = ffa_rx_acquire(ctx, &dst_buf, &buf_size);
     if ( ret != FFA_RET_OK )
         goto out;
 
-    dst_buf = ctx->rx;
-    end_buf = ctx->rx + ctx->page_count * FFA_PAGE_SIZE;
+    end_buf = dst_buf + buf_size;
 
     /* An entry should be smaller than a page */
     BUILD_BUG_ON(sizeof(struct ffa_partition_info_1_1) > FFA_PAGE_SIZE);
@@ -304,7 +304,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
 
 out_rx_release:
     if ( ret )
-        ffa_rx_release(d);
+        ffa_rx_release(ctx);
 out:
     if ( ret )
         ffa_set_regs_error(regs, ret);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 4c97041829..904ad1df73 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -445,8 +445,10 @@ void ffa_rxtx_domain_destroy(struct domain *d);
 int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count);
 int32_t ffa_handle_rxtx_unmap(void);
-int32_t ffa_rx_acquire(struct domain *d);
-int32_t ffa_rx_release(struct domain *d);
+int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size);
+int32_t ffa_rx_release(struct ffa_ctx *ctx);
+int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size);
+int32_t ffa_tx_release(struct ffa_ctx *ctx);
 
 void ffa_notif_init(void);
 void ffa_notif_init_interrupt(void);
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 63203b22b8..7d8bb4f4d0 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -257,10 +257,9 @@ int32_t ffa_handle_rxtx_unmap(void)
     return rxtx_unmap(current->domain);
 }
 
-int32_t ffa_rx_acquire(struct domain *d)
+int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
 {
     int32_t ret = FFA_RET_OK;
-    struct ffa_ctx *ctx = d->arch.tee;
 
     spin_lock(&ctx->rx_lock);
 
@@ -278,21 +277,22 @@ int32_t ffa_rx_acquire(struct domain *d)
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        ret = ffa_simple_call(FFA_RX_ACQUIRE, ffa_get_vm_id(d), 0, 0, 0);
+        ret = ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
             goto out;
     }
     ctx->rx_is_free = false;
+    *buf = ctx->rx;
+    *buf_size = ctx->page_count * FFA_PAGE_SIZE;
 out:
     spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
 
-int32_t ffa_rx_release(struct domain *d)
+int32_t ffa_rx_release(struct ffa_ctx *ctx)
 {
     int32_t ret = FFA_RET_DENIED;
-    struct ffa_ctx *ctx = d->arch.tee;
 
     spin_lock(&ctx->rx_lock);
 
@@ -301,7 +301,7 @@ int32_t ffa_rx_release(struct domain *d)
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        ret = ffa_simple_call(FFA_RX_RELEASE, ffa_get_vm_id(d), 0, 0, 0);
+        ret = ffa_simple_call(FFA_RX_RELEASE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
             goto out;
     }
@@ -313,6 +313,37 @@ out:
     return ret;
 }
 
+int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size)
+{
+    int32_t ret = FFA_RET_DENIED;
+
+    if ( !spin_trylock(&ctx->tx_lock) )
+        return FFA_RET_BUSY;
+
+    if ( !ctx->page_count )
+        goto err_unlock;
+
+    if ( !ctx->tx )
+        goto err_unlock;
+
+    *buf = ctx->tx;
+    *buf_size = ctx->page_count * FFA_PAGE_SIZE;
+    return FFA_RET_OK;
+
+err_unlock:
+    spin_unlock(&ctx->tx_lock);
+
+    return ret;
+}
+
+int32_t ffa_tx_release(struct ffa_ctx *ctx)
+{
+    ASSERT(spin_is_locked(&ctx->tx_lock));
+
+    spin_unlock(&ctx->tx_lock);
+    return FFA_RET_OK;
+}
+
 int32_t ffa_rxtx_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index e275d3769d..b862578c55 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -460,6 +460,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     struct ffa_mem_transaction_int trans;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    const void *tx_buf;
+    size_t tx_size;
     struct ffa_shm_mem *shm = NULL;
     register_t handle_hi = 0;
     register_t handle_lo = 0;
@@ -498,16 +500,14 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    if ( !spin_trylock(&ctx->tx_lock) )
-    {
-        ret = FFA_RET_BUSY;
+    ret = ffa_tx_acquire(ctx, &tx_buf, &tx_size);
+    if ( ret != FFA_RET_OK )
         goto out_set_ret;
-    }
 
-    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
+    if ( frag_len > tx_size )
         goto out_unlock;
 
-    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), ctx->tx,
+    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), tx_buf,
                                frag_len, &trans);
     if ( ret )
         goto out_unlock;
@@ -535,7 +535,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
         goto out_unlock;
 
-    mem_access = ctx->tx + trans.mem_access_offs;
+    mem_access = tx_buf + trans.mem_access_offs;
 
     dst_id = ACCESS_ONCE(mem_access->access_perm.endpoint_id);
     if ( !FFA_ID_IS_SECURE(dst_id) )
@@ -558,7 +558,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
-    region_descr = ctx->tx + region_offs;
+    region_descr = tx_buf + region_offs;
     range_count = ACCESS_ONCE(region_descr->address_range_count);
     page_count = ACCESS_ONCE(region_descr->total_page_count);
 
@@ -605,7 +605,7 @@ out:
     if ( ret )
         free_ffa_shm_mem(d, shm);
 out_unlock:
-    spin_unlock(&ctx->tx_lock);
+    ffa_tx_release(ctx);
 
 out_set_ret:
     if ( ret == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219067.1527950 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Nv-0000aM-8Z; Mon, 02 Feb 2026 21:23:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219067.1527950; Mon, 02 Feb 2026 21: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 1vn1Nv-0000aD-5s; Mon, 02 Feb 2026 21:23:03 +0000
Received: by outflank-mailman (input) for mailman id 1219067;
 Mon, 02 Feb 2026 21: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 1vn1Nu-0000a7-LR
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1Nu-00H95D-38
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1Nu-00EOAC-1v
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=m8zgJwCaIs7cIuma1EU02uocSOQZAGXQNzlPWEmhLXo=; b=tCivQwJb7Ier2uIMQYR8zT6SGe
	PJvjQZlyVg/GeBk6nRZTrxve3MDAwTrzW8xrutooYaT+NvF6+YY90LrW7jhNExN1WSgdhJvePz0uc
	NXElCjxjZOHqNcV/rGDy6XSz0Py29VOmKI4xM4tvRdL+I8rXLY3lP06SkqO3mnuuDPVg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: use signed 32-bit status codes
Message-Id: <E1vn1Nu-00EOAC-1v@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:02 +0000

commit 00c4db573101eb765c888153e3e741850c8787c7
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:24 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: use signed 32-bit status codes
    
    The FF-A spec defines return status values as signed 32-bit integers.
    Align the Xen mediator with this requirement by:
    
    - switching the FF-A helpers (ffa_handle_mem_reclaim(), partition info
      init, notification ops, dispatcher glue, etc.) to int32_t return types
      so callers cannot silently truncate negative values
    - masking SMCCC responses/exits in ffa_get_version(),
      ffa_get_ret_code() and ffa_set_regs_error() to 32 bits before storing
      them in guest registers
    - updating notifier, shared-memory reclaim, partition-info and
      dispatcher call sites to use the new prototypes so the entire FF-A
      path propagates spec-compliant 32-bit signed error codes
    
    While there, tidy up the FF-A notification helpers by using GENMASK(15, 0)
    for endpoint extraction and fix the secure-endpoint check in
    ffa_handle_notification_set() to apply the mask to the endpoint ID before
    calling FFA_ID_IS_SECURE(), instead of testing the wrong halfword of
    src_dst.
    
    Fixes: 911b305e7bdab ("xen/arm: ffa: Enable VM to VM without firmware")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 12 +++++++-----
 xen/arch/arm/tee/ffa_notif.c    | 14 +++++++-------
 xen/arch/arm/tee/ffa_partinfo.c |  4 ++--
 xen/arch/arm/tee/ffa_private.h  | 21 +++++++++++----------
 xen/arch/arm/tee/ffa_shm.c      |  4 ++--
 5 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 69a5e1e876..2c09d10ae6 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -129,12 +129,14 @@ static bool ffa_get_version(uint32_t *vers)
         .a1 = FFA_MY_VERSION,
     };
     struct arm_smccc_1_2_regs resp;
+    int32_t ret;
 
     arm_smccc_1_2_smc(&arg, &resp);
-    if ( resp.a0 == FFA_RET_NOT_SUPPORTED )
+    ret = resp.a0 & GENMASK_ULL(31, 0);
+    if ( ret == FFA_RET_NOT_SUPPORTED )
         return false;
 
-    *vers = resp.a0;
+    *vers = resp.a0 & GENMASK_ULL(31, 0);
 
     return true;
 }
@@ -310,7 +312,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    int e;
+    int32_t e;
 
     if ( !ctx )
         return false;
@@ -382,8 +384,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
-        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
-        return true;
+        e = FFA_RET_NOT_SUPPORTED;
+        break;
     }
 
     if ( e )
diff --git a/xen/arch/arm/tee/ffa_notif.c b/xen/arch/arm/tee/ffa_notif.c
index 86bef6b3b2..37b05747cd 100644
--- a/xen/arch/arm/tee/ffa_notif.c
+++ b/xen/arch/arm/tee/ffa_notif.c
@@ -19,7 +19,7 @@
 static bool __ro_after_init fw_notif_enabled;
 static unsigned int __ro_after_init notif_sri_irq;
 
-int ffa_handle_notification_bind(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_bind(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
@@ -27,7 +27,7 @@ int ffa_handle_notification_bind(struct cpu_user_regs *regs)
     uint32_t bitmap_lo = get_user_reg(regs, 3);
     uint32_t bitmap_hi = get_user_reg(regs, 4);
 
-    if ( (src_dst & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (src_dst & GENMASK(15, 0)) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
     if ( flags )    /* Only global notifications are supported */
@@ -40,14 +40,14 @@ int ffa_handle_notification_bind(struct cpu_user_regs *regs)
     return FFA_RET_NOT_SUPPORTED;
 }
 
-int ffa_handle_notification_unbind(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_unbind(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
     uint32_t bitmap_lo = get_user_reg(regs, 3);
     uint32_t bitmap_hi = get_user_reg(regs, 4);
 
-    if ( (src_dst & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (src_dst & GENMASK(15, 0)) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
     if ( FFA_ID_IS_SECURE(src_dst >> 16) && fw_notif_enabled )
@@ -106,7 +106,7 @@ void ffa_handle_notification_get(struct cpu_user_regs *regs)
         return;
     }
 
-    if ( (recv & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (recv & GENMASK(15, 0)) != ffa_get_vm_id(d) )
     {
         ffa_set_regs_error(regs, FFA_RET_INVALID_PARAMETERS);
         return;
@@ -162,7 +162,7 @@ void ffa_handle_notification_get(struct cpu_user_regs *regs)
     ffa_set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, w4, w5, w6, w7);
 }
 
-int ffa_handle_notification_set(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_set(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
@@ -173,7 +173,7 @@ int ffa_handle_notification_set(struct cpu_user_regs *regs)
     if ( (src_dst >> 16) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
-    if ( FFA_ID_IS_SECURE(src_dst >> 16) && fw_notif_enabled )
+    if ( FFA_ID_IS_SECURE(src_dst & GENMASK(15, 0)) && fw_notif_enabled )
         return ffa_simple_call(FFA_NOTIFICATION_SET, src_dst, flags, bitmap_lo,
                                bitmap_hi);
 
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 16c905cb12..c9faf54158 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -448,7 +448,7 @@ bool ffa_partinfo_init(void)
     bool ret = false;
     uint32_t fpi_size;
     uint32_t count;
-    int e;
+    int32_t e;
     void *spmc_rx;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
@@ -515,7 +515,7 @@ static void vm_destroy_bitmap_init(struct ffa_ctx *ctx,
     }
 }
 
-int ffa_partinfo_domain_init(struct domain *d)
+int32_t ffa_partinfo_domain_init(struct domain *d)
 {
     unsigned int count = BITS_TO_LONGS(subscr_vm_destroyed_count);
     struct ffa_ctx *ctx = d->arch.tee;
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 904ad1df73..c274177029 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -31,9 +31,9 @@
 
 /* FFA_VERSION helpers */
 #define FFA_VERSION_MAJOR_SHIFT         16U
-#define FFA_VERSION_MAJOR_MASK          0x7FFFU
+#define FFA_VERSION_MAJOR_MASK          GENMASK(14, 0)
 #define FFA_VERSION_MINOR_SHIFT         0U
-#define FFA_VERSION_MINOR_MASK          0xFFFFU
+#define FFA_VERSION_MINOR_MASK          GENMASK(15, 0)
 #define MAKE_FFA_VERSION(major, minor)  \
         ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT) | \
          ((minor) & FFA_VERSION_MINOR_MASK))
@@ -426,10 +426,10 @@ extern atomic_t ffa_vm_count;
 
 bool ffa_shm_domain_destroy(struct domain *d);
 void ffa_handle_mem_share(struct cpu_user_regs *regs);
-int ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags);
+int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags);
 
 bool ffa_partinfo_init(void);
-int ffa_partinfo_domain_init(struct domain *d);
+int32_t ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
@@ -455,11 +455,11 @@ void ffa_notif_init_interrupt(void);
 int ffa_notif_domain_init(struct domain *d);
 void ffa_notif_domain_destroy(struct domain *d);
 
-int ffa_handle_notification_bind(struct cpu_user_regs *regs);
-int ffa_handle_notification_unbind(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_bind(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_unbind(struct cpu_user_regs *regs);
 void ffa_handle_notification_info_get(struct cpu_user_regs *regs);
 void ffa_handle_notification_get(struct cpu_user_regs *regs);
-int ffa_handle_notification_set(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_set(struct cpu_user_regs *regs);
 
 #ifdef CONFIG_FFA_VM_TO_VM
 void ffa_raise_rx_buffer_full(struct domain *d);
@@ -525,9 +525,10 @@ static inline void ffa_set_regs(struct cpu_user_regs *regs, register_t v0,
 }
 
 static inline void ffa_set_regs_error(struct cpu_user_regs *regs,
-                                      uint32_t error_code)
+                                      int32_t error_code)
 {
-    ffa_set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
+    ffa_set_regs(regs, FFA_ERROR, 0, error_code & GENMASK_ULL(31, 0), 0, 0, 0,
+                 0, 0);
 }
 
 static inline void ffa_set_regs_success(struct cpu_user_regs *regs,
@@ -542,7 +543,7 @@ static inline int32_t ffa_get_ret_code(const struct arm_smccc_1_2_regs *resp)
     {
     case FFA_ERROR:
         if ( resp->a2 )
-            return resp->a2;
+            return resp->a2 & GENMASK_ULL(31, 0);
         else
             return FFA_RET_NOT_SUPPORTED;
     case FFA_SUCCESS_32:
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index b862578c55..8282bacf85 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -626,14 +626,14 @@ static struct ffa_shm_mem *find_shm_mem(struct ffa_ctx *ctx, uint64_t handle)
     return NULL;
 }
 
-int ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
+int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
 {
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
     register_t handle_hi;
     register_t handle_lo;
-    int ret;
+    int32_t ret;
 
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
         return FFA_RET_NOT_SUPPORTED;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219068.1527954 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1O5-0000cb-A4; Mon, 02 Feb 2026 21:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219068.1527954; Mon, 02 Feb 2026 21: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 1vn1O5-0000cT-7K; Mon, 02 Feb 2026 21:23:13 +0000
Received: by outflank-mailman (input) for mailman id 1219068;
 Mon, 02 Feb 2026 21: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 1vn1O4-0000cN-Ny
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21: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 1vn1O5-00H95M-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1O4-00EOBm-2D
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21: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=zXEACA0zUxspetulU5hmSjbqwS+Db+Fmmdr5Pep6e6w=; b=VM5PgzyLMZ+S+KzAS4fQKitUDo
	2+5CGIGURu9i7n9vmKArrvbzI4KfoM5qImfBaKcpS0AGSxdQcnCt+Kx38eMNA1YY5PeSu1cfqDHyX
	qUEDERfTXx1M3jEyYhVA6iMyaPF0A7/f69ExGswf9xBdT6qmVWq6HQ+1T9w/esZnRyD4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: add UUID helpers for partition info
Message-Id: <E1vn1O4-00EOBm-2D@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:12 +0000

commit 5c856002700e7c58fdf54f24835d34f06efa9234
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:25 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add UUID helpers for partition info
    
    Introduce struct ffa_uuid together with nil/equality/set helpers, and
    use it end-to-end in the partition-info plumbing.
    
    The SP and VM enumeration paths now build UUIDs from the guest
    registers, call a new ffa_copy_info() helper and ensure non-nil UUID
    queries only return matching SP entries, relying on firmware UUID
    filtering. VM entries are skipped because we do not track per-VM UUIDs.
    
    Count requests and subscriber initialisation are updated accordingly so
    firmware is always called with an explicit UUID. This keeps count and
    listing requests aligned with the FF-A v1.1 rules while preserving the
    Linux compatibility workaround for v1.2 requesters.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_partinfo.c | 209 +++++++++++++++++++++++++---------------
 xen/arch/arm/tee/ffa_private.h  |  21 ++++
 2 files changed, 154 insertions(+), 76 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index c9faf54158..bf906ed0c8 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -33,7 +33,7 @@ static uint16_t subscr_vm_created_count __read_mostly;
 static uint16_t *subscr_vm_destroyed __read_mostly;
 static uint16_t subscr_vm_destroyed_count __read_mostly;
 
-static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
+static int32_t ffa_partition_info_get(struct ffa_uuid uuid, uint32_t flags,
                                       uint32_t *count, uint32_t *fpi_size)
 {
     struct arm_smccc_1_2_regs arg = {
@@ -41,15 +41,12 @@ static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
         .a5 = flags,
     };
     struct arm_smccc_1_2_regs resp;
-    uint32_t ret;
+    int32_t ret;
 
-    if ( uuid )
-    {
-        arg.a1 = uuid[0];
-        arg.a2 = uuid[1];
-        arg.a3 = uuid[2];
-        arg.a4 = uuid[3];
-    }
+    arg.a1 = uuid.val[0] & GENMASK(31, 0);
+    arg.a2 = (uuid.val[0] >> 32) & GENMASK(31, 0);
+    arg.a3 = uuid.val[1] & GENMASK(31, 0);
+    arg.a4 = (uuid.val[1] >> 32) & GENMASK(31, 0);
 
     arm_smccc_1_2_smc(&arg, &resp);
 
@@ -63,7 +60,26 @@ static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
     return ret;
 }
 
-static int32_t ffa_get_sp_count(uint32_t *uuid, uint32_t *sp_count)
+static int32_t ffa_copy_info(void **dst, void *dst_end, const void *src,
+                             uint32_t dst_size, uint32_t src_size)
+{
+    uint8_t *pos = *dst;
+    uint8_t *end = dst_end;
+
+    if ( pos > end - dst_size )
+        return FFA_RET_NO_MEMORY;
+
+    memcpy(pos, src, MIN(dst_size, src_size));
+
+    if ( dst_size > src_size )
+        memset(pos + src_size, 0, dst_size - src_size);
+
+    *dst = pos + dst_size;
+
+    return FFA_RET_OK;
+}
+
+static int32_t ffa_get_sp_count(struct ffa_uuid uuid, uint32_t *sp_count)
 {
     uint32_t src_size;
 
@@ -71,8 +87,8 @@ static int32_t ffa_get_sp_count(uint32_t *uuid, uint32_t *sp_count)
                                   sp_count, &src_size);
 }
 
-static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
-                                   void *dst_buf, void *end_buf,
+static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
+                                   void **dst_buf, void *end_buf,
                                    uint32_t dst_size)
 {
     int32_t ret;
@@ -120,17 +136,18 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
         /* filter out SP not following bit 15 convention if any */
         if ( FFA_ID_IS_SECURE(fpi->id) )
         {
-            if ( dst_buf > (end_buf - dst_size) )
-            {
-                ret = FFA_RET_NO_MEMORY;
-                goto out;
-            }
+            /*
+             * If VM is 1.0 but firmware is 1.1 we could have several entries
+             * with the same ID but different UUIDs. In this case the VM will
+             * get a list with several time the same ID.
+             * This is a non-compliance to the specification but 1.0 VMs should
+             * handle that on their own to simplify Xen implementation.
+             */
 
-            memcpy(dst_buf, src_buf, MIN(src_size, dst_size));
-            if ( dst_size > src_size )
-                memset(dst_buf + src_size, 0, dst_size - src_size);
+            ret = ffa_copy_info(dst_buf, end_buf, src_buf, dst_size, src_size);
+            if ( ret )
+                goto out;
 
-            dst_buf += dst_size;
             count++;
         }
 
@@ -144,69 +161,90 @@ out:
     return ret;
 }
 
-static int32_t ffa_get_vm_partinfo(uint32_t *vm_count, void *dst_buf,
-                                   void *end_buf, uint32_t dst_size)
+static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t *vm_count,
+                                   void **dst_buf, void *end_buf,
+                                   uint32_t dst_size)
 {
-    struct ffa_ctx *curr_ctx = current->domain->arch.tee;
+    struct domain *d = current->domain;
+    struct ffa_ctx *curr_ctx = d->arch.tee;
     struct ffa_ctx *dest_ctx;
     uint32_t count = 0;
     int32_t ret = FFA_RET_OK;
+    /*
+     * We do not have UUID info for VMs so use the 1.0 structure so that we set
+     * UUIDs to zero using memset
+     */
+    struct ffa_partition_info_1_0 info;
 
     /*
-     * There could potentially be a lot of VMs in the system and we could
-     * hold the CPU for long here.
-     * Right now there is no solution in FF-A specification to split
-     * the work in this case.
-     * TODO: Check how we could delay the work or have preemption checks.
+     * We do not have protocol UUIDs for VMs so if a request has non Nil UUID
+     * we must return an empty list.
      */
-    read_lock(&ffa_ctx_list_rwlock);
-    list_for_each_entry(dest_ctx, &ffa_ctx_head, ctx_list)
+    if ( !ffa_uuid_is_nil(uuid) )
+    {
+        *vm_count = 0;
+        return FFA_RET_OK;
+    }
+
+    /*
+     * Workaround for Linux FF-A Driver not accepting to have its own
+     * entry in the list before FF-A v1.2 was supported.
+     * This workaround is generally acceptable for other implementations
+     * as the specification was not completely clear on wether or not
+     * the requester endpoint information should be included or not
+     */
+    if ( ACCESS_ONCE(curr_ctx->guest_vers) >= FFA_VERSION_1_2 )
+    {
+        /* Add caller VM information */
+        info.id = curr_ctx->ffa_id;
+        info.execution_context = curr_ctx->num_vcpus;
+        info.partition_properties = FFA_PART_VM_PROP;
+        if ( is_64bit_domain(d) )
+            info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
+
+        ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size, sizeof(info));
+        if ( ret )
+            return ret;
+
+        count++;
+    }
+
+    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
         /*
-         * Do not include an entry for the caller VM as the spec is not
-         * clearly mandating it and it is not supported by Linux.
+         * There could potentially be a lot of VMs in the system and we could
+         * hold the CPU for long here.
+         * Right now there is no solution in FF-A specification to split
+         * the work in this case.
+         * TODO: Check how we could delay the work or have preemption checks.
          */
-        if ( dest_ctx != curr_ctx )
+        read_lock(&ffa_ctx_list_rwlock);
+        list_for_each_entry(dest_ctx, &ffa_ctx_head, ctx_list)
         {
-            /*
-             * We do not have UUID info for VMs so use
-             * the 1.0 structure so that we set UUIDs to
-             * zero using memset
-             */
-            struct ffa_partition_info_1_0 info;
+            /* Ignore the caller entry as it was already added */
+            if ( dest_ctx == curr_ctx )
+                continue;
 
-            if  ( dst_buf > (end_buf - dst_size) )
-            {
-                ret = FFA_RET_NO_MEMORY;
-                goto out;
-            }
-
-            /*
-             * Context might has been removed since we go it or being removed
-             * right now so we might return information for a VM not existing
-             * anymore. This is acceptable as we return a view of the system
-             * which could change at any time.
-             */
             info.id = dest_ctx->ffa_id;
             info.execution_context = dest_ctx->num_vcpus;
             info.partition_properties = FFA_PART_VM_PROP;
             if ( dest_ctx->is_64bit )
                 info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
 
-            memcpy(dst_buf, &info, MIN(sizeof(info), dst_size));
-
-            if ( dst_size > sizeof(info) )
-                memset(dst_buf + sizeof(info), 0,
-                       dst_size - sizeof(info));
+            ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size,
+                                sizeof(info));
+            if ( ret )
+            {
+                read_unlock(&ffa_ctx_list_rwlock);
+                return ret;
+            }
 
-            dst_buf += dst_size;
             count++;
         }
+        read_unlock(&ffa_ctx_list_rwlock);
     }
-    *vm_count = count;
 
-out:
-    read_unlock(&ffa_ctx_list_rwlock);
+    *vm_count = count;
 
     return ret;
 }
@@ -217,17 +255,18 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     uint32_t flags = get_user_reg(regs, 5);
-    uint32_t uuid[4] = {
-        get_user_reg(regs, 1),
-        get_user_reg(regs, 2),
-        get_user_reg(regs, 3),
-        get_user_reg(regs, 4),
-    };
+    struct ffa_uuid uuid;
     uint32_t dst_size = 0;
     size_t buf_size;
     void *dst_buf, *end_buf;
     uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
 
+    ffa_uuid_set(&uuid,
+             get_user_reg(regs, 1),
+             get_user_reg(regs, 2),
+             get_user_reg(regs, 3),
+             get_user_reg(regs, 4));
+
     /*
      * If the guest is v1.0, he does not get back the entry size so we must
      * use the v1.0 structure size in the destination buffer.
@@ -260,10 +299,23 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
         }
 
         /*
-         * Do not count the caller VM as the spec is not clearly mandating it
-         * and it is not supported by Linux.
+         * We do not have protocol UUIDs for VMs so if a request has non Nil
+         * UUID we must return a vm_count of 0
          */
-        ffa_vm_count = get_ffa_vm_count() - 1;
+        if ( ffa_uuid_is_nil(uuid) )
+        {
+            ffa_vm_count = get_ffa_vm_count();
+
+            /*
+             * Workaround for Linux FF-A Driver not accepting to have its own
+             * entry in the list before FF-A v1.2 was supported.
+             * This workaround is generally acceptable for other implementations
+             * as the specification was not completely clear on wether or not
+             * the requester endpoint information should be included or not
+             */
+            if ( ACCESS_ONCE(ctx->guest_vers) < FFA_VERSION_1_2 )
+                ffa_vm_count -= 1;
+        }
 
         goto out;
     }
@@ -290,17 +342,15 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
 
     if ( ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) )
     {
-        ret = ffa_get_sp_partinfo(uuid, &ffa_sp_count, dst_buf, end_buf,
+        ret = ffa_get_sp_partinfo(uuid, &ffa_sp_count, &dst_buf, end_buf,
                                   dst_size);
 
         if ( ret )
             goto out_rx_release;
-
-        dst_buf += ffa_sp_count * dst_size;
     }
 
-    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
-        ret = ffa_get_vm_partinfo(&ffa_vm_count, dst_buf, end_buf, dst_size);
+    ret = ffa_get_vm_partinfo(uuid, &ffa_vm_count, &dst_buf, end_buf,
+                              dst_size);
 
 out_rx_release:
     if ( ret )
@@ -309,7 +359,13 @@ out:
     if ( ret )
         ffa_set_regs_error(regs, ret);
     else
+    {
+        /* Size should be 0 on count request and was not supported in 1.0 */
+        if ( flags || ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 )
+            dst_size = 0;
+
         ffa_set_regs_success(regs, ffa_sp_count + ffa_vm_count, dst_size);
+    }
 }
 
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
@@ -450,6 +506,7 @@ bool ffa_partinfo_init(void)
     uint32_t count;
     int32_t e;
     void *spmc_rx;
+    struct ffa_uuid nil_uuid = { .val = { 0ULL, 0ULL } };
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
          !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
@@ -459,7 +516,7 @@ bool ffa_partinfo_init(void)
     if (!spmc_rx)
         return false;
 
-    e = ffa_partition_info_get(NULL, 0, &count, &fpi_size);
+    e = ffa_partition_info_get(nil_uuid, 0, &count, &fpi_size);
     if ( e )
     {
         printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index c274177029..fb5212bd28 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -307,6 +307,10 @@ struct ffa_mem_region {
     struct ffa_address_range address_range_array[];
 };
 
+struct ffa_uuid {
+    uint64_t val[2];
+};
+
 struct ffa_ctx_notif {
     /*
      * True if domain is reported by FFA_NOTIFICATION_INFO_GET to have
@@ -581,4 +585,21 @@ static inline bool ffa_fw_supports_fid(uint32_t fid)
     return test_bit(FFA_ABI_BITNUM(fid), ffa_fw_abi_supported);
 }
 
+static inline bool ffa_uuid_is_nil(struct ffa_uuid id)
+{
+    return id.val[0] == 0 && id.val[1] == 0;
+}
+
+static inline bool ffa_uuid_equal(struct ffa_uuid id1, struct ffa_uuid id2)
+{
+    return id1.val[0] == id2.val[0] && id1.val[1] == id2.val[1];
+}
+
+static inline void ffa_uuid_set(struct ffa_uuid *id, uint32_t val0,
+                                uint32_t val1, uint32_t val2, uint32_t val3)
+{
+    id->val[0] = ((uint64_t)val1 << 32U) | val0;
+    id->val[1] = ((uint64_t)val3 << 32U) | val2;
+}
+
 #endif /*__FFA_PRIVATE_H__*/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219069.1527957 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1OF-0000fK-Ck; Mon, 02 Feb 2026 21:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219069.1527957; Mon, 02 Feb 2026 21:23: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 1vn1OF-0000fC-AA; Mon, 02 Feb 2026 21:23:23 +0000
Received: by outflank-mailman (input) for mailman id 1219069;
 Mon, 02 Feb 2026 21:23: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 1vn1OE-0000f5-RU
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21:23: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 1vn1OF-00H95Q-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1OE-00EOD8-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23: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=7vsXKNNGvaSpk/+49lcL8ca/OtE6Hjga2sw6NM68G2I=; b=h6xf7UQtWsJOpafKBhnSh8fxBR
	hArDuX2WY/4q0vMXVm4H3VH032HPehOjRvYIFcW1/1DsWvQoR+3qzsg1VXdyImO9ulHn4ZxBKXLMF
	GawOK6VB8ToUY0haYbBFfaTEyvLnc3P2bbcy/gVjsPISy7hv10EKdZi9gAaV/cSL6nLY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Add FFA_RUN support
Message-Id: <E1vn1OE-00EOD8-2U@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:22 +0000

commit 7a90dad8de405d032f06b79bcd2014cecf4526b2
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:26 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: Add FFA_RUN support
    
    Add FFA_RUN support and remove mention that YIELD and INTERRUPT are not
    supported in the comment as we will now return them.
    
    Make FFA_FEATURE answer supported for RUN, YIELD and INTERRUPT.
    
    Share the SMCCC plumbing used by SEND_DIRECT and RUN via a common
    ffa_finish_direct_req_run() helper so canonical success and error cases
    are handled in one place.
    
    The dispatcher now routes FFA_RUN through ffa_handle_run(), and direct
    requests bail out early if a guest targets itself or a non-secure
    endpoint. This simplifies the direct path while adding support for
    INTERRUPT or YIELD answers from secure world.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |   9 ++--
 xen/arch/arm/tee/ffa_msg.c     | 111 +++++++++++++++++++++++++++++------------
 xen/arch/arm/tee/ffa_private.h |   1 +
 3 files changed, 87 insertions(+), 34 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2c09d10ae6..0f07efe5a7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -24,9 +24,6 @@
  * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
  *   or access of a memory region
  * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
- * o FFA_MSG_YIELD
- * o FFA_INTERRUPT - Used to report preemption
- * o FFA_RUN
  *
  * Limitations in the implemented FF-A interfaces:
  * o FFA_RXTX_MAP_*:
@@ -266,6 +263,9 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
     case FFA_MSG_SEND2:
+    case FFA_RUN:
+    case FFA_INTERRUPT:
+    case FFA_MSG_YIELD:
         ffa_set_regs_success(regs, 0, 0);
         break;
     case FFA_MEM_SHARE_64:
@@ -353,6 +353,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         ffa_handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_RUN:
+        ffa_handle_run(regs, fid);
+        return true;
     case FFA_MSG_SEND2:
         e = ffa_handle_msg_send2(regs);
         break;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index d60eed6d88..5a4cb1bb82 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -21,42 +21,74 @@ struct ffa_part_msg_rxtx {
     uint32_t msg_size;
 };
 
-void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
+                                      struct arm_smccc_1_2_regs *req)
 {
-    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
     struct arm_smccc_1_2_regs resp = { };
-    struct domain *d = current->domain;
-    uint32_t src_dst;
     uint64_t mask;
 
-    if ( smccc_is_conv_64(fid) )
+    arm_smccc_1_2_smc(req, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+    case FFA_MSG_SEND_DIRECT_RESP_32:
+    case FFA_MSG_SEND_DIRECT_RESP_64:
+    case FFA_MSG_YIELD:
+    case FFA_INTERRUPT:
+        break;
+    default:
+        /* Bad fid, report back to the caller. */
+        ffa_set_regs_error(regs, FFA_RET_ABORTED);
+        return;
+    }
+
+    if ( smccc_is_conv_64(resp.a0) )
         mask = GENMASK_ULL(63, 0);
     else
         mask = GENMASK_ULL(31, 0);
 
+    ffa_set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
+                 resp.a4 & mask, resp.a5 & mask, resp.a6 & mask,
+                 resp.a7 & mask);
+}
+
+void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    struct domain *d = current->domain;
+    uint32_t src_dst;
+    uint64_t mask;
+    int32_t ret;
+
     if ( !ffa_fw_supports_fid(fid) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_NOT_SUPPORTED;
+        ret = FFA_RET_NOT_SUPPORTED;
         goto out;
     }
 
     src_dst = get_user_reg(regs, 1);
-    if ( (src_dst >> 16) != ffa_get_vm_id(d) )
+    if ( (src_dst >> 16) != ffa_get_vm_id(d) ||
+         (src_dst & GENMASK(15,0)) == ffa_get_vm_id(d) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_INVALID_PARAMETERS;
+        ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
     }
 
     /* we do not support direct messages to VMs */
     if ( !FFA_ID_IS_SECURE(src_dst & GENMASK(15,0)) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_NOT_SUPPORTED;
+        ret = FFA_RET_NOT_SUPPORTED;
         goto out;
     }
 
+    if ( smccc_is_conv_64(fid) )
+        mask = GENMASK_ULL(63, 0);
+    else
+        mask = GENMASK_ULL(31, 0);
+
     arg.a1 = src_dst;
     arg.a2 = get_user_reg(regs, 2) & mask;
     arg.a3 = get_user_reg(regs, 3) & mask;
@@ -65,27 +97,11 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     arg.a6 = get_user_reg(regs, 6) & mask;
     arg.a7 = get_user_reg(regs, 7) & mask;
 
-    arm_smccc_1_2_smc(&arg, &resp);
-    switch ( resp.a0 )
-    {
-    case FFA_ERROR:
-    case FFA_SUCCESS_32:
-    case FFA_SUCCESS_64:
-    case FFA_MSG_SEND_DIRECT_RESP_32:
-    case FFA_MSG_SEND_DIRECT_RESP_64:
-        break;
-    default:
-        /* Bad fid, report back to the caller. */
-        memset(&resp, 0, sizeof(resp));
-        resp.a0 = FFA_ERROR;
-        resp.a1 = src_dst;
-        resp.a2 = FFA_RET_ABORTED;
-    }
+    ffa_finish_direct_req_run(regs, &arg);
+    return;
 
 out:
-    ffa_set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
-                 resp.a4 & mask, resp.a5 & mask, resp.a6 & mask,
-                 resp.a7 & mask);
+    ffa_set_regs_error(regs, ret);
 }
 
 static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
@@ -217,3 +233,36 @@ out:
     ffa_tx_release(src_ctx);
     return ret;
 }
+
+void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    uint32_t dst = get_user_reg(regs, 1);
+    int32_t ret;
+
+    if ( !ffa_fw_supports_fid(fid) )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
+
+    /*
+     * We do not support FFA_RUN to VMs.
+     * Destination endpoint ID is in bits [31:16], bits[15:0] contain the
+     * vCPU ID.
+     */
+    if ( !FFA_ID_IS_SECURE(dst >> 16) )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
+
+    arg.a1 = dst;
+
+    ffa_finish_direct_req_run(regs, &arg);
+
+    return;
+
+out:
+    ffa_set_regs_error(regs, ret);
+}
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index fb5212bd28..1fbd3fc3a6 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -475,6 +475,7 @@ static inline void ffa_raise_rx_buffer_full(struct domain *d)
 
 void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid);
 int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs);
+void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid);
 
 #ifdef CONFIG_FFA_VM_TO_VM
 static inline uint16_t get_ffa_vm_count(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219070.1527962 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1OP-0000hT-Ea; Mon, 02 Feb 2026 21:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219070.1527962; Mon, 02 Feb 2026 21:23: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 1vn1OP-0000hL-Bi; Mon, 02 Feb 2026 21:23:33 +0000
Received: by outflank-mailman (input) for mailman id 1219070;
 Mon, 02 Feb 2026 21:23: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 1vn1OO-0000hE-Tz
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21:23: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 1vn1OP-00H95W-0m
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1OO-00EOEM-2o
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23: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=X4VlBJgWwPSNAuiHjD9AjhezCZBY0h5viZ+PAyJQL9E=; b=d4tPM9Ckm7e3dvZM3/P2IV1wWi
	vMrPU+4Gh63isyn4WLY+vR9ozyQqdICYC7ySY3sO4CWPhLBsj0jVPKuw30mLV0g/g1rjv+HiHAmac
	TNfZ+gVuHeTDgx67BNR9BYdT/I+R9xUozjtoLKA/vqVfnFBo8vvEuRKsWAM2JgdGealg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: add v1.2 SEND2 header layout
Message-Id: <E1vn1OO-00EOEM-2o@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:32 +0000

commit e040b94d0ffff24b0cd9b527be2be4e47901f49f
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:27 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add v1.2 SEND2 header layout
    
    Teach the SEND2 path about the distinct FF-A v1.1 and v1.2 RX/TX header
    layouts so we can propagate the 128-bit UUIDs introduced in v1.2.
    
    VM-to-VM SEND2 calls now build the larger v1.2 header, zeroing the UUID
    fields for v1.1 senders, and the dispatcher validates messages using
    the v1.1 header layout to keep legacy guests working.
    
    While there, make the code more robust by checking that the send is not
    trying to send a message to himself.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_msg.c | 58 +++++++++++++++++++++++++++++++++++++---------
 1 file changed, 47 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 5a4cb1bb82..c3552a3ae3 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -13,7 +13,7 @@
 #include "ffa_private.h"
 
 /* Encoding of partition message in RX/TX buffer */
-struct ffa_part_msg_rxtx {
+struct ffa_part_msg_rxtx_1_1 {
     uint32_t flags;
     uint32_t reserved;
     uint32_t msg_offset;
@@ -21,6 +21,16 @@ struct ffa_part_msg_rxtx {
     uint32_t msg_size;
 };
 
+struct ffa_part_msg_rxtx_1_2 {
+    uint32_t flags;
+    uint32_t reserved;
+    uint32_t msg_offset;
+    uint32_t send_recv_id;
+    uint32_t msg_size;
+    uint32_t reserved2;
+    uint64_t uuid[2];
+};
+
 static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
                                       struct arm_smccc_1_2_regs *req)
 {
@@ -105,11 +115,11 @@ out:
 }
 
 static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
-                                struct ffa_part_msg_rxtx *src_msg)
+                                struct ffa_part_msg_rxtx_1_2 *src_msg)
 {
     struct domain *dst_d;
     struct ffa_ctx *dst_ctx;
-    struct ffa_part_msg_rxtx *dst_msg;
+    struct ffa_part_msg_rxtx_1_2 *dst_msg;
     void *rx_buf;
     size_t rx_size;
     int err;
@@ -143,7 +153,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
         goto out_unlock;
 
     /* we need to have enough space in the destination buffer */
-    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
+    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx_1_2)) < src_msg->msg_size )
     {
         ret = FFA_RET_NO_MEMORY;
         ffa_rx_release(dst_ctx);
@@ -155,11 +165,14 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* prepare destination header */
     dst_msg->flags = 0;
     dst_msg->reserved = 0;
-    dst_msg->msg_offset = sizeof(struct ffa_part_msg_rxtx);
+    dst_msg->msg_offset = sizeof(struct ffa_part_msg_rxtx_1_2);
     dst_msg->send_recv_id = src_msg->send_recv_id;
     dst_msg->msg_size = src_msg->msg_size;
+    dst_msg->reserved2 = 0;
+    dst_msg->uuid[0] = src_msg->uuid[0];
+    dst_msg->uuid[1] = src_msg->uuid[1];
 
-    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx),
+    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx_1_2),
            src_buf + src_msg->msg_offset, src_msg->msg_size);
 
     /* receiver rx buffer will be released by the receiver*/
@@ -178,11 +191,17 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     struct ffa_ctx *src_ctx = src_d->arch.tee;
     const void *tx_buf;
     size_t tx_size;
-    struct ffa_part_msg_rxtx src_msg;
+    /*
+     * src_msg is interpreted as v1.2 header, but:
+     * - for v1.1 guests, uuid[] is ignored and may contain payload bytes
+     * - for v1.2 guests, uuid[] carries the FF-A v1.2 UUID fields
+     */
+    struct ffa_part_msg_rxtx_1_2 src_msg;
     uint16_t dst_id, src_id;
     int32_t ret;
 
-    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx) >= FFA_PAGE_SIZE);
+    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx_1_1) >= FFA_PAGE_SIZE);
+    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx_1_2) >= FFA_PAGE_SIZE);
 
     ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
     if ( ret != FFA_RET_OK )
@@ -194,15 +213,32 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
 
-    if ( src_id != ffa_get_vm_id(src_d) )
+    if ( src_id != ffa_get_vm_id(src_d) ||
+         dst_id == ffa_get_vm_id(src_d) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    if ( ACCESS_ONCE(src_ctx->guest_vers) < FFA_VERSION_1_2 )
+    {
+        if (src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_1))
+        {
+            ret = FFA_RET_INVALID_PARAMETERS;
+            goto out;
+        }
+        /* Set uuid to Nil UUID for v1.1 guests */
+        src_msg.uuid[0] = 0;
+        src_msg.uuid[1] = 0;
+    }
+    else if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_2) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
     }
 
     /* check source message fits in buffer */
-    if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx) ||
-            src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
+    if ( src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
             src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219071.1527966 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Oa-0000jb-Fh; Mon, 02 Feb 2026 21:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219071.1527966; Mon, 02 Feb 2026 21:23: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 1vn1Oa-0000jT-D7; Mon, 02 Feb 2026 21:23:44 +0000
Received: by outflank-mailman (input) for mailman id 1219071;
 Mon, 02 Feb 2026 21:23: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 1vn1OZ-0000jL-17
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21:23: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 1vn1OZ-00H95t-16
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1OY-00EOFO-36
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23: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=p9aYC3NJ1dx2W55hO3Syxhn4mIRc7xqQg1OP7Mnri7Y=; b=bdDoBvVToXKO3gbWz/hgqpgfRc
	2vT8T4RWor0wVPo7ofwUuSY9+z3C+xuwetRVwr0oyFsgJV+UY1ysiY95yJFBgnHHJoZratzruhTo1
	BNw+Soev5QUF5PLiPOO3D1a56Om3fSIUuE/ZmxjRnZUHTF3L8g4GIwWzUWtUei1ClD28=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: add MSG_SEND_DIRECT_REQ2 support
Message-Id: <E1vn1OY-00EOFO-36@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:42 +0000

commit 3ca6aca20d359d27486c527a865dfdcd11bab3f5
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:28 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add MSG_SEND_DIRECT_REQ2 support
    
    Extend the direct-request path so FF-A v1.2 guests can issue
    FFA_MSG_SEND_DIRECT_REQ2 and receive the matching RESP2.
    
    The handler now marshals registers x8–x17, and
    ffa_finish_direct_req_run() copies back the 17-register response used by
    FFA_MSG_SEND_DIRECT_RESP2. The new opcode is exposed via FFA_FEATURES
    and gated on guests that negotiated v1.2.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c     | 20 ++++++++++++++++++++
 xen/arch/arm/tee/ffa_msg.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 0f07efe5a7..2c6443a7f6 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -237,6 +237,8 @@ out_continue:
 static void handle_features(struct cpu_user_regs *regs)
 {
     uint32_t a1 = get_user_reg(regs, 1);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
     unsigned int n;
 
     for ( n = 2; n <= 7; n++ )
@@ -268,6 +270,16 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_MSG_YIELD:
         ffa_set_regs_success(regs, 0, 0);
         break;
+    case FFA_MSG_SEND_DIRECT_REQ2:
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        {
+            ffa_set_regs_success(regs, 0, 0);
+        }
+        else
+        {
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        }
+        break;
     case FFA_MEM_SHARE_64:
     case FFA_MEM_SHARE_32:
         /*
@@ -353,6 +365,14 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         ffa_handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_MSG_SEND_DIRECT_REQ2:
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        {
+            ffa_handle_msg_send_direct_req(regs, fid);
+            return true;
+        }
+        e = FFA_RET_NOT_SUPPORTED;
+        break;
     case FFA_RUN:
         ffa_handle_run(regs, fid);
         return true;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index c3552a3ae3..4e26596461 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -49,6 +49,30 @@ static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
     case FFA_MSG_YIELD:
     case FFA_INTERRUPT:
         break;
+    case FFA_MSG_SEND_DIRECT_RESP2:
+        /*
+         * REQ2 / RESP2 use a 17-register payload (x1–x17). Copy all of them
+         * back to the guest context.
+         */
+        set_user_reg(regs, 0, resp.a0);
+        set_user_reg(regs, 1, resp.a1);
+        set_user_reg(regs, 2, resp.a2);
+        set_user_reg(regs, 3, resp.a3);
+        set_user_reg(regs, 4, resp.a4);
+        set_user_reg(regs, 5, resp.a5);
+        set_user_reg(regs, 6, resp.a6);
+        set_user_reg(regs, 7, resp.a7);
+        set_user_reg(regs, 8, resp.a8);
+        set_user_reg(regs, 9, resp.a9);
+        set_user_reg(regs, 10, resp.a10);
+        set_user_reg(regs, 11, resp.a11);
+        set_user_reg(regs, 12, resp.a12);
+        set_user_reg(regs, 13, resp.a13);
+        set_user_reg(regs, 14, resp.a14);
+        set_user_reg(regs, 15, resp.a15);
+        set_user_reg(regs, 16, resp.a16);
+        set_user_reg(regs, 17, resp.a17);
+        return;
     default:
         /* Bad fid, report back to the caller. */
         ffa_set_regs_error(regs, FFA_RET_ABORTED);
@@ -107,6 +131,21 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     arg.a6 = get_user_reg(regs, 6) & mask;
     arg.a7 = get_user_reg(regs, 7) & mask;
 
+    if ( fid == FFA_MSG_SEND_DIRECT_REQ2 )
+    {
+        /* 17 registers are used for REQ2 */
+        arg.a8 = get_user_reg(regs, 8);
+        arg.a9 = get_user_reg(regs, 9);
+        arg.a10 = get_user_reg(regs, 10);
+        arg.a11 = get_user_reg(regs, 11);
+        arg.a12 = get_user_reg(regs, 12);
+        arg.a13 = get_user_reg(regs, 13);
+        arg.a14 = get_user_reg(regs, 14);
+        arg.a15 = get_user_reg(regs, 15);
+        arg.a16 = get_user_reg(regs, 16);
+        arg.a17 = get_user_reg(regs, 17);
+    }
+
     ffa_finish_direct_req_run(regs, &arg);
     return;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 21:23:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 21:23:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219072.1527969 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn1Ok-0000nE-HF; Mon, 02 Feb 2026 21:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219072.1527969; Mon, 02 Feb 2026 21:23: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 1vn1Ok-0000n6-Eg; Mon, 02 Feb 2026 21:23:54 +0000
Received: by outflank-mailman (input) for mailman id 1219072;
 Mon, 02 Feb 2026 21:23: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 1vn1Oj-0000mz-41
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 21:23: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 1vn1Oj-00H95x-1N
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn1Oj-00EOGH-0C
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 21:23: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=LaB4viEis7gxjCbGuaKJhxLtp4yYU0u2UJZyzjXhpCU=; b=dK2lWGR7uSviJKXlM6IJT2mPHn
	H2cg2AqezFT2RwFtT1yRXe+LZ/FGj0Pokk2+WsYOr2Jt+Qu98/HsbCMgj0tI+EP7uULo/6Hjp7NM2
	9PXT4NLKNICbVbmBGtGswyaN/GYLKX9iX/uh5ajtog60DeiHfwDtX8PTIEqlTUU9fr6U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: advertise FF-A v1.2
Message-Id: <E1vn1Oj-00EOGH-0C@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 21:23:53 +0000

commit f42bacb20e7acefd4cdb63abc2b6eccd99ae9307
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:29 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: advertise FF-A v1.2
    
    Expose the RX/TX MAP capacity field only once a guest has
    negotiated FF-A v1.2.
    
    While there, drop the stale <asm/tee/ffa.h> include.
    
    To comply with the wider v1.2 register ABI, zero registers x8–x17 when
    responding to a v1.2 VM. The dispatcher also rejects SMCCC64 calls from
    AArch32 guests.
    
    Finally, bump Xen's FF-A version to 1.2.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 19 +++++++++++++++++--
 xen/arch/arm/tee/ffa_private.h | 29 ++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2c6443a7f6..ed18e76080 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -65,7 +65,6 @@
 #include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/smccc.h>
-#include <asm/tee/ffa.h>
 #include <asm/tee/tee.h>
 
 #include "ffa_private.h"
@@ -296,7 +295,16 @@ static void handle_features(struct cpu_user_regs *regs)
          * differs from FFA_PAGE_SIZE (SZ_4K).
          */
         BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
-        ffa_set_regs_success(regs, 0, 0);
+
+        /*
+         * From FFA v1.2, we can give the maximum number of pages we support
+         * for the RX/TX buffers.
+         */
+        if ( ACCESS_ONCE(ctx->guest_vers) < FFA_VERSION_1_2 )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_success(regs, FFA_MAX_RXTX_PAGE_COUNT << 16, 0);
+
         break;
     case FFA_FEATURE_NOTIF_PEND_INTR:
         ffa_set_regs_success(regs, GUEST_FFA_NOTIF_PEND_INTR_ID, 0);
@@ -329,6 +337,13 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     if ( !ctx )
         return false;
 
+    if ( !is_64bit_domain(d) && smccc_is_conv_64(fid) )
+    {
+        /* 32bit guests should only use 32bit convention calls */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        return true;
+    }
+
     /* A version must be negotiated first */
     if ( !ACCESS_ONCE(ctx->guest_vers) )
     {
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 1fbd3fc3a6..282c105f3b 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -53,7 +53,7 @@
  * that particular guest or SP.
  */
 #define FFA_MY_VERSION_MAJOR    1U
-#define FFA_MY_VERSION_MINOR    1U
+#define FFA_MY_VERSION_MINOR    2U
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
@@ -519,14 +519,25 @@ static inline void ffa_set_regs(struct cpu_user_regs *regs, register_t v0,
                                 register_t v4, register_t v5, register_t v6,
                                 register_t v7)
 {
-        set_user_reg(regs, 0, v0);
-        set_user_reg(regs, 1, v1);
-        set_user_reg(regs, 2, v2);
-        set_user_reg(regs, 3, v3);
-        set_user_reg(regs, 4, v4);
-        set_user_reg(regs, 5, v5);
-        set_user_reg(regs, 6, v6);
-        set_user_reg(regs, 7, v7);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    int i;
+
+    set_user_reg(regs, 0, v0);
+    set_user_reg(regs, 1, v1);
+    set_user_reg(regs, 2, v2);
+    set_user_reg(regs, 3, v3);
+    set_user_reg(regs, 4, v4);
+    set_user_reg(regs, 5, v5);
+    set_user_reg(regs, 6, v6);
+    set_user_reg(regs, 7, v7);
+
+    if ( ctx && ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 &&
+         is_64bit_domain(d) )
+    {
+        for (i = 8; i <= 17; i++)
+            set_user_reg(regs, i, 0);
+    }
 }
 
 static inline void ffa_set_regs_error(struct cpu_user_regs *regs,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219073.1527976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Tf-0000WW-3K; Mon, 02 Feb 2026 22:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219073.1527976; Mon, 02 Feb 2026 22: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 1vn2Te-0000WM-WE; Mon, 02 Feb 2026 22:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1219073;
 Mon, 02 Feb 2026 22: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 1vn2Te-0000WG-2L
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2Te-00HAI3-10
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2Td-00ETBW-2w
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=nsqo0gzo2NAdIMspdszsqEXG1YxIr01IPPO2njIgmvQ=; b=JM+VF7nXZMsx1Qzyzja4rgGbHf
	v42cmRmgLerAdlEed0s8VsiJUq5OcAVZW+m8Hs7arMRZHksSQZ5SodYC81rq6TkAAMuOUyaMztaya
	FAxOsphhHSVsWiccZWoBFJxMN40iZxQMhX8wthoY8EVmdGTBwyHmPDg5NeS+LYgFWV58=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: add FF-A v1.2 function IDs
Message-Id: <E1vn2Td-00ETBW-2w@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:01 +0000

commit a9eb6c6269cb912f8378ae7eef9b6ea99ebbbabc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:18 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add FF-A v1.2 function IDs
    
    Bring the FF-A headers up to the v1.2 baseline and fix the function-number
    range used for ABI discovery:
    
    - update FFA_FNUM_MAX_VALUE so the FF-A function-number window covers the
      full v1.2 range, and derive the ABI bitmap bounds from
      FFA_FNUM_MIN_VALUE/FFA_FNUM_MAX_VALUE instead of hard-coding
      FFA_ERROR/FFA_MSG_SEND2
    - define the new v1.2 function IDs; CONSOLE_LOG_32/64 and
      PARTITION_INFO_GET_REGS are added for ABI discovery even though they are
      not implemented yet
    - extend the firmware ABI table to probe RUN and
      MSG_SEND_DIRECT_REQ2/RESP2
    - while there, fix an off-by-one in ffa_fw_supports_fid(): the computed bit
      index must be strictly smaller than FFA_ABI_BITMAP_SIZE, so use >= in the
      bounds check
    - Also fix comment as call IDs reserved for FF-A are from 0x60 to 0xEF
    
    Keep FFA_MY_VERSION at 1.1 for now; we only advertise v1.2 once the
    implementation is fully compliant.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/include/asm/tee/ffa.h |  3 ++-
 xen/arch/arm/tee/ffa.c             |  4 ++++
 xen/arch/arm/tee/ffa_private.h     | 21 +++++++++++++--------
 3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/tee/ffa.h b/xen/arch/arm/include/asm/tee/ffa.h
index 24cd4d99c8..7acb541d1f 100644
--- a/xen/arch/arm/include/asm/tee/ffa.h
+++ b/xen/arch/arm/include/asm/tee/ffa.h
@@ -15,8 +15,9 @@
 #include <asm/smccc.h>
 #include <asm/types.h>
 
+/* FF-A Function ID range (AArch32 function number field) as of FF-A v1.2 */
 #define FFA_FNUM_MIN_VALUE              _AC(0x60,U)
-#define FFA_FNUM_MAX_VALUE              _AC(0x86,U)
+#define FFA_FNUM_MAX_VALUE              _AC(0x8E,U)
 
 static inline bool is_ffa_fid(uint32_t fid)
 {
diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 1d0239cf69..2b4e24750d 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -11,6 +11,8 @@
  *               https://developer.arm.com/documentation/den0077/a
  * FF-A-1.1-REL0: FF-A specification version 1.1 available at
  *                https://developer.arm.com/documentation/den0077/e
+ * FF-A-1.2-REL0: FF-A specification version 1.2 available at
+ *                https://developer.arm.com/documentation/den0077/j
  * TEEC-1.0C: TEE Client API Specification version 1.0c available at
  *            https://globalplatform.org/specs-library/tee-client-api-specification/
  *
@@ -102,6 +104,8 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_32),
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_64),
     FW_ABI(FFA_MSG_SEND2),
+    FW_ABI(FFA_MSG_SEND_DIRECT_REQ2),
+    FW_ABI(FFA_RUN),
 };
 
 /*
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 6dbdb200d8..8d01da0009 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -15,6 +15,7 @@
 #include <xen/spinlock.h>
 #include <xen/time.h>
 #include <xen/types.h>
+#include <asm/tee/ffa.h>
 
 /* Error codes */
 #define FFA_RET_OK                      0
@@ -42,6 +43,7 @@
 
 #define FFA_VERSION_1_0         MAKE_FFA_VERSION(1, 0)
 #define FFA_VERSION_1_1         MAKE_FFA_VERSION(1, 1)
+#define FFA_VERSION_1_2         MAKE_FFA_VERSION(1, 2)
 /* The minimal FF-A version of the SPMC that can be supported */
 #define FFA_MIN_SPMC_VERSION    FFA_VERSION_1_1
 
@@ -270,21 +272,24 @@
 #define FFA_RX_ACQUIRE                  0x84000084U
 #define FFA_SPM_ID_GET                  0x84000085U
 #define FFA_MSG_SEND2                   0x84000086U
+#define FFA_CONSOLE_LOG_32              0x8400008AU
+#define FFA_CONSOLE_LOG_64              0xC400008AU
+#define FFA_PARTITION_INFO_GET_REGS     0x8400008BU
+#define FFA_MSG_SEND_DIRECT_REQ2        0xC400008DU
+#define FFA_MSG_SEND_DIRECT_RESP2       0xC400008EU
 
 /**
  * Encoding of features supported or not by the fw in a bitmap:
- * - Function IDs are going from 0x60 to 0xFF
+ * - Function IDs are going from 0x60 to 0xEF in SMCCC standard
  * - A function can be supported in 32 and/or 64bit
  * The bitmap has one bit for each function in 32 and 64 bit.
  */
 #define FFA_ABI_ID(id)        ((id) & ARM_SMCCC_FUNC_MASK)
 #define FFA_ABI_CONV(id)      (((id) >> ARM_SMCCC_CONV_SHIFT) & BIT(0,U))
 
-#define FFA_ABI_MIN           FFA_ABI_ID(FFA_ERROR)
-#define FFA_ABI_MAX           FFA_ABI_ID(FFA_MSG_SEND2)
-
-#define FFA_ABI_BITMAP_SIZE   (2 * (FFA_ABI_MAX - FFA_ABI_MIN + 1))
-#define FFA_ABI_BITNUM(id)    ((FFA_ABI_ID(id) - FFA_ABI_MIN) << 1 | \
+#define FFA_ABI_BITMAP_SIZE   (2 * (FFA_FNUM_MAX_VALUE - FFA_FNUM_MIN_VALUE \
+                               + 1))
+#define FFA_ABI_BITNUM(id)    ((FFA_ABI_ID(id) - FFA_FNUM_MIN_VALUE) << 1 | \
                                FFA_ABI_CONV(id))
 
 /* Constituent memory region descriptor */
@@ -549,9 +554,9 @@ static inline int32_t ffa_hyp_rx_release(void)
 
 static inline bool ffa_fw_supports_fid(uint32_t fid)
 {
-    BUILD_BUG_ON(FFA_ABI_MIN > FFA_ABI_MAX);
+    BUILD_BUG_ON(FFA_FNUM_MIN_VALUE > FFA_FNUM_MAX_VALUE);
 
-    if ( FFA_ABI_BITNUM(fid) > FFA_ABI_BITMAP_SIZE)
+    if ( FFA_ABI_BITNUM(fid) >= FFA_ABI_BITMAP_SIZE)
         return false;
     return test_bit(FFA_ABI_BITNUM(fid), ffa_fw_abi_supported);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219074.1527978 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Tp-0000Yl-5T; Mon, 02 Feb 2026 22:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219074.1527978; Mon, 02 Feb 2026 22: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 1vn2Tp-0000Yd-2e; Mon, 02 Feb 2026 22:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1219074;
 Mon, 02 Feb 2026 22: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 1vn2To-0000YP-6T
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2To-00HAID-1X
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2To-00ETBv-07
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=UdDLOS4bEdFtH/tq0Duptq8jEuGk4ux7BapLJ5x7szw=; b=1MTyOPlzI1grE28p5oKPxvnWdo
	LF3LG0dGsKcti/VJhUY2wHVNzXyNVVEvWI/jlMZH6PSHXCcdSqAG7RHc+LmgovDd1A4fo1wQJXXHu
	m353k6aRja6TF2wjibmKVygTe7I3dUYTh7+4QjzGdWXP6jqMAmlD8yR3KYDvVSp8Rsx0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: per-VM FFA_VERSION negotiation state
Message-Id: <E1vn2To-00ETBv-07@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:12 +0000

commit ad2d3a7dafbaf73b2a0b0354ddcf44ce2ac90176
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:19 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: per-VM FFA_VERSION negotiation state
    
    Track FF-A version negotiation per VM and enforce that no FF-A ABI
    (other than FFA_VERSION) is processed before a guest has selected a
    version.
    
    Each ffa_ctx gains a dedicated guest_vers_lock, a negotiated version
    (guest_vers) and a guest_vers_tmp:
    - guest_vers is the version negotiated or 0 if no version has been
      negotiated. This must be used with ACCESS_ONCE when reading it without
      the spinlock taken.
    - guest_vers_tmp stores the version currently requested by a VM.
    
    The version requested is the one actually negotiated once a call
    different from FFA_VERSION is done to allow several attempts and as
    requested by FF-A specification.
    We always return our implementation version FFA_MY_VERSION, even if the
    version requested was different, as requested by FF-A specification.
    
    Any call other than FFA_VERSION is rejected until a version has been
    requested.
    
    Update all places in the code where guest_vers is used to use
    ACCESS_ONCE.
    
    This prevents partially initialised contexts from using the mediator
    and complies with the FF-A 1.2 FFA_VERSION semantics.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 101 +++++++++++++++++++++++++++++++---------
 xen/arch/arm/tee/ffa_msg.c      |   2 +-
 xen/arch/arm/tee/ffa_partinfo.c |   4 +-
 xen/arch/arm/tee/ffa_private.h  |  27 ++++++++---
 xen/arch/arm/tee/ffa_shm.c      |   3 +-
 5 files changed, 106 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2b4e24750d..aadd6c21e7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -158,31 +158,38 @@ static bool ffa_abi_supported(uint32_t id)
     return !ffa_simple_call(FFA_FEATURES, id, 0, 0, 0);
 }
 
-static void handle_version(struct cpu_user_regs *regs)
+static bool ffa_negotiate_version(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    uint32_t vers = get_user_reg(regs, 1);
-    uint32_t old_vers;
+    uint32_t fid = get_user_reg(regs, 0);
+    uint32_t in_vers = get_user_reg(regs, 1);
+    uint32_t out_vers = FFA_MY_VERSION;
 
-    /*
-     * Guest will use the version it requested if it is our major and minor
-     * lower or equals to ours. If the minor is greater, our version will be
-     * used.
-     * In any case return our version to the caller.
-     */
-    if ( FFA_VERSION_MAJOR(vers) == FFA_MY_VERSION_MAJOR )
+    spin_lock(&ctx->guest_vers_lock);
+
+    /* If negotiation already published, continue without handling. */
+    if ( ACCESS_ONCE(ctx->guest_vers) )
+        goto out_continue;
+
+    if ( fid != FFA_VERSION )
     {
-        spin_lock(&ctx->lock);
-        old_vers = ctx->guest_vers;
+        if ( !ctx->guest_vers_tmp )
+        {
+            out_vers = 0;
+            goto out_handled;
+        }
 
-        if ( FFA_VERSION_MINOR(vers) > FFA_MY_VERSION_MINOR )
-            ctx->guest_vers = FFA_MY_VERSION;
-        else
-            ctx->guest_vers = vers;
-        spin_unlock(&ctx->lock);
+        /*
+         * A successful FFA_VERSION call does not freeze negotiation. Guests
+         * are allowed to issue multiple FFA_VERSION attempts (e.g. probing
+         * several minor versions). Negotiation becomes final only when a
+         * non-VERSION ABI is invoked, as required by the FF-A specification.
+         * Finalize negotiation: publish guest_vers once, then never change.
+         */
+        ACCESS_ONCE(ctx->guest_vers) = ctx->guest_vers_tmp;
 
-        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && !old_vers )
+        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
         {
             /* One more VM with FF-A support available */
             inc_ffa_vm_count();
@@ -190,8 +197,48 @@ static void handle_version(struct cpu_user_regs *regs)
             list_add_tail(&ctx->ctx_list, &ffa_ctx_head);
             write_unlock(&ffa_ctx_list_rwlock);
         }
+
+        goto out_continue;
     }
-    ffa_set_regs(regs, FFA_MY_VERSION, 0, 0, 0, 0, 0, 0, 0);
+
+    /*
+     * guest_vers_tmp stores the version selected by the guest (lower minor may
+     * require reduced data structures). However, the value returned to the
+     * guest via FFA_VERSION is always FFA_MY_VERSION, the implementation
+     * version, as required by FF-A. The two values intentionally differ.
+     */
+
+    /*
+     * Return our highest implementation version on request different than our
+     * major and mark negotiated version as our implementation version.
+     */
+    if ( FFA_VERSION_MAJOR(in_vers) != FFA_MY_VERSION_MAJOR )
+    {
+        ctx->guest_vers_tmp = FFA_MY_VERSION;
+        goto out_handled;
+    }
+
+    /*
+     * Use our minor version if a greater minor was requested or the requested
+     * minor if it is lower than ours was requested.
+     */
+    if ( FFA_VERSION_MINOR(in_vers) > FFA_MY_VERSION_MINOR )
+        ctx->guest_vers_tmp = FFA_MY_VERSION;
+    else
+        ctx->guest_vers_tmp = in_vers;
+
+out_handled:
+    spin_unlock(&ctx->guest_vers_lock);
+    if ( out_vers )
+        ffa_set_regs(regs, out_vers, 0, 0, 0, 0, 0, 0, 0);
+    else
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+    return true;
+
+out_continue:
+    spin_unlock(&ctx->guest_vers_lock);
+
+    return false;
 }
 
 static void handle_features(struct cpu_user_regs *regs)
@@ -274,10 +321,17 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     if ( !ctx )
         return false;
 
+    /* A version must be negotiated first */
+    if ( !ACCESS_ONCE(ctx->guest_vers) )
+    {
+        if ( ffa_negotiate_version(regs) )
+            return true;
+    }
+
     switch ( fid )
     {
     case FFA_VERSION:
-        handle_version(regs);
+        ffa_set_regs(regs, FFA_MY_VERSION, 0, 0, 0, 0, 0, 0, 0);
         return true;
     case FFA_ID_GET:
         ffa_set_regs_success(regs, ffa_get_vm_id(d), 0);
@@ -371,6 +425,11 @@ static int ffa_domain_init(struct domain *d)
     d->arch.tee = ctx;
     ctx->teardown_d = d;
     INIT_LIST_HEAD(&ctx->shm_list);
+    spin_lock_init(&ctx->lock);
+    spin_lock_init(&ctx->guest_vers_lock);
+    ctx->guest_vers = 0;
+    ctx->guest_vers_tmp = 0;
+    INIT_LIST_HEAD(&ctx->ctx_list);
 
     ctx->ffa_id = ffa_get_vm_id(d);
     ctx->num_vcpus = d->max_vcpus;
@@ -452,7 +511,7 @@ static int ffa_domain_teardown(struct domain *d)
     if ( !ctx )
         return 0;
 
-    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && ctx->guest_vers )
+    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) && ACCESS_ONCE(ctx->guest_vers) )
     {
         dec_ffa_vm_count();
         write_lock(&ffa_ctx_list_rwlock);
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index c20c5bec0f..2c2ebc9c5c 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -113,7 +113,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     }
 
     dst_ctx = dst_d->arch.tee;
-    if ( !dst_ctx->guest_vers )
+    if ( !ACCESS_ONCE(dst_ctx->guest_vers) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out_unlock;
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index fa56b1587e..ec5a53ed1c 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -238,7 +238,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
      * use the v1.0 structure size in the destination buffer.
      * Otherwise use the size of the highest version we support, here 1.1.
      */
-    if ( ctx->guest_vers == FFA_VERSION_1_0 )
+    if ( ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 )
         dst_size = sizeof(struct ffa_partition_info_1_0);
     else
         dst_size = sizeof(struct ffa_partition_info_1_1);
@@ -250,7 +250,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
          * FF-A v1.0 has w5 MBZ while v1.1 allows
          * FFA_PARTITION_INFO_GET_COUNT_FLAG to be non-zero.
          */
-        if ( ctx->guest_vers == FFA_VERSION_1_0 ||
+        if ( ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 ||
                 flags != FFA_PARTITION_INFO_GET_COUNT_FLAG )
         {
             ret = FFA_RET_INVALID_PARAMETERS;
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 8d01da0009..8ef2143447 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -355,12 +355,6 @@ struct ffa_ctx {
      * Global data accessed with lock locked.
      */
     spinlock_t lock;
-    /*
-     * FF-A version negotiated by the guest, only modifications to
-     * this field are done with the lock held as this is expected to
-     * be done once at init by a guest.
-     */
-    uint32_t guest_vers;
     /* Number of 4kB pages in each of rx/rx_pg and tx/tx_pg */
     unsigned int page_count;
     /* Number of allocated shared memory object */
@@ -368,6 +362,27 @@ struct ffa_ctx {
     /* Used shared memory objects, struct ffa_shm_mem */
     struct list_head shm_list;
 
+    /*
+     * FF-A version handling
+     * guest_vers is the single published negotiated version. It is 0 until
+     * negotiation completes, after which it is set once and never changes.
+     * Negotiation uses guest_vers_tmp under guest_vers_lock; when a
+     * non-VERSION ABI is invoked, Xen finalizes negotiation by publishing
+     * guest_vers using ACCESS_ONCE() store.
+     * Readers use ACCESS_ONCE(guest_vers) != 0 to detect availability and
+     * can consume guest_vers without barriers because it never changes once
+     * published.
+     */
+    spinlock_t guest_vers_lock;
+    /*
+     * Published negotiated version. Zero means "not negotiated yet".
+     * Once non-zero, it never changes.
+     * Must always be accessed using ACCESS_ONCE().
+     */
+    uint32_t guest_vers;
+    /* Temporary version used during negotiation under guest_vers_lock */
+    uint32_t guest_vers_tmp;
+
     /*
      * Rx buffer, accessed with rx_lock locked.
      * rx_is_free is used to serialize access.
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index d628c1b706..dad3da1922 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -495,7 +495,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
         goto out_unlock;
 
-    ret = read_mem_transaction(ctx->guest_vers, ctx->tx, frag_len, &trans);
+    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), ctx->tx,
+                               frag_len, &trans);
     if ( ret )
         goto out_unlock;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219076.1527992 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Tz-0000pj-Ct; Mon, 02 Feb 2026 22:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219076.1527992; Mon, 02 Feb 2026 22: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 1vn2Tz-0000pd-A7; Mon, 02 Feb 2026 22:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1219076;
 Mon, 02 Feb 2026 22: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 1vn2Ty-0000pI-8N
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2Ty-00HAIH-1p
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2Ty-00ETCN-0d
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=GGHETy1TUSgTmpl7IDZuq8F60E3KUwClC5ndvTVCVIg=; b=YC1RiASX/pp+HTjzoct5seIuoZ
	pxAszGvkcy+QY1Fjw9oYvlQ0temMVQn/dHbiT7/hG2zkOyF/TjhcYiI6Q7F68bdB8iSjwu3LpC7jF
	0DVdiU3J+ncQbdCgRr3pG9lf93VOKZimbqliK1PhIOFNkcy5OMvE6tyGc3bmhQjBMT24=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix is_64bit init
Message-Id: <E1vn2Ty-00ETCN-0d@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:22 +0000

commit 6e8c62d457ab920b2528c3a5381aef8caa1ff357
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:20 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: Fix is_64bit init
    
    is_64bit_domain(d) is not set during domain_init as the domain field is
    only set when loading the domain image which is done after executing
    domain_init.
    
    Fix the implementation to set is_64bit when version gets negotiated.
    is_64bit is only used during partition_info_get once a domain is added
    in the list of domains having ffa support. It must only be accessed when
    the rwlock is taken (which is the case).
    
    is_64bit must not be used without the rwlock taken and other places in
    the code needing to test 64bit support of the current domain will have
    to use calls to is_64bit_domain instead of the field from now on.
    
    Fixes: 09a201605f99 ("xen/arm: ffa: Introduce VM to VM support")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 9 ++++++++-
 xen/arch/arm/tee/ffa_private.h | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index aadd6c21e7..0f6f837378 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -180,6 +180,14 @@ static bool ffa_negotiate_version(struct cpu_user_regs *regs)
             goto out_handled;
         }
 
+        /*
+         * We cannot set is_64bit during domain init because the field is not
+         * yet initialized.
+         * This field is only used during partinfo_get with the rwlock taken
+         * so there is no ordering issue with guest_vers.
+         */
+        ctx->is_64bit = is_64bit_domain(d);
+
         /*
          * A successful FFA_VERSION call does not freeze negotiation. Guests
          * are allowed to issue multiple FFA_VERSION attempts (e.g. probing
@@ -433,7 +441,6 @@ static int ffa_domain_init(struct domain *d)
 
     ctx->ffa_id = ffa_get_vm_id(d);
     ctx->num_vcpus = d->max_vcpus;
-    ctx->is_64bit = is_64bit_domain(d);
 
     /*
      * ffa_domain_teardown() will be called if ffa_domain_init() returns an
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 8ef2143447..96794ecebe 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -344,6 +344,11 @@ struct ffa_ctx {
     /* FF-A Endpoint ID */
     uint16_t ffa_id;
     uint16_t num_vcpus;
+    /*
+     * Must only be accessed with the ffa_ctx_list_rwlock taken as it set
+     * when guest_vers is set and other accesses could see a partially set
+     * value.
+     */
     bool is_64bit;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219078.1527996 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2U9-0000vo-EA; Mon, 02 Feb 2026 22:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219078.1527996; Mon, 02 Feb 2026 22: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 1vn2U9-0000vg-BU; Mon, 02 Feb 2026 22:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1219078;
 Mon, 02 Feb 2026 22: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 1vn2U8-0000vQ-C0
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2U8-00HAIN-2B
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2U8-00ETCr-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=9zN+WzuuRtF+ZxDbp/ni7qPHzO3cAQzVbISdyEyQTuQ=; b=wOiK4EHUfKd632C1qHfewtH1Bo
	Xw47DrG3NdSgBHqQSOiJxQzeauY7EUrMeOld49rHcGNwdHnQZ03eBQQdgnGu2b0/OZHtP+r1Z5ZkW
	3dgKxIXVYlyqcbqAyZSUakd16Gl1j9ltNMh5XwTdC+pltzhgFqQ3THPVqsRhOkp7GV/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: harden RX/TX mapping
Message-Id: <E1vn2U8-00ETCr-0u@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:32 +0000

commit a3075e2fda1d0b50340f95723f6c9720495c05a7
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:21 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: harden RX/TX mapping
    
    Harden the RX/TX mapping paths and keep signed FF-A return codes
    end-to-end.
    
    Reject zero-length mappings and insist on page-aligned RX/TX buffer
    addresses before touching the P2M. The unmap plumbing is switched to
    use the same signed helpers so dispatcher error handling is consistent
    across map and unmap operations.
    
    This avoids partially mapped or silently truncated buffers and makes the
    mediator behaviour match the FF-A error model more closely.
    
    Prevent concurrent usage of rx or tx buffer during map or unmap by
    holding the rx_lock and tx_lock.
    
    While there also introduce a domain_rxtx_init to properly initialize the
    rxtx buffers spinlocks.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |  4 +++
 xen/arch/arm/tee/ffa_private.h |  5 ++--
 xen/arch/arm/tee/ffa_rxtx.c    | 68 ++++++++++++++++++++++++++++++++++--------
 3 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 0f6f837378..497ada8264 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -451,6 +451,10 @@ static int ffa_domain_init(struct domain *d)
     if ( ret )
         return ret;
 
+    ret = ffa_rxtx_domain_init(d);
+    if ( ret )
+        return ret;
+
     return ffa_notif_domain_init(d);
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 96794ecebe..0bb5a84553 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -439,10 +439,11 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
 bool ffa_rxtx_init(void);
 void ffa_rxtx_destroy(void);
+int32_t ffa_rxtx_domain_init(struct domain *d);
 void ffa_rxtx_domain_destroy(struct domain *d);
-uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
+int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count);
-uint32_t ffa_handle_rxtx_unmap(void);
+int32_t ffa_handle_rxtx_unmap(void);
 int32_t ffa_rx_acquire(struct domain *d);
 int32_t ffa_rx_release(struct domain *d);
 
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index a40e5b32e3..5776693bb3 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -41,10 +41,10 @@ static int32_t ffa_rxtx_unmap(uint16_t id)
     return ffa_simple_call(FFA_RXTX_UNMAP, ((uint64_t)id) << 16, 0, 0, 0);
 }
 
-uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
+int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count)
 {
-    uint32_t ret = FFA_RET_INVALID_PARAMETERS;
+    int32_t ret = FFA_RET_INVALID_PARAMETERS;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct page_info *tx_pg;
@@ -66,20 +66,30 @@ uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         rx_addr &= UINT32_MAX;
     }
 
-    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT )
+    if ( page_count > FFA_MAX_RXTX_PAGE_COUNT || !page_count )
     {
         printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
                page_count, FFA_MAX_RXTX_PAGE_COUNT);
         return FFA_RET_INVALID_PARAMETERS;
     }
 
+    if ( !IS_ALIGNED(tx_addr, FFA_PAGE_SIZE) ||
+         !IS_ALIGNED(rx_addr, FFA_PAGE_SIZE) )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    spin_lock(&ctx->rx_lock);
+    spin_lock(&ctx->tx_lock);
+
     /* Already mapped */
     if ( ctx->rx )
-        return FFA_RET_DENIED;
+    {
+        ret = FFA_RET_DENIED;
+        goto err_unlock_rxtx;
+    }
 
     tx_pg = get_page_from_gfn(d, gfn_x(gaddr_to_gfn(tx_addr)), &t, P2M_ALLOC);
     if ( !tx_pg )
-        return FFA_RET_INVALID_PARAMETERS;
+        goto err_unlock_rxtx;
 
     /* Only normal RW RAM for now */
     if ( t != p2m_ram_rw )
@@ -167,6 +177,10 @@ uint32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
     ctx->tx_pg = tx_pg;
     ctx->page_count = page_count;
     ctx->rx_is_free = true;
+
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
+
     return FFA_RET_OK;
 
 err_unmap_rx:
@@ -177,24 +191,32 @@ err_put_rx_pg:
     put_page(rx_pg);
 err_put_tx_pg:
     put_page(tx_pg);
+err_unlock_rxtx:
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
 
-static uint32_t  rxtx_unmap(struct domain *d)
+static int32_t rxtx_unmap(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
+    int32_t ret = FFA_RET_OK;
+
+    spin_lock(&ctx->rx_lock);
+    spin_lock(&ctx->tx_lock);
 
     if ( !ctx->page_count )
-        return FFA_RET_INVALID_PARAMETERS;
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto err_unlock_rxtx;
+    }
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        uint32_t ret;
-
         ret = ffa_rxtx_unmap(ffa_get_vm_id(d));
         if ( ret != FFA_RET_OK )
-            return ret;
+            goto err_unlock_rxtx;
     }
 
     unmap_domain_page_global(ctx->rx);
@@ -208,10 +230,14 @@ static uint32_t  rxtx_unmap(struct domain *d)
     ctx->page_count = 0;
     ctx->rx_is_free = false;
 
-    return FFA_RET_OK;
+err_unlock_rxtx:
+    spin_unlock(&ctx->tx_lock);
+    spin_unlock(&ctx->rx_lock);
+
+    return ret;
 }
 
-uint32_t ffa_handle_rxtx_unmap(void)
+int32_t ffa_handle_rxtx_unmap(void)
 {
     return rxtx_unmap(current->domain);
 }
@@ -272,6 +298,22 @@ out:
     return ret;
 }
 
+int32_t ffa_rxtx_domain_init(struct domain *d)
+{
+    struct ffa_ctx *ctx = d->arch.tee;
+
+    spin_lock_init(&ctx->rx_lock);
+    spin_lock_init(&ctx->tx_lock);
+    ctx->rx = NULL;
+    ctx->tx = NULL;
+    ctx->rx_pg = NULL;
+    ctx->tx_pg = NULL;
+    ctx->page_count = 0;
+    ctx->rx_is_free = false;
+
+    return 0;
+}
+
 void ffa_rxtx_domain_destroy(struct domain *d)
 {
     rxtx_unmap(d);
@@ -298,7 +340,7 @@ void ffa_rxtx_destroy(void)
 
 bool ffa_rxtx_init(void)
 {
-    int e;
+    int32_t e;
 
     /* Firmware not there or not supporting */
     if ( !ffa_fw_supports_fid(FFA_RXTX_MAP_64) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219081.1528000 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2UK-000135-FZ; Mon, 02 Feb 2026 22:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219081.1528000; Mon, 02 Feb 2026 22: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 1vn2UK-00012x-Ct; Mon, 02 Feb 2026 22:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1219081;
 Mon, 02 Feb 2026 22: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 1vn2UI-00012l-Iu
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2UI-00HAIk-2q
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2UI-00ETDj-1H
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=1w33UOSdkvng5wIuUmMXaNm3um9sqoJY8ds4xd8pzrQ=; b=3gSib9qTo6ZytxWGWXMmK04F3h
	UodQD/MFw9XBQV+WD7mrjB8/zioVrh9zXpq/m5EFUUL21oOkA3xfRI3aWlqLERYm07eTnnJHLjp9B
	+UNMnBWSICdQRe7DZ69TGUHt6JpH366c8VG1t0fL/FheIF/gKH/cvo/wA0yGnSXcN5wY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: rework SPMC RX/TX buffer management
Message-Id: <E1vn2UI-00ETDj-1H@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:42 +0000

commit 9e9504ef32f54db77d25631f3ebcc02205388ac1
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:22 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: rework SPMC RX/TX buffer management
    
    Rework how Xen accesses the RX/TX buffers shared with the SPMC so that
    ownership and locking are handled centrally.
    
    Move the SPMC RX/TX buffer bases into ffa_rxtx.c as ffa_spmc_rx/ffa_spmc_tx,
    protect them with dedicated ffa_spmc_{rx,tx}_lock spinlocks and expose
    ffa_rxtx_spmc_{rx,tx}_{acquire,release}() helpers instead of the global
    ffa_rx/ffa_tx pointers and ffa_{rx,tx}_buffer_lock.
    
    The RX helpers now always issue FFA_RX_RELEASE when we are done
    consuming data from the SPMC, so partition-info enumeration and shared
    memory paths release the RX buffer on all exit paths. The RX/TX mapping
    code is updated to use the descriptor offsets (rx_region_offs and
    tx_region_offs) rather than hard-coded structure layout, and to use the
    TX acquire/release helpers instead of touching the TX buffer directly.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          |  22 ++-----
 xen/arch/arm/tee/ffa_partinfo.c |  40 ++++++-------
 xen/arch/arm/tee/ffa_private.h  |  18 +++---
 xen/arch/arm/tee/ffa_rxtx.c     | 126 +++++++++++++++++++++++++++++++---------
 xen/arch/arm/tee/ffa_shm.c      |  29 +++++----
 5 files changed, 149 insertions(+), 86 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 497ada8264..43af49d1c0 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -48,8 +48,8 @@
  *     notification for secure partitions
  *   - doesn't support notifications for Xen itself
  *
- * There are some large locked sections with ffa_tx_buffer_lock and
- * ffa_rx_buffer_lock. Especially the ffa_tx_buffer_lock spinlock used
+ * There are some large locked sections with ffa_spmc_tx_lock and
+ * ffa_spmc_rx_lock. Especially the ffa_spmc_tx_lock spinlock used
  * around share_shm() is a very large locked section which can let one VM
  * affect another VM.
  */
@@ -108,20 +108,6 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_RUN),
 };
 
-/*
- * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
- * number of pages used in each of these buffers.
- *
- * The RX buffer is protected from concurrent usage with ffa_rx_buffer_lock.
- * Note that the SPMC is also tracking the ownership of our RX buffer so
- * for calls which uses our RX buffer to deliver a result we must call
- * ffa_rx_release() to let the SPMC know that we're done with the buffer.
- */
-void *ffa_rx __read_mostly;
-void *ffa_tx __read_mostly;
-DEFINE_SPINLOCK(ffa_rx_buffer_lock);
-DEFINE_SPINLOCK(ffa_tx_buffer_lock);
-
 LIST_HEAD(ffa_ctx_head);
 /* RW Lock to protect addition/removal and reading in ffa_ctx_head */
 DEFINE_RWLOCK(ffa_ctx_list_rwlock);
@@ -617,7 +603,7 @@ static bool ffa_probe_fw(void)
                    ffa_fw_abi_needed[i].name);
     }
 
-    if ( !ffa_rxtx_init() )
+    if ( !ffa_rxtx_spmc_init() )
     {
         printk(XENLOG_ERR "ffa: Error during RXTX buffer init\n");
         goto err_no_fw;
@@ -631,7 +617,7 @@ static bool ffa_probe_fw(void)
     return true;
 
 err_rxtx_destroy:
-    ffa_rxtx_destroy();
+    ffa_rxtx_spmc_destroy();
 err_no_fw:
     ffa_fw_version = 0;
     bitmap_zero(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index ec5a53ed1c..145b869957 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -77,28 +77,24 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
 {
     int32_t ret;
     uint32_t src_size, real_sp_count;
-    void *src_buf = ffa_rx;
+    void *src_buf;
     uint32_t count = 0;
 
-    /* Do we have a RX buffer with the SPMC */
-    if ( !ffa_rx )
-        return FFA_RET_DENIED;
-
     /* We need to use the RX buffer to receive the list */
-    spin_lock(&ffa_rx_buffer_lock);
+    src_buf = ffa_rxtx_spmc_rx_acquire();
+    if ( !src_buf )
+        return FFA_RET_DENIED;
 
     ret = ffa_partition_info_get(uuid, 0, &real_sp_count, &src_size);
     if ( ret )
         goto out;
 
-    /* We now own the RX buffer */
-
     /* Validate the src_size we got */
     if ( src_size < sizeof(struct ffa_partition_info_1_0) ||
          src_size >= FFA_PAGE_SIZE )
     {
         ret = FFA_RET_NOT_SUPPORTED;
-        goto out_release;
+        goto out;
     }
 
     /*
@@ -114,7 +110,7 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
     if ( real_sp_count > (FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE) / src_size )
     {
         ret = FFA_RET_NOT_SUPPORTED;
-        goto out_release;
+        goto out;
     }
 
     for ( uint32_t sp_num = 0; sp_num < real_sp_count; sp_num++ )
@@ -127,7 +123,7 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
             if ( dst_buf > (end_buf - dst_size) )
             {
                 ret = FFA_RET_NO_MEMORY;
-                goto out_release;
+                goto out;
             }
 
             memcpy(dst_buf, src_buf, MIN(src_size, dst_size));
@@ -143,10 +139,8 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
 
     *sp_count = count;
 
-out_release:
-    ffa_hyp_rx_release();
 out:
-    spin_unlock(&ffa_rx_buffer_lock);
+    ffa_rxtx_spmc_rx_release();
     return ret;
 }
 
@@ -378,7 +372,7 @@ static void uninit_subscribers(void)
         XFREE(subscr_vm_destroyed);
 }
 
-static bool init_subscribers(uint16_t count, uint32_t fpi_size)
+static bool init_subscribers(void *buf, uint16_t count, uint32_t fpi_size)
 {
     uint16_t n;
     uint16_t c_pos;
@@ -395,7 +389,7 @@ static bool init_subscribers(uint16_t count, uint32_t fpi_size)
     subscr_vm_destroyed_count = 0;
     for ( n = 0; n < count; n++ )
     {
-        fpi = ffa_rx + n * fpi_size;
+        fpi = buf + n * fpi_size;
 
         /*
          * We need to have secure partitions using bit 15 set convention for
@@ -433,7 +427,7 @@ static bool init_subscribers(uint16_t count, uint32_t fpi_size)
 
     for ( c_pos = 0, d_pos = 0, n = 0; n < count; n++ )
     {
-        fpi = ffa_rx + n * fpi_size;
+        fpi = buf + n * fpi_size;
 
         if ( FFA_ID_IS_SECURE(fpi->id) )
         {
@@ -455,10 +449,14 @@ bool ffa_partinfo_init(void)
     uint32_t fpi_size;
     uint32_t count;
     int e;
+    void *spmc_rx;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
-         !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32) ||
-         !ffa_rx || !ffa_tx )
+         !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
+        return false;
+
+    spmc_rx = ffa_rxtx_spmc_rx_acquire();
+    if (!spmc_rx)
         return false;
 
     e = ffa_partition_info_get(NULL, 0, &count, &fpi_size);
@@ -475,10 +473,10 @@ bool ffa_partinfo_init(void)
         goto out;
     }
 
-    ret = init_subscribers(count, fpi_size);
+    ret = init_subscribers(spmc_rx, count, fpi_size);
 
 out:
-    ffa_hyp_rx_release();
+    ffa_rxtx_spmc_rx_release();
     return ret;
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 0bb5a84553..4c97041829 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -416,10 +416,6 @@ struct ffa_ctx {
     unsigned long *vm_destroy_bitmap;
 };
 
-extern void *ffa_rx;
-extern void *ffa_tx;
-extern spinlock_t ffa_rx_buffer_lock;
-extern spinlock_t ffa_tx_buffer_lock;
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
 
 extern struct list_head ffa_ctx_head;
@@ -437,8 +433,13 @@ int ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
-bool ffa_rxtx_init(void);
-void ffa_rxtx_destroy(void);
+bool ffa_rxtx_spmc_init(void);
+void ffa_rxtx_spmc_destroy(void);
+void *ffa_rxtx_spmc_rx_acquire(void);
+void ffa_rxtx_spmc_rx_release(void);
+void *ffa_rxtx_spmc_tx_acquire(void);
+void ffa_rxtx_spmc_tx_release(void);
+
 int32_t ffa_rxtx_domain_init(struct domain *d);
 void ffa_rxtx_domain_destroy(struct domain *d);
 int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
@@ -568,11 +569,6 @@ static inline int32_t ffa_simple_call(uint32_t fid, register_t a1,
     return ffa_get_ret_code(&resp);
 }
 
-static inline int32_t ffa_hyp_rx_release(void)
-{
-    return ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
-}
-
 static inline bool ffa_fw_supports_fid(uint32_t fid)
 {
     BUILD_BUG_ON(FFA_FNUM_MIN_VALUE > FFA_FNUM_MAX_VALUE);
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 5776693bb3..63203b22b8 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -30,6 +30,20 @@ struct ffa_endpoint_rxtx_descriptor_1_1 {
     uint32_t tx_region_offs;
 };
 
+/*
+ * Our rx/tx buffers shared with the SPMC. FFA_RXTX_PAGE_COUNT is the
+ * number of pages used in each of these buffers.
+ * Each buffer has its own lock to protect from concurrent usage.
+ *
+ * Note that the SPMC is also tracking the ownership of our RX buffer so
+ * for calls which uses our RX buffer to deliver a result we must do an
+ * FFA_RX_RELEASE to let the SPMC know that we're done with the buffer.
+ */
+static void *ffa_spmc_rx __read_mostly;
+static void *ffa_spmc_tx __read_mostly;
+static DEFINE_SPINLOCK(ffa_spmc_rx_lock);
+static DEFINE_SPINLOCK(ffa_spmc_tx_lock);
+
 static int32_t ffa_rxtx_map(paddr_t tx_addr, paddr_t rx_addr,
                             uint32_t page_count)
 {
@@ -126,8 +140,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
                      sizeof(struct ffa_address_range) * 2 >
                      FFA_MAX_RXTX_PAGE_COUNT * FFA_PAGE_SIZE);
 
-        spin_lock(&ffa_tx_buffer_lock);
-        rxtx_desc = ffa_tx;
+        rxtx_desc = ffa_rxtx_spmc_tx_acquire();
+        if ( !rxtx_desc )
+            goto err_unmap_rx;
 
         /*
          * We have only one page for each so we pack everything:
@@ -144,7 +159,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
                                              address_range_array[1]);
 
         /* rx buffer */
-        mem_reg = ffa_tx + sizeof(*rxtx_desc);
+        mem_reg = (void *)rxtx_desc + rxtx_desc->rx_region_offs;
         mem_reg->total_page_count = 1;
         mem_reg->address_range_count = 1;
         mem_reg->reserved = 0;
@@ -154,7 +169,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         mem_reg->address_range_array[0].reserved = 0;
 
         /* tx buffer */
-        mem_reg = ffa_tx + rxtx_desc->tx_region_offs;
+        mem_reg = (void *)rxtx_desc + rxtx_desc->tx_region_offs;
         mem_reg->total_page_count = 1;
         mem_reg->address_range_count = 1;
         mem_reg->reserved = 0;
@@ -165,7 +180,7 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
         ret = ffa_rxtx_map(0, 0, 0);
 
-        spin_unlock(&ffa_tx_buffer_lock);
+        ffa_rxtx_spmc_tx_release();
 
         if ( ret != FFA_RET_OK )
             goto err_unmap_rx;
@@ -319,49 +334,108 @@ void ffa_rxtx_domain_destroy(struct domain *d)
     rxtx_unmap(d);
 }
 
-void ffa_rxtx_destroy(void)
+void *ffa_rxtx_spmc_rx_acquire(void)
+{
+    spin_lock(&ffa_spmc_rx_lock);
+
+    if ( ffa_spmc_rx )
+        return ffa_spmc_rx;
+
+    return NULL;
+}
+
+void ffa_rxtx_spmc_rx_release(void)
+{
+    int32_t ret;
+
+    ASSERT(spin_is_locked(&ffa_spmc_rx_lock));
+
+    /* Inform the SPMC that we are done with our RX buffer */
+    ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+    if ( ret != FFA_RET_OK )
+        printk(XENLOG_DEBUG "Error releasing SPMC RX buffer: %d\n", ret);
+
+    spin_unlock(&ffa_spmc_rx_lock);
+}
+
+void *ffa_rxtx_spmc_tx_acquire(void)
 {
-    bool need_unmap = ffa_tx && ffa_rx;
+    spin_lock(&ffa_spmc_tx_lock);
 
-    if ( ffa_tx )
+    if ( ffa_spmc_tx )
+        return ffa_spmc_tx;
+
+    return NULL;
+}
+
+void ffa_rxtx_spmc_tx_release(void)
+{
+    ASSERT(spin_is_locked(&ffa_spmc_tx_lock));
+
+    spin_unlock(&ffa_spmc_tx_lock);
+}
+
+void ffa_rxtx_spmc_destroy(void)
+{
+    bool need_unmap;
+
+    spin_lock(&ffa_spmc_rx_lock);
+    spin_lock(&ffa_spmc_tx_lock);
+    need_unmap = ffa_spmc_tx && ffa_spmc_rx;
+
+    if ( ffa_spmc_tx )
     {
-        free_xenheap_pages(ffa_tx, 0);
-        ffa_tx = NULL;
+        free_xenheap_pages(ffa_spmc_tx, 0);
+        ffa_spmc_tx = NULL;
     }
-    if ( ffa_rx )
+    if ( ffa_spmc_rx )
     {
-        free_xenheap_pages(ffa_rx, 0);
-        ffa_rx = NULL;
+        free_xenheap_pages(ffa_spmc_rx, 0);
+        ffa_spmc_rx = NULL;
     }
 
     if ( need_unmap )
         ffa_rxtx_unmap(0);
+
+    spin_unlock(&ffa_spmc_tx_lock);
+    spin_unlock(&ffa_spmc_rx_lock);
 }
 
-bool ffa_rxtx_init(void)
+bool ffa_rxtx_spmc_init(void)
 {
     int32_t e;
+    bool ret = false;
 
     /* Firmware not there or not supporting */
     if ( !ffa_fw_supports_fid(FFA_RXTX_MAP_64) )
         return false;
 
-    ffa_rx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
-    if ( !ffa_rx )
-        return false;
+    spin_lock(&ffa_spmc_rx_lock);
+    spin_lock(&ffa_spmc_tx_lock);
 
-    ffa_tx = alloc_xenheap_pages(get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
-    if ( !ffa_tx )
-        goto err;
+    ffa_spmc_rx = alloc_xenheap_pages(
+                            get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_spmc_rx )
+        goto exit;
 
-    e = ffa_rxtx_map(__pa(ffa_tx), __pa(ffa_rx), FFA_RXTX_PAGE_COUNT);
+    ffa_spmc_tx = alloc_xenheap_pages(
+                            get_order_from_pages(FFA_RXTX_PAGE_COUNT), 0);
+    if ( !ffa_spmc_tx )
+        goto exit;
+
+    e = ffa_rxtx_map(__pa(ffa_spmc_tx), __pa(ffa_spmc_rx),
+                     FFA_RXTX_PAGE_COUNT);
     if ( e )
-        goto err;
+        goto exit;
+
+    ret = true;
 
-    return true;
+exit:
+    spin_unlock(&ffa_spmc_tx_lock);
+    spin_unlock(&ffa_spmc_rx_lock);
 
-err:
-    ffa_rxtx_destroy();
+    if ( !ret )
+        ffa_rxtx_spmc_destroy();
 
-    return false;
+    return ret;
 }
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index dad3da1922..e275d3769d 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -286,9 +286,8 @@ static void init_range(struct ffa_address_range *addr_range,
 }
 
 /*
- * This function uses the ffa_tx buffer to transmit the memory transaction
- * descriptor. The function depends ffa_tx_buffer_lock to be used to guard
- * the buffer from concurrent use.
+ * This function uses the ffa_spmc tx buffer to transmit the memory transaction
+ * descriptor.
  */
 static int share_shm(struct ffa_shm_mem *shm)
 {
@@ -298,17 +297,22 @@ static int share_shm(struct ffa_shm_mem *shm)
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
     const unsigned int region_count = 1;
-    void *buf = ffa_tx;
     uint32_t frag_len;
     uint32_t tot_len;
     paddr_t last_pa;
     unsigned int n;
     paddr_t pa;
+    int32_t ret;
+    void *buf;
 
-    ASSERT(spin_is_locked(&ffa_tx_buffer_lock));
     ASSERT(shm->page_count);
 
+    buf = ffa_rxtx_spmc_tx_acquire();
+    if ( !buf )
+        return FFA_RET_NOT_SUPPORTED;
+
     descr = buf;
+
     memset(descr, 0, sizeof(*descr));
     descr->sender_id = shm->sender_id;
     descr->handle = shm->handle;
@@ -340,7 +344,10 @@ static int share_shm(struct ffa_shm_mem *shm)
     tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
                                 region_descr->address_range_count);
     if ( tot_len > max_frag_len )
-        return FFA_RET_NOT_SUPPORTED;
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
 
     addr_range = region_descr->address_range_array;
     frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
@@ -360,7 +367,12 @@ static int share_shm(struct ffa_shm_mem *shm)
         init_range(addr_range, pa);
     }
 
-    return ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+
+out:
+    ffa_rxtx_spmc_tx_release();
+
+    return ret;
 }
 
 static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
@@ -579,10 +591,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
-    /* Note that share_shm() uses our tx buffer */
-    spin_lock(&ffa_tx_buffer_lock);
     ret = share_shm(shm);
-    spin_unlock(&ffa_tx_buffer_lock);
     if ( ret )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219083.1528004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2UU-000196-IL; Mon, 02 Feb 2026 22:33:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219083.1528004; Mon, 02 Feb 2026 22: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 1vn2UU-00018y-Fi; Mon, 02 Feb 2026 22:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1219083;
 Mon, 02 Feb 2026 22: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 1vn2US-00018i-LY
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2US-00HAIo-38
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2US-00ETEx-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=7iwOUuOnFwBoFgZeSORWjJqKTrLTtDQixkNtlug0Yyk=; b=SrWx9EG/s53rphFNklIkiMkacE
	gFuciR9C6EMzudam5QCznCf4I7wdP4FFtyOhbO8oc5EnykZN+tKi+FfinWUpe+Z1hwpNFV8fOYJvP
	YqFkxc7odopdUszDQoeoyGtietwoWzvmwjGS4t6+/JosfzkL0JtJOIgn2w2rO5TbNInc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: rework VM RX/TX buffer management
Message-Id: <E1vn2US-00ETEx-1w@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:33:52 +0000

commit 3528248b8c994ee77ad4e4ba884db0ecf235f067
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:23 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: rework VM RX/TX buffer management
    
    Rework access to VM RX/TX buffer to use acquire/release functions
    equivalent to the ones used for the SPMC RX/TX buffers and remove all
    direct access to ctx->tx or ctx->rx by giving back the buffer pointer
    and size back in acquire.
    
    This design ensures that rx or page_count is not accessed without the
    lock held and limit direct usage of the context rx/tx buffer info to
    ffa_rxtx.c
    
    Modify msg, partinfo and shm code to use the new RX/TX buffer
    acquire/release functions and remove all direct accesses to rx/tx and
    page_count so that any access is done only with the lock taken.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          |  2 +-
 xen/arch/arm/tee/ffa_msg.c      | 32 ++++++++++++++++--------------
 xen/arch/arm/tee/ffa_partinfo.c |  8 ++++----
 xen/arch/arm/tee/ffa_private.h  |  6 ++++--
 xen/arch/arm/tee/ffa_rxtx.c     | 43 +++++++++++++++++++++++++++++++++++------
 xen/arch/arm/tee/ffa_shm.c      | 18 ++++++++---------
 6 files changed, 72 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 43af49d1c0..69a5e1e876 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -345,7 +345,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         ffa_handle_partition_info_get(regs);
         return true;
     case FFA_RX_RELEASE:
-        e = ffa_rx_release(d);
+        e = ffa_rx_release(ctx);
         break;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 2c2ebc9c5c..d60eed6d88 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -94,6 +94,8 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     struct domain *dst_d;
     struct ffa_ctx *dst_ctx;
     struct ffa_part_msg_rxtx *dst_msg;
+    void *rx_buf;
+    size_t rx_size;
     int err;
     int32_t ret;
 
@@ -120,20 +122,19 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     }
 
     /* This also checks that destination has set a Rx buffer */
-    ret = ffa_rx_acquire(dst_d);
+    ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
     if ( ret )
         goto out_unlock;
 
     /* we need to have enough space in the destination buffer */
-    if ( (dst_ctx->page_count * FFA_PAGE_SIZE -
-          sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
+    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
     {
         ret = FFA_RET_NO_MEMORY;
-        ffa_rx_release(dst_d);
+        ffa_rx_release(dst_ctx);
         goto out_unlock;
     }
 
-    dst_msg = dst_ctx->rx;
+    dst_msg = rx_buf;
 
     /* prepare destination header */
     dst_msg->flags = 0;
@@ -142,7 +143,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     dst_msg->send_recv_id = src_msg->send_recv_id;
     dst_msg->msg_size = src_msg->msg_size;
 
-    memcpy(dst_ctx->rx + sizeof(struct ffa_part_msg_rxtx),
+    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx),
            src_buf + src_msg->msg_offset, src_msg->msg_size);
 
     /* receiver rx buffer will be released by the receiver*/
@@ -159,17 +160,20 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 {
     struct domain *src_d = current->domain;
     struct ffa_ctx *src_ctx = src_d->arch.tee;
+    const void *tx_buf;
+    size_t tx_size;
     struct ffa_part_msg_rxtx src_msg;
     uint16_t dst_id, src_id;
     int32_t ret;
 
     BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx) >= FFA_PAGE_SIZE);
 
-    if ( !spin_trylock(&src_ctx->tx_lock) )
-        return FFA_RET_BUSY;
+    ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
+    if ( ret != FFA_RET_OK )
+        return ret;
 
     /* create a copy of the message header */
-    memcpy(&src_msg, src_ctx->tx, sizeof(src_msg));
+    memcpy(&src_msg, tx_buf, sizeof(src_msg));
 
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
@@ -182,10 +186,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
     /* check source message fits in buffer */
     if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx) ||
-            src_msg.msg_size == 0 ||
-            src_msg.msg_offset > src_ctx->page_count * FFA_PAGE_SIZE ||
-            src_msg.msg_size > (src_ctx->page_count * FFA_PAGE_SIZE -
-                                src_msg.msg_offset) )
+            src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
+            src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
@@ -206,12 +208,12 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     else if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
         /* Message for a VM */
-        ret = ffa_msg_send2_vm(dst_id, src_ctx->tx, &src_msg);
+        ret = ffa_msg_send2_vm(dst_id, tx_buf, &src_msg);
     }
     else
         ret = FFA_RET_INVALID_PARAMETERS;
 
 out:
-    spin_unlock(&src_ctx->tx_lock);
+    ffa_tx_release(src_ctx);
     return ret;
 }
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 145b869957..16c905cb12 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -224,6 +224,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
         get_user_reg(regs, 4),
     };
     uint32_t dst_size = 0;
+    size_t buf_size;
     void *dst_buf, *end_buf;
     uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
 
@@ -268,12 +269,11 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
     }
 
     /* Get the RX buffer to write the list of partitions */
-    ret = ffa_rx_acquire(d);
+    ret = ffa_rx_acquire(ctx, &dst_buf, &buf_size);
     if ( ret != FFA_RET_OK )
         goto out;
 
-    dst_buf = ctx->rx;
-    end_buf = ctx->rx + ctx->page_count * FFA_PAGE_SIZE;
+    end_buf = dst_buf + buf_size;
 
     /* An entry should be smaller than a page */
     BUILD_BUG_ON(sizeof(struct ffa_partition_info_1_1) > FFA_PAGE_SIZE);
@@ -304,7 +304,7 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
 
 out_rx_release:
     if ( ret )
-        ffa_rx_release(d);
+        ffa_rx_release(ctx);
 out:
     if ( ret )
         ffa_set_regs_error(regs, ret);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 4c97041829..904ad1df73 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -445,8 +445,10 @@ void ffa_rxtx_domain_destroy(struct domain *d);
 int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 			     register_t rx_addr, uint32_t page_count);
 int32_t ffa_handle_rxtx_unmap(void);
-int32_t ffa_rx_acquire(struct domain *d);
-int32_t ffa_rx_release(struct domain *d);
+int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size);
+int32_t ffa_rx_release(struct ffa_ctx *ctx);
+int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size);
+int32_t ffa_tx_release(struct ffa_ctx *ctx);
 
 void ffa_notif_init(void);
 void ffa_notif_init_interrupt(void);
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 63203b22b8..7d8bb4f4d0 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -257,10 +257,9 @@ int32_t ffa_handle_rxtx_unmap(void)
     return rxtx_unmap(current->domain);
 }
 
-int32_t ffa_rx_acquire(struct domain *d)
+int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
 {
     int32_t ret = FFA_RET_OK;
-    struct ffa_ctx *ctx = d->arch.tee;
 
     spin_lock(&ctx->rx_lock);
 
@@ -278,21 +277,22 @@ int32_t ffa_rx_acquire(struct domain *d)
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        ret = ffa_simple_call(FFA_RX_ACQUIRE, ffa_get_vm_id(d), 0, 0, 0);
+        ret = ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
             goto out;
     }
     ctx->rx_is_free = false;
+    *buf = ctx->rx;
+    *buf_size = ctx->page_count * FFA_PAGE_SIZE;
 out:
     spin_unlock(&ctx->rx_lock);
 
     return ret;
 }
 
-int32_t ffa_rx_release(struct domain *d)
+int32_t ffa_rx_release(struct ffa_ctx *ctx)
 {
     int32_t ret = FFA_RET_DENIED;
-    struct ffa_ctx *ctx = d->arch.tee;
 
     spin_lock(&ctx->rx_lock);
 
@@ -301,7 +301,7 @@ int32_t ffa_rx_release(struct domain *d)
 
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
-        ret = ffa_simple_call(FFA_RX_RELEASE, ffa_get_vm_id(d), 0, 0, 0);
+        ret = ffa_simple_call(FFA_RX_RELEASE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
             goto out;
     }
@@ -313,6 +313,37 @@ out:
     return ret;
 }
 
+int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size)
+{
+    int32_t ret = FFA_RET_DENIED;
+
+    if ( !spin_trylock(&ctx->tx_lock) )
+        return FFA_RET_BUSY;
+
+    if ( !ctx->page_count )
+        goto err_unlock;
+
+    if ( !ctx->tx )
+        goto err_unlock;
+
+    *buf = ctx->tx;
+    *buf_size = ctx->page_count * FFA_PAGE_SIZE;
+    return FFA_RET_OK;
+
+err_unlock:
+    spin_unlock(&ctx->tx_lock);
+
+    return ret;
+}
+
+int32_t ffa_tx_release(struct ffa_ctx *ctx)
+{
+    ASSERT(spin_is_locked(&ctx->tx_lock));
+
+    spin_unlock(&ctx->tx_lock);
+    return FFA_RET_OK;
+}
+
 int32_t ffa_rxtx_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx = d->arch.tee;
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index e275d3769d..b862578c55 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -460,6 +460,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     struct ffa_mem_transaction_int trans;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
+    const void *tx_buf;
+    size_t tx_size;
     struct ffa_shm_mem *shm = NULL;
     register_t handle_hi = 0;
     register_t handle_lo = 0;
@@ -498,16 +500,14 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_set_ret;
     }
 
-    if ( !spin_trylock(&ctx->tx_lock) )
-    {
-        ret = FFA_RET_BUSY;
+    ret = ffa_tx_acquire(ctx, &tx_buf, &tx_size);
+    if ( ret != FFA_RET_OK )
         goto out_set_ret;
-    }
 
-    if ( frag_len > ctx->page_count * FFA_PAGE_SIZE )
+    if ( frag_len > tx_size )
         goto out_unlock;
 
-    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), ctx->tx,
+    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), tx_buf,
                                frag_len, &trans);
     if ( ret )
         goto out_unlock;
@@ -535,7 +535,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
         goto out_unlock;
 
-    mem_access = ctx->tx + trans.mem_access_offs;
+    mem_access = tx_buf + trans.mem_access_offs;
 
     dst_id = ACCESS_ONCE(mem_access->access_perm.endpoint_id);
     if ( !FFA_ID_IS_SECURE(dst_id) )
@@ -558,7 +558,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
-    region_descr = ctx->tx + region_offs;
+    region_descr = tx_buf + region_offs;
     range_count = ACCESS_ONCE(region_descr->address_range_count);
     page_count = ACCESS_ONCE(region_descr->total_page_count);
 
@@ -605,7 +605,7 @@ out:
     if ( ret )
         free_ffa_shm_mem(d, shm);
 out_unlock:
-    spin_unlock(&ctx->tx_lock);
+    ffa_tx_release(ctx);
 
 out_set_ret:
     if ( ret == 0)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219084.1528008 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Ue-0001Cn-Jh; Mon, 02 Feb 2026 22:34:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219084.1528008; Mon, 02 Feb 2026 22: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 1vn2Ue-0001Cf-H4; Mon, 02 Feb 2026 22:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1219084;
 Mon, 02 Feb 2026 22: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 1vn2Uc-0001CV-O5
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2Ud-00HAJ4-0A
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2Uc-00ETGm-2E
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=d8bymiI/J9mp9xTgfz/v56Ntdap5RZoCLeVz+GPJvj4=; b=Y7OhilfxlU4ZDeQWAKLnjsloTQ
	yFkfWbbW/UIs2czkyvxYsKm5j7crsqcXoSrVTdJrX5BJAxPkd8Jcy40V7JM0trA46CACVdIfiUE2L
	7dgz+QCzWrjNtOk85swZLkkpwColDE25H26jbey4UvkJ61jrmFtmU/irFAnMHGTHfmEo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: use signed 32-bit status codes
Message-Id: <E1vn2Uc-00ETGm-2E@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:02 +0000

commit 00c4db573101eb765c888153e3e741850c8787c7
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:24 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: use signed 32-bit status codes
    
    The FF-A spec defines return status values as signed 32-bit integers.
    Align the Xen mediator with this requirement by:
    
    - switching the FF-A helpers (ffa_handle_mem_reclaim(), partition info
      init, notification ops, dispatcher glue, etc.) to int32_t return types
      so callers cannot silently truncate negative values
    - masking SMCCC responses/exits in ffa_get_version(),
      ffa_get_ret_code() and ffa_set_regs_error() to 32 bits before storing
      them in guest registers
    - updating notifier, shared-memory reclaim, partition-info and
      dispatcher call sites to use the new prototypes so the entire FF-A
      path propagates spec-compliant 32-bit signed error codes
    
    While there, tidy up the FF-A notification helpers by using GENMASK(15, 0)
    for endpoint extraction and fix the secure-endpoint check in
    ffa_handle_notification_set() to apply the mask to the endpoint ID before
    calling FFA_ID_IS_SECURE(), instead of testing the wrong halfword of
    src_dst.
    
    Fixes: 911b305e7bdab ("xen/arm: ffa: Enable VM to VM without firmware")
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 12 +++++++-----
 xen/arch/arm/tee/ffa_notif.c    | 14 +++++++-------
 xen/arch/arm/tee/ffa_partinfo.c |  4 ++--
 xen/arch/arm/tee/ffa_private.h  | 21 +++++++++++----------
 xen/arch/arm/tee/ffa_shm.c      |  4 ++--
 5 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 69a5e1e876..2c09d10ae6 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -129,12 +129,14 @@ static bool ffa_get_version(uint32_t *vers)
         .a1 = FFA_MY_VERSION,
     };
     struct arm_smccc_1_2_regs resp;
+    int32_t ret;
 
     arm_smccc_1_2_smc(&arg, &resp);
-    if ( resp.a0 == FFA_RET_NOT_SUPPORTED )
+    ret = resp.a0 & GENMASK_ULL(31, 0);
+    if ( ret == FFA_RET_NOT_SUPPORTED )
         return false;
 
-    *vers = resp.a0;
+    *vers = resp.a0 & GENMASK_ULL(31, 0);
 
     return true;
 }
@@ -310,7 +312,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     uint32_t fid = get_user_reg(regs, 0);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    int e;
+    int32_t e;
 
     if ( !ctx )
         return false;
@@ -382,8 +384,8 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
 
     default:
         gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
-        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
-        return true;
+        e = FFA_RET_NOT_SUPPORTED;
+        break;
     }
 
     if ( e )
diff --git a/xen/arch/arm/tee/ffa_notif.c b/xen/arch/arm/tee/ffa_notif.c
index 86bef6b3b2..37b05747cd 100644
--- a/xen/arch/arm/tee/ffa_notif.c
+++ b/xen/arch/arm/tee/ffa_notif.c
@@ -19,7 +19,7 @@
 static bool __ro_after_init fw_notif_enabled;
 static unsigned int __ro_after_init notif_sri_irq;
 
-int ffa_handle_notification_bind(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_bind(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
@@ -27,7 +27,7 @@ int ffa_handle_notification_bind(struct cpu_user_regs *regs)
     uint32_t bitmap_lo = get_user_reg(regs, 3);
     uint32_t bitmap_hi = get_user_reg(regs, 4);
 
-    if ( (src_dst & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (src_dst & GENMASK(15, 0)) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
     if ( flags )    /* Only global notifications are supported */
@@ -40,14 +40,14 @@ int ffa_handle_notification_bind(struct cpu_user_regs *regs)
     return FFA_RET_NOT_SUPPORTED;
 }
 
-int ffa_handle_notification_unbind(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_unbind(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
     uint32_t bitmap_lo = get_user_reg(regs, 3);
     uint32_t bitmap_hi = get_user_reg(regs, 4);
 
-    if ( (src_dst & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (src_dst & GENMASK(15, 0)) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
     if ( FFA_ID_IS_SECURE(src_dst >> 16) && fw_notif_enabled )
@@ -106,7 +106,7 @@ void ffa_handle_notification_get(struct cpu_user_regs *regs)
         return;
     }
 
-    if ( (recv & 0xFFFFU) != ffa_get_vm_id(d) )
+    if ( (recv & GENMASK(15, 0)) != ffa_get_vm_id(d) )
     {
         ffa_set_regs_error(regs, FFA_RET_INVALID_PARAMETERS);
         return;
@@ -162,7 +162,7 @@ void ffa_handle_notification_get(struct cpu_user_regs *regs)
     ffa_set_regs(regs, FFA_SUCCESS_32, 0, w2, w3, w4, w5, w6, w7);
 }
 
-int ffa_handle_notification_set(struct cpu_user_regs *regs)
+int32_t ffa_handle_notification_set(struct cpu_user_regs *regs)
 {
     struct domain *d = current->domain;
     uint32_t src_dst = get_user_reg(regs, 1);
@@ -173,7 +173,7 @@ int ffa_handle_notification_set(struct cpu_user_regs *regs)
     if ( (src_dst >> 16) != ffa_get_vm_id(d) )
         return FFA_RET_INVALID_PARAMETERS;
 
-    if ( FFA_ID_IS_SECURE(src_dst >> 16) && fw_notif_enabled )
+    if ( FFA_ID_IS_SECURE(src_dst & GENMASK(15, 0)) && fw_notif_enabled )
         return ffa_simple_call(FFA_NOTIFICATION_SET, src_dst, flags, bitmap_lo,
                                bitmap_hi);
 
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 16c905cb12..c9faf54158 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -448,7 +448,7 @@ bool ffa_partinfo_init(void)
     bool ret = false;
     uint32_t fpi_size;
     uint32_t count;
-    int e;
+    int32_t e;
     void *spmc_rx;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
@@ -515,7 +515,7 @@ static void vm_destroy_bitmap_init(struct ffa_ctx *ctx,
     }
 }
 
-int ffa_partinfo_domain_init(struct domain *d)
+int32_t ffa_partinfo_domain_init(struct domain *d)
 {
     unsigned int count = BITS_TO_LONGS(subscr_vm_destroyed_count);
     struct ffa_ctx *ctx = d->arch.tee;
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 904ad1df73..c274177029 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -31,9 +31,9 @@
 
 /* FFA_VERSION helpers */
 #define FFA_VERSION_MAJOR_SHIFT         16U
-#define FFA_VERSION_MAJOR_MASK          0x7FFFU
+#define FFA_VERSION_MAJOR_MASK          GENMASK(14, 0)
 #define FFA_VERSION_MINOR_SHIFT         0U
-#define FFA_VERSION_MINOR_MASK          0xFFFFU
+#define FFA_VERSION_MINOR_MASK          GENMASK(15, 0)
 #define MAKE_FFA_VERSION(major, minor)  \
         ((((major) & FFA_VERSION_MAJOR_MASK) << FFA_VERSION_MAJOR_SHIFT) | \
          ((minor) & FFA_VERSION_MINOR_MASK))
@@ -426,10 +426,10 @@ extern atomic_t ffa_vm_count;
 
 bool ffa_shm_domain_destroy(struct domain *d);
 void ffa_handle_mem_share(struct cpu_user_regs *regs);
-int ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags);
+int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags);
 
 bool ffa_partinfo_init(void);
-int ffa_partinfo_domain_init(struct domain *d);
+int32_t ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
@@ -455,11 +455,11 @@ void ffa_notif_init_interrupt(void);
 int ffa_notif_domain_init(struct domain *d);
 void ffa_notif_domain_destroy(struct domain *d);
 
-int ffa_handle_notification_bind(struct cpu_user_regs *regs);
-int ffa_handle_notification_unbind(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_bind(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_unbind(struct cpu_user_regs *regs);
 void ffa_handle_notification_info_get(struct cpu_user_regs *regs);
 void ffa_handle_notification_get(struct cpu_user_regs *regs);
-int ffa_handle_notification_set(struct cpu_user_regs *regs);
+int32_t ffa_handle_notification_set(struct cpu_user_regs *regs);
 
 #ifdef CONFIG_FFA_VM_TO_VM
 void ffa_raise_rx_buffer_full(struct domain *d);
@@ -525,9 +525,10 @@ static inline void ffa_set_regs(struct cpu_user_regs *regs, register_t v0,
 }
 
 static inline void ffa_set_regs_error(struct cpu_user_regs *regs,
-                                      uint32_t error_code)
+                                      int32_t error_code)
 {
-    ffa_set_regs(regs, FFA_ERROR, 0, error_code, 0, 0, 0, 0, 0);
+    ffa_set_regs(regs, FFA_ERROR, 0, error_code & GENMASK_ULL(31, 0), 0, 0, 0,
+                 0, 0);
 }
 
 static inline void ffa_set_regs_success(struct cpu_user_regs *regs,
@@ -542,7 +543,7 @@ static inline int32_t ffa_get_ret_code(const struct arm_smccc_1_2_regs *resp)
     {
     case FFA_ERROR:
         if ( resp->a2 )
-            return resp->a2;
+            return resp->a2 & GENMASK_ULL(31, 0);
         else
             return FFA_RET_NOT_SUPPORTED;
     case FFA_SUCCESS_32:
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index b862578c55..8282bacf85 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -626,14 +626,14 @@ static struct ffa_shm_mem *find_shm_mem(struct ffa_ctx *ctx, uint64_t handle)
     return NULL;
 }
 
-int ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
+int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
 {
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
     register_t handle_hi;
     register_t handle_lo;
-    int ret;
+    int32_t ret;
 
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
         return FFA_RET_NOT_SUPPORTED;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219085.1528012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Uo-0001FJ-L3; Mon, 02 Feb 2026 22:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219085.1528012; Mon, 02 Feb 2026 22: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 1vn2Uo-0001FB-IR; Mon, 02 Feb 2026 22:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1219085;
 Mon, 02 Feb 2026 22: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 1vn2Um-0001Ez-Sn
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2Un-00HAJ8-0d
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2Um-00ETHG-2U
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=vf2uzwW11II5iCSToSiEfEzY3XwAgTMEx5VHSoyN9Nc=; b=4iV1uGKm/XIcA1sGW6ipWQz/E/
	OBxDQ6TxvA2CfC8oSMjjU8DIturKOtzqTes34GcuCHdKzidYFqbikrCL/7Smb8iDyDARejtCSzr4S
	QxfgrzD3fiKxjot9FvGAlfsY/uwaCclUMwTNNJBnoSKYRHZLCZl89UHmNdLfWFNQ1BPQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: add UUID helpers for partition info
Message-Id: <E1vn2Um-00ETHG-2U@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:12 +0000

commit 5c856002700e7c58fdf54f24835d34f06efa9234
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:25 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add UUID helpers for partition info
    
    Introduce struct ffa_uuid together with nil/equality/set helpers, and
    use it end-to-end in the partition-info plumbing.
    
    The SP and VM enumeration paths now build UUIDs from the guest
    registers, call a new ffa_copy_info() helper and ensure non-nil UUID
    queries only return matching SP entries, relying on firmware UUID
    filtering. VM entries are skipped because we do not track per-VM UUIDs.
    
    Count requests and subscriber initialisation are updated accordingly so
    firmware is always called with an explicit UUID. This keeps count and
    listing requests aligned with the FF-A v1.1 rules while preserving the
    Linux compatibility workaround for v1.2 requesters.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_partinfo.c | 209 +++++++++++++++++++++++++---------------
 xen/arch/arm/tee/ffa_private.h  |  21 ++++
 2 files changed, 154 insertions(+), 76 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index c9faf54158..bf906ed0c8 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -33,7 +33,7 @@ static uint16_t subscr_vm_created_count __read_mostly;
 static uint16_t *subscr_vm_destroyed __read_mostly;
 static uint16_t subscr_vm_destroyed_count __read_mostly;
 
-static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
+static int32_t ffa_partition_info_get(struct ffa_uuid uuid, uint32_t flags,
                                       uint32_t *count, uint32_t *fpi_size)
 {
     struct arm_smccc_1_2_regs arg = {
@@ -41,15 +41,12 @@ static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
         .a5 = flags,
     };
     struct arm_smccc_1_2_regs resp;
-    uint32_t ret;
+    int32_t ret;
 
-    if ( uuid )
-    {
-        arg.a1 = uuid[0];
-        arg.a2 = uuid[1];
-        arg.a3 = uuid[2];
-        arg.a4 = uuid[3];
-    }
+    arg.a1 = uuid.val[0] & GENMASK(31, 0);
+    arg.a2 = (uuid.val[0] >> 32) & GENMASK(31, 0);
+    arg.a3 = uuid.val[1] & GENMASK(31, 0);
+    arg.a4 = (uuid.val[1] >> 32) & GENMASK(31, 0);
 
     arm_smccc_1_2_smc(&arg, &resp);
 
@@ -63,7 +60,26 @@ static int32_t ffa_partition_info_get(uint32_t *uuid, uint32_t flags,
     return ret;
 }
 
-static int32_t ffa_get_sp_count(uint32_t *uuid, uint32_t *sp_count)
+static int32_t ffa_copy_info(void **dst, void *dst_end, const void *src,
+                             uint32_t dst_size, uint32_t src_size)
+{
+    uint8_t *pos = *dst;
+    uint8_t *end = dst_end;
+
+    if ( pos > end - dst_size )
+        return FFA_RET_NO_MEMORY;
+
+    memcpy(pos, src, MIN(dst_size, src_size));
+
+    if ( dst_size > src_size )
+        memset(pos + src_size, 0, dst_size - src_size);
+
+    *dst = pos + dst_size;
+
+    return FFA_RET_OK;
+}
+
+static int32_t ffa_get_sp_count(struct ffa_uuid uuid, uint32_t *sp_count)
 {
     uint32_t src_size;
 
@@ -71,8 +87,8 @@ static int32_t ffa_get_sp_count(uint32_t *uuid, uint32_t *sp_count)
                                   sp_count, &src_size);
 }
 
-static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
-                                   void *dst_buf, void *end_buf,
+static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
+                                   void **dst_buf, void *end_buf,
                                    uint32_t dst_size)
 {
     int32_t ret;
@@ -120,17 +136,18 @@ static int32_t ffa_get_sp_partinfo(uint32_t *uuid, uint32_t *sp_count,
         /* filter out SP not following bit 15 convention if any */
         if ( FFA_ID_IS_SECURE(fpi->id) )
         {
-            if ( dst_buf > (end_buf - dst_size) )
-            {
-                ret = FFA_RET_NO_MEMORY;
-                goto out;
-            }
+            /*
+             * If VM is 1.0 but firmware is 1.1 we could have several entries
+             * with the same ID but different UUIDs. In this case the VM will
+             * get a list with several time the same ID.
+             * This is a non-compliance to the specification but 1.0 VMs should
+             * handle that on their own to simplify Xen implementation.
+             */
 
-            memcpy(dst_buf, src_buf, MIN(src_size, dst_size));
-            if ( dst_size > src_size )
-                memset(dst_buf + src_size, 0, dst_size - src_size);
+            ret = ffa_copy_info(dst_buf, end_buf, src_buf, dst_size, src_size);
+            if ( ret )
+                goto out;
 
-            dst_buf += dst_size;
             count++;
         }
 
@@ -144,69 +161,90 @@ out:
     return ret;
 }
 
-static int32_t ffa_get_vm_partinfo(uint32_t *vm_count, void *dst_buf,
-                                   void *end_buf, uint32_t dst_size)
+static int32_t ffa_get_vm_partinfo(struct ffa_uuid uuid, uint32_t *vm_count,
+                                   void **dst_buf, void *end_buf,
+                                   uint32_t dst_size)
 {
-    struct ffa_ctx *curr_ctx = current->domain->arch.tee;
+    struct domain *d = current->domain;
+    struct ffa_ctx *curr_ctx = d->arch.tee;
     struct ffa_ctx *dest_ctx;
     uint32_t count = 0;
     int32_t ret = FFA_RET_OK;
+    /*
+     * We do not have UUID info for VMs so use the 1.0 structure so that we set
+     * UUIDs to zero using memset
+     */
+    struct ffa_partition_info_1_0 info;
 
     /*
-     * There could potentially be a lot of VMs in the system and we could
-     * hold the CPU for long here.
-     * Right now there is no solution in FF-A specification to split
-     * the work in this case.
-     * TODO: Check how we could delay the work or have preemption checks.
+     * We do not have protocol UUIDs for VMs so if a request has non Nil UUID
+     * we must return an empty list.
      */
-    read_lock(&ffa_ctx_list_rwlock);
-    list_for_each_entry(dest_ctx, &ffa_ctx_head, ctx_list)
+    if ( !ffa_uuid_is_nil(uuid) )
+    {
+        *vm_count = 0;
+        return FFA_RET_OK;
+    }
+
+    /*
+     * Workaround for Linux FF-A Driver not accepting to have its own
+     * entry in the list before FF-A v1.2 was supported.
+     * This workaround is generally acceptable for other implementations
+     * as the specification was not completely clear on wether or not
+     * the requester endpoint information should be included or not
+     */
+    if ( ACCESS_ONCE(curr_ctx->guest_vers) >= FFA_VERSION_1_2 )
+    {
+        /* Add caller VM information */
+        info.id = curr_ctx->ffa_id;
+        info.execution_context = curr_ctx->num_vcpus;
+        info.partition_properties = FFA_PART_VM_PROP;
+        if ( is_64bit_domain(d) )
+            info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
+
+        ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size, sizeof(info));
+        if ( ret )
+            return ret;
+
+        count++;
+    }
+
+    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
         /*
-         * Do not include an entry for the caller VM as the spec is not
-         * clearly mandating it and it is not supported by Linux.
+         * There could potentially be a lot of VMs in the system and we could
+         * hold the CPU for long here.
+         * Right now there is no solution in FF-A specification to split
+         * the work in this case.
+         * TODO: Check how we could delay the work or have preemption checks.
          */
-        if ( dest_ctx != curr_ctx )
+        read_lock(&ffa_ctx_list_rwlock);
+        list_for_each_entry(dest_ctx, &ffa_ctx_head, ctx_list)
         {
-            /*
-             * We do not have UUID info for VMs so use
-             * the 1.0 structure so that we set UUIDs to
-             * zero using memset
-             */
-            struct ffa_partition_info_1_0 info;
+            /* Ignore the caller entry as it was already added */
+            if ( dest_ctx == curr_ctx )
+                continue;
 
-            if  ( dst_buf > (end_buf - dst_size) )
-            {
-                ret = FFA_RET_NO_MEMORY;
-                goto out;
-            }
-
-            /*
-             * Context might has been removed since we go it or being removed
-             * right now so we might return information for a VM not existing
-             * anymore. This is acceptable as we return a view of the system
-             * which could change at any time.
-             */
             info.id = dest_ctx->ffa_id;
             info.execution_context = dest_ctx->num_vcpus;
             info.partition_properties = FFA_PART_VM_PROP;
             if ( dest_ctx->is_64bit )
                 info.partition_properties |= FFA_PART_PROP_AARCH64_STATE;
 
-            memcpy(dst_buf, &info, MIN(sizeof(info), dst_size));
-
-            if ( dst_size > sizeof(info) )
-                memset(dst_buf + sizeof(info), 0,
-                       dst_size - sizeof(info));
+            ret = ffa_copy_info(dst_buf, end_buf, &info, dst_size,
+                                sizeof(info));
+            if ( ret )
+            {
+                read_unlock(&ffa_ctx_list_rwlock);
+                return ret;
+            }
 
-            dst_buf += dst_size;
             count++;
         }
+        read_unlock(&ffa_ctx_list_rwlock);
     }
-    *vm_count = count;
 
-out:
-    read_unlock(&ffa_ctx_list_rwlock);
+    *vm_count = count;
 
     return ret;
 }
@@ -217,17 +255,18 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     uint32_t flags = get_user_reg(regs, 5);
-    uint32_t uuid[4] = {
-        get_user_reg(regs, 1),
-        get_user_reg(regs, 2),
-        get_user_reg(regs, 3),
-        get_user_reg(regs, 4),
-    };
+    struct ffa_uuid uuid;
     uint32_t dst_size = 0;
     size_t buf_size;
     void *dst_buf, *end_buf;
     uint32_t ffa_vm_count = 0, ffa_sp_count = 0;
 
+    ffa_uuid_set(&uuid,
+             get_user_reg(regs, 1),
+             get_user_reg(regs, 2),
+             get_user_reg(regs, 3),
+             get_user_reg(regs, 4));
+
     /*
      * If the guest is v1.0, he does not get back the entry size so we must
      * use the v1.0 structure size in the destination buffer.
@@ -260,10 +299,23 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
         }
 
         /*
-         * Do not count the caller VM as the spec is not clearly mandating it
-         * and it is not supported by Linux.
+         * We do not have protocol UUIDs for VMs so if a request has non Nil
+         * UUID we must return a vm_count of 0
          */
-        ffa_vm_count = get_ffa_vm_count() - 1;
+        if ( ffa_uuid_is_nil(uuid) )
+        {
+            ffa_vm_count = get_ffa_vm_count();
+
+            /*
+             * Workaround for Linux FF-A Driver not accepting to have its own
+             * entry in the list before FF-A v1.2 was supported.
+             * This workaround is generally acceptable for other implementations
+             * as the specification was not completely clear on wether or not
+             * the requester endpoint information should be included or not
+             */
+            if ( ACCESS_ONCE(ctx->guest_vers) < FFA_VERSION_1_2 )
+                ffa_vm_count -= 1;
+        }
 
         goto out;
     }
@@ -290,17 +342,15 @@ void ffa_handle_partition_info_get(struct cpu_user_regs *regs)
 
     if ( ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) )
     {
-        ret = ffa_get_sp_partinfo(uuid, &ffa_sp_count, dst_buf, end_buf,
+        ret = ffa_get_sp_partinfo(uuid, &ffa_sp_count, &dst_buf, end_buf,
                                   dst_size);
 
         if ( ret )
             goto out_rx_release;
-
-        dst_buf += ffa_sp_count * dst_size;
     }
 
-    if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
-        ret = ffa_get_vm_partinfo(&ffa_vm_count, dst_buf, end_buf, dst_size);
+    ret = ffa_get_vm_partinfo(uuid, &ffa_vm_count, &dst_buf, end_buf,
+                              dst_size);
 
 out_rx_release:
     if ( ret )
@@ -309,7 +359,13 @@ out:
     if ( ret )
         ffa_set_regs_error(regs, ret);
     else
+    {
+        /* Size should be 0 on count request and was not supported in 1.0 */
+        if ( flags || ACCESS_ONCE(ctx->guest_vers) == FFA_VERSION_1_0 )
+            dst_size = 0;
+
         ffa_set_regs_success(regs, ffa_sp_count + ffa_vm_count, dst_size);
+    }
 }
 
 static int32_t ffa_direct_req_send_vm(uint16_t sp_id, uint16_t vm_id,
@@ -450,6 +506,7 @@ bool ffa_partinfo_init(void)
     uint32_t count;
     int32_t e;
     void *spmc_rx;
+    struct ffa_uuid nil_uuid = { .val = { 0ULL, 0ULL } };
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
          !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
@@ -459,7 +516,7 @@ bool ffa_partinfo_init(void)
     if (!spmc_rx)
         return false;
 
-    e = ffa_partition_info_get(NULL, 0, &count, &fpi_size);
+    e = ffa_partition_info_get(nil_uuid, 0, &count, &fpi_size);
     if ( e )
     {
         printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index c274177029..fb5212bd28 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -307,6 +307,10 @@ struct ffa_mem_region {
     struct ffa_address_range address_range_array[];
 };
 
+struct ffa_uuid {
+    uint64_t val[2];
+};
+
 struct ffa_ctx_notif {
     /*
      * True if domain is reported by FFA_NOTIFICATION_INFO_GET to have
@@ -581,4 +585,21 @@ static inline bool ffa_fw_supports_fid(uint32_t fid)
     return test_bit(FFA_ABI_BITNUM(fid), ffa_fw_abi_supported);
 }
 
+static inline bool ffa_uuid_is_nil(struct ffa_uuid id)
+{
+    return id.val[0] == 0 && id.val[1] == 0;
+}
+
+static inline bool ffa_uuid_equal(struct ffa_uuid id1, struct ffa_uuid id2)
+{
+    return id1.val[0] == id2.val[0] && id1.val[1] == id2.val[1];
+}
+
+static inline void ffa_uuid_set(struct ffa_uuid *id, uint32_t val0,
+                                uint32_t val1, uint32_t val2, uint32_t val3)
+{
+    id->val[0] = ((uint64_t)val1 << 32U) | val0;
+    id->val[1] = ((uint64_t)val3 << 32U) | val2;
+}
+
 #endif /*__FFA_PRIVATE_H__*/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219086.1528016 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2Uy-0001Ia-OG; Mon, 02 Feb 2026 22:34:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219086.1528016; Mon, 02 Feb 2026 22: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 1vn2Uy-0001IS-LB; Mon, 02 Feb 2026 22:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1219086;
 Mon, 02 Feb 2026 22: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 1vn2Uw-0001I3-VJ
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22:34: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 1vn2Ux-00HAJC-0u
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2Uw-00ETHk-2x
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=sl5TVir9ygIYYbq9iOdUm+PgH8aovkXxDoPV1auyKwk=; b=ZXOmh4ZKOCOZDnaCRUrdg0l8cU
	kqRMuhlPys8cve0Re1zyccGseHDGX4JaoidKph/VePOMSchMnTvCXdX2xkOQs2K/IstbX9IIg+ITQ
	Z+IUZSp+c8ggJDjD4eYl9LUhOHX9lqqMss/xdekQuStnGnHi3FP404AnORbIejzDcTXw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Add FFA_RUN support
Message-Id: <E1vn2Uw-00ETHk-2x@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:22 +0000

commit 7a90dad8de405d032f06b79bcd2014cecf4526b2
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:26 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: Add FFA_RUN support
    
    Add FFA_RUN support and remove mention that YIELD and INTERRUPT are not
    supported in the comment as we will now return them.
    
    Make FFA_FEATURE answer supported for RUN, YIELD and INTERRUPT.
    
    Share the SMCCC plumbing used by SEND_DIRECT and RUN via a common
    ffa_finish_direct_req_run() helper so canonical success and error cases
    are handled in one place.
    
    The dispatcher now routes FFA_RUN through ffa_handle_run(), and direct
    requests bail out early if a guest targets itself or a non-secure
    endpoint. This simplifies the direct path while adding support for
    INTERRUPT or YIELD answers from secure world.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |   9 ++--
 xen/arch/arm/tee/ffa_msg.c     | 111 +++++++++++++++++++++++++++++------------
 xen/arch/arm/tee/ffa_private.h |   1 +
 3 files changed, 87 insertions(+), 34 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2c09d10ae6..0f07efe5a7 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -24,9 +24,6 @@
  * o FFA_MEM_DONATE_* and FFA_MEM_LEND_* - Used when tranferring ownership
  *   or access of a memory region
  * o FFA_MSG_SEND2 and FFA_MSG_WAIT - Used for indirect messaging
- * o FFA_MSG_YIELD
- * o FFA_INTERRUPT - Used to report preemption
- * o FFA_RUN
  *
  * Limitations in the implemented FF-A interfaces:
  * o FFA_RXTX_MAP_*:
@@ -266,6 +263,9 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
     case FFA_MSG_SEND2:
+    case FFA_RUN:
+    case FFA_INTERRUPT:
+    case FFA_MSG_YIELD:
         ffa_set_regs_success(regs, 0, 0);
         break;
     case FFA_MEM_SHARE_64:
@@ -353,6 +353,9 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         ffa_handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_RUN:
+        ffa_handle_run(regs, fid);
+        return true;
     case FFA_MSG_SEND2:
         e = ffa_handle_msg_send2(regs);
         break;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index d60eed6d88..5a4cb1bb82 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -21,42 +21,74 @@ struct ffa_part_msg_rxtx {
     uint32_t msg_size;
 };
 
-void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
+                                      struct arm_smccc_1_2_regs *req)
 {
-    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
     struct arm_smccc_1_2_regs resp = { };
-    struct domain *d = current->domain;
-    uint32_t src_dst;
     uint64_t mask;
 
-    if ( smccc_is_conv_64(fid) )
+    arm_smccc_1_2_smc(req, &resp);
+
+    switch ( resp.a0 )
+    {
+    case FFA_ERROR:
+    case FFA_SUCCESS_32:
+    case FFA_SUCCESS_64:
+    case FFA_MSG_SEND_DIRECT_RESP_32:
+    case FFA_MSG_SEND_DIRECT_RESP_64:
+    case FFA_MSG_YIELD:
+    case FFA_INTERRUPT:
+        break;
+    default:
+        /* Bad fid, report back to the caller. */
+        ffa_set_regs_error(regs, FFA_RET_ABORTED);
+        return;
+    }
+
+    if ( smccc_is_conv_64(resp.a0) )
         mask = GENMASK_ULL(63, 0);
     else
         mask = GENMASK_ULL(31, 0);
 
+    ffa_set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
+                 resp.a4 & mask, resp.a5 & mask, resp.a6 & mask,
+                 resp.a7 & mask);
+}
+
+void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    struct domain *d = current->domain;
+    uint32_t src_dst;
+    uint64_t mask;
+    int32_t ret;
+
     if ( !ffa_fw_supports_fid(fid) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_NOT_SUPPORTED;
+        ret = FFA_RET_NOT_SUPPORTED;
         goto out;
     }
 
     src_dst = get_user_reg(regs, 1);
-    if ( (src_dst >> 16) != ffa_get_vm_id(d) )
+    if ( (src_dst >> 16) != ffa_get_vm_id(d) ||
+         (src_dst & GENMASK(15,0)) == ffa_get_vm_id(d) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_INVALID_PARAMETERS;
+        ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
     }
 
     /* we do not support direct messages to VMs */
     if ( !FFA_ID_IS_SECURE(src_dst & GENMASK(15,0)) )
     {
-        resp.a0 = FFA_ERROR;
-        resp.a2 = FFA_RET_NOT_SUPPORTED;
+        ret = FFA_RET_NOT_SUPPORTED;
         goto out;
     }
 
+    if ( smccc_is_conv_64(fid) )
+        mask = GENMASK_ULL(63, 0);
+    else
+        mask = GENMASK_ULL(31, 0);
+
     arg.a1 = src_dst;
     arg.a2 = get_user_reg(regs, 2) & mask;
     arg.a3 = get_user_reg(regs, 3) & mask;
@@ -65,27 +97,11 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     arg.a6 = get_user_reg(regs, 6) & mask;
     arg.a7 = get_user_reg(regs, 7) & mask;
 
-    arm_smccc_1_2_smc(&arg, &resp);
-    switch ( resp.a0 )
-    {
-    case FFA_ERROR:
-    case FFA_SUCCESS_32:
-    case FFA_SUCCESS_64:
-    case FFA_MSG_SEND_DIRECT_RESP_32:
-    case FFA_MSG_SEND_DIRECT_RESP_64:
-        break;
-    default:
-        /* Bad fid, report back to the caller. */
-        memset(&resp, 0, sizeof(resp));
-        resp.a0 = FFA_ERROR;
-        resp.a1 = src_dst;
-        resp.a2 = FFA_RET_ABORTED;
-    }
+    ffa_finish_direct_req_run(regs, &arg);
+    return;
 
 out:
-    ffa_set_regs(regs, resp.a0, resp.a1 & mask, resp.a2 & mask, resp.a3 & mask,
-                 resp.a4 & mask, resp.a5 & mask, resp.a6 & mask,
-                 resp.a7 & mask);
+    ffa_set_regs_error(regs, ret);
 }
 
 static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
@@ -217,3 +233,36 @@ out:
     ffa_tx_release(src_ctx);
     return ret;
 }
+
+void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
+{
+    struct arm_smccc_1_2_regs arg = { .a0 = fid, };
+    uint32_t dst = get_user_reg(regs, 1);
+    int32_t ret;
+
+    if ( !ffa_fw_supports_fid(fid) )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
+
+    /*
+     * We do not support FFA_RUN to VMs.
+     * Destination endpoint ID is in bits [31:16], bits[15:0] contain the
+     * vCPU ID.
+     */
+    if ( !FFA_ID_IS_SECURE(dst >> 16) )
+    {
+        ret = FFA_RET_NOT_SUPPORTED;
+        goto out;
+    }
+
+    arg.a1 = dst;
+
+    ffa_finish_direct_req_run(regs, &arg);
+
+    return;
+
+out:
+    ffa_set_regs_error(regs, ret);
+}
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index fb5212bd28..1fbd3fc3a6 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -475,6 +475,7 @@ static inline void ffa_raise_rx_buffer_full(struct domain *d)
 
 void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid);
 int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs);
+void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid);
 
 #ifdef CONFIG_FFA_VM_TO_VM
 static inline uint16_t get_ffa_vm_count(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219087.1528020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2V8-0001Kw-PK; Mon, 02 Feb 2026 22:34:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219087.1528020; Mon, 02 Feb 2026 22: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 1vn2V8-0001Ko-Mc; Mon, 02 Feb 2026 22:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1219087;
 Mon, 02 Feb 2026 22: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 1vn2V7-0001Kg-2R
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2V7-00HAJY-1E
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2V6-00ETIF-3D
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34: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=0vwTH+HTv+BoEsVE0iD2D3qCE3HElt4i/o8D1q6p4O8=; b=6PH9x6RD2jMfuMnINghLEtzbfn
	Ret2/PNQBGv0vPO6a9L3DQsBBsBf1iO1Bq3KSIMpI1XF7mdR2xxtP8jmIRu/zEMY6RRoA5s4SdQyS
	qzb5Nlz7JCrmGnLgO+DSmVSxo2UVnlZUiddI4uRsGMqigYXTVUGF2Nu9/ax8dv+3xF7E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: add v1.2 SEND2 header layout
Message-Id: <E1vn2V6-00ETIF-3D@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:32 +0000

commit e040b94d0ffff24b0cd9b527be2be4e47901f49f
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:27 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add v1.2 SEND2 header layout
    
    Teach the SEND2 path about the distinct FF-A v1.1 and v1.2 RX/TX header
    layouts so we can propagate the 128-bit UUIDs introduced in v1.2.
    
    VM-to-VM SEND2 calls now build the larger v1.2 header, zeroing the UUID
    fields for v1.1 senders, and the dispatcher validates messages using
    the v1.1 header layout to keep legacy guests working.
    
    While there, make the code more robust by checking that the send is not
    trying to send a message to himself.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_msg.c | 58 +++++++++++++++++++++++++++++++++++++---------
 1 file changed, 47 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 5a4cb1bb82..c3552a3ae3 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -13,7 +13,7 @@
 #include "ffa_private.h"
 
 /* Encoding of partition message in RX/TX buffer */
-struct ffa_part_msg_rxtx {
+struct ffa_part_msg_rxtx_1_1 {
     uint32_t flags;
     uint32_t reserved;
     uint32_t msg_offset;
@@ -21,6 +21,16 @@ struct ffa_part_msg_rxtx {
     uint32_t msg_size;
 };
 
+struct ffa_part_msg_rxtx_1_2 {
+    uint32_t flags;
+    uint32_t reserved;
+    uint32_t msg_offset;
+    uint32_t send_recv_id;
+    uint32_t msg_size;
+    uint32_t reserved2;
+    uint64_t uuid[2];
+};
+
 static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
                                       struct arm_smccc_1_2_regs *req)
 {
@@ -105,11 +115,11 @@ out:
 }
 
 static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
-                                struct ffa_part_msg_rxtx *src_msg)
+                                struct ffa_part_msg_rxtx_1_2 *src_msg)
 {
     struct domain *dst_d;
     struct ffa_ctx *dst_ctx;
-    struct ffa_part_msg_rxtx *dst_msg;
+    struct ffa_part_msg_rxtx_1_2 *dst_msg;
     void *rx_buf;
     size_t rx_size;
     int err;
@@ -143,7 +153,7 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
         goto out_unlock;
 
     /* we need to have enough space in the destination buffer */
-    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx)) < src_msg->msg_size )
+    if ( (rx_size - sizeof(struct ffa_part_msg_rxtx_1_2)) < src_msg->msg_size )
     {
         ret = FFA_RET_NO_MEMORY;
         ffa_rx_release(dst_ctx);
@@ -155,11 +165,14 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* prepare destination header */
     dst_msg->flags = 0;
     dst_msg->reserved = 0;
-    dst_msg->msg_offset = sizeof(struct ffa_part_msg_rxtx);
+    dst_msg->msg_offset = sizeof(struct ffa_part_msg_rxtx_1_2);
     dst_msg->send_recv_id = src_msg->send_recv_id;
     dst_msg->msg_size = src_msg->msg_size;
+    dst_msg->reserved2 = 0;
+    dst_msg->uuid[0] = src_msg->uuid[0];
+    dst_msg->uuid[1] = src_msg->uuid[1];
 
-    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx),
+    memcpy(rx_buf + sizeof(struct ffa_part_msg_rxtx_1_2),
            src_buf + src_msg->msg_offset, src_msg->msg_size);
 
     /* receiver rx buffer will be released by the receiver*/
@@ -178,11 +191,17 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     struct ffa_ctx *src_ctx = src_d->arch.tee;
     const void *tx_buf;
     size_t tx_size;
-    struct ffa_part_msg_rxtx src_msg;
+    /*
+     * src_msg is interpreted as v1.2 header, but:
+     * - for v1.1 guests, uuid[] is ignored and may contain payload bytes
+     * - for v1.2 guests, uuid[] carries the FF-A v1.2 UUID fields
+     */
+    struct ffa_part_msg_rxtx_1_2 src_msg;
     uint16_t dst_id, src_id;
     int32_t ret;
 
-    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx) >= FFA_PAGE_SIZE);
+    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx_1_1) >= FFA_PAGE_SIZE);
+    BUILD_BUG_ON(sizeof(struct ffa_part_msg_rxtx_1_2) >= FFA_PAGE_SIZE);
 
     ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
     if ( ret != FFA_RET_OK )
@@ -194,15 +213,32 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     src_id = src_msg.send_recv_id >> 16;
     dst_id = src_msg.send_recv_id & GENMASK(15,0);
 
-    if ( src_id != ffa_get_vm_id(src_d) )
+    if ( src_id != ffa_get_vm_id(src_d) ||
+         dst_id == ffa_get_vm_id(src_d) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out;
+    }
+
+    if ( ACCESS_ONCE(src_ctx->guest_vers) < FFA_VERSION_1_2 )
+    {
+        if (src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_1))
+        {
+            ret = FFA_RET_INVALID_PARAMETERS;
+            goto out;
+        }
+        /* Set uuid to Nil UUID for v1.1 guests */
+        src_msg.uuid[0] = 0;
+        src_msg.uuid[1] = 0;
+    }
+    else if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_2) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
         goto out;
     }
 
     /* check source message fits in buffer */
-    if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx) ||
-            src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
+    if ( src_msg.msg_size == 0 || src_msg.msg_offset > tx_size ||
             src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219088.1528024 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2VI-0001NB-Qg; Mon, 02 Feb 2026 22:34:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219088.1528024; Mon, 02 Feb 2026 22: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 1vn2VI-0001N3-O0; Mon, 02 Feb 2026 22:34:44 +0000
Received: by outflank-mailman (input) for mailman id 1219088;
 Mon, 02 Feb 2026 22: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 1vn2VH-0001Mv-4v
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2VH-00HAJs-1U
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2VH-00ETJP-0J
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=4WXNaR2G3LFvLzp7l8jWnedrmQxahK3g+oO3tvyTJCM=; b=2SEt4WD0ZtgdNPioF1OEo/zYvU
	/RqPPMbk5iPCCyfUiyOKvBIVvj7Dl9xcUY5/K3NoLUdB0uKU9VYLHOwm0LfP+Cqceqh26rq/HBSHb
	YS8YzWjrdRKlvwIJtL988V+x8xKyJZwi91uGL4Zz9NGQfZYE87EDH2ZzPb+Tc1hPEJHs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: add MSG_SEND_DIRECT_REQ2 support
Message-Id: <E1vn2VH-00ETJP-0J@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:43 +0000

commit 3ca6aca20d359d27486c527a865dfdcd11bab3f5
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:28 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: add MSG_SEND_DIRECT_REQ2 support
    
    Extend the direct-request path so FF-A v1.2 guests can issue
    FFA_MSG_SEND_DIRECT_REQ2 and receive the matching RESP2.
    
    The handler now marshals registers x8–x17, and
    ffa_finish_direct_req_run() copies back the 17-register response used by
    FFA_MSG_SEND_DIRECT_RESP2. The new opcode is exposed via FFA_FEATURES
    and gated on guests that negotiated v1.2.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c     | 20 ++++++++++++++++++++
 xen/arch/arm/tee/ffa_msg.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 0f07efe5a7..2c6443a7f6 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -237,6 +237,8 @@ out_continue:
 static void handle_features(struct cpu_user_regs *regs)
 {
     uint32_t a1 = get_user_reg(regs, 1);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
     unsigned int n;
 
     for ( n = 2; n <= 7; n++ )
@@ -268,6 +270,16 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_MSG_YIELD:
         ffa_set_regs_success(regs, 0, 0);
         break;
+    case FFA_MSG_SEND_DIRECT_REQ2:
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        {
+            ffa_set_regs_success(regs, 0, 0);
+        }
+        else
+        {
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        }
+        break;
     case FFA_MEM_SHARE_64:
     case FFA_MEM_SHARE_32:
         /*
@@ -353,6 +365,14 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     case FFA_MSG_SEND_DIRECT_REQ_64:
         ffa_handle_msg_send_direct_req(regs, fid);
         return true;
+    case FFA_MSG_SEND_DIRECT_REQ2:
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        {
+            ffa_handle_msg_send_direct_req(regs, fid);
+            return true;
+        }
+        e = FFA_RET_NOT_SUPPORTED;
+        break;
     case FFA_RUN:
         ffa_handle_run(regs, fid);
         return true;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index c3552a3ae3..4e26596461 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -49,6 +49,30 @@ static void ffa_finish_direct_req_run(struct cpu_user_regs *regs,
     case FFA_MSG_YIELD:
     case FFA_INTERRUPT:
         break;
+    case FFA_MSG_SEND_DIRECT_RESP2:
+        /*
+         * REQ2 / RESP2 use a 17-register payload (x1–x17). Copy all of them
+         * back to the guest context.
+         */
+        set_user_reg(regs, 0, resp.a0);
+        set_user_reg(regs, 1, resp.a1);
+        set_user_reg(regs, 2, resp.a2);
+        set_user_reg(regs, 3, resp.a3);
+        set_user_reg(regs, 4, resp.a4);
+        set_user_reg(regs, 5, resp.a5);
+        set_user_reg(regs, 6, resp.a6);
+        set_user_reg(regs, 7, resp.a7);
+        set_user_reg(regs, 8, resp.a8);
+        set_user_reg(regs, 9, resp.a9);
+        set_user_reg(regs, 10, resp.a10);
+        set_user_reg(regs, 11, resp.a11);
+        set_user_reg(regs, 12, resp.a12);
+        set_user_reg(regs, 13, resp.a13);
+        set_user_reg(regs, 14, resp.a14);
+        set_user_reg(regs, 15, resp.a15);
+        set_user_reg(regs, 16, resp.a16);
+        set_user_reg(regs, 17, resp.a17);
+        return;
     default:
         /* Bad fid, report back to the caller. */
         ffa_set_regs_error(regs, FFA_RET_ABORTED);
@@ -107,6 +131,21 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     arg.a6 = get_user_reg(regs, 6) & mask;
     arg.a7 = get_user_reg(regs, 7) & mask;
 
+    if ( fid == FFA_MSG_SEND_DIRECT_REQ2 )
+    {
+        /* 17 registers are used for REQ2 */
+        arg.a8 = get_user_reg(regs, 8);
+        arg.a9 = get_user_reg(regs, 9);
+        arg.a10 = get_user_reg(regs, 10);
+        arg.a11 = get_user_reg(regs, 11);
+        arg.a12 = get_user_reg(regs, 12);
+        arg.a13 = get_user_reg(regs, 13);
+        arg.a14 = get_user_reg(regs, 14);
+        arg.a15 = get_user_reg(regs, 15);
+        arg.a16 = get_user_reg(regs, 16);
+        arg.a17 = get_user_reg(regs, 17);
+    }
+
     ffa_finish_direct_req_run(regs, &arg);
     return;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 02 22:34:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 02 Feb 2026 22:34:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219089.1528029 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vn2VS-0001PM-SF; Mon, 02 Feb 2026 22:34:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219089.1528029; Mon, 02 Feb 2026 22: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 1vn2VS-0001PE-PO; Mon, 02 Feb 2026 22:34:54 +0000
Received: by outflank-mailman (input) for mailman id 1219089;
 Mon, 02 Feb 2026 22: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 1vn2VR-0001P4-7g
 for xen-changelog@lists.xenproject.org; Mon, 02 Feb 2026 22: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 1vn2VR-00HAJw-1k
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22:34:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vn2VR-00ETJx-0Z
 for xen-changelog@lists.xenproject.org;
 Mon, 02 Feb 2026 22: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=jIF9WqDkvboLOY+ljYLm8FGo8/kKrEydibAmt4rXUGY=; b=HopLwvvccSUT22ZvWuSgoNbC/m
	DgBf5+iQ92ZWXHi9lFgkD/qKH0fc9ZhztAA5Yvw4Djtfg7ZZDNAt4ROrOMuAgxK4pq36pcwkHY0gm
	FSLp83WBhCI18QIFapIdpnQ5dnqWKblQNN5elrIZe32R8f29GSGvbR4LecL6RHux3ZOs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: advertise FF-A v1.2
Message-Id: <E1vn2VR-00ETJx-0Z@xenbits.xenproject.org>
Date: Mon, 02 Feb 2026 22:34:53 +0000

commit f42bacb20e7acefd4cdb63abc2b6eccd99ae9307
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Dec 15 15:49:29 2025 +0100
Commit:     Julien Grall <julien@xen.org>
CommitDate: Mon Feb 2 21:19:17 2026 +0000

    xen/arm: ffa: advertise FF-A v1.2
    
    Expose the RX/TX MAP capacity field only once a guest has
    negotiated FF-A v1.2.
    
    While there, drop the stale <asm/tee/ffa.h> include.
    
    To comply with the wider v1.2 register ABI, zero registers x8–x17 when
    responding to a v1.2 VM. The dispatcher also rejects SMCCC64 calls from
    AArch32 guests.
    
    Finally, bump Xen's FF-A version to 1.2.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 19 +++++++++++++++++--
 xen/arch/arm/tee/ffa_private.h | 29 ++++++++++++++++++++---------
 2 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 2c6443a7f6..ed18e76080 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -65,7 +65,6 @@
 #include <asm/event.h>
 #include <asm/regs.h>
 #include <asm/smccc.h>
-#include <asm/tee/ffa.h>
 #include <asm/tee/tee.h>
 
 #include "ffa_private.h"
@@ -296,7 +295,16 @@ static void handle_features(struct cpu_user_regs *regs)
          * differs from FFA_PAGE_SIZE (SZ_4K).
          */
         BUILD_BUG_ON(PAGE_SIZE != FFA_PAGE_SIZE);
-        ffa_set_regs_success(regs, 0, 0);
+
+        /*
+         * From FFA v1.2, we can give the maximum number of pages we support
+         * for the RX/TX buffers.
+         */
+        if ( ACCESS_ONCE(ctx->guest_vers) < FFA_VERSION_1_2 )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_success(regs, FFA_MAX_RXTX_PAGE_COUNT << 16, 0);
+
         break;
     case FFA_FEATURE_NOTIF_PEND_INTR:
         ffa_set_regs_success(regs, GUEST_FFA_NOTIF_PEND_INTR_ID, 0);
@@ -329,6 +337,13 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     if ( !ctx )
         return false;
 
+    if ( !is_64bit_domain(d) && smccc_is_conv_64(fid) )
+    {
+        /* 32bit guests should only use 32bit convention calls */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        return true;
+    }
+
     /* A version must be negotiated first */
     if ( !ACCESS_ONCE(ctx->guest_vers) )
     {
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 1fbd3fc3a6..282c105f3b 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -53,7 +53,7 @@
  * that particular guest or SP.
  */
 #define FFA_MY_VERSION_MAJOR    1U
-#define FFA_MY_VERSION_MINOR    1U
+#define FFA_MY_VERSION_MINOR    2U
 #define FFA_MY_VERSION          MAKE_FFA_VERSION(FFA_MY_VERSION_MAJOR, \
                                                  FFA_MY_VERSION_MINOR)
 
@@ -519,14 +519,25 @@ static inline void ffa_set_regs(struct cpu_user_regs *regs, register_t v0,
                                 register_t v4, register_t v5, register_t v6,
                                 register_t v7)
 {
-        set_user_reg(regs, 0, v0);
-        set_user_reg(regs, 1, v1);
-        set_user_reg(regs, 2, v2);
-        set_user_reg(regs, 3, v3);
-        set_user_reg(regs, 4, v4);
-        set_user_reg(regs, 5, v5);
-        set_user_reg(regs, 6, v6);
-        set_user_reg(regs, 7, v7);
+    struct domain *d = current->domain;
+    struct ffa_ctx *ctx = d->arch.tee;
+    int i;
+
+    set_user_reg(regs, 0, v0);
+    set_user_reg(regs, 1, v1);
+    set_user_reg(regs, 2, v2);
+    set_user_reg(regs, 3, v3);
+    set_user_reg(regs, 4, v4);
+    set_user_reg(regs, 5, v5);
+    set_user_reg(regs, 6, v6);
+    set_user_reg(regs, 7, v7);
+
+    if ( ctx && ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 &&
+         is_64bit_domain(d) )
+    {
+        for (i = 8; i <= 17; i++)
+            set_user_reg(regs, i, 0);
+    }
 }
 
 static inline void ffa_set_regs_error(struct cpu_user_regs *regs,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 16:22:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 16:22:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219363.1528232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnJAB-00088A-Jw; Tue, 03 Feb 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 1219363.1528232; Tue, 03 Feb 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 1vnJAB-000881-HD; Tue, 03 Feb 2026 16:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1219363;
 Tue, 03 Feb 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 1vnJAA-00087v-Hy
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 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 1vnJAA-0012M2-2l
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnJAA-00FV36-1X
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 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=adVpDx8B3ApnM+nIix7xyk/lvcgpaEVwRi/fTPkZzuI=; b=cjjjk6v1Dl/6lpIO56GUukKQax
	x8IKTHgfMy78wQXOAwjuV9ncYj3r+ntqOJtCh+SIo1PbOewXH9oIX6rkAbg16eH7zhDK8YBzLuTZC
	tWcMo5OJhh6/skW7XtDspvHyQy3a79Y6mLHF657QR1AAN1HNCU6X7g2f2TiVqoOeKVZY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MSI: adjust permitted vector range
Message-Id: <E1vnJAA-00FV36-1X@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 16:22:02 +0000

commit 1b53f3644a27fca2fe15b431b5cdcaa465edf6bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:09:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:09:34 2026 +0100

    x86/MSI: adjust permitted vector range
    
    It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
    there is a form of open-coding in use right now.
    
    No change in practice, due to the present aliasing.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 57ad5002c5..3fe22b3b6d 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
 {
     memset(msg, 0, sizeof(*msg));
 
-    if ( vector < FIRST_DYNAMIC_VECTOR )
+    if ( vector < FIRST_IRQ_VECTOR )
         return;
 
     if ( cpu_mask )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 16:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 16:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219364.1528236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnJAM-0008AJ-LF; Tue, 03 Feb 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 1219364.1528236; Tue, 03 Feb 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 1vnJAM-0008AB-Ia; Tue, 03 Feb 2026 16:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1219364;
 Tue, 03 Feb 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 1vnJAK-00089t-Ky
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 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 1vnJAK-0012MA-35
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnJAK-00FV40-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 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=Tpj8RvbreeN9qdqj3FRoEfGaExTv1FGzWeiV2SfjPHc=; b=vCIVCPSgmQPRvOV0xk+zdFVIy+
	1HYSmbZLI9FTNG+8QfxzZA5a0u4fCyaOWjPYaXgOqnk3Yhxz8DwM30NYqLTOsvIAVNgFGhvEjmD0g
	vjDkw/j2NZCBl5/X3vS2h/4hSkVQCaSEQCdXkpSmOfnPmX4I0duIoaxRvxQis/IYBRh8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/mm: split struct sh_dirty_vram and make results private
Message-Id: <E1vnJAK-00FV40-1t@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 16:22:12 +0000

commit 17492a08011411bf198b7a6a39afab8ec02ace34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:10:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:10:33 2026 +0100

    x86/mm: split struct sh_dirty_vram and make results private
    
    The types are local to the shadow and HAP subsystems respectively, and
    HAP has no need for the shadow-specific fields (i.e. it can get away with
    smaller allocations). In struct hvm_domain it therefore suffices to have
    a union of two (generally opaque) pointers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/hvm/domain.h |  5 ++++-
 xen/arch/x86/include/asm/paging.h     | 13 -------------
 xen/arch/x86/mm/hap/hap.c             | 19 ++++++++++++-------
 xen/arch/x86/mm/shadow/common.c       |  8 ++++----
 xen/arch/x86/mm/shadow/hvm.c          | 16 ++++++++--------
 xen/arch/x86/mm/shadow/multi.c        |  2 +-
 xen/arch/x86/mm/shadow/private.h      | 10 +++++++++-
 7 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index be1a0d8c5b..abf9bc448d 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -95,7 +95,10 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support.  Protect with the domain paging lock. */
-    struct sh_dirty_vram *dirty_vram;
+    union {
+        struct sh_dirty_vram *sh;
+        struct hap_dirty_vram *hap;
+    } dirty_vram;
 
     bool                   is_s3_suspended;
 
diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 9668deed4c..291ab386e8 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -135,19 +135,6 @@ struct paging_mode {
     (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \
                   PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1)
 
-#ifdef CONFIG_HVM
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-#ifdef CONFIG_SHADOW_PAGING
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-#endif
-};
-#endif
-
 #if PG_log_dirty
 
 /* log dirty initialization */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 2f69ff9c7b..a337752bf4 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -36,6 +36,11 @@
 /*          HAP VRAM TRACKING SUPPORT           */
 /************************************************/
 
+struct hap_dirty_vram {
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+};
+
 /*
  * hap_track_dirty_vram()
  * Create the domain's dv_dirty_vram struct on demand.
@@ -52,7 +57,7 @@ int hap_track_dirty_vram(struct domain *d,
                          XEN_GUEST_HANDLE(void) guest_dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram;
+    struct hap_dirty_vram *dirty_vram;
     uint8_t *dirty_bitmap = NULL;
 
     if ( nr_frames )
@@ -66,17 +71,17 @@ int hap_track_dirty_vram(struct domain *d,
 
         paging_lock(d);
 
-        dirty_vram = d->arch.hvm.dirty_vram;
+        dirty_vram = d->arch.hvm.dirty_vram.hap;
         if ( !dirty_vram )
         {
             rc = -ENOMEM;
-            if ( (dirty_vram = xzalloc(struct sh_dirty_vram)) == NULL )
+            if ( (dirty_vram = xzalloc(struct hap_dirty_vram)) == NULL )
             {
                 paging_unlock(d);
                 goto out;
             }
 
-            d->arch.hvm.dirty_vram = dirty_vram;
+            d->arch.hvm.dirty_vram.hap = dirty_vram;
         }
 
         if ( begin_pfn != dirty_vram->begin_pfn ||
@@ -132,7 +137,7 @@ int hap_track_dirty_vram(struct domain *d,
     {
         paging_lock(d);
 
-        dirty_vram = d->arch.hvm.dirty_vram;
+        dirty_vram = d->arch.hvm.dirty_vram.hap;
         if ( dirty_vram )
         {
             /*
@@ -142,7 +147,7 @@ int hap_track_dirty_vram(struct domain *d,
             begin_pfn = dirty_vram->begin_pfn;
             nr_frames = dirty_vram->end_pfn - dirty_vram->begin_pfn;
             xfree(dirty_vram);
-            d->arch.hvm.dirty_vram = NULL;
+            d->arch.hvm.dirty_vram.hap = NULL;
         }
 
         paging_unlock(d);
@@ -630,7 +635,7 @@ void hap_teardown(struct domain *d, bool *preempted)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    XFREE(d->arch.hvm.dirty_vram);
+    XFREE(d->arch.hvm.dirty_vram.hap);
 
 out:
     paging_unlock(d);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index d92ca84362..96986ee255 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2316,11 +2316,11 @@ void shadow_teardown(struct domain *d, bool *preempted)
     d->arch.paging.mode &= ~PG_log_dirty;
 
 #ifdef CONFIG_HVM
-    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram )
+    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram.sh )
     {
-        xfree(d->arch.hvm.dirty_vram->sl1ma);
-        xfree(d->arch.hvm.dirty_vram->dirty_bitmap);
-        XFREE(d->arch.hvm.dirty_vram);
+        xfree(d->arch.hvm.dirty_vram.sh->sl1ma);
+        xfree(d->arch.hvm.dirty_vram.sh->dirty_bitmap);
+        XFREE(d->arch.hvm.dirty_vram.sh);
     }
 #endif
 
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index d857b1d9d6..bfc81b680a 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1036,7 +1036,7 @@ int shadow_track_dirty_vram(struct domain *d,
     p2m_lock(p2m_get_hostp2m(d));
     paging_lock(d);
 
-    dirty_vram = d->arch.hvm.dirty_vram;
+    dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     if ( dirty_vram && (!nr_frames ||
              ( begin_pfn != dirty_vram->begin_pfn
@@ -1046,8 +1046,8 @@ int shadow_track_dirty_vram(struct domain *d,
         gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
         xfree(dirty_vram->sl1ma);
         xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm.dirty_vram = NULL;
+        d->arch.hvm.dirty_vram.sh = NULL;
+        XFREE(dirty_vram);
     }
 
     if ( !nr_frames )
@@ -1078,7 +1078,7 @@ int shadow_track_dirty_vram(struct domain *d,
             goto out;
         dirty_vram->begin_pfn = begin_pfn;
         dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm.dirty_vram = dirty_vram;
+        d->arch.hvm.dirty_vram.sh = dirty_vram;
 
         if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr_frames)) == NULL )
             goto out_dirty_vram;
@@ -1205,8 +1205,8 @@ int shadow_track_dirty_vram(struct domain *d,
  out_sl1ma:
     xfree(dirty_vram->sl1ma);
  out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm.dirty_vram = NULL;
+    d->arch.hvm.dirty_vram.sh = NULL;
+    XFREE(dirty_vram);
 
  out:
     paging_unlock(d);
@@ -1229,7 +1229,7 @@ void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
                          const struct domain *d)
 {
     unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     ASSERT(is_hvm_domain(d));
 
@@ -1259,7 +1259,7 @@ void shadow_vram_put_mfn(mfn_t mfn, unsigned int l1f,
                          const struct domain *d)
 {
     unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     ASSERT(is_hvm_domain(d));
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 72f0c6fcbc..3bbaceec12 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -608,7 +608,7 @@ _sh_propagate(struct vcpu *v,
 #ifdef CONFIG_HVM
     if ( unlikely(level == 1) && is_hvm_domain(d) )
     {
-        struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+        struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
         if ( dirty_vram && dirty_vram->last_dirty == -1 &&
              gfn_x(target_gfn) >= dirty_vram->begin_pfn &&
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index e1d940bf6a..6420ec4645 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -416,7 +416,15 @@ mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels);
 void sh_destroy_monitor_table(const struct vcpu *v, mfn_t mmfn,
                               unsigned int shadow_levels);
 
-/* VRAM dirty tracking helpers. */
+/* VRAM dirty tracking support */
+struct sh_dirty_vram {
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    paddr_t *sl1ma;
+    uint8_t *dirty_bitmap;
+    s_time_t last_dirty;
+};
+
 void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
                          mfn_t sl1mfn, const void *sl1e,
                          const struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 16:22:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 16:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219365.1528240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnJAW-0008Cc-Mf; Tue, 03 Feb 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 1219365.1528240; Tue, 03 Feb 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 1vnJAW-0008CV-K2; Tue, 03 Feb 2026 16:22:24 +0000
Received: by outflank-mailman (input) for mailman id 1219365;
 Tue, 03 Feb 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 1vnJAU-0008CG-OR
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 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 1vnJAV-0012ME-0C
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnJAU-00FV4U-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 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=z1j2cnl+ngzFmm3wEv1YTacP+0zmF5WkcAdHjTT5e8s=; b=7NhUvn6f5LHNuh9e4qRCD/SiP0
	raAJj9zx1ELU65EepsscDLAAnKXqUhpH7tKXVOgm3mFGk4pc3ZWXg7mYQT4RVCXbBK/XcOgJrjKzm
	R2u1u/xDsUIYsqACNQOPid8Bt/ZQaZ0quALs3xOwuWRTlB5PcR5A1bFUsAi9QqKm4+nQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables
Message-Id: <E1vnJAU-00FV4U-2B@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 16:22:22 +0000

commit 67e055ee9c1a5a28d5fbc3c54bcab920bb9b7215
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:11:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:11:16 2026 +0100

    CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables
    
    cpumask_var_t can resolve to a pointer or to an array. While the pointer
    typically is allocated once for a CPU and then only read (i.e. wants to be
    marked read-mostly), the same isn't necessarily true for the array case.
    There things depend on how the variable is actually used. cpu_core_mask
    and cpu_sibling_mask (which all architectures have inherited from x86,
    which in turn is possibly wrong) are altered only as CPUs are brought up
    or down, so may remain uniformly read-mostly. Other (x86-only) instances
    want to change, to avoid disturbing adjacent read-mostly data.
    
    While doing the x86 adjustment, also do one in the opposite direction,
    i.e. where there was no read-mostly annotation when it is applicable in
    the "pointer" case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/genapic/x2apic.c | 2 +-
 xen/arch/x86/smpboot.c        | 6 +++---
 xen/include/xen/cpumask.h     | 6 ++++++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 89d66bc627..5f2765cf14 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -20,7 +20,7 @@
 static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
 static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
 static cpumask_t *cluster_cpus_spare;
-static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
+static DEFINE_PER_CPU_CPUMASK_VAR(scratch_mask);
 
 static inline u32 x2apic_cluster(unsigned int cpu)
 {
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 69cc9bbc6e..961bdf5333 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -52,13 +52,13 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_mask);
 /* representing HT and core siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask);
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, scratch_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(scratch_cpumask);
 static cpumask_t scratch_cpu0mask;
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, hpet_scratch_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(hpet_scratch_cpumask);
 static cpumask_t hpet_scratch_cpu0mask;
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, send_ipi_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(send_ipi_cpumask);
 static cpumask_t send_ipi_cpu0mask;
 
 DEFINE_PER_CPU_READ_MOSTLY(struct stubs, stubs);
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index b713bb69a9..f3a53d90e0 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -311,6 +311,9 @@ extern const cpumask_t cpumask_all;
 
 typedef cpumask_t *cpumask_var_t;
 
+#define DEFINE_PER_CPU_CPUMASK_VAR(sym) \
+	DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, sym)
+
 static inline bool alloc_cpumask_var(cpumask_var_t *mask)
 {
 	*mask = _xmalloc(nr_cpumask_bits / 8, sizeof(long));
@@ -349,6 +352,9 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #else
 typedef cpumask_t cpumask_var_t[1];
 
+#define DEFINE_PER_CPU_CPUMASK_VAR(sym) \
+	DEFINE_PER_CPU(cpumask_var_t, sym)
+
 static inline bool alloc_cpumask_var(cpumask_var_t *mask)
 {
 	return true;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 16:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 16:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219366.1528244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnJAg-0008Em-Ny; Tue, 03 Feb 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 1219366.1528244; Tue, 03 Feb 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 1vnJAg-0008Ee-LR; Tue, 03 Feb 2026 16:22:34 +0000
Received: by outflank-mailman (input) for mailman id 1219366;
 Tue, 03 Feb 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 1vnJAe-0008EQ-TS
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 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 1vnJAf-0012MM-0U
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnJAe-00FV7L-2V
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 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=fn1o3AJo/MsfltHJ1hEAgGE7yo+aZxlM0n0lox5Oh3k=; b=fBqdqFQltKOHOLJpeSoHiKDXg5
	4hzPWL+mVUYjNdWOmlUdWJOi8705Gm2gwWWTf6U9rVFywtSLcs0xb9HetfFWnUJHlylOfQTLujKqZ
	sfsZlcZYoiQRegm6+3oq8zMilqEj3HS65oDHbO3nYJgQUWWLlqQoveY1CAWTnoN0uH7w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: calculate number of synthetic feature and bug enumerators
Message-Id: <E1vnJAe-00FV7L-2V@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 16:22:32 +0000

commit 191e2c7a02b0f6454ad9bf8876192b00df3adf6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:11:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:11:53 2026 +0100

    x86: calculate number of synthetic feature and bug enumerators
    
    Rather than spelling out their amounts (requiring updates when multiples
    of 32 are crossed), introduce a sentinel each and calculate the two
    numbers from those.
    
    No difference in generated code, albeit debug info size grows quite a bit.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/cpufeatures.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0d90924e3e..f7958110af 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,6 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -44,9 +43,11 @@ XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
 XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
+XEN_CPUFEATURE(nr,                X86_SYNTH(33)) /* Number of synthetic features */
+
+#define X86_NR_SYNTH DIV_ROUND_UP(X86_FEATURE_nr - FSCAPINTS * 32, 32)
 
 /* Bug words follow the synthetic words. */
-#define X86_NR_BUG 1
 #define X86_BUG(x) ((FSCAPINTS + X86_NR_SYNTH) * 32 + (x))
 
 #define X86_BUG_FPU_PTRS          X86_BUG( 0) /* (F)X{SAVE,RSTOR} doesn't save/restore FOP/FIP/FDP. */
@@ -64,5 +65,10 @@ XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy()
 #define X86_SPEC_BHB_LOOPS        X86_BUG(20) /* Use clear_bhb_loops for BHI mitigation.*/
 #define X86_SPEC_BHB_LOOPS_LONG   X86_BUG(21) /* Upgrade clear_bhb_loops to the "long" sequence. */
 
+#define X86_BUG_nr                X86_BUG(22) /* Number of bug identifiers */
+
+#define X86_NR_BUG DIV_ROUND_UP(X86_BUG_nr - (FSCAPINTS + X86_NR_SYNTH) * 32, \
+                                32)
+
 /* Total number of capability words, inc synth and bug words. */
 #define NCAPINTS (FSCAPINTS + X86_NR_SYNTH + X86_NR_BUG) /* N 32-bit words worth of info */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 16:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 16:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219367.1528248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnJAq-0008Gr-Pp; Tue, 03 Feb 2026 16:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219367.1528248; Tue, 03 Feb 2026 16: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 1vnJAq-0008Gj-Mp; Tue, 03 Feb 2026 16:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1219367;
 Tue, 03 Feb 2026 16: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 1vnJAo-0008GU-U5
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 16: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 1vnJAp-0012Ma-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnJAo-00FV7h-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 16: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=IAc7+RmxIMz+mzN+rQ/uUzc39FvmgAe2zz8sW4GKV7Y=; b=lI3zIKuAjIUzYQ8tpqav6FpAW+
	Qu3RtcRHgx4GDcNXDy6/uHyDgH5th8MjPG63RVCrfdfg3a/lY160jktCfLWlEsb6j7VxJKwLZsAfk
	z88dngCpFLdoqv5iInyBsXFgrvdhBQvWa7Z8CPPtGlnPyK6a2gkdOZxH0P1vahrv31qc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] PCI/regs: minimal adjustments for Misra rule 7.2
Message-Id: <E1vnJAo-00FV7h-2n@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 16:22:42 +0000

commit c97cbb7074636d5e5692930291abf05e12c5ef99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:12:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:12:17 2026 +0100

    PCI/regs: minimal adjustments for Misra rule 7.2
    
    As was recently noticed with PCI_X_STATUS_533MHZ, leaving presently unused
    #define-s in non-Misra-compliant shape (7.2 is "A `u' or `U' suffix shall
    be applied to all integer constants that are represented in an unsigned
    type") is putting new code actually using any of the constants at risk of
    then causing Misra scan failures in CI. Adjust those few constants which
    strictly require a suffix.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/pci_regs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index 8d6bbea3c9..395ab49fa6 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -272,7 +272,7 @@
 #define PCI_AGP_VERSION		2	/* BCD version number */
 #define PCI_AGP_RFU		3	/* Rest of capability flags */
 #define PCI_AGP_STATUS		4	/* Status register */
-#define  PCI_AGP_STATUS_RQ_MASK	0xff000000	/* Maximum number of requests - 1 */
+#define  PCI_AGP_STATUS_RQ_MASK	0xff000000U /* Maximum number of requests - 1 */
 #define  PCI_AGP_STATUS_SBA	0x0200	/* Sideband addressing supported */
 #define  PCI_AGP_STATUS_64BIT	0x0020	/* 64-bit addressing supported */
 #define  PCI_AGP_STATUS_FW	0x0010	/* FW transfers supported */
@@ -280,7 +280,7 @@
 #define  PCI_AGP_STATUS_RATE2	0x0002	/* 2x transfer rate supported */
 #define  PCI_AGP_STATUS_RATE1	0x0001	/* 1x transfer rate supported */
 #define PCI_AGP_COMMAND		8	/* Control register */
-#define  PCI_AGP_COMMAND_RQ_MASK 0xff000000  /* Master: Maximum number of requests */
+#define  PCI_AGP_COMMAND_RQ_MASK 0xff000000U /* Master: Maximum number of requests */
 #define  PCI_AGP_COMMAND_SBA	0x0200	/* Sideband addressing enabled */
 #define  PCI_AGP_COMMAND_AGP	0x0100	/* Allow processing of AGP transactions */
 #define  PCI_AGP_COMMAND_64BIT	0x0020 	/* Allow processing of 64-bit addresses */
@@ -582,7 +582,7 @@
 #define  HT_MSI_FLAGS_FIXED	0x2		/* Fixed mapping only */
 #define  HT_MSI_FIXED_ADDR	0x00000000FEE00000ULL	/* Fixed addr */
 #define  HT_MSI_ADDR_LO		0x04		/* Offset to low addr bits */
-#define  HT_MSI_ADDR_LO_MASK	0xFFF00000	/* Low address bit mask */
+#define  HT_MSI_ADDR_LO_MASK	0xFFF00000U	/* Low address bit mask */
 #define  HT_MSI_ADDR_HI		0x08		/* Offset to high addr bits */
 #define HT_CAPTYPE_DIRECT_ROUTE	0xB0	/* Direct routing configuration */
 #define HT_CAPTYPE_VCSET	0xB8	/* Virtual Channel configuration */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219676.1528532 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL2J-0005Bf-RH; Tue, 03 Feb 2026 18:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219676.1528532; Tue, 03 Feb 2026 18: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 1vnL2J-0005BX-OU; Tue, 03 Feb 2026 18:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1219676;
 Tue, 03 Feb 2026 18: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 1vnL2I-0005BR-FN
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL2I-0014wi-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL2I-00FiMv-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=ICSxIFKp9dLQSU56DOAWSUBmzspn3LyTVP48uO4JTG4=; b=R5Exh58PRx6TSKw28pPOcJzxNn
	GrALoC5dO6ur0dVIPt0g4Mx1xfOCOQQULArL5ZnkQNtME3E0p02zPqjskmjSidn1UU9pDKKhdWbhe
	YFrF10L4WsicYeIxRuficOXJTWr7YkQ8kwQZgQzka1ygIHhYIR+CBY4seITNYPdOwYQA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] symbols: re-number intermediate files
Message-Id: <E1vnL2I-00FiMv-1D@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:02 +0000

commit ee66c421661cd59291fff21f5b1422e5631065bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:35:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:35:01 2026 +0100

    symbols: re-number intermediate files
    
    symbols/x86: re-number intermediate files
    
    In preparation to do away with symbols-dummy, re-number the assembly and
    object files used, for the numbers to match the next passes real output.
    This is to make 0 available to use for what now is handled by
    symbols-dummy. (Mirror the numbering to the intermediate reloc files for
    xen.efi, just to avoid confusion.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    
    symbols/arm: re-number intermediate files
    
    In preparation to do away with symbols-dummy, re-number the assembly and
    object files used, for the numbers to match the next passes real output.
    This is to make 0 available to use for what now is handled by
    symbols-dummy.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 5c1c05b27bf28bb7670e2b7fe729d853fa8a4b05
    master date: 2025-11-26 12:09:32 +0100
    master commit: ba7974b5d2581fb1f5b439c49a5d5b301817591d
    master date: 2025-12-08 15:28:43 +0100
---
 xen/arch/arm/Makefile | 12 ++++++------
 xen/arch/x86/Makefile | 28 ++++++++++++++--------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7e88ddd3d7..11c6b6b06d 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -89,16 +89,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0.S
-	$(MAKE) $(build)=$(@D) $(dot-target).0.o
+		> $(dot-target).1.S
+	$(MAKE) $(build)=$(@D) $(dot-target).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
-	    $(dot-target).0.o -o $(dot-target).1
+	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).1.S
-	$(MAKE) $(build)=$(@D) $(dot-target).1.o
+		> $(dot-target).2.S
+	$(MAKE) $(build)=$(@D) $(dot-target).2.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).1.o -o $@
+	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 407571c510..6fe6cddea4 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -138,16 +138,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0.S
-	$(MAKE) $(build)=$(@D) $(dot-target).0.o
+		> $(dot-target).1.S
+	$(MAKE) $(build)=$(@D) $(dot-target).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(dot-target).0.o -o $(dot-target).1
+	    $(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) \
-		> $(dot-target).1.S
-	$(MAKE) $(build)=$(@D) $(dot-target).1.o
+		> $(dot-target).2.S
+	$(MAKE) $(build)=$(@D) $(dot-target).2.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
-	    $(orphan-handling-y) $(dot-target).1.o -o $@
+	    $(orphan-handling-y) $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		> $@.map
@@ -211,23 +211,23 @@ endif
 	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
-		> $(dot-target).0r.S
+		> $(dot-target).1r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).0s.S
-	$(MAKE) $(build)=$(@D) .$(@F).0r.o .$(@F).0s.o
+		> $(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 $< \
-	                $(dot-target).0r.o $(dot-target).0s.o $(note_file_option) \
+	                $(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) \
-		> $(dot-target).1r.S
+		> $(dot-target).2r.S
 	$(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
-		> $(dot-target).1s.S
-	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
+		> $(dot-target).2s.S
+	$(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \
-	      $(dot-target).1r.o $(dot-target).1s.o $(orphan-handling-y) \
+	      $(dot-target).2r.o $(dot-target).2s.o $(orphan-handling-y) \
 	      $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219677.1528537 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL2T-0005EE-VL; Tue, 03 Feb 2026 18:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219677.1528537; Tue, 03 Feb 2026 18: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 1vnL2T-0005E6-R8; Tue, 03 Feb 2026 18:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1219677;
 Tue, 03 Feb 2026 18: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 1vnL2S-0005Du-HD
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL2S-0014wo-2h
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL2S-00FiNl-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=EOkwmKYQHOjxGyL65ucyrKuYnrS9AudBKpLf2NCRFls=; b=aeU5JtGDRGwlYTOZqE6XIh5aBy
	ayvJlr8PBvYfkI7evA8SdxxQn9YC4xhJoHxeZMXc2RUo7oxDubD7L9AepJGNQGljMUWmgqnP9bC1Q
	kXvd0U6IjJMXO483AvmCPTsQvIhELjmRFaxCThBnZWPaOB8dxKOdWIJpfd4JLjDSo3bA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] symbols: don't use symbols-dummy
Message-Id: <E1vnL2S-00FiNl-1V@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:12 +0000

commit 97593f78ea1b702fdbad5a2b44baf457078c9538
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:35:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:35:28 2026 +0100

    symbols: don't use symbols-dummy
    
    symbols/x86: don't use symbols-dummy
    
    In particular when linking with lld, which converts hidden symbols to
    local ones, the ELF symbol table can change in unhelpful ways between the
    first two linking passes, resulting in the .rodata contributions to change
    between the 2nd and 3rd pass. That, however, renders our embedded symbol
    table pretty much unusable; the recently introduced self-test may then
    also fail. (Another difference between compiling a C file and assembling
    the generated ones is that - with -fdata-sections in use - the .rodata
    contributions move between passes 1 and 2, when we'd prefer them not to.)
    
    Make tools/symbols capable of producing an "empty" assembly file, such
    that unwanted differences between passes 1 and 2 go away when then using
    the corresponding objects in place of common/symbols-dummy.o.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    
    symbols/arm: don't use symbols-dummy
    
    In particular when linking with lld, which converts hidden symbols to
    local ones, the ELF symbol table can change in unhelpful ways between the
    first two linking passes, resulting in the .rodata contributions to change
    between the 2nd and 3rd pass. That, however, renders our embedded symbol
    table pretty much unusable; the recently introduced self-test may then
    also fail. (Another difference between compiling a C file and assembling
    the generated ones is that - with -fdata-sections in use - the .rodata
    contributions move between passes 1 and 2, when we'd prefer them not to.)
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
    master commit: 92f3beb62750f9b1f14d0e4693e793355a99c185
    master date: 2025-11-26 12:10:00 +0100
    master commit: d88873d01f4ec638daf722e332e2cab9f8ab3019
    master date: 2025-12-08 15:29:12 +0100
---
 xen/arch/arm/Makefile | 4 +++-
 xen/arch/x86/Makefile | 8 ++++++--
 xen/tools/symbols.c   | 5 ++++-
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 11c6b6b06d..7494a0f926 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -85,8 +85,10 @@ ifeq ($(CONFIG_ARM_64),y)
 endif
 
 $(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 $< \
-	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
+	      $(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
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 6fe6cddea4..9d07a0a0d6 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -134,8 +134,10 @@ $(TARGET): $(TARGET)-syms $(efi-y) $(obj)/boot/mkelf32
 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) \
-	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
+	      $(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
@@ -206,9 +208,11 @@ $(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
+	$(MAKE) $(build)=$(@D) .$(@F).0s.o
 	$(foreach base, $(VIRT_BASE) $(ALT_BASE), \
 	          $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
-	                $(objtree)/common/symbols-dummy.o $(note_file_option) \
+	                $(dot-target).0s.o $(note_file_option) \
 	                -o $(dot-target).$(base).0 &&) :
 	$(MKRELOC) $(foreach base,$(VIRT_BASE) $(ALT_BASE),$(dot-target).$(base).0) \
 		> $(dot-target).1r.S
diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 7685866b97..0af8a1e91c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -675,7 +675,10 @@ int main(int argc, char **argv)
 				warn_dup = true;
 			else if (strcmp(argv[i], "--error-dup") == 0)
 				warn_dup = error_dup = true;
-			else if (strcmp(argv[i], "--xensyms") == 0)
+			else if (strcmp(argv[i], "--empty") == 0) {
+				write_src();
+				return 0;
+			} else if (strcmp(argv[i], "--xensyms") == 0)
 				map_only = true;
 			else
 				usage();
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219678.1528540 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL2d-0005Gg-VG; Tue, 03 Feb 2026 18:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219678.1528540; Tue, 03 Feb 2026 18: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 1vnL2d-0005GY-SZ; Tue, 03 Feb 2026 18:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1219678;
 Tue, 03 Feb 2026 18: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 1vnL2c-0005GP-Jr
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL2c-0014wu-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL2c-00FiOG-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=N+jF0mt7ofpAoGjtVlJNMWnIdMpzPsLCrhmgEa6hNtA=; b=x+tSheIqRaJ8awswssgyvMAlDV
	eN04+SMUTuE0qWAloIYLIc+DbL+mmwJ5Vwjth6BFvVMc6FY8wM3pfyagelRBfBHI2w330knxlgv93
	+J8idt1LryHP9xYMB4NqidhLhhXlEv/FalDaKvh/lR63FeJ/z8M/PvQz3xye4STQZw08=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/domain: Disallow XENMEM_claim_pages on dying domains
Message-Id: <E1vnL2c-00FiOG-1m@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:22 +0000

commit bc63b09ecc03570ed760980957840329f9610f9b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:36:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:36:14 2026 +0100

    xen/domain: Disallow XENMEM_claim_pages on dying domains
    
    XENMEM_claim_pages can be issued on a domain in the later stages of
    domain_kill().  In that case, the claimed memory is leaked, as there's no way
    to subsequently release the claim.
    
    Claims are intended for use during domain construction; to reserve sufficient
    RAM to construct the domain fully.  There's no legitimate reason to be calling
    it on a dying domain.
    
    Fixes: 65c9792df600 ("mmu: Introduce XENMEM_claim_pages (subop of memory ops)")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 2379ca04feab7df40051d03f73487d9e0cef43ac
    master date: 2025-12-17 17:35:24 +0000
---
 xen/common/memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 3cb6fa9495..10becf7c1f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1685,6 +1685,9 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
 
         rc = xsm_claim_pages(XSM_PRIV, d);
 
+        if ( !rc && d->is_dying )
+            rc = -EINVAL;
+
         if ( !rc )
             rc = domain_set_outstanding_pages(d, reservation.nr_extents);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219679.1528544 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL2o-0005Im-0G; Tue, 03 Feb 2026 18:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219679.1528544; Tue, 03 Feb 2026 18: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 1vnL2n-0005Ie-Ty; Tue, 03 Feb 2026 18:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1219679;
 Tue, 03 Feb 2026 18: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 1vnL2m-0005IW-NF
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL2n-0014x0-01
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL2m-00FiQn-24
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=bq8ARUm7OiV0Hg+aNVnTTeFTPTgbUurF/sTyLK1MtPQ=; b=FlppGear/CRrAlg1udDXhVwa4/
	mNCHJAdZa1tLSDS9JR1CC88kNg9rbE5Db0VI8yA2/J6QN7StXBvD/PxKNI7STqLXym7FZMedPBDi1
	8RINoR0h4cR/K6WK6BleFAklJP1AagU50CMdjNQ0LkbUquaQ1flaQkF8YnwmRnvRPm6E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/time: deal with negative deltas in get_s_time_fixed()
Message-Id: <E1vnL2m-00FiQn-24@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:32 +0000

commit b3f59203a542001ff7485bb0be95658cbb9bb106
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:37:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:37:12 2026 +0100

    x86/time: deal with negative deltas in get_s_time_fixed()
    
    Callers may pass in TSC values from before the local TSC stamp was last
    updated (this would in particular be the case when the TSC was latched, a
    time rendezvous occurs, and the latched value is used only afterwards).
    scale_delta(), otoh, deals with unsigned values, and hence would treat
    negative incoming deltas as huge positive values, yielding entirely bogus
    return values.
    
    Fixes: 88e64cb785c1 ("x86/HVM: use fixed TSC value when saving or restoring domain")
    Reported-by: Антон Марков <akmarkov45@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 7b3e1b4e848d34c9a5b6634009959a7b9dd42104
    master date: 2026-01-20 09:03:17 +0100
---
 xen/arch/x86/time.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index ece9ae0b34..3b451525a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1649,8 +1649,13 @@ s_time_t get_s_time_fixed(u64 at_tsc)
         tsc = at_tsc;
     else
         tsc = rdtsc_ordered();
-    delta = tsc - t->stamp.local_tsc;
-    return t->stamp.local_stime + scale_delta(delta, &t->tsc_scale);
+
+    if ( likely(tsc >= t->stamp.local_tsc) )
+        delta = scale_delta(tsc - t->stamp.local_tsc, &t->tsc_scale);
+    else
+        delta = -scale_delta(t->stamp.local_tsc - tsc, &t->tsc_scale);
+
+    return t->stamp.local_stime + delta;
 }
 
 s_time_t get_s_time(void)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219680.1528548 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL2y-0005Kt-1i; Tue, 03 Feb 2026 18:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219680.1528548; Tue, 03 Feb 2026 18: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 1vnL2x-0005Kl-VI; Tue, 03 Feb 2026 18:22:43 +0000
Received: by outflank-mailman (input) for mailman id 1219680;
 Tue, 03 Feb 2026 18: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 1vnL2w-0005Ke-PF
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL2x-0014xK-0H
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL2w-00FiRh-2K
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=1J37Hr/ZgtKEEIjgABhPeQk6CGJ4GqHbQMDAGER2rx0=; b=4tW9O0/7B5kLFwfv09a6nOQhaq
	Xs7OWOsSs2p+X1gl5z3MGE5ox9MWb7jlykTr9zIbfVCM8xKH8SLMNz3fI3saVwwwCqAYtVfkAipDL
	efB8Qhnv5AoZpNHS8LMb4bXzYXTujpA5/KwSml3q3XnnqHsaXfj9ZyUkc7K17cm9lcHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/CPU: extend is_forced_cpu_cap()'s "reach"
Message-Id: <E1vnL2w-00FiRh-2K@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:42 +0000

commit 4e3c9c2eca01e2437395296ee44d48b1341f52a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:37:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:37:54 2026 +0100

    x86/CPU: extend is_forced_cpu_cap()'s "reach"
    
    "cpuid=no-rdrand" cannot actually be used to suppress the respective
    boot warning on certain AMD hardware. That's because cleared_caps[] are
    only applied after the ->c_init() hooks ran, i.e. cpu_has() still
    returns true in init_amd().
    
    Fixes: 93401e28a84b ("x86: clear RDRAND CPUID bit on AMD family 15h/16h")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: f09f2e28a9ec5e2a867f212177e4d4c458dc3d85
    master date: 2026-01-22 09:10:10 +0100
---
 xen/arch/x86/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 8c8bf1a806..5869fff8f9 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -109,7 +109,7 @@ void __init setup_force_cpu_cap(unsigned int cap)
 
 bool __init is_forced_cpu_cap(unsigned int cap)
 {
-	return test_bit(cap, forced_caps);
+	return test_bit(cap, forced_caps) || test_bit(cap, cleared_caps);
 }
 
 static void cf_check default_init(struct cpuinfo_x86 * c)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219681.1528552 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL38-0005N4-2y; Tue, 03 Feb 2026 18:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219681.1528552; Tue, 03 Feb 2026 18: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 1vnL38-0005Mw-0Q; Tue, 03 Feb 2026 18:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1219681;
 Tue, 03 Feb 2026 18: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 1vnL36-0005Mg-RX
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL37-0014xh-0W
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL36-00FiSB-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=/lTJLZX57la4Lu5vSx90v/ghe8ZnEk7+x5MtKDOX1Z4=; b=ej3KoRciiNYQw4Ej1yqHoejrEu
	/0h/sLdh+Bv644il0H7mEk57gboC09insRHKzx4L6LTHJHJkLJmBSdmp/cK+RCJZdaZh2zwT8Qos3
	0u1r0cWG2cR3Z41jZrYQKpBXNg1WRPnDrAMyJCQNkMulc0Iplly4/CzKYWHLAyswl3As=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] PCI: handle PCI->PCIe bridges as well in alloc_pdev()
Message-Id: <E1vnL36-00FiSB-2a@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:22:52 +0000

commit 8cb60ba2365c36570fddebdfda321d63e17cb2e7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:38:31 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:38:31 2026 +0100

    PCI: handle PCI->PCIe bridges as well in alloc_pdev()
    
    It's not clear why the enumerator was omitted, as these clearly shouldn't
    take the "default" path (issuing a warning). Handle them the same as
    legacy and PCIe->PCI bridges.
    
    Fixes: e7e08d86ad2f ("IOMMU/PCI: consolidate pdev_type() and cache its result for a given device")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    master commit: cd2b9f0b1986a8581ac22c7276edce0f1fc17d26
    master date: 2026-01-22 09:13:14 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 52c22fa50c..fc2372c523 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -351,6 +351,7 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:23:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219682.1528556 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL3J-0005PA-4M; Tue, 03 Feb 2026 18:23:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219682.1528556; Tue, 03 Feb 2026 18:23: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 1vnL3J-0005P2-1n; Tue, 03 Feb 2026 18:23:05 +0000
Received: by outflank-mailman (input) for mailman id 1219682;
 Tue, 03 Feb 2026 18: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 1vnL3G-0005Ov-U6
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnL3H-0014y9-0m
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL3G-00FiSx-2p
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=degnWhiVDp8+83+g7GJn4/wpp2fBsnhQZQ6f+w5daGg=; b=VDaQ2SBGuovvXDtMJKUX0LC8GA
	Ba2ogIPIxr4reRp+aFT/AraPpnjNSjTe2ViUrf/Rrki59i6WPyN2Rz6JOVelruKq0wwGNWBZ3R15K
	d7l4YrGXL8P+DwFb96ljE5LT1LQ2/getBsF1T8aUdvzFlwvAKI6x6J7hF+9vyA2DrTEo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] flask: fix gcov build with gcc14+
Message-Id: <E1vnL3G-00FiSx-2p@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:23:02 +0000

commit b75f39c692dcc73e3d762393f479742b73faa01e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:38:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:38:48 2026 +0100

    flask: fix gcov build with gcc14+
    
    Gcc's "threading" of conditionals can lead to undue warnings, as reported
    in e.g. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 (no matter
    that the overall situation is different there). While my gcc15 complains
    ("buf[2] may be used uninitialized in this function") about only two of
    the three instances (not about the one in type_read()), adjust all three
    to be on the safe side.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 7db4509d80242cc03cc7228c50e88248c8eeb02f
    master date: 2026-01-26 10:34:14 +0100
---
 xen/xsm/flask/ss/policydb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index 165304c133..f3674371ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1271,7 +1271,10 @@ static int cf_check role_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1342,7 +1345,10 @@ static int cf_check type_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 4);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
+        buf[3] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
@@ -1436,7 +1442,10 @@ static int cf_check user_read(struct policydb *p, struct hashtab *h, void *fp)
     if ( ver >= POLICYDB_VERSION_BOUNDARY )
         rc = next_entry(buf, fp, sizeof(buf[0]) * 3);
     else
+    {
         rc = next_entry(buf, fp, sizeof(buf[0]) * 2);
+        buf[2] = cpu_to_le32(0); /* gcc14 onwards */
+    }
 
     if ( rc < 0 )
         goto bad;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:23:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219683.1528560 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL3S-0005RO-6J; Tue, 03 Feb 2026 18:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219683.1528560; Tue, 03 Feb 2026 18:23: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 1vnL3S-0005RG-3D; Tue, 03 Feb 2026 18:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1219683;
 Tue, 03 Feb 2026 18:23: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 1vnL3R-0005R8-0G
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18:23: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 1vnL3R-0014yP-11
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL3Q-00FiTR-35
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=t2AxieXe8x3X2Z8GgysbKGv9a0Q5S7VMMV54fM6YBsQ=; b=0NKR5g1yAwFgFB2NMqS6hHEqou
	+CNeyoLxQmvVirc1Wa5MBTinYXYKINgWSZAsvRW/N1kNHe4uIcReSCE5a1YaksH1Q/e/PPEKBzSaX
	lyazgQ7eFtwBb2f/xTIrRyDGG5bDIADgqRGeu/w6fOWMntiS6/+/7rRMNW3pk7cW2ce4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] symbols: ensure sorting by value yields reproducible outcome
Message-Id: <E1vnL3Q-00FiTR-35@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:23:12 +0000

commit fc024ebf24baedcef98310347abd2480662aca74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:39:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:39:03 2026 +0100

    symbols: ensure sorting by value yields reproducible outcome
    
    qsort() implementations have freedom towards actions taken when two items
    compare equal. The latest with the introduction of fake "end" symbols,
    inconsistent sorting between the 1st and 2nd run can lead to extra "end"
    symbols in one of the runs, making the resulting symbol table partly
    unusable. (Note in particular that --warn-dup or --error-dup are passed
    only on the 2nd run, and only for xen.syms, and that option has the effect
    of doing a name sort ahead of doing the address sort. I.e. the inputs to
    the 2nd qsort() are pretty different between the 1st and 2nd runs.)
    
    Make the result stable by using original order to break ties.
    
    Fixes: d3b637fba31b ("symbols: arrange to know where functions end")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: af3466ddd6490e2ff634bfdaca5a40725b466c2a
    master date: 2026-01-26 11:49:06 +0100
---
 xen/tools/symbols.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 0af8a1e91c..a2b46d655c 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -40,6 +40,7 @@ struct sym_entry {
 	unsigned long long addr;
 	unsigned long size;
 	unsigned int len;
+	unsigned int orig_idx;
 	unsigned char *sym;
 	char *orig_symbol;
 	unsigned int addr_idx;
@@ -247,6 +248,9 @@ static void read_map(FILE *in)
 				exit (1);
 			}
 		}
+
+		table[table_cnt].orig_idx = table_cnt;
+
 		if (read_symbol(in, &table[table_cnt]) == 0)
 			table_cnt++;
 	}
@@ -639,7 +643,11 @@ static int compare_value(const void *p1, const void *p2)
 		return -1;
 	if (isupper(*sym2->sym))
 		return +1;
-	return 0;
+
+	/* Explicitly request "keep original order" otherwise. */
+	if (sym1->orig_idx < sym2->orig_idx)
+		return -1;
+	return sym1->orig_idx > sym2->orig_idx;
 }
 
 static int compare_name(const void *p1, const void *p2)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:23:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219684.1528564 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL3c-0005UG-8t; Tue, 03 Feb 2026 18:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219684.1528564; Tue, 03 Feb 2026 18:23: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 1vnL3c-0005U8-5x; Tue, 03 Feb 2026 18:23:24 +0000
Received: by outflank-mailman (input) for mailman id 1219684;
 Tue, 03 Feb 2026 18:23: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 1vnL3b-0005U2-2s
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18:23: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 1vnL3b-0014yX-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL3b-00FiUh-06
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23: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=rqh+Npqq9pSlb7rJStLmmTo2loi/833QlXTx9SDmLEw=; b=MP7LSij5dQZAp50cj7qhyKUG1U
	7f6T1n5+AYzkWjahE8xr89x+/0yq8hF3YahtqCZhGs2xrvdSEneTxCsZr9Gj28OzvUvLSw+W09nJf
	5Tu+7PhnWmTKkPrbOplE9WWBLesyFmCsbA02UFTphEphtsN3DZtRbWTl9GE4L86oCJS8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] symbols: don't omit "end" symbols upon mixed code / data aliases
Message-Id: <E1vnL3b-00FiUh-06@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:23:23 +0000

commit 25db82b062f49c52e897a024e69339c69181928c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:39:26 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:39:26 2026 +0100

    symbols: don't omit "end" symbols upon mixed code / data aliases
    
    At the example of _sinitext - that symbol has four aliases on x86:
    __init_begin, __2M_init_start, __2M_rodata_end, and whatever the first
    function in .init.text. With the GNU toolchain all of them are marked
    'T' or 't'. With Clang/LLVM, however, some are marked 'r'. Since, to
    save space, we want fake "end" symbols only for text, right now
    want_symbol_end() has a respective check. That is getting in the way,
    however, when the final of those symbols is 'r'. Remove the check and
    instead zap the size for anything that is non-code.
    
    Fixes: 6eede548df21 ('symbols: avoid emitting "end" symbols for data items')
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: af2dbe260f3d5bdd5d47dacc87bfcc449bf91c24
    master date: 2026-01-26 11:49:31 +0100
---
 xen/tools/symbols.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index a2b46d655c..509394d5a4 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -165,6 +165,10 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	else if (str[0] == '$')
 		goto skip_tail;
 
+	/* We want fake "end" symbols only for text / code. */
+	if (toupper((uint8_t)stype) != 'T')
+		s->size = 0;
+
 	/* include the type field in the symbol name, so that it gets
 	 * compressed together */
 	s->len = strlen(str) + 1;
@@ -316,7 +320,6 @@ static int compare_name_orig(const void *p1, const void *p2)
 static bool want_symbol_end(unsigned int idx)
 {
 	return table[idx].size &&
-	       toupper(table[idx].type) == 'T' &&
 	       (idx + 1 == table_cnt ||
 	        table[idx].addr + table[idx].size < table[idx + 1].addr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:23:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219685.1528568 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL3m-0005WM-AB; Tue, 03 Feb 2026 18:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219685.1528568; Tue, 03 Feb 2026 18:23: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 1vnL3m-0005WE-7O; Tue, 03 Feb 2026 18:23:34 +0000
Received: by outflank-mailman (input) for mailman id 1219685;
 Tue, 03 Feb 2026 18:23: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 1vnL3l-0005W1-5K
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18:23: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 1vnL3l-0014yd-1W
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL3l-00FiVP-0L
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23: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=eJaEDn9OOF78RxldP4TNFMYLUhlRQgw4RySQ4YEexHs=; b=m9vDEq40L32EhVEUzh9RxJqR9D
	3ZpRg3sxxuO2vPp0IWJcZOOzaRGpMPb00olzNZhEehn7SGMiNKKT+UiI8MlYzJuacFCgBh1PFYFwj
	8bkWfmP9HyPcUw04p4XxJyGQcYysYKBriRwBEzefi/z43dgWskkFZsYJWHyqj1P8BANY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] build/non-x86: fix symbol lookup in presence of build-id
Message-Id: <E1vnL3l-00FiVP-0L@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:23:33 +0000

commit 8d7a0f86619c2e2c00c98f2aa5708cd638039815
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jan 29 13:40:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:40:28 2026 +0100

    build/non-x86: fix symbol lookup in presence of build-id
    
    It's not clear why only x86 had $(build_id_linker) applied to all three
    linking passes. Not doing so will alter symbol offsets between the 2nd
    and 3rd passes for, potentially, all of the symbols at higher addresses
    (intermediate alignment padding may mask this effect, though, so it will
    look as if problems appeared randomly).
    
    Fixes: a353cab905af ("build_id: Provide ld-embedded build-ids")
    Reported-by: Mykola Kvach <xakep.amatop@gmail.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Tested-by: Mykola Kvach <xakep.amatop@gmail.com> # arm
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> # riscv
    Tested-by: Jason Andryuk <jason.andryuk@amd.com> # arm64
    Acked-by: Michal Orzel <michal.orzel@amd.com>
    [jb: backport limited to Arm]
    master commit: f0abe60de13b7ca33464d5715d28e77fb545a1f0
    master date: 2026-01-27 10:26:36 +0100
---
 xen/arch/arm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7494a0f926..95bc7ad25e 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -87,13 +87,13 @@ endif
 $(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 $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	      $(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 $< \
+	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).1.o -o $(dot-target).1
 	$(NM) -pa --format=sysv $(dot-target).1 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:23:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219686.1528571 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnL3w-0005YR-BD; Tue, 03 Feb 2026 18:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219686.1528571; Tue, 03 Feb 2026 18:23: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 1vnL3w-0005YJ-8i; Tue, 03 Feb 2026 18:23:44 +0000
Received: by outflank-mailman (input) for mailman id 1219686;
 Tue, 03 Feb 2026 18:23: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 1vnL3v-0005Y8-7p
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18:23: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 1vnL3v-0014yp-1l
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnL3v-00FiVn-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:23: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=0ZcbATUY+y60EjKL4RXnBPGW2n3SOkoksPMimH743tw=; b=4u/e+hDXOxqopEKj1A8Nyow+Iw
	PvwYC/nvY7V7LAe1yOgzgJVHYv4J0KR9EOIh8DGr3z0Wu/hw39L0n/dJc6PhqUPu0G9XpwPPNatDM
	PuYxwLljiOgmETVl9d69DqAqspO+OOhZ5ydq1tO0Obc8p2/3cmT6Z4REn4ccEGTbTa0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
Message-Id: <E1vnL3v-00FiVn-0c@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:23:43 +0000

commit 3f4bf1e876c38e1898de745da69223b4519d4fb6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jan 29 13:40:41 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jan 29 13:40:41 2026 +0100

    x86/amd: Fold another DE_CFG edit into amd_init_de_cfg()
    
    As amd_init_de_cfg() states, it's only safe for there to be one location
    writing to DE_CFG.  This happens to be a latent bug rather than a real one
    because Fam12h CPUs aren't SMT-capable.  Nevertheless, group it together with
    the other DE_CFG modifications.
    
    This removes a printk() which is not noteworthy, and skips the adjustment
    entirely under virt, where the attempted write wouldn't have stuck anyway.
    
    Fixes: d0c75dc4c028 ("x86/amd: Fix race editing DE_CFG")
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: f49bbd301b0e9eb81cff2dddf6862ec469cf8ef9
    master date: 2026-01-27 13:59:12 +0000
---
 xen/arch/x86/cpu/amd.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fb5c6acded..b7c71ebc67 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -1023,6 +1023,13 @@ void amd_init_de_cfg(const struct cpuinfo_x86 *c)
     if ( zenbleed_use_chickenbit() )
         new |= (1 << 9);
 
+    /*
+     * Erratum #665, doc 44739.  Integer divide instructions may cause
+     * unpredictable behaviour.
+     */
+    if ( c->family == 0x12 )
+        new |= 1U << 31;
+
     /* Avoid reading DE_CFG if we don't intend to change anything. */
     if ( !new )
         return;
@@ -1310,15 +1317,6 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 					    smp_processor_id());
 			wrmsrl(MSR_AMD64_LS_CFG, value | (1 << 15));
 		}
-	} else if (c->x86 == 0x12) {
-		rdmsrl(MSR_AMD64_DE_CFG, value);
-		if (!(value & (1U << 31))) {
-			if (c == &boot_cpu_data || opt_cpu_info)
-				printk_once(XENLOG_WARNING
-					    "CPU%u: Applying workaround for erratum 665\n",
-					    smp_processor_id());
-			wrmsrl(MSR_AMD64_DE_CFG, value | (1U << 31));
-		}
 	}
 
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219689.1528576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnLNa-000886-Mo; Tue, 03 Feb 2026 18:44:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219689.1528576; Tue, 03 Feb 2026 18: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 1vnLNa-00087y-KC; Tue, 03 Feb 2026 18:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1219689;
 Tue, 03 Feb 2026 18: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 1vnLNa-00087s-9f
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnLNa-0015Lb-1W
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnLNZ-00Fjx7-3C
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=GCrrONTIdG7MPG8tjvSKcOY5nDLzkfoBobm0JgZB+dA=; b=IQkPTNUJER8w/YW64rFtdao9z6
	V8pjccvkqc+RFks3wQm4MXVuobGALFYKRdJ4BJnotid23CYeixkJqdSRw/682Jsr3jatlBx9dnYZ5
	+e+YigfTDul9ER2YYl7xc9mqVwRFSLX3Cbx9OMXa1Y+M2HZDjDCO160Ebl5MASHN/S4A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MSI: adjust permitted vector range
Message-Id: <E1vnLNZ-00Fjx7-3C@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:44:01 +0000

commit 1b53f3644a27fca2fe15b431b5cdcaa465edf6bb
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:09:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:09:34 2026 +0100

    x86/MSI: adjust permitted vector range
    
    It's really FIRST_IRQ_VECTOR vector which is meant here, i.e. effectively
    there is a form of open-coding in use right now.
    
    No change in practice, due to the present aliasing.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 57ad5002c5..3fe22b3b6d 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -158,7 +158,7 @@ void msi_compose_msg(unsigned vector, const cpumask_t *cpu_mask, struct msi_msg
 {
     memset(msg, 0, sizeof(*msg));
 
-    if ( vector < FIRST_DYNAMIC_VECTOR )
+    if ( vector < FIRST_IRQ_VECTOR )
         return;
 
     if ( cpu_mask )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:44:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:44:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219690.1528580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnLNk-0008A7-OP; Tue, 03 Feb 2026 18:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219690.1528580; Tue, 03 Feb 2026 18: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 1vnLNk-00089z-Lb; Tue, 03 Feb 2026 18:44:12 +0000
Received: by outflank-mailman (input) for mailman id 1219690;
 Tue, 03 Feb 2026 18: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 1vnLNk-00089p-8x
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnLNk-0015Lf-1t
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnLNk-00FjyI-0e
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=m02pave/2ADM06SQXvkaEATRNaiEp6MB2xyIqyZUU5k=; b=CQH0FSRLR/ef6oqfcKqOJE/5cz
	d5tzObTQTxT9BGGgMJAVxoWa/qeFwo/eS/hbSNPyhRE4Tm4CzKvd06v+e28V5WKRbxZWlkYAXKiw2
	Gcbs6/9V3NGTHiXnc0lfS0MObZxBbP0eFSNCCOlX0NISx3x6xYXEyZNi8z4YjnrCOmmU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/mm: split struct sh_dirty_vram and make results private
Message-Id: <E1vnLNk-00FjyI-0e@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:44:12 +0000

commit 17492a08011411bf198b7a6a39afab8ec02ace34
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:10:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:10:33 2026 +0100

    x86/mm: split struct sh_dirty_vram and make results private
    
    The types are local to the shadow and HAP subsystems respectively, and
    HAP has no need for the shadow-specific fields (i.e. it can get away with
    smaller allocations). In struct hvm_domain it therefore suffices to have
    a union of two (generally opaque) pointers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/hvm/domain.h |  5 ++++-
 xen/arch/x86/include/asm/paging.h     | 13 -------------
 xen/arch/x86/mm/hap/hap.c             | 19 ++++++++++++-------
 xen/arch/x86/mm/shadow/common.c       |  8 ++++----
 xen/arch/x86/mm/shadow/hvm.c          | 16 ++++++++--------
 xen/arch/x86/mm/shadow/multi.c        |  2 +-
 xen/arch/x86/mm/shadow/private.h      | 10 +++++++++-
 7 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index be1a0d8c5b..abf9bc448d 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -95,7 +95,10 @@ struct hvm_domain {
     struct list_head       pinned_cacheattr_ranges;
 
     /* VRAM dirty support.  Protect with the domain paging lock. */
-    struct sh_dirty_vram *dirty_vram;
+    union {
+        struct sh_dirty_vram *sh;
+        struct hap_dirty_vram *hap;
+    } dirty_vram;
 
     bool                   is_s3_suspended;
 
diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/paging.h
index 9668deed4c..291ab386e8 100644
--- a/xen/arch/x86/include/asm/paging.h
+++ b/xen/arch/x86/include/asm/paging.h
@@ -135,19 +135,6 @@ struct paging_mode {
     (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \
                   PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1)
 
-#ifdef CONFIG_HVM
-/* VRAM dirty tracking support */
-struct sh_dirty_vram {
-    unsigned long begin_pfn;
-    unsigned long end_pfn;
-#ifdef CONFIG_SHADOW_PAGING
-    paddr_t *sl1ma;
-    uint8_t *dirty_bitmap;
-    s_time_t last_dirty;
-#endif
-};
-#endif
-
 #if PG_log_dirty
 
 /* log dirty initialization */
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 2f69ff9c7b..a337752bf4 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -36,6 +36,11 @@
 /*          HAP VRAM TRACKING SUPPORT           */
 /************************************************/
 
+struct hap_dirty_vram {
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+};
+
 /*
  * hap_track_dirty_vram()
  * Create the domain's dv_dirty_vram struct on demand.
@@ -52,7 +57,7 @@ int hap_track_dirty_vram(struct domain *d,
                          XEN_GUEST_HANDLE(void) guest_dirty_bitmap)
 {
     long rc = 0;
-    struct sh_dirty_vram *dirty_vram;
+    struct hap_dirty_vram *dirty_vram;
     uint8_t *dirty_bitmap = NULL;
 
     if ( nr_frames )
@@ -66,17 +71,17 @@ int hap_track_dirty_vram(struct domain *d,
 
         paging_lock(d);
 
-        dirty_vram = d->arch.hvm.dirty_vram;
+        dirty_vram = d->arch.hvm.dirty_vram.hap;
         if ( !dirty_vram )
         {
             rc = -ENOMEM;
-            if ( (dirty_vram = xzalloc(struct sh_dirty_vram)) == NULL )
+            if ( (dirty_vram = xzalloc(struct hap_dirty_vram)) == NULL )
             {
                 paging_unlock(d);
                 goto out;
             }
 
-            d->arch.hvm.dirty_vram = dirty_vram;
+            d->arch.hvm.dirty_vram.hap = dirty_vram;
         }
 
         if ( begin_pfn != dirty_vram->begin_pfn ||
@@ -132,7 +137,7 @@ int hap_track_dirty_vram(struct domain *d,
     {
         paging_lock(d);
 
-        dirty_vram = d->arch.hvm.dirty_vram;
+        dirty_vram = d->arch.hvm.dirty_vram.hap;
         if ( dirty_vram )
         {
             /*
@@ -142,7 +147,7 @@ int hap_track_dirty_vram(struct domain *d,
             begin_pfn = dirty_vram->begin_pfn;
             nr_frames = dirty_vram->end_pfn - dirty_vram->begin_pfn;
             xfree(dirty_vram);
-            d->arch.hvm.dirty_vram = NULL;
+            d->arch.hvm.dirty_vram.hap = NULL;
         }
 
         paging_unlock(d);
@@ -630,7 +635,7 @@ void hap_teardown(struct domain *d, bool *preempted)
 
     d->arch.paging.mode &= ~PG_log_dirty;
 
-    XFREE(d->arch.hvm.dirty_vram);
+    XFREE(d->arch.hvm.dirty_vram.hap);
 
 out:
     paging_unlock(d);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index d92ca84362..96986ee255 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2316,11 +2316,11 @@ void shadow_teardown(struct domain *d, bool *preempted)
     d->arch.paging.mode &= ~PG_log_dirty;
 
 #ifdef CONFIG_HVM
-    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram )
+    if ( is_hvm_domain(d) && d->arch.hvm.dirty_vram.sh )
     {
-        xfree(d->arch.hvm.dirty_vram->sl1ma);
-        xfree(d->arch.hvm.dirty_vram->dirty_bitmap);
-        XFREE(d->arch.hvm.dirty_vram);
+        xfree(d->arch.hvm.dirty_vram.sh->sl1ma);
+        xfree(d->arch.hvm.dirty_vram.sh->dirty_bitmap);
+        XFREE(d->arch.hvm.dirty_vram.sh);
     }
 #endif
 
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index d857b1d9d6..bfc81b680a 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -1036,7 +1036,7 @@ int shadow_track_dirty_vram(struct domain *d,
     p2m_lock(p2m_get_hostp2m(d));
     paging_lock(d);
 
-    dirty_vram = d->arch.hvm.dirty_vram;
+    dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     if ( dirty_vram && (!nr_frames ||
              ( begin_pfn != dirty_vram->begin_pfn
@@ -1046,8 +1046,8 @@ int shadow_track_dirty_vram(struct domain *d,
         gdprintk(XENLOG_INFO, "stopping tracking VRAM %lx - %lx\n", dirty_vram->begin_pfn, dirty_vram->end_pfn);
         xfree(dirty_vram->sl1ma);
         xfree(dirty_vram->dirty_bitmap);
-        xfree(dirty_vram);
-        dirty_vram = d->arch.hvm.dirty_vram = NULL;
+        d->arch.hvm.dirty_vram.sh = NULL;
+        XFREE(dirty_vram);
     }
 
     if ( !nr_frames )
@@ -1078,7 +1078,7 @@ int shadow_track_dirty_vram(struct domain *d,
             goto out;
         dirty_vram->begin_pfn = begin_pfn;
         dirty_vram->end_pfn = end_pfn;
-        d->arch.hvm.dirty_vram = dirty_vram;
+        d->arch.hvm.dirty_vram.sh = dirty_vram;
 
         if ( (dirty_vram->sl1ma = xmalloc_array(paddr_t, nr_frames)) == NULL )
             goto out_dirty_vram;
@@ -1205,8 +1205,8 @@ int shadow_track_dirty_vram(struct domain *d,
  out_sl1ma:
     xfree(dirty_vram->sl1ma);
  out_dirty_vram:
-    xfree(dirty_vram);
-    dirty_vram = d->arch.hvm.dirty_vram = NULL;
+    d->arch.hvm.dirty_vram.sh = NULL;
+    XFREE(dirty_vram);
 
  out:
     paging_unlock(d);
@@ -1229,7 +1229,7 @@ void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
                          const struct domain *d)
 {
     unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     ASSERT(is_hvm_domain(d));
 
@@ -1259,7 +1259,7 @@ void shadow_vram_put_mfn(mfn_t mfn, unsigned int l1f,
                          const struct domain *d)
 {
     unsigned long gfn;
-    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+    struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
     ASSERT(is_hvm_domain(d));
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 72f0c6fcbc..3bbaceec12 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -608,7 +608,7 @@ _sh_propagate(struct vcpu *v,
 #ifdef CONFIG_HVM
     if ( unlikely(level == 1) && is_hvm_domain(d) )
     {
-        struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram;
+        struct sh_dirty_vram *dirty_vram = d->arch.hvm.dirty_vram.sh;
 
         if ( dirty_vram && dirty_vram->last_dirty == -1 &&
              gfn_x(target_gfn) >= dirty_vram->begin_pfn &&
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index e1d940bf6a..6420ec4645 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -416,7 +416,15 @@ mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels);
 void sh_destroy_monitor_table(const struct vcpu *v, mfn_t mmfn,
                               unsigned int shadow_levels);
 
-/* VRAM dirty tracking helpers. */
+/* VRAM dirty tracking support */
+struct sh_dirty_vram {
+    unsigned long begin_pfn;
+    unsigned long end_pfn;
+    paddr_t *sl1ma;
+    uint8_t *dirty_bitmap;
+    s_time_t last_dirty;
+};
+
 void shadow_vram_get_mfn(mfn_t mfn, unsigned int l1f,
                          mfn_t sl1mfn, const void *sl1e,
                          const struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:44:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219691.1528584 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnLNu-0008CS-Pf; Tue, 03 Feb 2026 18:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219691.1528584; Tue, 03 Feb 2026 18:44: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 1vnLNu-0008CK-N1; Tue, 03 Feb 2026 18:44:22 +0000
Received: by outflank-mailman (input) for mailman id 1219691;
 Tue, 03 Feb 2026 18: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 1vnLNu-0008CE-C7
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnLNu-0015Lj-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnLNu-00Fk0T-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=kvO+7VPrjRev6Hy0hWiUDXIicBKBW20jdIKDpIG8qLs=; b=PTPXPaMLBCJ4byhr2xZGOTH3qC
	9BvQKt/Z184/sIX01jpE4D3n0VW9hcE+MosWUJJsg0WVlV5izldEU8VAkEMY8rteW49wN/YjiIkw0
	3MSa+FqAuJdijq6bnte4tk8jD5gJlgfpPinFTf1JI9/tCiJ63UVWwcilku1xZxExigJs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables
Message-Id: <E1vnLNu-00Fk0T-0y@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:44:22 +0000

commit 67e055ee9c1a5a28d5fbc3c54bcab920bb9b7215
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:11:16 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:11:16 2026 +0100

    CPU: abstract read-mostly-ness for per-CPU cpumask_var_t variables
    
    cpumask_var_t can resolve to a pointer or to an array. While the pointer
    typically is allocated once for a CPU and then only read (i.e. wants to be
    marked read-mostly), the same isn't necessarily true for the array case.
    There things depend on how the variable is actually used. cpu_core_mask
    and cpu_sibling_mask (which all architectures have inherited from x86,
    which in turn is possibly wrong) are altered only as CPUs are brought up
    or down, so may remain uniformly read-mostly. Other (x86-only) instances
    want to change, to avoid disturbing adjacent read-mostly data.
    
    While doing the x86 adjustment, also do one in the opposite direction,
    i.e. where there was no read-mostly annotation when it is applicable in
    the "pointer" case.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/genapic/x2apic.c | 2 +-
 xen/arch/x86/smpboot.c        | 6 +++---
 xen/include/xen/cpumask.h     | 6 ++++++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 89d66bc627..5f2765cf14 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -20,7 +20,7 @@
 static DEFINE_PER_CPU_READ_MOSTLY(u32, cpu_2_logical_apicid);
 static DEFINE_PER_CPU_READ_MOSTLY(cpumask_t *, cluster_cpus);
 static cpumask_t *cluster_cpus_spare;
-static DEFINE_PER_CPU(cpumask_var_t, scratch_mask);
+static DEFINE_PER_CPU_CPUMASK_VAR(scratch_mask);
 
 static inline u32 x2apic_cluster(unsigned int cpu)
 {
diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c
index 69cc9bbc6e..961bdf5333 100644
--- a/xen/arch/x86/smpboot.c
+++ b/xen/arch/x86/smpboot.c
@@ -52,13 +52,13 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_sibling_mask);
 /* representing HT and core siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_core_mask);
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, scratch_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(scratch_cpumask);
 static cpumask_t scratch_cpu0mask;
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, hpet_scratch_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(hpet_scratch_cpumask);
 static cpumask_t hpet_scratch_cpu0mask;
 
-DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, send_ipi_cpumask);
+DEFINE_PER_CPU_CPUMASK_VAR(send_ipi_cpumask);
 static cpumask_t send_ipi_cpu0mask;
 
 DEFINE_PER_CPU_READ_MOSTLY(struct stubs, stubs);
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index b713bb69a9..f3a53d90e0 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -311,6 +311,9 @@ extern const cpumask_t cpumask_all;
 
 typedef cpumask_t *cpumask_var_t;
 
+#define DEFINE_PER_CPU_CPUMASK_VAR(sym) \
+	DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, sym)
+
 static inline bool alloc_cpumask_var(cpumask_var_t *mask)
 {
 	*mask = _xmalloc(nr_cpumask_bits / 8, sizeof(long));
@@ -349,6 +352,9 @@ static inline void free_cpumask_var(cpumask_var_t mask)
 #else
 typedef cpumask_t cpumask_var_t[1];
 
+#define DEFINE_PER_CPU_CPUMASK_VAR(sym) \
+	DEFINE_PER_CPU(cpumask_var_t, sym)
+
 static inline bool alloc_cpumask_var(cpumask_var_t *mask)
 {
 	return true;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219692.1528588 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnLO5-0008F6-SC; Tue, 03 Feb 2026 18:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219692.1528588; Tue, 03 Feb 2026 18: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 1vnLO5-0008Ey-Pd; Tue, 03 Feb 2026 18:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1219692;
 Tue, 03 Feb 2026 18: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 1vnLO4-0008Eq-Ew
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnLO4-0015Ln-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnLO4-00Fk1N-1H
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=v3EXrd5XM2fBl9ZqdAaSqpmwqbkSetMb7UQikl2HHHU=; b=Yn0yW18cjOO3Q3cdKppFQQSu+B
	ZPkEjn/R/yAxAhv6KOfknrgnSrIK8mo2Bbz5hQKIoyHilbW40YGNC95pMFQF4+IrHIlGLHwXT+Sth
	/mJCUN/9KF2UIYlvKn57CasFiKOfYEy9/F/35Ly+0V64gzbEJqSgHI3oGLfhSirLJC64=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: calculate number of synthetic feature and bug enumerators
Message-Id: <E1vnLO4-00Fk1N-1H@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:44:32 +0000

commit 191e2c7a02b0f6454ad9bf8876192b00df3adf6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:11:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:11:53 2026 +0100

    x86: calculate number of synthetic feature and bug enumerators
    
    Rather than spelling out their amounts (requiring updates when multiples
    of 32 are crossed), introduce a sentinel each and calculate the two
    numbers from those.
    
    No difference in generated code, albeit debug info size grows quite a bit.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/cpufeatures.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/cpufeatures.h b/xen/arch/x86/include/asm/cpufeatures.h
index 0d90924e3e..f7958110af 100644
--- a/xen/arch/x86/include/asm/cpufeatures.h
+++ b/xen/arch/x86/include/asm/cpufeatures.h
@@ -7,7 +7,6 @@
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
 /* Synthetic words follow the featureset words. */
-#define X86_NR_SYNTH 2
 #define X86_SYNTH(x) (FSCAPINTS * 32 + (x))
 
 /* Synthetic features */
@@ -44,9 +43,11 @@ XEN_CPUFEATURE(IBPB_ENTRY_HVM,    X86_SYNTH(29)) /* MSR_PRED_CMD used by Xen for
 XEN_CPUFEATURE(USE_VMCALL,        X86_SYNTH(30)) /* Use VMCALL instead of VMMCALL */
 XEN_CPUFEATURE(PDX_COMPRESSION,   X86_SYNTH(31)) /* PDX compression */
 XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy() */
+XEN_CPUFEATURE(nr,                X86_SYNTH(33)) /* Number of synthetic features */
+
+#define X86_NR_SYNTH DIV_ROUND_UP(X86_FEATURE_nr - FSCAPINTS * 32, 32)
 
 /* Bug words follow the synthetic words. */
-#define X86_NR_BUG 1
 #define X86_BUG(x) ((FSCAPINTS + X86_NR_SYNTH) * 32 + (x))
 
 #define X86_BUG_FPU_PTRS          X86_BUG( 0) /* (F)X{SAVE,RSTOR} doesn't save/restore FOP/FIP/FDP. */
@@ -64,5 +65,10 @@ XEN_CPUFEATURE(XEN_REP_MOVSB,     X86_SYNTH(32)) /* REP MOVSB used for memcpy()
 #define X86_SPEC_BHB_LOOPS        X86_BUG(20) /* Use clear_bhb_loops for BHI mitigation.*/
 #define X86_SPEC_BHB_LOOPS_LONG   X86_BUG(21) /* Upgrade clear_bhb_loops to the "long" sequence. */
 
+#define X86_BUG_nr                X86_BUG(22) /* Number of bug identifiers */
+
+#define X86_NR_BUG DIV_ROUND_UP(X86_BUG_nr - (FSCAPINTS + X86_NR_SYNTH) * 32, \
+                                32)
+
 /* Total number of capability words, inc synth and bug words. */
 #define NCAPINTS (FSCAPINTS + X86_NR_SYNTH + X86_NR_BUG) /* N 32-bit words worth of info */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 03 18:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 03 Feb 2026 18:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1219693.1528592 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnLOF-0008HC-TR; Tue, 03 Feb 2026 18:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1219693.1528592; Tue, 03 Feb 2026 18: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 1vnLOF-0008H3-Qw; Tue, 03 Feb 2026 18:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1219693;
 Tue, 03 Feb 2026 18: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 1vnLOE-0008Gw-IE
 for xen-changelog@lists.xenproject.org; Tue, 03 Feb 2026 18: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 1vnLOE-0015Lt-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnLOE-00Fk2c-1Y
 for xen-changelog@lists.xenproject.org;
 Tue, 03 Feb 2026 18: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=Dr2u9PA8qbfl0o+byVzuEAUWsaSY3yzqQRwjA+s4Xl0=; b=skBzCaT7xp5UeCh2EC1/meH7Vu
	5ga8ZNGnXkG0OTqo0Ag00pmPKCiNBs/ye0y1JSE4uRS/UhcwfGEUCgocU3pD5f96e4SdGubLhvf2I
	wOERbEfk44l9mFSnvQzoKNzdt/Mw1t1IKcTyrPtkx7ZfSa56Ujy91Euiic7LWjQN8vAM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] PCI/regs: minimal adjustments for Misra rule 7.2
Message-Id: <E1vnLOE-00Fk2c-1Y@xenbits.xenproject.org>
Date: Tue, 03 Feb 2026 18:44:42 +0000

commit c97cbb7074636d5e5692930291abf05e12c5ef99
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 3 15:12:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 3 15:12:17 2026 +0100

    PCI/regs: minimal adjustments for Misra rule 7.2
    
    As was recently noticed with PCI_X_STATUS_533MHZ, leaving presently unused
    #define-s in non-Misra-compliant shape (7.2 is "A `u' or `U' suffix shall
    be applied to all integer constants that are represented in an unsigned
    type") is putting new code actually using any of the constants at risk of
    then causing Misra scan failures in CI. Adjust those few constants which
    strictly require a suffix.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/xen/pci_regs.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index 8d6bbea3c9..395ab49fa6 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -272,7 +272,7 @@
 #define PCI_AGP_VERSION		2	/* BCD version number */
 #define PCI_AGP_RFU		3	/* Rest of capability flags */
 #define PCI_AGP_STATUS		4	/* Status register */
-#define  PCI_AGP_STATUS_RQ_MASK	0xff000000	/* Maximum number of requests - 1 */
+#define  PCI_AGP_STATUS_RQ_MASK	0xff000000U /* Maximum number of requests - 1 */
 #define  PCI_AGP_STATUS_SBA	0x0200	/* Sideband addressing supported */
 #define  PCI_AGP_STATUS_64BIT	0x0020	/* 64-bit addressing supported */
 #define  PCI_AGP_STATUS_FW	0x0010	/* FW transfers supported */
@@ -280,7 +280,7 @@
 #define  PCI_AGP_STATUS_RATE2	0x0002	/* 2x transfer rate supported */
 #define  PCI_AGP_STATUS_RATE1	0x0001	/* 1x transfer rate supported */
 #define PCI_AGP_COMMAND		8	/* Control register */
-#define  PCI_AGP_COMMAND_RQ_MASK 0xff000000  /* Master: Maximum number of requests */
+#define  PCI_AGP_COMMAND_RQ_MASK 0xff000000U /* Master: Maximum number of requests */
 #define  PCI_AGP_COMMAND_SBA	0x0200	/* Sideband addressing enabled */
 #define  PCI_AGP_COMMAND_AGP	0x0100	/* Allow processing of AGP transactions */
 #define  PCI_AGP_COMMAND_64BIT	0x0020 	/* Allow processing of 64-bit addresses */
@@ -582,7 +582,7 @@
 #define  HT_MSI_FLAGS_FIXED	0x2		/* Fixed mapping only */
 #define  HT_MSI_FIXED_ADDR	0x00000000FEE00000ULL	/* Fixed addr */
 #define  HT_MSI_ADDR_LO		0x04		/* Offset to low addr bits */
-#define  HT_MSI_ADDR_LO_MASK	0xFFF00000	/* Low address bit mask */
+#define  HT_MSI_ADDR_LO_MASK	0xFFF00000U	/* Low address bit mask */
 #define  HT_MSI_ADDR_HI		0x08		/* Offset to high addr bits */
 #define HT_CAPTYPE_DIRECT_ROUTE	0xB0	/* Direct routing configuration */
 #define HT_CAPTYPE_VCSET	0xB8	/* Virtual Channel configuration */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 22:44:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 22:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221221.1529495 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnlbN-0003oB-Uf; Wed, 04 Feb 2026 22:44:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221221.1529495; Wed, 04 Feb 2026 22:44:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnlbN-0003o2-Rw; Wed, 04 Feb 2026 22:44:01 +0000
Received: by outflank-mailman (input) for mailman id 1221221;
 Wed, 04 Feb 2026 22: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 1vnlbN-0003nw-Jy
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 22: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 1vnlbN-002lnW-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 22:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnlbN-00HMl7-1O
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 22: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=hBQIxr5AVTlBG2ycIItIXWdO4c9wDkWYWzWThQUztj0=; b=kJN/7F1fvSuImGVMmIpDXQAI5C
	N8O0hB2dg7qBLYJJ7dGUAfjjgQgRUeVem1+SkwMK8T/gLs15rzG8moGz0gVHLCsvOf82rhQJm25j/
	8pdtdgT//h3Xla5+con3ywvUExzzVAVepurC3dqzP7OWpGlgupz39Ex8QYUxodmAg44c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] automation: align XTF qemu parameters across achitectures
Message-Id: <E1vnlbN-00HMl7-1O@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 22:44:01 +0000

commit 3a7b63536598bcef4d4e4cbf48d6bd265e5720d7
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Feb 2 11:32:31 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 14:35:00 2026 -0800

    automation: align XTF qemu parameters across achitectures
    
    It is handy to have 2 CPUs and more RAM for smoke testing a hypervisor
    change via XTF.
    
    Align x86 QEMU configuration with Arm for XTF tests: 2 CPU and 2G of RAM.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/include/xtf-x86-64     | 3 ++-
 automation/scripts/include/xtf-x86-64-efi | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/include/xtf-x86-64 b/automation/scripts/include/xtf-x86-64
index b1b0cc201e..186f074bd8 100644
--- a/automation/scripts/include/xtf-x86-64
+++ b/automation/scripts/include/xtf-x86-64
@@ -23,7 +23,8 @@ function xtf_arch_setup()
         -nographic \
         -monitor none \
         -serial stdio \
-        -m 512 \
+        -m 2048 \
+        -smp 2 \
         -kernel ${XEN_BINARY} \
         -initrd ${XTF_BINARY} \
         -append \"${XEN_CMDLINE}\" \
diff --git a/automation/scripts/include/xtf-x86-64-efi b/automation/scripts/include/xtf-x86-64-efi
index 8340c745db..15c6463dcd 100644
--- a/automation/scripts/include/xtf-x86-64-efi
+++ b/automation/scripts/include/xtf-x86-64-efi
@@ -49,7 +49,8 @@ EOF
         -nographic \
         -monitor none \
         -serial stdio \
-        -m 512 \
+        -m 2048 \
+        -smp 2 \
         -M q35,kernel-irqchip=split \
         -drive if=pflash,format=raw,readonly=on,file=${FW_PREFIX}OVMF_CODE${suff}.fd \
         -drive if=pflash,format=raw,file=${WORKDIR}/OVMF_VARS${suff}.fd \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 23:44:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 23:44:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221298.1529572 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnmXT-0005eG-51; Wed, 04 Feb 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 1221298.1529572; Wed, 04 Feb 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 1vnmXT-0005e8-2Q; Wed, 04 Feb 2026 23:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1221298;
 Wed, 04 Feb 2026 23: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 1vnmXR-0005e2-Nl
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 23: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 1vnmXR-002mxc-32
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnmXR-00HPmv-1l
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23: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=FGFt2hRDbYQKzJLUGGggPmiKt0D08Q62hLkGe6tlMAA=; b=mypq2Dp8vlCKwK4zQLeDhsXcxv
	adP6hweVGfQW6jt8GPRcvOWIGuq43B/62XNe8bIW7nkVHF4UNCCpOOMFjFL2LXqnrTEMmcxsD9mfK
	zRSbgPuYkpur4vFxQGg2tH3C9ItAkWArCXdMF1qa6MwpevGbzpIA6lz8Ina6dSGga+xo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] automation: align XTF qemu parameters across achitectures
Message-Id: <E1vnmXR-00HPmv-1l@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 23:44:01 +0000

commit 3a7b63536598bcef4d4e4cbf48d6bd265e5720d7
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Mon Feb 2 11:32:31 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 14:35:00 2026 -0800

    automation: align XTF qemu parameters across achitectures
    
    It is handy to have 2 CPUs and more RAM for smoke testing a hypervisor
    change via XTF.
    
    Align x86 QEMU configuration with Arm for XTF tests: 2 CPU and 2G of RAM.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/include/xtf-x86-64     | 3 ++-
 automation/scripts/include/xtf-x86-64-efi | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/automation/scripts/include/xtf-x86-64 b/automation/scripts/include/xtf-x86-64
index b1b0cc201e..186f074bd8 100644
--- a/automation/scripts/include/xtf-x86-64
+++ b/automation/scripts/include/xtf-x86-64
@@ -23,7 +23,8 @@ function xtf_arch_setup()
         -nographic \
         -monitor none \
         -serial stdio \
-        -m 512 \
+        -m 2048 \
+        -smp 2 \
         -kernel ${XEN_BINARY} \
         -initrd ${XTF_BINARY} \
         -append \"${XEN_CMDLINE}\" \
diff --git a/automation/scripts/include/xtf-x86-64-efi b/automation/scripts/include/xtf-x86-64-efi
index 8340c745db..15c6463dcd 100644
--- a/automation/scripts/include/xtf-x86-64-efi
+++ b/automation/scripts/include/xtf-x86-64-efi
@@ -49,7 +49,8 @@ EOF
         -nographic \
         -monitor none \
         -serial stdio \
-        -m 512 \
+        -m 2048 \
+        -smp 2 \
         -M q35,kernel-irqchip=split \
         -drive if=pflash,format=raw,readonly=on,file=${FW_PREFIX}OVMF_CODE${suff}.fd \
         -drive if=pflash,format=raw,file=${WORKDIR}/OVMF_VARS${suff}.fd \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 23:55:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 23:55:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221313.1529576 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnmi7-00071k-U8; Wed, 04 Feb 2026 23:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221313.1529576; Wed, 04 Feb 2026 23: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 1vnmi7-00071c-Re; Wed, 04 Feb 2026 23:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1221313;
 Wed, 04 Feb 2026 23: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 1vnmi6-00071U-8x
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 23: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 1vnmi6-002nAM-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnmi6-00HQWO-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23: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=Dj/4JICLkKdqIzXg3y7RsFNzqMzIPqYSY1VovtVO5Gs=; b=TSS1UjWqejIvQO2R4TZgtS15bC
	VwYreN3LrJpT01ZX/mVGuivh8YCtei+UwalPwkSLOTTV5ozqokp30d5YATyncSpx/Hj5rw0BArK5a
	haYKG3Bl/5f62c637f5LPn/jcml7ML0Oa5O6/UCM/rjFKLFj2pBfZLWjqwlpodKNpoYo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] scripts/config: import Kconfig manipulation tool from Linux
Message-Id: <E1vnmi6-00HQWO-0Y@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 23:55:02 +0000

commit 08f0b7d26e37de4336416edd64a1899021cab71c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:55 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:22 2026 -0800

    scripts/config: import Kconfig manipulation tool from Linux
    
    Manipulating Kconfig settings is often required when preparing a custom
    Xen build using an external build system (e.g., a Yocto-based workflow).
    
    Import the Kconfig manipulation tool from the Linux kernel
    (commit 0f61b1860cc3, Linux v6.19-rc5) to support this use case.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 236 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 236 insertions(+)

diff --git a/xen/scripts/config b/xen/scripts/config
new file mode 100755
index 0000000000..ea475c07de
--- /dev/null
+++ b/xen/scripts/config
@@ -0,0 +1,236 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0
+# Manipulate options in a .config file from the command line
+
+myname=${0##*/}
+
+# If no prefix forced, use the default CONFIG_
+CONFIG_="${CONFIG_-CONFIG_}"
+
+# We use an uncommon delimiter for sed substitutions
+SED_DELIM=$(echo -en "\001")
+
+usage() {
+	cat >&2 <<EOL
+Manipulate options in a .config file from the command line.
+Usage:
+$myname options command ...
+commands:
+	--enable|-e option   Enable option
+	--disable|-d option  Disable option
+	--module|-m option   Turn option into a module
+	--set-str option string
+	                     Set option to "string"
+	--set-val option value
+	                     Set option to value
+	--undefine|-u option Undefine option
+	--state|-s option    Print state of option (n,y,m,undef)
+
+	--enable-after|-E beforeopt option
+                             Enable option directly after other option
+	--disable-after|-D beforeopt option
+                             Disable option directly after other option
+	--module-after|-M beforeopt option
+                             Turn option into module directly after other option
+	--refresh            Refresh the config using old settings
+
+	commands can be repeated multiple times
+
+options:
+	--file config-file   .config file to change (default .config)
+	--keep-case|-k       Keep next symbols' case (dont' upper-case it)
+
+$myname doesn't check the validity of the .config file. This is done at next
+make time.
+
+By default, $myname will upper-case the given symbol. Use --keep-case to keep
+the case of all following symbols unchanged.
+
+$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
+variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
+EOL
+	exit 1
+}
+
+checkarg() {
+	ARG="$1"
+	if [ "$ARG" = "" ] ; then
+		usage
+	fi
+	case "$ARG" in
+	${CONFIG_}*)
+		ARG="${ARG/${CONFIG_}/}"
+		;;
+	esac
+	if [ "$MUNGE_CASE" = "yes" ] ; then
+		ARG="`echo $ARG | tr a-z A-Z`"
+	fi
+}
+
+txt_append() {
+	local anchor="$1"
+	local insert="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	# sed append cmd: 'a\' + newline + text + newline
+	cmd="$(printf "a\\%b$insert" "\n")"
+
+	sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_subst() {
+	local before="$1"
+	local after="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_delete() {
+	local text="$1"
+	local infile="$2"
+	local tmpfile="$infile.swp"
+
+	sed -e "/$text/d" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+set_var() {
+	local name=$1 new=$2 before=$3
+
+	name_re="^($name=|# $name is not set)"
+	before_re="^($before=|# $before is not set)"
+	if test -n "$before" && grep -Eq "$before_re" "$FN"; then
+		txt_append "^$before=" "$new" "$FN"
+		txt_append "^# $before is not set" "$new" "$FN"
+	elif grep -Eq "$name_re" "$FN"; then
+		txt_subst "^$name=.*" "$new" "$FN"
+		txt_subst "^# $name is not set" "$new" "$FN"
+	else
+		echo "$new" >>"$FN"
+	fi
+}
+
+undef_var() {
+	local name=$1
+
+	txt_delete "^$name=" "$FN"
+	txt_delete "^# $name is not set" "$FN"
+}
+
+FN=.config
+CMDS=()
+while [[ $# -gt 0 ]]; do
+	if [ "$1" = "--file" ]; then
+		if [ "$2" = "" ]; then
+			usage
+		fi
+		FN="$2"
+		shift 2
+	else
+		CMDS+=("$1")
+		shift
+	fi
+done
+
+set -- "${CMDS[@]}"
+if [ "$1" = "" ] ; then
+	usage
+fi
+
+MUNGE_CASE=yes
+while [ "$1" != "" ] ; do
+	CMD="$1"
+	shift
+	case "$CMD" in
+	--keep-case|-k)
+		MUNGE_CASE=no
+		continue
+		;;
+	--refresh)
+		;;
+	--*-after|-E|-D|-M)
+		checkarg "$1"
+		A=$ARG
+		checkarg "$2"
+		B=$ARG
+		shift 2
+		;;
+	-*)
+		checkarg "$1"
+		shift
+		;;
+	esac
+	case "$CMD" in
+	--enable|-e)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
+		;;
+
+	--disable|-d)
+		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
+		;;
+
+	--module|-m)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
+		;;
+
+	--set-str)
+		# sed swallows one level of escaping, so we need double-escaping
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
+		shift
+		;;
+
+	--set-val)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
+		shift
+		;;
+	--undefine|-u)
+		undef_var "${CONFIG_}$ARG"
+		;;
+
+	--state|-s)
+		if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
+			echo n
+		else
+			V="$(grep "^${CONFIG_}$ARG=" $FN)"
+			if [ $? != 0 ] ; then
+				echo undef
+			else
+				V="${V/#${CONFIG_}$ARG=/}"
+				V="${V/#\"/}"
+				V="${V/%\"/}"
+				V="${V//\\\"/\"}"
+				echo "${V}"
+			fi
+		fi
+		;;
+
+	--enable-after|-E)
+		set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
+		;;
+
+	--disable-after|-D)
+		set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
+		;;
+
+	--module-after|-M)
+		set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
+		;;
+
+	--refresh)
+		yes "" | make oldconfig KCONFIG_CONFIG=$FN
+		;;
+
+	*)
+		echo "bad command: $CMD" >&2
+		usage
+		;;
+	esac
+done
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 23:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 23:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221314.1529580 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnmiH-00073e-Vh; Wed, 04 Feb 2026 23:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221314.1529580; Wed, 04 Feb 2026 23: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 1vnmiH-00073W-T5; Wed, 04 Feb 2026 23:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1221314;
 Wed, 04 Feb 2026 23: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 1vnmiG-00073I-Cz
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 23: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 1vnmiG-002nCS-2H
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnmiG-00HQWm-15
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23: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=2dyvnRwxi3AVOuNbn36HDc12cAyaVNfDWUL0oquEb9w=; b=EzTT7cu/C2IRENsM1O72RVMRZR
	16aXqR0Sv9bqjXG1AcYH0Bd7ZzMfXDMFRH9L5jW4PFzl6wkiQsL2sOA8jFcpz5CN5QCkKtVzQkOUF
	wgObLw4VHDOee6VI4vzjIq9c4if1yUamiXootFqyfiqxWKU76tpDX+vD/B8d6W6O0ies=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] scripts/config: drop modules support
Message-Id: <E1vnmiG-00HQWm-15@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 23:55:12 +0000

commit 0081a505b3dc149a3e00c7406a29133157ad6f59
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:56 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:23 2026 -0800

    scripts/config: drop modules support
    
    Drop the --module (-m) and --module-after (-M) options, as Xen
    does not support loadable modules, so options are not applicable.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/xen/scripts/config b/xen/scripts/config
index ea475c07de..1050812aae 100755
--- a/xen/scripts/config
+++ b/xen/scripts/config
@@ -18,7 +18,6 @@ $myname options command ...
 commands:
 	--enable|-e option   Enable option
 	--disable|-d option  Disable option
-	--module|-m option   Turn option into a module
 	--set-str option string
 	                     Set option to "string"
 	--set-val option value
@@ -30,8 +29,6 @@ commands:
                              Enable option directly after other option
 	--disable-after|-D beforeopt option
                              Disable option directly after other option
-	--module-after|-M beforeopt option
-                             Turn option into module directly after other option
 	--refresh            Refresh the config using old settings
 
 	commands can be repeated multiple times
@@ -177,10 +174,6 @@ while [ "$1" != "" ] ; do
 		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
 		;;
 
-	--module|-m)
-		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
-		;;
-
 	--set-str)
 		# sed swallows one level of escaping, so we need double-escaping
 		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
@@ -220,10 +213,6 @@ while [ "$1" != "" ] ; do
 		set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
 		;;
 
-	--module-after|-M)
-		set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
-		;;
-
 	--refresh)
 		yes "" | make oldconfig KCONFIG_CONFIG=$FN
 		;;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 23:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 23:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221315.1529584 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnmiS-000767-0t; Wed, 04 Feb 2026 23:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221315.1529584; Wed, 04 Feb 2026 23: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 1vnmiR-00075z-UQ; Wed, 04 Feb 2026 23:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1221315;
 Wed, 04 Feb 2026 23: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 1vnmiQ-00075o-Fi
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 23: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 1vnmiQ-002nCo-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnmiQ-00HQX8-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23: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=AI2aBnoDWGEL0NSi1XjFvf5KKmVRrH6Rr+aACTzVr00=; b=zIaz0+SKF3a0IMirflrhUMPrgo
	0pPYd1/hOpWSJE+JXB7HnoQ4AnxWTONgkWtYv9cg0Q4i2IIbOqL9KxosCY4CYLWzLmvLkB8yKSvTY
	iezL/FwPpmRWXBP7dM8Ru/dX58n29WaUoaUGSATlTBNPPTLWKQyxXLeUBkZmDpIxMwag=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] scripts/config: add -y|-n flags
Message-Id: <E1vnmiQ-00HQX8-1M@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 23:55:22 +0000

commit 74bcaa9283796b97922310258f2cf77c422d1992
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:57 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:23 2026 -0800

    scripts/config: add -y|-n flags
    
    Add alias -y ("yes") to --enable and -n ("no") to --disable a Kconfig
    option for better scripting experience.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/scripts/config b/xen/scripts/config
index 1050812aae..1ede964320 100755
--- a/xen/scripts/config
+++ b/xen/scripts/config
@@ -16,8 +16,8 @@ Manipulate options in a .config file from the command line.
 Usage:
 $myname options command ...
 commands:
-	--enable|-e option   Enable option
-	--disable|-d option  Disable option
+	--enable|-e|-y|--yes    option   Enable option
+	--disable|-d|-n|--no    option   Disable option
 	--set-str option string
 	                     Set option to "string"
 	--set-val option value
@@ -166,11 +166,11 @@ while [ "$1" != "" ] ; do
 		;;
 	esac
 	case "$CMD" in
-	--enable|-e)
+	--enable|-e|-y|--yes)
 		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
 		;;
 
-	--disable|-d)
+	--disable|-d|-n|--no)
 		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
 		;;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 04 23:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Feb 2026 23:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221316.1529588 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnmib-00078w-29; Wed, 04 Feb 2026 23:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221316.1529588; Wed, 04 Feb 2026 23: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 1vnmia-00078m-Vn; Wed, 04 Feb 2026 23:55:32 +0000
Received: by outflank-mailman (input) for mailman id 1221316;
 Wed, 04 Feb 2026 23: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 1vnmia-00078g-Iu
 for xen-changelog@lists.xenproject.org; Wed, 04 Feb 2026 23: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 1vnmia-002nCu-2q
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnmia-00HQXa-1e
 for xen-changelog@lists.xenproject.org;
 Wed, 04 Feb 2026 23: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=/CVEGnuGj/sFK9OfBBK3LqpqJM/ECuChxQeIY5mBkQ4=; b=k378c6z0zHPkFDw1IZ68MscixO
	ATgDzndJS1JfIeW2Q/n6cwAAYACouzDgHUzn0YGlCns8dcKD+IaW1K2E/OgKon49DYoh+TP1UuoRu
	bK6A1dikm/xqnYpUr02IH4WkOHIiLjJLp9gHHtq3Kw1JVACl5PBS1Tdv042w+LnBDQ60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] scripts/config: hook to automation build script
Message-Id: <E1vnmia-00HQXa-1e@xenbits.xenproject.org>
Date: Wed, 04 Feb 2026 23:55:32 +0000

commit 032ac14b05268cfdc136b8b60779bc0d7344ace2
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:58 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:44:06 2026 -0800

    scripts/config: hook to automation build script
    
    Use the new .config manipulation tool to toggle CONFIG_DEBUG in the
    Xen automation build script.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 7a81d229de..359ee18444 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -27,7 +27,8 @@ else
     # Start off with arch's defconfig
     make -C xen defconfig
 
-    echo "CONFIG_DEBUG=${debug}" >> xen/.config
+    debug="${debug:-n}"
+    xen/scripts/config --file xen/.config -${debug} DEBUG
 
     if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then
         echo "${EXTRA_XEN_CONFIG}" >> xen/.config
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 00:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 00:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221332.1529593 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnneC-0006GA-6b; Thu, 05 Feb 2026 00:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221332.1529593; Thu, 05 Feb 2026 00: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 1vnneC-0006G2-3N; Thu, 05 Feb 2026 00:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1221332;
 Thu, 05 Feb 2026 00: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 1vnneA-0006Fu-Ha
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 00: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 1vnneA-002oup-2b
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnneA-00HTi8-1J
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00: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=CgvKpVIFAGOpkTq9QVrHl7reQFRcH6TnWEfHwp5nMww=; b=jnQEyNSwydtFCYXsQ6b+G8kqM4
	lu2M63jYjdwX+OpIUJgnWdYFtEWfHP2N/tmajvAw4kA+y6pcwsWuo1DzWgBGwsnVWBk5xcTjFEw7l
	fCduBxmvD/BnRkzQDSNrw26jhSt6pao59hJaZXp3EKDuE82zhM21kq6uNBLY02X0a+U0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] scripts/config: import Kconfig manipulation tool from Linux
Message-Id: <E1vnneA-00HTi8-1J@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 00:55:02 +0000

commit 08f0b7d26e37de4336416edd64a1899021cab71c
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:55 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:22 2026 -0800

    scripts/config: import Kconfig manipulation tool from Linux
    
    Manipulating Kconfig settings is often required when preparing a custom
    Xen build using an external build system (e.g., a Yocto-based workflow).
    
    Import the Kconfig manipulation tool from the Linux kernel
    (commit 0f61b1860cc3, Linux v6.19-rc5) to support this use case.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 236 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 236 insertions(+)

diff --git a/xen/scripts/config b/xen/scripts/config
new file mode 100755
index 0000000000..ea475c07de
--- /dev/null
+++ b/xen/scripts/config
@@ -0,0 +1,236 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0
+# Manipulate options in a .config file from the command line
+
+myname=${0##*/}
+
+# If no prefix forced, use the default CONFIG_
+CONFIG_="${CONFIG_-CONFIG_}"
+
+# We use an uncommon delimiter for sed substitutions
+SED_DELIM=$(echo -en "\001")
+
+usage() {
+	cat >&2 <<EOL
+Manipulate options in a .config file from the command line.
+Usage:
+$myname options command ...
+commands:
+	--enable|-e option   Enable option
+	--disable|-d option  Disable option
+	--module|-m option   Turn option into a module
+	--set-str option string
+	                     Set option to "string"
+	--set-val option value
+	                     Set option to value
+	--undefine|-u option Undefine option
+	--state|-s option    Print state of option (n,y,m,undef)
+
+	--enable-after|-E beforeopt option
+                             Enable option directly after other option
+	--disable-after|-D beforeopt option
+                             Disable option directly after other option
+	--module-after|-M beforeopt option
+                             Turn option into module directly after other option
+	--refresh            Refresh the config using old settings
+
+	commands can be repeated multiple times
+
+options:
+	--file config-file   .config file to change (default .config)
+	--keep-case|-k       Keep next symbols' case (dont' upper-case it)
+
+$myname doesn't check the validity of the .config file. This is done at next
+make time.
+
+By default, $myname will upper-case the given symbol. Use --keep-case to keep
+the case of all following symbols unchanged.
+
+$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
+variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
+EOL
+	exit 1
+}
+
+checkarg() {
+	ARG="$1"
+	if [ "$ARG" = "" ] ; then
+		usage
+	fi
+	case "$ARG" in
+	${CONFIG_}*)
+		ARG="${ARG/${CONFIG_}/}"
+		;;
+	esac
+	if [ "$MUNGE_CASE" = "yes" ] ; then
+		ARG="`echo $ARG | tr a-z A-Z`"
+	fi
+}
+
+txt_append() {
+	local anchor="$1"
+	local insert="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	# sed append cmd: 'a\' + newline + text + newline
+	cmd="$(printf "a\\%b$insert" "\n")"
+
+	sed -e "/$anchor/$cmd" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_subst() {
+	local before="$1"
+	local after="$2"
+	local infile="$3"
+	local tmpfile="$infile.swp"
+
+	sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+txt_delete() {
+	local text="$1"
+	local infile="$2"
+	local tmpfile="$infile.swp"
+
+	sed -e "/$text/d" "$infile" >"$tmpfile"
+	# replace original file with the edited one
+	mv "$tmpfile" "$infile"
+}
+
+set_var() {
+	local name=$1 new=$2 before=$3
+
+	name_re="^($name=|# $name is not set)"
+	before_re="^($before=|# $before is not set)"
+	if test -n "$before" && grep -Eq "$before_re" "$FN"; then
+		txt_append "^$before=" "$new" "$FN"
+		txt_append "^# $before is not set" "$new" "$FN"
+	elif grep -Eq "$name_re" "$FN"; then
+		txt_subst "^$name=.*" "$new" "$FN"
+		txt_subst "^# $name is not set" "$new" "$FN"
+	else
+		echo "$new" >>"$FN"
+	fi
+}
+
+undef_var() {
+	local name=$1
+
+	txt_delete "^$name=" "$FN"
+	txt_delete "^# $name is not set" "$FN"
+}
+
+FN=.config
+CMDS=()
+while [[ $# -gt 0 ]]; do
+	if [ "$1" = "--file" ]; then
+		if [ "$2" = "" ]; then
+			usage
+		fi
+		FN="$2"
+		shift 2
+	else
+		CMDS+=("$1")
+		shift
+	fi
+done
+
+set -- "${CMDS[@]}"
+if [ "$1" = "" ] ; then
+	usage
+fi
+
+MUNGE_CASE=yes
+while [ "$1" != "" ] ; do
+	CMD="$1"
+	shift
+	case "$CMD" in
+	--keep-case|-k)
+		MUNGE_CASE=no
+		continue
+		;;
+	--refresh)
+		;;
+	--*-after|-E|-D|-M)
+		checkarg "$1"
+		A=$ARG
+		checkarg "$2"
+		B=$ARG
+		shift 2
+		;;
+	-*)
+		checkarg "$1"
+		shift
+		;;
+	esac
+	case "$CMD" in
+	--enable|-e)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
+		;;
+
+	--disable|-d)
+		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
+		;;
+
+	--module|-m)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
+		;;
+
+	--set-str)
+		# sed swallows one level of escaping, so we need double-escaping
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
+		shift
+		;;
+
+	--set-val)
+		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
+		shift
+		;;
+	--undefine|-u)
+		undef_var "${CONFIG_}$ARG"
+		;;
+
+	--state|-s)
+		if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
+			echo n
+		else
+			V="$(grep "^${CONFIG_}$ARG=" $FN)"
+			if [ $? != 0 ] ; then
+				echo undef
+			else
+				V="${V/#${CONFIG_}$ARG=/}"
+				V="${V/#\"/}"
+				V="${V/%\"/}"
+				V="${V//\\\"/\"}"
+				echo "${V}"
+			fi
+		fi
+		;;
+
+	--enable-after|-E)
+		set_var "${CONFIG_}$B" "${CONFIG_}$B=y" "${CONFIG_}$A"
+		;;
+
+	--disable-after|-D)
+		set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
+		;;
+
+	--module-after|-M)
+		set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
+		;;
+
+	--refresh)
+		yes "" | make oldconfig KCONFIG_CONFIG=$FN
+		;;
+
+	*)
+		echo "bad command: $CMD" >&2
+		usage
+		;;
+	esac
+done
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 00:55:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 00:55:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221333.1529595 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnneL-0006I7-9A; Thu, 05 Feb 2026 00:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221333.1529595; Thu, 05 Feb 2026 00: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 1vnneL-0006Hz-6S; Thu, 05 Feb 2026 00:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1221333;
 Thu, 05 Feb 2026 00: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 1vnneK-0006Hr-Jb
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 00: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 1vnneK-002owu-2r
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnneK-00HTic-1g
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00: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=iaiE8AU2aos39lh5wpMXRVIEwsKtQ0uEJ/eTp5KIW2k=; b=Ohn7fOg1PApUaeeadR1JGs/1bx
	WG55BjMQDb34xyBqhVo/I4VPDnHkOTfcb5dEfvcDswHCyCORQQKf3Sb2WUX8bESb2FAXx31HSVVKQ
	K0dFwodzRUTgvEVPvKap5YFJhdRk+MJTw9zTUV93AIihkrwXa+KnFMbVnu4TOQupuNBo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] scripts/config: drop modules support
Message-Id: <E1vnneK-00HTic-1g@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 00:55:12 +0000

commit 0081a505b3dc149a3e00c7406a29133157ad6f59
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:56 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:23 2026 -0800

    scripts/config: drop modules support
    
    Drop the --module (-m) and --module-after (-M) options, as Xen
    does not support loadable modules, so options are not applicable.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/xen/scripts/config b/xen/scripts/config
index ea475c07de..1050812aae 100755
--- a/xen/scripts/config
+++ b/xen/scripts/config
@@ -18,7 +18,6 @@ $myname options command ...
 commands:
 	--enable|-e option   Enable option
 	--disable|-d option  Disable option
-	--module|-m option   Turn option into a module
 	--set-str option string
 	                     Set option to "string"
 	--set-val option value
@@ -30,8 +29,6 @@ commands:
                              Enable option directly after other option
 	--disable-after|-D beforeopt option
                              Disable option directly after other option
-	--module-after|-M beforeopt option
-                             Turn option into module directly after other option
 	--refresh            Refresh the config using old settings
 
 	commands can be repeated multiple times
@@ -177,10 +174,6 @@ while [ "$1" != "" ] ; do
 		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
 		;;
 
-	--module|-m)
-		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=m"
-		;;
-
 	--set-str)
 		# sed swallows one level of escaping, so we need double-escaping
 		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=\"${1//\"/\\\\\"}\""
@@ -220,10 +213,6 @@ while [ "$1" != "" ] ; do
 		set_var "${CONFIG_}$B" "# ${CONFIG_}$B is not set" "${CONFIG_}$A"
 		;;
 
-	--module-after|-M)
-		set_var "${CONFIG_}$B" "${CONFIG_}$B=m" "${CONFIG_}$A"
-		;;
-
 	--refresh)
 		yes "" | make oldconfig KCONFIG_CONFIG=$FN
 		;;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 00:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 00:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221334.1529599 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnneV-0006Ke-Aa; Thu, 05 Feb 2026 00:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221334.1529599; Thu, 05 Feb 2026 00: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 1vnneV-0006KV-7t; Thu, 05 Feb 2026 00:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1221334;
 Thu, 05 Feb 2026 00: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 1vnneU-0006KL-Ly
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 00: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 1vnneU-002oxG-3B
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnneU-00HTiy-1x
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00: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=QacoAnjWVsbLcDpBc8fOMbhe2VnIKttJyqyh/fVWvI8=; b=qpfS8FaN1TlFKDULJB2slYwScq
	WDBwmQXPwPsouM4Wj0b61OS55k1Xrx1tJqO20MhvYw5rHF9cnvQTf5F2vcN87wXtZyayT+hr3ucMc
	55Dr2T9aHo2Rhm1fmvJ46XqNDb/DKn50E20Wx1gnvhv7YkT+EqanIgrLRdKJmFi58neQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] scripts/config: add -y|-n flags
Message-Id: <E1vnneU-00HTiy-1x@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 00:55:22 +0000

commit 74bcaa9283796b97922310258f2cf77c422d1992
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:57 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:42:23 2026 -0800

    scripts/config: add -y|-n flags
    
    Add alias -y ("yes") to --enable and -n ("no") to --disable a Kconfig
    option for better scripting experience.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 xen/scripts/config | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/scripts/config b/xen/scripts/config
index 1050812aae..1ede964320 100755
--- a/xen/scripts/config
+++ b/xen/scripts/config
@@ -16,8 +16,8 @@ Manipulate options in a .config file from the command line.
 Usage:
 $myname options command ...
 commands:
-	--enable|-e option   Enable option
-	--disable|-d option  Disable option
+	--enable|-e|-y|--yes    option   Enable option
+	--disable|-d|-n|--no    option   Disable option
 	--set-str option string
 	                     Set option to "string"
 	--set-val option value
@@ -166,11 +166,11 @@ while [ "$1" != "" ] ; do
 		;;
 	esac
 	case "$CMD" in
-	--enable|-e)
+	--enable|-e|-y|--yes)
 		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=y"
 		;;
 
-	--disable|-d)
+	--disable|-d|-n|--no)
 		set_var "${CONFIG_}$ARG" "# ${CONFIG_}$ARG is not set"
 		;;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 00:55:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 00:55:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221335.1529603 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnnef-0006NA-Bl; Thu, 05 Feb 2026 00:55:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221335.1529603; Thu, 05 Feb 2026 00: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 1vnnef-0006N2-9F; Thu, 05 Feb 2026 00:55:33 +0000
Received: by outflank-mailman (input) for mailman id 1221335;
 Thu, 05 Feb 2026 00: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 1vnnee-0006Mw-PJ
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 00: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 1vnnef-002oxO-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnnee-00HTjT-2H
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 00: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=nUTIn96PgQIu6DVH5jVl/CXu4I6khKSlJAG0B4JObwo=; b=HBbbHWwTq66OK+xpnb0Ly9h/83
	oGkNk6YNP2xab/KIVJlc9QG1ge/StBcyxcrPPnbuZEJaVjCW8XrwYmsJTMYejdkgWV5XZFjfIcF1A
	4AfRT9VWgSlovfjmHGEh9/JmiOEv0NZ0AUtqrhuXT0Q4rQjj736tVGspTI/sV/KgvQCE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] scripts/config: hook to automation build script
Message-Id: <E1vnnee-00HTjT-2H@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 00:55:32 +0000

commit 032ac14b05268cfdc136b8b60779bc0d7344ace2
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Jan 15 20:34:58 2026 -0800
Commit:     Stefano Stabellini <stefano.stabellini@amd.com>
CommitDate: Wed Feb 4 15:44:06 2026 -0800

    scripts/config: hook to automation build script
    
    Use the new .config manipulation tool to toggle CONFIG_DEBUG in the
    Xen automation build script.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/automation/scripts/build b/automation/scripts/build
index 7a81d229de..359ee18444 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -27,7 +27,8 @@ else
     # Start off with arch's defconfig
     make -C xen defconfig
 
-    echo "CONFIG_DEBUG=${debug}" >> xen/.config
+    debug="${debug:-n}"
+    xen/scripts/config --file xen/.config -${debug} DEBUG
 
     if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then
         echo "${EXTRA_XEN_CONFIG}" >> xen/.config
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 08:00:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 08:00:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221542.1529738 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnuHT-0004Hd-3L; Thu, 05 Feb 2026 08:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221542.1529738; Thu, 05 Feb 2026 08: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 1vnuHS-0004H4-Vn; Thu, 05 Feb 2026 08:00:02 +0000
Received: by outflank-mailman (input) for mailman id 1221542;
 Thu, 05 Feb 2026 08: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 1vnuHR-0003oS-Px
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 08: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 1vnuHS-00451C-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 08:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnuHR-000Fw9-2D
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 08: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=vbSt/+fR1wA2FbxMYX//oGdD5zbhy24vr3efpG/pjbY=; b=n00lrPmL3Qs2rAUly2vwWLPDHv
	TkGpNyeHrt1/GdIlocJBdkuvRvs0TdmO78I00kvw9zu3rtX48LgrsxqiHQOXO7qPK92G1p7HVkua4
	wvWTDbK0DVEY5tQp7eeZE9eJ0UnMfTv5VqguVDufD9OWjZ2SdGf1zxF8sbaALOcpuvP0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vnuHR-000Fw9-2D@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 08:00:01 +0000

commit cbb484d008e1c7982e0038b1331ff59f94201be5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 29 11:55:05 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 08:53:07 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index ec2d2dc537..72a6928624 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -144,6 +144,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -163,13 +166,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #if defined(CONFIG_ARM_64) || defined(CONFIG_MPU)
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index 91c405876b..402d06bdaa 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -57,6 +57,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -75,13 +78,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index a005d0247a..9e28c24954 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -273,13 +273,6 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
@@ -293,6 +286,9 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #else
 #define PGC_static     0
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 419fa17a43..06c20ab8de 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2efc11ce09..2ee249ac36 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -170,7 +170,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 08:00:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 08:00:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221551.1529741 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnuHd-00056t-Ac; Thu, 05 Feb 2026 08:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221551.1529741; Thu, 05 Feb 2026 08: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 1vnuHd-00056l-7O; Thu, 05 Feb 2026 08:00:13 +0000
Received: by outflank-mailman (input) for mailman id 1221551;
 Thu, 05 Feb 2026 08:00: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 1vnuHb-00056b-SP
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 08: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 1vnuHc-0045Iy-0a
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 08:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnuHb-000FxR-2a
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 08: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=bUmEqTPh+CG0Cmhz+4uKG8MezJZ3GzAUDIQ9n3xmfIA=; b=DuUtpXvUiHXecJ6Gn3oVXMA+nK
	QGL4PmhTh6gy0G2BrNDJWrcshNO2CWBxLA8W+xEtO1pfBopncjZSP0JysmMll57aznEfBDSQJFOTQ
	Fj308pYwcUtP2i0Y8RWh4WV1soRC4NO4o/casQosKeKN6cIHuV85Xvqi2SEBGduuYXg4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vnuHb-000FxR-2a@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 08:00:11 +0000

commit 83a784a15b479827ad21a519b4b685b65ee6d781
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jan 12 16:18:59 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 08:53:07 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c     |  23 +++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  10 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 376351b528..163f7fc966 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -615,6 +615,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -676,6 +688,7 @@ static int domain_teardown(struct domain *d)
 
         /* Trivial teardown, not long-running enough to need a preemption check. */
         domain_llc_coloring_free(d);
+        domain_pending_scrub_free(d);
 
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
@@ -719,6 +732,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     XVFREE(d->console);
 
@@ -1678,6 +1692,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..9240a6005e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -159,6 +159,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -275,7 +342,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -286,6 +365,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j], true);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2ee249ac36..588b5b99cb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -792,7 +792,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 # define scrub_page_cold clear_page_cold
 #endif
 
-static void scrub_one_page(const struct page_info *pg, bool cold)
+void scrub_one_page(const struct page_info *pg, bool cold)
 {
     void *ptr;
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 426362adb2..d80bfba6d3 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -145,6 +145,16 @@ unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
 
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg, bool cold);
+
 int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 91d6a49daf..735d5b76b4 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -661,6 +661,11 @@ struct domain
 
     /* Pointer to console settings; NULL for system domains. */
     struct domain_console *console;
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 09:00:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 09:00:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221656.1529836 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnvDW-000050-IH; Thu, 05 Feb 2026 09:00:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221656.1529836; Thu, 05 Feb 2026 09: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 1vnvDW-0008WM-FJ; Thu, 05 Feb 2026 09:00:02 +0000
Received: by outflank-mailman (input) for mailman id 1221656;
 Thu, 05 Feb 2026 09: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 1vnvDV-0008JK-Kk
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 09: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 1vnvDV-0046RQ-2O
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnvDV-000JVg-1B
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09: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=mlF4hty1PzDqZ7TWUs2vCYJBXg3ueMj+OP+395PN100=; b=zU5iguRPNoCkWAGCD3iCmkPoO9
	hKaEjZE54P6/y/IacA++GKd4xdMsTVuy4AF1LjuCWQU0bw4tmD4k8FX0/f21KRbMRWr1pe4w9vs4a
	b+LYcTPsctZCWhEsd9nLF1/xst3gwqzCnaoNSgTNNffgoJ0ZkgVON6A29YKcGP4uwYXw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vnvDV-000JVg-1B@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 09:00:01 +0000

commit cbb484d008e1c7982e0038b1331ff59f94201be5
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Jan 29 11:55:05 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 08:53:07 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index ec2d2dc537..72a6928624 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -144,6 +144,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -163,13 +166,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #if defined(CONFIG_ARM_64) || defined(CONFIG_MPU)
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index 91c405876b..402d06bdaa 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -57,6 +57,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -75,13 +78,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index a005d0247a..9e28c24954 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -273,13 +273,6 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
@@ -293,6 +286,9 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #else
 #define PGC_static     0
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 419fa17a43..06c20ab8de 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2efc11ce09..2ee249ac36 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -170,7 +170,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 09:00:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 09:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221658.1529840 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnvDg-0000n6-JE; Thu, 05 Feb 2026 09:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221658.1529840; Thu, 05 Feb 2026 09: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 1vnvDg-0000my-Gj; Thu, 05 Feb 2026 09:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1221658;
 Thu, 05 Feb 2026 09:00: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 1vnvDf-0000mm-HZ
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 09: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 1vnvDf-0046Ta-2i
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnvDf-000JX0-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09: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=h9HdEWsCP3pwUrxUVugkIdYrAhqs2u96uPRMW5HxoF0=; b=tgVD6iYgoenJgA6HIbJL48oJ+w
	/EWyLtA2v/nkziSbvqcHWJy8Zkp8hRuJVx7aTY5ydUnPI7dlfjlPFWZCC5q7FDuWgXLDC7/wGpfZn
	ZLZSb4bhvltc50CnpMm32fhpZLZ265mzR4/yMwqObX8wG/wbIrAfi2absKwtINamtxx4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vnvDf-000JX0-1V@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 09:00:11 +0000

commit 83a784a15b479827ad21a519b4b685b65ee6d781
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jan 12 16:18:59 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 08:53:07 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c     |  23 +++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  10 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 376351b528..163f7fc966 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -615,6 +615,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -676,6 +688,7 @@ static int domain_teardown(struct domain *d)
 
         /* Trivial teardown, not long-running enough to need a preemption check. */
         domain_llc_coloring_free(d);
+        domain_pending_scrub_free(d);
 
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
@@ -719,6 +732,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     XVFREE(d->console);
 
@@ -1678,6 +1692,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..9240a6005e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -159,6 +159,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -275,7 +342,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -286,6 +365,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j], true);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2ee249ac36..588b5b99cb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -792,7 +792,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 # define scrub_page_cold clear_page_cold
 #endif
 
-static void scrub_one_page(const struct page_info *pg, bool cold)
+void scrub_one_page(const struct page_info *pg, bool cold)
 {
     void *ptr;
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 426362adb2..d80bfba6d3 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -145,6 +145,16 @@ unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
 
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg, bool cold);
+
 int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 91d6a49daf..735d5b76b4 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -661,6 +661,11 @@ struct domain
 
     /* Pointer to console settings; NULL for system domains. */
     struct domain_console *console;
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 09:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 09:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221665.1529855 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnvOB-0002ZR-MK; Thu, 05 Feb 2026 09:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221665.1529855; Thu, 05 Feb 2026 09: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 1vnvOB-0002ZJ-If; Thu, 05 Feb 2026 09:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1221665;
 Thu, 05 Feb 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 1vnvO9-0002Xc-Pn
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 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 1vnvOA-0046eT-01
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnvO9-000KGl-22
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 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=poRjFURPDOnkQe/pyzbwoG6e5d+DR/XKhbcpOabBK+k=; b=b3L0YECYawWWLGGc0OGpzgGYe2
	y0SzeJ58lfYxcfcTtLQ/AB33mCUF8CnbhSsuS4nk5SnrQ+P1Swqhvmm4tQ2zyDzoqr+/B0bmPRyd8
	UriNMyWKWN2RrZK/RnLabC2UgX9mvy5XaA5khHTqQnmCJv8JwuBYo+yhRics8I7twAi0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Kconfig: Fix XEN_START_ADDRESS input prompt
Message-Id: <E1vnvO9-000KGl-22@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 09:11:01 +0000

commit 8380a6923919d0d8371eb0d47e650c7844ec9fb9
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Jan 27 14:19:22 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Feb 5 09:33:42 2026 +0100

    xen/arm: Kconfig: Fix XEN_START_ADDRESS input prompt
    
    Remove the part about platform defined address which is not true. The
    help text is correct i.e. 0xFFFFFFFF is used as default value to indicate
    that user has not customized this address.
    
    Amends: d736b6eb451b ("xen/arm: mpu: Define Xen start address for MPU systems")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 442d353b43..2f2b501fda 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -28,7 +28,7 @@ config ARCH_DEFCONFIG
 	default "arch/arm/configs/arm64_defconfig" if ARM_64
 
 config XEN_START_ADDRESS
-	hex "Xen start address: keep default to use platform defined address"
+	hex "Xen start address"
 	default 0xFFFFFFFF
 	depends on MPU
 	help
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 09:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 09:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221669.1529858 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnvOL-0002jc-Mq; Thu, 05 Feb 2026 09:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221669.1529858; Thu, 05 Feb 2026 09: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 1vnvOL-0002jS-Ju; Thu, 05 Feb 2026 09:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1221669;
 Thu, 05 Feb 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 1vnvOJ-0002fB-Ps
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 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 1vnvOK-0046ee-0I
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 09:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnvOJ-000KHR-2K
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 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=16G+7kLbnE7FJAgjJz5vufnD8ovDUEEYuq+jVX173d8=; b=5oDnXdU/tBaBwxm7MjCiCTw1RK
	D+NZMBMWyyBffaqZi0aJBJ6/2JPX3Et62K/5KOljtV6koQJnXSj8QBiM2CZrCH/Z1qXZOY7UAqwc0
	DRYv4IWu+RAI1j1IuGQF55r352MxUCSwaZr8fihgIM0L6aeZxxEgdxly3xysQCCmazK0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] static-memory: Fix incorrect tot_size calculation
Message-Id: <E1vnvOJ-000KHR-2K@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 09:11:11 +0000

commit d6a6ea77e1cf50b200ea54f28a852a9492c4206d
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Feb 4 13:42:35 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Feb 5 09:34:53 2026 +0100

    static-memory: Fix incorrect tot_size calculation
    
    When a physical memory bank spans multiple guest RAM banks, the variable
    psize is modified inside the allocation loop, but the modified value
    (instead of the original bank size) is added to tot_size. This causes an
    incorrect total size calculation leading to false panic. Move the
    tot_size calculation right after acquire_static_memory_bank().
    
    Fixes: 487975df53b5 ("xen/arm: introduce allocate_static_memory")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/static-memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/static-memory.c b/xen/common/device-tree/static-memory.c
index 0774d06806..ffbc12aa24 100644
--- a/xen/common/device-tree/static-memory.c
+++ b/xen/common/device-tree/static-memory.c
@@ -118,6 +118,8 @@ void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
         if ( mfn_eq(smfn, INVALID_MFN) )
             goto fail;
 
+        tot_size += psize;
+
         printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
                d, bank, pbase, pbase + psize);
 
@@ -158,8 +160,6 @@ void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
                 mem->bank[gbank].start = rambase[gbank];
             }
         }
-
-        tot_size += psize;
     }
 
     mem->nr_banks = ++gbank;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 10:44:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 10:44:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221733.1529882 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnwqB-0006Bt-Be; Thu, 05 Feb 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 1221733.1529882; Thu, 05 Feb 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 1vnwqB-0006Bl-8x; Thu, 05 Feb 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1221733;
 Thu, 05 Feb 2026 10: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 1vnwqA-0006Bf-Ck
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 10: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 1vnwqA-0048Wq-1S
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnwqA-000PoX-0C
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 10: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=7EIrPedUVyWWSXW+zvh/o93whO12wvoLmDPFhA2bKvc=; b=FeFl1Af7cBf/Ueyh9tw9uN8eRC
	SznjogxAlrpbOG9T4kHOASSTm5RrndISIghJ813amwzULwwFGan9U54Qm5ubGvth/FlfalldrMsb+
	GwH2QxtxyQOM53EkWXeYmUem1mIpL16Y0qLua5Y5xpYYfe4eIH8ttgsOdgcIp95r5dc8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Kconfig: Fix XEN_START_ADDRESS input prompt
Message-Id: <E1vnwqA-000PoX-0C@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 10:44:02 +0000

commit 8380a6923919d0d8371eb0d47e650c7844ec9fb9
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Tue Jan 27 14:19:22 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Feb 5 09:33:42 2026 +0100

    xen/arm: Kconfig: Fix XEN_START_ADDRESS input prompt
    
    Remove the part about platform defined address which is not true. The
    help text is correct i.e. 0xFFFFFFFF is used as default value to indicate
    that user has not customized this address.
    
    Amends: d736b6eb451b ("xen/arm: mpu: Define Xen start address for MPU systems")
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 442d353b43..2f2b501fda 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -28,7 +28,7 @@ config ARCH_DEFCONFIG
 	default "arch/arm/configs/arm64_defconfig" if ARM_64
 
 config XEN_START_ADDRESS
-	hex "Xen start address: keep default to use platform defined address"
+	hex "Xen start address"
 	default 0xFFFFFFFF
 	depends on MPU
 	help
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221734.1529886 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnwqL-0006Dv-EH; Thu, 05 Feb 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 1221734.1529886; Thu, 05 Feb 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 1vnwqL-0006Dn-Bb; Thu, 05 Feb 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1221734;
 Thu, 05 Feb 2026 10: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 1vnwqK-0006Dd-7Z
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 10: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 1vnwqK-0048Wu-1k
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnwqK-000Pq3-0W
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 10: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=GHdlsufmtiPU2Rj8OaY7CZj5ToUsvjnlCzJyWQ/+6vE=; b=KBAXMjtppS4Kh4wR6Mv4u4MzHG
	PItIaU50mF0Ozvm1Pt5PfZuujXkU75GkQXb2LU7SrF8ETS4cG1IvJ306mZ0ebMoIDaejMfXUUFxIw
	jJJi2Ixg6K1vGoTgwjwQXMhg5mdzooQbvCxR5eZwNQP2iPdMv2JULi1qW1uVHbJGm11A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] static-memory: Fix incorrect tot_size calculation
Message-Id: <E1vnwqK-000Pq3-0W@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 10:44:12 +0000

commit d6a6ea77e1cf50b200ea54f28a852a9492c4206d
Author:     Michal Orzel <michal.orzel@amd.com>
AuthorDate: Wed Feb 4 13:42:35 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Thu Feb 5 09:34:53 2026 +0100

    static-memory: Fix incorrect tot_size calculation
    
    When a physical memory bank spans multiple guest RAM banks, the variable
    psize is modified inside the allocation loop, but the modified value
    (instead of the original bank size) is added to tot_size. This causes an
    incorrect total size calculation leading to false panic. Move the
    tot_size calculation right after acquire_static_memory_bank().
    
    Fixes: 487975df53b5 ("xen/arm: introduce allocate_static_memory")
    Signed-off-by: Michal Orzel <michal.orzel@amd.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/common/device-tree/static-memory.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/device-tree/static-memory.c b/xen/common/device-tree/static-memory.c
index 0774d06806..ffbc12aa24 100644
--- a/xen/common/device-tree/static-memory.c
+++ b/xen/common/device-tree/static-memory.c
@@ -118,6 +118,8 @@ void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
         if ( mfn_eq(smfn, INVALID_MFN) )
             goto fail;
 
+        tot_size += psize;
+
         printk(XENLOG_INFO "%pd: STATIC BANK[%u] %#"PRIpaddr"-%#"PRIpaddr"\n",
                d, bank, pbase, pbase + psize);
 
@@ -158,8 +160,6 @@ void __init allocate_static_memory(struct domain *d, struct kernel_info *kinfo,
                 mem->bank[gbank].start = rambase[gbank];
             }
         }
-
-        tot_size += psize;
     }
 
     mem->nr_banks = ++gbank;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 11:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 11:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221764.1529890 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnxba-0003Vl-My; Thu, 05 Feb 2026 11:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221764.1529890; Thu, 05 Feb 2026 11: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 1vnxba-0003Vd-K8; Thu, 05 Feb 2026 11:33:02 +0000
Received: by outflank-mailman (input) for mailman id 1221764;
 Thu, 05 Feb 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 1vnxba-0003VX-3z
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 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 1vnxba-0049RO-18
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnxbZ-000Saf-36
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11: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=YZqEg7cfMocs5iPWbQLI1bC5Dq+UaT1rPTgJ0/jEzUU=; b=eTKGoiszFxo9/H0DWFk5O4JXUs
	Kw9ge72DKOGBCkI8c5aDJ2moaFp5Mj/b1jKWes17l6qczPwkQoFHeJsrn+xx/b0L8B5XJtxgGlgd4
	i364efjbCyYtAhcc35mWP6HPpfSTwr990po902kVSsQX2G5qLr82Up6hMKbGixHfS1Pg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: make VMTRACE support optional
Message-Id: <E1vnxbZ-000Saf-36@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 11:33:01 +0000

commit 4202f7d0cd01370d0070f78aef1e47cbb3fcce39
Author:     Grygorii Strashko <grygorii_strashko@epam.com>
AuthorDate: Thu Feb 5 10:26:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:26:45 2026 +0100

    xen: make VMTRACE support optional
    
    The VMTRACE feature is depends on Platform/Arch HW and code support and now
    can be used only on x86 HVM with Intel VT-x (INTEL_VMX) enabled.
    This makes VMTRACE support optional by introducing HVM Kconfig option:
    - CONFIG_VMTRACE to enable/disable the feature.
    
    Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/domctl.c                   |  4 ++++
 xen/arch/x86/hvm/Kconfig                | 12 ++++++++++++
 xen/arch/x86/hvm/vmx/vmcs.c             |  2 ++
 xen/arch/x86/hvm/vmx/vmx.c              | 11 +++++++++++
 xen/arch/x86/include/asm/guest-msr.h    |  2 ++
 xen/arch/x86/include/asm/hvm/hvm.h      | 34 ++++++++++++---------------------
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  2 ++
 xen/arch/x86/mm/mem_sharing.c           |  2 ++
 xen/arch/x86/vm_event.c                 |  8 +++++---
 xen/common/domain.c                     | 10 ++++++++++
 xen/common/memory.c                     |  6 ++++++
 xen/common/vm_event.c                   |  3 ++-
 xen/include/xen/domain.h                |  4 ++++
 xen/include/xen/sched.h                 |  4 ++++
 14 files changed, 78 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 6153e3c07e..d9521808dc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -154,6 +154,7 @@ void arch_get_domain_info(const struct domain *d,
 static int do_vmtrace_op(struct domain *d, struct xen_domctl_vmtrace_op *op,
                          XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
+#ifdef CONFIG_VMTRACE
     struct vcpu *v;
     int rc;
 
@@ -198,6 +199,9 @@ static int do_vmtrace_op(struct domain *d, struct xen_domctl_vmtrace_op *op,
     vcpu_unpause(v);
 
     return rc;
+#else
+    return -EOPNOTSUPP;
+#endif
 }
 
 #define MAX_IOPORTS 0x10000
diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index 25eb3e374f..f32bf5cbb7 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -34,6 +34,18 @@ config INTEL_VMX
 	  If your system includes a processor with Intel VT-x support, say Y.
 	  If in doubt, say Y.
 
+config VMTRACE
+	bool "HW VM tracing support"
+	depends on INTEL_VMX
+	default y
+	help
+	  Enables HW VM tracing support which allows to configure HW processor
+	  features (vmtrace_op) to enable capturing information about software
+	  execution using dedicated hardware facilities with minimal interference
+	  to the software being traced. The trace data can be retrieved using buffer
+	  shared between Xen and domain
+	  (see XENMEM_acquire_resource(XENMEM_resource_vmtrace_buf)).
+
 config HVM_FEP
 	bool "HVM Forced Emulation Prefix support (UNSUPPORTED)" if UNSUPPORTED
 	default DEBUG
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d610988bf9..c2e7f9aed3 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -306,6 +306,7 @@ static int vmx_init_vmcs_config(bool bsp)
 
     rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
 
+#ifdef CONFIG_VMTRACE
     /* Check whether IPT is supported in VMX operation. */
     if ( bsp )
         vmtrace_available = cpu_has_proc_trace &&
@@ -317,6 +318,7 @@ static int vmx_init_vmcs_config(bool bsp)
                smp_processor_id());
         return -EINVAL;
     }
+#endif
 
     if ( caps.cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
     {
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 40e4c71244..82c55f49ae 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -622,6 +622,7 @@ static void cf_check domain_creation_finished(struct domain *d)
 
 static void vmx_init_ipt(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     unsigned int size = v->domain->vmtrace_size;
 
     if ( !size )
@@ -632,6 +633,7 @@ static void vmx_init_ipt(struct vcpu *v)
     ASSERT(size >= PAGE_SIZE && (size & (size - 1)) == 0);
 
     v->arch.msrs->rtit.output_limit = size - 1;
+#endif
 }
 
 static int cf_check vmx_vcpu_initialise(struct vcpu *v)
@@ -723,11 +725,13 @@ static void vmx_save_guest_msrs(struct vcpu *v)
      */
     v->arch.hvm.vmx.shadow_gs = read_gs_shadow();
 
+#ifdef CONFIG_VMTRACE
     if ( v->arch.hvm.vmx.ipt_active )
     {
         rdmsrl(MSR_RTIT_OUTPUT_MASK, msrs->rtit.output_mask);
         rdmsrl(MSR_RTIT_STATUS, msrs->rtit.status);
     }
+#endif
 
     if ( cp->feat.pks )
         msrs->pkrs = rdpkrs_and_cache();
@@ -746,12 +750,14 @@ static void vmx_restore_guest_msrs(struct vcpu *v)
     if ( cpu_has_msr_tsc_aux )
         wrmsr_tsc_aux(msrs->tsc_aux);
 
+#ifdef CONFIG_VMTRACE
     if ( v->arch.hvm.vmx.ipt_active )
     {
         wrmsrl(MSR_RTIT_OUTPUT_BASE, page_to_maddr(v->vmtrace.pg));
         wrmsrl(MSR_RTIT_OUTPUT_MASK, msrs->rtit.output_mask);
         wrmsrl(MSR_RTIT_STATUS, msrs->rtit.status);
     }
+#endif
 
     if ( cp->feat.pks )
         wrpkrs(msrs->pkrs);
@@ -2629,6 +2635,7 @@ static bool cf_check vmx_get_pending_event(
     return true;
 }
 
+#ifdef CONFIG_VMTRACE
 /*
  * We only let vmtrace agents see and modify a subset of bits in MSR_RTIT_CTL.
  * These all pertain to data-emitted into the trace buffer(s).  Must not
@@ -2771,6 +2778,7 @@ static int cf_check vmtrace_reset(struct vcpu *v)
     v->arch.msrs->rtit.status = 0;
     return 0;
 }
+#endif
 
 static uint64_t cf_check vmx_get_reg(struct vcpu *v, unsigned int reg)
 {
@@ -2945,11 +2953,14 @@ static struct hvm_function_table __initdata_cf_clobber vmx_function_table = {
     .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
     .altp2m_vcpu_emulate_vmfunc = vmx_vcpu_emulate_vmfunc,
 #endif
+
+#ifdef CONFIG_VMTRACE
     .vmtrace_control = vmtrace_control,
     .vmtrace_output_position = vmtrace_output_position,
     .vmtrace_set_option = vmtrace_set_option,
     .vmtrace_get_option = vmtrace_get_option,
     .vmtrace_reset = vmtrace_reset,
+#endif
 
     .get_reg = vmx_get_reg,
     .set_reg = vmx_set_reg,
diff --git a/xen/arch/x86/include/asm/guest-msr.h b/xen/arch/x86/include/asm/guest-msr.h
index 5f0cb0a939..702f47fe1e 100644
--- a/xen/arch/x86/include/asm/guest-msr.h
+++ b/xen/arch/x86/include/asm/guest-msr.h
@@ -50,6 +50,7 @@ struct vcpu_msrs
         };
     } misc_features_enables;
 
+#ifdef CONFIG_VMTRACE
     /*
      * 0x00000560 ... 57x - MSR_RTIT_*
      *
@@ -81,6 +82,7 @@ struct vcpu_msrs
             };
         };
     } rtit;
+#endif
 
     /*
      * 0x000006e1 - MSR_PKRS - Protection Key Supervisor.
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index af042ae858..7d9774df59 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -236,12 +236,14 @@ struct hvm_function_table {
     int (*altp2m_vcpu_emulate_vmfunc)(const struct cpu_user_regs *regs);
 #endif
 
+#ifdef CONFIG_VMTRACE
     /* vmtrace */
     int (*vmtrace_control)(struct vcpu *v, bool enable, bool reset);
     int (*vmtrace_output_position)(struct vcpu *v, uint64_t *pos);
     int (*vmtrace_set_option)(struct vcpu *v, uint64_t key, uint64_t value);
     int (*vmtrace_get_option)(struct vcpu *v, uint64_t key, uint64_t *value);
     int (*vmtrace_reset)(struct vcpu *v);
+#endif
 
     uint64_t (*get_reg)(struct vcpu *v, unsigned int reg);
     void (*set_reg)(struct vcpu *v, unsigned int reg, uint64_t val);
@@ -741,6 +743,7 @@ static inline bool altp2m_vcpu_emulate_ve(struct vcpu *v)
 bool altp2m_vcpu_emulate_ve(struct vcpu *v);
 #endif /* CONFIG_ALTP2M */
 
+#ifdef CONFIG_VMTRACE
 static inline int hvm_vmtrace_control(struct vcpu *v, bool enable, bool reset)
 {
     if ( hvm_funcs.vmtrace_control )
@@ -775,11 +778,20 @@ static inline int hvm_vmtrace_get_option(
 
     return -EOPNOTSUPP;
 }
+#else
+/*
+ * Function declaration(s) here are used without definition(s) to make compiler
+ * happy when VMTRACE=n, compiler DCE will eliminate unused code.
+ */
+int hvm_vmtrace_output_position(struct vcpu *v, uint64_t *pos);
+#endif
 
 static inline int hvm_vmtrace_reset(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     if ( hvm_funcs.vmtrace_reset )
         return alternative_call(hvm_funcs.vmtrace_reset, v);
+#endif
 
     return -EOPNOTSUPP;
 }
@@ -937,28 +949,6 @@ static inline bool hvm_has_set_descriptor_access_exiting(void)
     return false;
 }
 
-static inline int hvm_vmtrace_control(struct vcpu *v, bool enable, bool reset)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_output_position(struct vcpu *v, uint64_t *pos)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_set_option(
-    struct vcpu *v, uint64_t key, uint64_t value)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_get_option(
-    struct vcpu *v, uint64_t key, uint64_t *value)
-{
-    return -EOPNOTSUPP;
-}
-
 static inline uint64_t hvm_get_reg(struct vcpu *v, unsigned int reg)
 {
     ASSERT_UNREACHABLE();
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index 8ff7c8045f..879ec10cef 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -154,8 +154,10 @@ struct vmx_vcpu {
     /* Do we need to tolerate a spurious EPT_MISCONFIG VM exit? */
     bool                 ept_spurious_misconfig;
 
+#ifdef CONFIG_VMTRACE
     /* Processor Trace configured and enabled for the vcpu. */
     bool                 ipt_active;
+#endif
 
     /* Is the guest in real mode? */
     uint8_t              vmx_realmode;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index b5a259af1d..5c7a0ff30e 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1891,7 +1891,9 @@ static int fork(struct domain *cd, struct domain *d)
         domain_pause(d);
         cd->max_pages = d->max_pages;
         *cd->arch.cpu_policy = *d->arch.cpu_policy;
+#ifdef CONFIG_VMTRACE
         cd->vmtrace_size = d->vmtrace_size;
+#endif
         cd->parent = d;
     }
 
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index fc349270b9..112d2ef66d 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -253,7 +253,9 @@ void vm_event_fill_regs(vm_event_request_t *req)
     req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
     req->data.regs.x86.dr6 = ctxt.dr6;
 
-    if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
+    if ( IS_ENABLED(CONFIG_VMTRACE) &&
+         hvm_vmtrace_output_position(curr,
+                                     &req->data.regs.x86.vmtrace_pos) != 1 )
         req->data.regs.x86.vmtrace_pos = ~0;
 #endif
 }
@@ -303,12 +305,12 @@ void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
 #endif
 }
 
+#ifdef CONFIG_VMTRACE
 void vm_event_reset_vmtrace(struct vcpu *v)
 {
-#ifdef CONFIG_HVM
     hvm_vmtrace_reset(v);
-#endif
 }
+#endif
 
 /*
  * Local variables:
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 163f7fc966..3fd907e274 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -135,7 +135,9 @@ struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
 vcpu_info_t dummy_vcpu_info;
 
+#ifdef CONFIG_VMTRACE
 bool __read_mostly vmtrace_available;
+#endif
 
 bool __read_mostly vpmu_is_available;
 
@@ -358,6 +360,7 @@ static void free_vcpu_struct(struct vcpu *v)
 
 static void vmtrace_free_buffer(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     const struct domain *d = v->domain;
     struct page_info *pg = v->vmtrace.pg;
     unsigned int i;
@@ -372,10 +375,12 @@ static void vmtrace_free_buffer(struct vcpu *v)
         put_page_alloc_ref(&pg[i]);
         put_page_and_type(&pg[i]);
     }
+#endif
 }
 
 static int vmtrace_alloc_buffer(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     struct domain *d = v->domain;
     struct page_info *pg;
     unsigned int i;
@@ -417,6 +422,9 @@ static int vmtrace_alloc_buffer(struct vcpu *v)
     }
 
     return -ENODATA;
+#else
+    return 0;
+#endif
 }
 
 /*
@@ -884,7 +892,9 @@ struct domain *domain_create(domid_t domid,
         ASSERT(!config->altp2m.nr);
 #endif
 
+#ifdef CONFIG_VMTRACE
         d->vmtrace_size = config->vmtrace_size;
+#endif
     }
 
     /* Sort out our idea of is_control_domain(). */
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9240a6005e..918510f287 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1259,8 +1259,10 @@ static unsigned int resource_max_frames(const struct domain *d,
     case XENMEM_resource_ioreq_server:
         return ioreq_server_max_frames(d);
 
+#ifdef CONFIG_VMTRACE
     case XENMEM_resource_vmtrace_buf:
         return d->vmtrace_size >> PAGE_SHIFT;
+#endif
 
     default:
         return 0;
@@ -1302,6 +1304,7 @@ static int acquire_ioreq_server(struct domain *d,
 #endif
 }
 
+#ifdef CONFIG_VMTRACE
 static int acquire_vmtrace_buf(
     struct domain *d, unsigned int id, unsigned int frame,
     unsigned int nr_frames, xen_pfn_t mfn_list[])
@@ -1324,6 +1327,7 @@ static int acquire_vmtrace_buf(
 
     return nr_frames;
 }
+#endif
 
 /*
  * Returns -errno on error, or positive in the range [1, nr_frames] on
@@ -1342,8 +1346,10 @@ static int _acquire_resource(
     case XENMEM_resource_ioreq_server:
         return acquire_ioreq_server(d, id, frame, nr_frames, mfn_list);
 
+#ifdef CONFIG_VMTRACE
     case XENMEM_resource_vmtrace_buf:
         return acquire_vmtrace_buf(d, id, frame, nr_frames, mfn_list);
+#endif
 
     default:
         ASSERT_UNREACHABLE();
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index b2787c0108..cf0258223f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -441,7 +441,8 @@ static int vm_event_resume(struct domain *d, struct vm_event_domain *ved)
             if ( rsp.flags & VM_EVENT_FLAG_GET_NEXT_INTERRUPT )
                 vm_event_monitor_next_interrupt(v);
 
-            if ( rsp.flags & VM_EVENT_FLAG_RESET_VMTRACE )
+            if ( IS_ENABLED(CONFIG_VMTRACE) &&
+                 (rsp.flags & VM_EVENT_FLAG_RESET_VMTRACE) )
                 vm_event_reset_vmtrace(v);
 
             if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 273717c31b..627ca0e071 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -183,7 +183,11 @@ void vnuma_destroy(struct vnuma_info *vnuma);
 static inline void vnuma_destroy(struct vnuma_info *vnuma) { ASSERT(!vnuma); }
 #endif
 
+#ifdef CONFIG_VMTRACE
 extern bool vmtrace_available;
+#else
+#define vmtrace_available false
+#endif
 
 extern bool vpmu_is_available;
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 735d5b76b4..1268632344 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -300,9 +300,11 @@ struct vcpu
     /* vPCI per-vCPU area, used to store data for long running operations. */
     struct vpci_vcpu vpci;
 
+#ifdef CONFIG_VMTRACE
     struct {
         struct page_info *pg; /* One contiguous allocation of d->vmtrace_size */
     } vmtrace;
+#endif
 
     struct arch_vcpu arch;
 
@@ -626,7 +628,9 @@ struct domain
     unsigned int nr_altp2m;    /* Number of altp2m tables. */
 #endif
 
+#ifdef CONFIG_VMTRACE
     unsigned int vmtrace_size; /* Buffer size in bytes, or 0 to disable. */
+#endif
 
 #ifdef CONFIG_ARGO
     /* Argo interdomain communication support */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 11:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 11:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221765.1529894 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnxbk-0003Xk-O7; Thu, 05 Feb 2026 11:33:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221765.1529894; Thu, 05 Feb 2026 11: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 1vnxbk-0003Xc-Lc; Thu, 05 Feb 2026 11:33:12 +0000
Received: by outflank-mailman (input) for mailman id 1221765;
 Thu, 05 Feb 2026 11: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 1vnxbk-0003XR-4e
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 11: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 1vnxbk-0049RZ-1S
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnxbk-000Sbk-0D
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11: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=WIqfJrh/EzR0cmj82kxt95Oa9o2kJsFoBrn8aJ9ioII=; b=4ohetZoKxrM7G8O/chO148yOGf
	Ut6rb0YJ9lDPd0uHnMgCvwDDH7+wsn8zNEUEIpGUcyoWpudFY0qF2TC2dbHw0BIE8warkRRcudFh1
	1F2LtEkLLbVeePkHUQBOb79Apt9UPHuMfyWB5v584BKIUZ0yP15SnFr28nuKLJ+9qOwE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] build: avoid Paths.mk in hypervisor build
Message-Id: <E1vnxbk-000Sbk-0D@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 11:33:12 +0000

commit 204f44257731a33083820a97de44fb330316a04f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:27:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:27:17 2026 +0100

    build: avoid Paths.mk in hypervisor build
    
    Its inclusion placed where it is, it affects the hypervisor build as well.
    The hypervisor build, in its _install rule, uses $(DEBUG_DIR), first in
    
            [ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
    
    $(D) is an absolute directory (shorthand for $(DESTDIR)). $(DEBUG_DIR) as
    set by Paths.mk is, too. Both point into the build tree. The two simply
    shouldn't be glued together.
    
    Note that the earlier
    
            [ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR)
    
    continues to be working fine, as BOOT_DIR continues to be controlled by
    config/StdGNU.mk. Its DEBUG_DIR isn't taking effect anymore, when for the
    hypervisor build it should.
    
    And of course behavior now differs between building xen/ in a tree where
    tools/ was built before vs in an otherwise clean tree.
    
    Fixes: 82b9cc04a7c7 ("build: add make macro for making file from file.in")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 Config.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Config.mk b/Config.mk
index a3e219a0b8..fdc0245079 100644
--- a/Config.mk
+++ b/Config.mk
@@ -162,7 +162,9 @@ endef
 PATH_FILES := Paths.mk
 INC_FILES = $(foreach f, $(PATH_FILES), $(XEN_ROOT)/config/$(f))
 
+ifndef XEN_FULLVERSION
 -include $(INC_FILES)
+endif
 
 BUILD_MAKE_VARS = $(foreach f, $(PATH_FILES), $(shell awk '$$2 == ":=" { print $$1; }' $(XEN_ROOT)/config/$(f).in))
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 11:33:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 11:33:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221766.1529898 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnxbu-0003a5-Pf; Thu, 05 Feb 2026 11:33:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221766.1529898; Thu, 05 Feb 2026 11:33: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 1vnxbu-0003Zx-N6; Thu, 05 Feb 2026 11:33:22 +0000
Received: by outflank-mailman (input) for mailman id 1221766;
 Thu, 05 Feb 2026 11: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 1vnxbu-0003Zp-7o
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 11: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 1vnxbu-0049Rd-1l
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnxbu-000ScV-0X
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11: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=sVzQopl94ujsSRbKwCBdqoUjD++VHYeZZ55plCm554o=; b=sbGj6Sa3OwR7B1rRDKFLSq1NZB
	TxUAPc2Ef1Wilb7tLsnTa6WPQElZqgtDdu4W7954MQgK+BUX/KuYsMe7Y609rX8hmbgtt/2HPSzR+
	h/acFsSVyuCVEPYqexOQ08GrBH4E5q6MdL1QpWmXsSyqFxAHuYBAXMzxi+UZor27cRYQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] MAINTAINERS: Add Jens as arm TEE reviewer
Message-Id: <E1vnxbu-000ScV-0X@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 11:33:22 +0000

commit b2937439c5ef697a33d544b276cddcf82e304539
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Thu Feb 5 10:28:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:28:50 2026 +0100

    MAINTAINERS: Add Jens as arm TEE reviewer
    
    Add Jens as arm TEE reviewers so that he is informed of changes in FF-A
    or OPTEE changes in Xen and can review them.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0ceb4bba21..ccc25a0e55 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -547,6 +547,7 @@ F:	stubdom/
 TEE MEDIATORS
 M:	Volodymyr Babchuk <volodymyr_babchuk@epam.com>
 M:	Bertrand Marquis <bertrand.marquis@arm.com>
+R:	Jens Wiklander <jens.wiklander@linaro.org>
 S:	Supported
 F:	xen/arch/arm/include/asm/tee/
 F:	xen/arch/arm/tee/
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 11:33:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 11:33:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221767.1529902 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnxc4-0003cE-R7; Thu, 05 Feb 2026 11:33:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221767.1529902; Thu, 05 Feb 2026 11:33: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 1vnxc4-0003c6-OV; Thu, 05 Feb 2026 11:33:32 +0000
Received: by outflank-mailman (input) for mailman id 1221767;
 Thu, 05 Feb 2026 11: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 1vnxc4-0003c0-BE
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 11: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 1vnxc4-0049S1-26
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnxc4-000SdC-0r
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11: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=EsbP0iWfNfwXVPp7Qm22AlqTh+720fslNp28bKJF7P4=; b=q5/CjyQ/jlOmrsmFRPDXK1JtSr
	hFTo05C1TJ4NOlA9V+oJvISVlwLXTGq+TbbO5Zxe61cpOdZnDCix61gj8FRqriiaYqFEA6gisAr8A
	R4iRd5WaQpuJkINp/wW4i9zyTxsSFBRSRVwHYAwl9gc9hTdRP4nBO2EsPFbQwaane/+Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/P2M: correct type use in p2m_put_gfn()
Message-Id: <E1vnxc4-000SdC-0r@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 11:33:32 +0000

commit 0b6bad1d8f3da7b81901f82ebad09bdb9ebe922b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:29:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:29:20 2026 +0100

    x86/P2M: correct type use in p2m_put_gfn()
    
    Everywhere else gfn_t are passed into respective GFN locking macros: Do so
    here as well.
    
    Amends: 819cdc5a7301 ("x86/p2m: re-arrange {,__}put_gfn()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/p2m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8d34357bcb..e915da26a8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -338,9 +338,9 @@ mfn_t p2m_get_gfn_type_access(struct p2m_domain *p2m, gfn_t gfn,
 
 void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
 {
-    ASSERT(gfn_locked_by_me(p2m, gfn_x(gfn)));
+    ASSERT(gfn_locked_by_me(p2m, gfn));
 
-    gfn_unlock(p2m, gfn_x(gfn), 0);
+    gfn_unlock(p2m, gfn, 0);
 }
 
 static struct page_info *get_page_from_mfn_and_type(
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 11:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 11:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221769.1529910 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnxcG-0003iO-5X; Thu, 05 Feb 2026 11:33:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221769.1529910; Thu, 05 Feb 2026 11: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 1vnxcG-0003i3-1x; Thu, 05 Feb 2026 11:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1221769;
 Thu, 05 Feb 2026 11: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 1vnxcE-0003ey-Dd
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 11: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 1vnxcE-0049S7-2M
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnxcE-000SeQ-1B
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 11: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=Ylub93TZhqvYT0OmdhLBmY9GBT+sokkxKxVBlBPZIZg=; b=aSZ2VwavtpBvZGdXzUVhE+Tzaf
	9UoFwPl77yokfOeDnS/qIkeRo3EMmMSWh+uejkl2pFY0gaNDh2h3l5smkSmicDXRzreRmWaXkz6tr
	6aojoBw05wySdhl0f6A7G6BiEJnv1JNDBFBT0ex5NxmmQAifUJLvf6CNpFT5Q/iZAo0g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: relax barrier in sync_vcpu_execstate()
Message-Id: <E1vnxcE-000SeQ-1B@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 11:33:42 +0000

commit 3d11d55e19b749697ea7c3799c264b83f5a57a80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:29:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:29:53 2026 +0100

    Arm: relax barrier in sync_vcpu_execstate()
    
    The counterpart in vcpu_context_saved() is smp_wmb(), and here we don't
    really need any more than a read barrier: The concern expressed in the
    comment is void, as updates to the context are necessarily observed ahead
    of ->is_running going false, by virtue of said barrier in
    vcpu_context_saved().
    
    Amends: f6790389613c ("xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 507df807ed..2eca2b913d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -342,11 +342,8 @@ void sync_vcpu_execstate(struct vcpu *v)
      * Per vcpu_context_saved(), the context can be observed when
      * v->is_running is false (the caller should check it before calling
      * this function).
-     *
-     * Note this is a full barrier to also prevent update of the context
-     * to happen before it was observed.
      */
-    smp_mb();
+    smp_rmb();
 }
 
 #define NEXT_ARG(fmt, args)                                                 \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 12:33:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 12:33:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221891.1530003 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnyXf-0007PI-6I; Thu, 05 Feb 2026 12:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221891.1530003; Thu, 05 Feb 2026 12: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 1vnyXf-0007PA-3c; Thu, 05 Feb 2026 12:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1221891;
 Thu, 05 Feb 2026 12: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 1vnyXe-0007P4-8J
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 12: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 1vnyXe-004AfD-1i
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnyXe-000Vnt-0W
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12: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=SUOYbm2/VM44pzVVaHFvZY/2pbhrt4sLH2WiwPlKOIY=; b=b3MyAKbPEQn5c9G1T6vk/EyMYg
	kmW10DIeiBwdfi3urPXHerKMn1zetWKtBm1DA8clGUAQW+/wKkdSy/mnes1d/gQxbYswI62g9vLqC
	lLgnyM4Veu0msy+Z1bTaktqOsUjG3js/soEPfHsqAK2wF+chI6RKcC6dLXojq1lpLgf8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: make VMTRACE support optional
Message-Id: <E1vnyXe-000Vnt-0W@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 12:33:02 +0000

commit 4202f7d0cd01370d0070f78aef1e47cbb3fcce39
Author:     Grygorii Strashko <grygorii_strashko@epam.com>
AuthorDate: Thu Feb 5 10:26:45 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:26:45 2026 +0100

    xen: make VMTRACE support optional
    
    The VMTRACE feature is depends on Platform/Arch HW and code support and now
    can be used only on x86 HVM with Intel VT-x (INTEL_VMX) enabled.
    This makes VMTRACE support optional by introducing HVM Kconfig option:
    - CONFIG_VMTRACE to enable/disable the feature.
    
    Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 xen/arch/x86/domctl.c                   |  4 ++++
 xen/arch/x86/hvm/Kconfig                | 12 ++++++++++++
 xen/arch/x86/hvm/vmx/vmcs.c             |  2 ++
 xen/arch/x86/hvm/vmx/vmx.c              | 11 +++++++++++
 xen/arch/x86/include/asm/guest-msr.h    |  2 ++
 xen/arch/x86/include/asm/hvm/hvm.h      | 34 ++++++++++++---------------------
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |  2 ++
 xen/arch/x86/mm/mem_sharing.c           |  2 ++
 xen/arch/x86/vm_event.c                 |  8 +++++---
 xen/common/domain.c                     | 10 ++++++++++
 xen/common/memory.c                     |  6 ++++++
 xen/common/vm_event.c                   |  3 ++-
 xen/include/xen/domain.h                |  4 ++++
 xen/include/xen/sched.h                 |  4 ++++
 14 files changed, 78 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 6153e3c07e..d9521808dc 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -154,6 +154,7 @@ void arch_get_domain_info(const struct domain *d,
 static int do_vmtrace_op(struct domain *d, struct xen_domctl_vmtrace_op *op,
                          XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
+#ifdef CONFIG_VMTRACE
     struct vcpu *v;
     int rc;
 
@@ -198,6 +199,9 @@ static int do_vmtrace_op(struct domain *d, struct xen_domctl_vmtrace_op *op,
     vcpu_unpause(v);
 
     return rc;
+#else
+    return -EOPNOTSUPP;
+#endif
 }
 
 #define MAX_IOPORTS 0x10000
diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig
index 25eb3e374f..f32bf5cbb7 100644
--- a/xen/arch/x86/hvm/Kconfig
+++ b/xen/arch/x86/hvm/Kconfig
@@ -34,6 +34,18 @@ config INTEL_VMX
 	  If your system includes a processor with Intel VT-x support, say Y.
 	  If in doubt, say Y.
 
+config VMTRACE
+	bool "HW VM tracing support"
+	depends on INTEL_VMX
+	default y
+	help
+	  Enables HW VM tracing support which allows to configure HW processor
+	  features (vmtrace_op) to enable capturing information about software
+	  execution using dedicated hardware facilities with minimal interference
+	  to the software being traced. The trace data can be retrieved using buffer
+	  shared between Xen and domain
+	  (see XENMEM_acquire_resource(XENMEM_resource_vmtrace_buf)).
+
 config HVM_FEP
 	bool "HVM Forced Emulation Prefix support (UNSUPPORTED)" if UNSUPPORTED
 	default DEBUG
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index d610988bf9..c2e7f9aed3 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -306,6 +306,7 @@ static int vmx_init_vmcs_config(bool bsp)
 
     rdmsrl(MSR_IA32_VMX_MISC, _vmx_misc_cap);
 
+#ifdef CONFIG_VMTRACE
     /* Check whether IPT is supported in VMX operation. */
     if ( bsp )
         vmtrace_available = cpu_has_proc_trace &&
@@ -317,6 +318,7 @@ static int vmx_init_vmcs_config(bool bsp)
                smp_processor_id());
         return -EINVAL;
     }
+#endif
 
     if ( caps.cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS )
     {
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 40e4c71244..82c55f49ae 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -622,6 +622,7 @@ static void cf_check domain_creation_finished(struct domain *d)
 
 static void vmx_init_ipt(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     unsigned int size = v->domain->vmtrace_size;
 
     if ( !size )
@@ -632,6 +633,7 @@ static void vmx_init_ipt(struct vcpu *v)
     ASSERT(size >= PAGE_SIZE && (size & (size - 1)) == 0);
 
     v->arch.msrs->rtit.output_limit = size - 1;
+#endif
 }
 
 static int cf_check vmx_vcpu_initialise(struct vcpu *v)
@@ -723,11 +725,13 @@ static void vmx_save_guest_msrs(struct vcpu *v)
      */
     v->arch.hvm.vmx.shadow_gs = read_gs_shadow();
 
+#ifdef CONFIG_VMTRACE
     if ( v->arch.hvm.vmx.ipt_active )
     {
         rdmsrl(MSR_RTIT_OUTPUT_MASK, msrs->rtit.output_mask);
         rdmsrl(MSR_RTIT_STATUS, msrs->rtit.status);
     }
+#endif
 
     if ( cp->feat.pks )
         msrs->pkrs = rdpkrs_and_cache();
@@ -746,12 +750,14 @@ static void vmx_restore_guest_msrs(struct vcpu *v)
     if ( cpu_has_msr_tsc_aux )
         wrmsr_tsc_aux(msrs->tsc_aux);
 
+#ifdef CONFIG_VMTRACE
     if ( v->arch.hvm.vmx.ipt_active )
     {
         wrmsrl(MSR_RTIT_OUTPUT_BASE, page_to_maddr(v->vmtrace.pg));
         wrmsrl(MSR_RTIT_OUTPUT_MASK, msrs->rtit.output_mask);
         wrmsrl(MSR_RTIT_STATUS, msrs->rtit.status);
     }
+#endif
 
     if ( cp->feat.pks )
         wrpkrs(msrs->pkrs);
@@ -2629,6 +2635,7 @@ static bool cf_check vmx_get_pending_event(
     return true;
 }
 
+#ifdef CONFIG_VMTRACE
 /*
  * We only let vmtrace agents see and modify a subset of bits in MSR_RTIT_CTL.
  * These all pertain to data-emitted into the trace buffer(s).  Must not
@@ -2771,6 +2778,7 @@ static int cf_check vmtrace_reset(struct vcpu *v)
     v->arch.msrs->rtit.status = 0;
     return 0;
 }
+#endif
 
 static uint64_t cf_check vmx_get_reg(struct vcpu *v, unsigned int reg)
 {
@@ -2945,11 +2953,14 @@ static struct hvm_function_table __initdata_cf_clobber vmx_function_table = {
     .altp2m_vcpu_emulate_ve = vmx_vcpu_emulate_ve,
     .altp2m_vcpu_emulate_vmfunc = vmx_vcpu_emulate_vmfunc,
 #endif
+
+#ifdef CONFIG_VMTRACE
     .vmtrace_control = vmtrace_control,
     .vmtrace_output_position = vmtrace_output_position,
     .vmtrace_set_option = vmtrace_set_option,
     .vmtrace_get_option = vmtrace_get_option,
     .vmtrace_reset = vmtrace_reset,
+#endif
 
     .get_reg = vmx_get_reg,
     .set_reg = vmx_set_reg,
diff --git a/xen/arch/x86/include/asm/guest-msr.h b/xen/arch/x86/include/asm/guest-msr.h
index 5f0cb0a939..702f47fe1e 100644
--- a/xen/arch/x86/include/asm/guest-msr.h
+++ b/xen/arch/x86/include/asm/guest-msr.h
@@ -50,6 +50,7 @@ struct vcpu_msrs
         };
     } misc_features_enables;
 
+#ifdef CONFIG_VMTRACE
     /*
      * 0x00000560 ... 57x - MSR_RTIT_*
      *
@@ -81,6 +82,7 @@ struct vcpu_msrs
             };
         };
     } rtit;
+#endif
 
     /*
      * 0x000006e1 - MSR_PKRS - Protection Key Supervisor.
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index af042ae858..7d9774df59 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -236,12 +236,14 @@ struct hvm_function_table {
     int (*altp2m_vcpu_emulate_vmfunc)(const struct cpu_user_regs *regs);
 #endif
 
+#ifdef CONFIG_VMTRACE
     /* vmtrace */
     int (*vmtrace_control)(struct vcpu *v, bool enable, bool reset);
     int (*vmtrace_output_position)(struct vcpu *v, uint64_t *pos);
     int (*vmtrace_set_option)(struct vcpu *v, uint64_t key, uint64_t value);
     int (*vmtrace_get_option)(struct vcpu *v, uint64_t key, uint64_t *value);
     int (*vmtrace_reset)(struct vcpu *v);
+#endif
 
     uint64_t (*get_reg)(struct vcpu *v, unsigned int reg);
     void (*set_reg)(struct vcpu *v, unsigned int reg, uint64_t val);
@@ -741,6 +743,7 @@ static inline bool altp2m_vcpu_emulate_ve(struct vcpu *v)
 bool altp2m_vcpu_emulate_ve(struct vcpu *v);
 #endif /* CONFIG_ALTP2M */
 
+#ifdef CONFIG_VMTRACE
 static inline int hvm_vmtrace_control(struct vcpu *v, bool enable, bool reset)
 {
     if ( hvm_funcs.vmtrace_control )
@@ -775,11 +778,20 @@ static inline int hvm_vmtrace_get_option(
 
     return -EOPNOTSUPP;
 }
+#else
+/*
+ * Function declaration(s) here are used without definition(s) to make compiler
+ * happy when VMTRACE=n, compiler DCE will eliminate unused code.
+ */
+int hvm_vmtrace_output_position(struct vcpu *v, uint64_t *pos);
+#endif
 
 static inline int hvm_vmtrace_reset(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     if ( hvm_funcs.vmtrace_reset )
         return alternative_call(hvm_funcs.vmtrace_reset, v);
+#endif
 
     return -EOPNOTSUPP;
 }
@@ -937,28 +949,6 @@ static inline bool hvm_has_set_descriptor_access_exiting(void)
     return false;
 }
 
-static inline int hvm_vmtrace_control(struct vcpu *v, bool enable, bool reset)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_output_position(struct vcpu *v, uint64_t *pos)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_set_option(
-    struct vcpu *v, uint64_t key, uint64_t value)
-{
-    return -EOPNOTSUPP;
-}
-
-static inline int hvm_vmtrace_get_option(
-    struct vcpu *v, uint64_t key, uint64_t *value)
-{
-    return -EOPNOTSUPP;
-}
-
 static inline uint64_t hvm_get_reg(struct vcpu *v, unsigned int reg)
 {
     ASSERT_UNREACHABLE();
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
index 8ff7c8045f..879ec10cef 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -154,8 +154,10 @@ struct vmx_vcpu {
     /* Do we need to tolerate a spurious EPT_MISCONFIG VM exit? */
     bool                 ept_spurious_misconfig;
 
+#ifdef CONFIG_VMTRACE
     /* Processor Trace configured and enabled for the vcpu. */
     bool                 ipt_active;
+#endif
 
     /* Is the guest in real mode? */
     uint8_t              vmx_realmode;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index b5a259af1d..5c7a0ff30e 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1891,7 +1891,9 @@ static int fork(struct domain *cd, struct domain *d)
         domain_pause(d);
         cd->max_pages = d->max_pages;
         *cd->arch.cpu_policy = *d->arch.cpu_policy;
+#ifdef CONFIG_VMTRACE
         cd->vmtrace_size = d->vmtrace_size;
+#endif
         cd->parent = d;
     }
 
diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c
index fc349270b9..112d2ef66d 100644
--- a/xen/arch/x86/vm_event.c
+++ b/xen/arch/x86/vm_event.c
@@ -253,7 +253,9 @@ void vm_event_fill_regs(vm_event_request_t *req)
     req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
     req->data.regs.x86.dr6 = ctxt.dr6;
 
-    if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
+    if ( IS_ENABLED(CONFIG_VMTRACE) &&
+         hvm_vmtrace_output_position(curr,
+                                     &req->data.regs.x86.vmtrace_pos) != 1 )
         req->data.regs.x86.vmtrace_pos = ~0;
 #endif
 }
@@ -303,12 +305,12 @@ void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
 #endif
 }
 
+#ifdef CONFIG_VMTRACE
 void vm_event_reset_vmtrace(struct vcpu *v)
 {
-#ifdef CONFIG_HVM
     hvm_vmtrace_reset(v);
-#endif
 }
+#endif
 
 /*
  * Local variables:
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 163f7fc966..3fd907e274 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -135,7 +135,9 @@ struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
 vcpu_info_t dummy_vcpu_info;
 
+#ifdef CONFIG_VMTRACE
 bool __read_mostly vmtrace_available;
+#endif
 
 bool __read_mostly vpmu_is_available;
 
@@ -358,6 +360,7 @@ static void free_vcpu_struct(struct vcpu *v)
 
 static void vmtrace_free_buffer(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     const struct domain *d = v->domain;
     struct page_info *pg = v->vmtrace.pg;
     unsigned int i;
@@ -372,10 +375,12 @@ static void vmtrace_free_buffer(struct vcpu *v)
         put_page_alloc_ref(&pg[i]);
         put_page_and_type(&pg[i]);
     }
+#endif
 }
 
 static int vmtrace_alloc_buffer(struct vcpu *v)
 {
+#ifdef CONFIG_VMTRACE
     struct domain *d = v->domain;
     struct page_info *pg;
     unsigned int i;
@@ -417,6 +422,9 @@ static int vmtrace_alloc_buffer(struct vcpu *v)
     }
 
     return -ENODATA;
+#else
+    return 0;
+#endif
 }
 
 /*
@@ -884,7 +892,9 @@ struct domain *domain_create(domid_t domid,
         ASSERT(!config->altp2m.nr);
 #endif
 
+#ifdef CONFIG_VMTRACE
         d->vmtrace_size = config->vmtrace_size;
+#endif
     }
 
     /* Sort out our idea of is_control_domain(). */
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9240a6005e..918510f287 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1259,8 +1259,10 @@ static unsigned int resource_max_frames(const struct domain *d,
     case XENMEM_resource_ioreq_server:
         return ioreq_server_max_frames(d);
 
+#ifdef CONFIG_VMTRACE
     case XENMEM_resource_vmtrace_buf:
         return d->vmtrace_size >> PAGE_SHIFT;
+#endif
 
     default:
         return 0;
@@ -1302,6 +1304,7 @@ static int acquire_ioreq_server(struct domain *d,
 #endif
 }
 
+#ifdef CONFIG_VMTRACE
 static int acquire_vmtrace_buf(
     struct domain *d, unsigned int id, unsigned int frame,
     unsigned int nr_frames, xen_pfn_t mfn_list[])
@@ -1324,6 +1327,7 @@ static int acquire_vmtrace_buf(
 
     return nr_frames;
 }
+#endif
 
 /*
  * Returns -errno on error, or positive in the range [1, nr_frames] on
@@ -1342,8 +1346,10 @@ static int _acquire_resource(
     case XENMEM_resource_ioreq_server:
         return acquire_ioreq_server(d, id, frame, nr_frames, mfn_list);
 
+#ifdef CONFIG_VMTRACE
     case XENMEM_resource_vmtrace_buf:
         return acquire_vmtrace_buf(d, id, frame, nr_frames, mfn_list);
+#endif
 
     default:
         ASSERT_UNREACHABLE();
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index b2787c0108..cf0258223f 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -441,7 +441,8 @@ static int vm_event_resume(struct domain *d, struct vm_event_domain *ved)
             if ( rsp.flags & VM_EVENT_FLAG_GET_NEXT_INTERRUPT )
                 vm_event_monitor_next_interrupt(v);
 
-            if ( rsp.flags & VM_EVENT_FLAG_RESET_VMTRACE )
+            if ( IS_ENABLED(CONFIG_VMTRACE) &&
+                 (rsp.flags & VM_EVENT_FLAG_RESET_VMTRACE) )
                 vm_event_reset_vmtrace(v);
 
             if ( rsp.flags & VM_EVENT_FLAG_VCPU_PAUSED )
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 273717c31b..627ca0e071 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -183,7 +183,11 @@ void vnuma_destroy(struct vnuma_info *vnuma);
 static inline void vnuma_destroy(struct vnuma_info *vnuma) { ASSERT(!vnuma); }
 #endif
 
+#ifdef CONFIG_VMTRACE
 extern bool vmtrace_available;
+#else
+#define vmtrace_available false
+#endif
 
 extern bool vpmu_is_available;
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 735d5b76b4..1268632344 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -300,9 +300,11 @@ struct vcpu
     /* vPCI per-vCPU area, used to store data for long running operations. */
     struct vpci_vcpu vpci;
 
+#ifdef CONFIG_VMTRACE
     struct {
         struct page_info *pg; /* One contiguous allocation of d->vmtrace_size */
     } vmtrace;
+#endif
 
     struct arch_vcpu arch;
 
@@ -626,7 +628,9 @@ struct domain
     unsigned int nr_altp2m;    /* Number of altp2m tables. */
 #endif
 
+#ifdef CONFIG_VMTRACE
     unsigned int vmtrace_size; /* Buffer size in bytes, or 0 to disable. */
+#endif
 
 #ifdef CONFIG_ARGO
     /* Argo interdomain communication support */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 12:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 12:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221892.1530010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnyXp-0007RF-8C; Thu, 05 Feb 2026 12:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221892.1530010; Thu, 05 Feb 2026 12: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 1vnyXp-0007R7-51; Thu, 05 Feb 2026 12:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1221892;
 Thu, 05 Feb 2026 12: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 1vnyXo-0007Qz-Ag
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 12: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 1vnyXo-004AfO-23
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnyXo-000Vor-0n
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12: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=qUpdB1I+9RmAcYZZHeiXqPijrQLtdqMwuJagXH4hyp4=; b=oNCJBWjba2F0FCf7EHQH6uPHUx
	BtqlA1tY/C4bcw3hoffKFncSD9NwyK5YLXsLMjoboKS91ifCFkJiAP1gLlbS8d2YA72JFdU3lpDLD
	VaoNNscDPHIpoUKZZ+Nvfh5HzdEGcAnJuLQvTgehsQkFWLCKWb85XNYD5Up8CZb0Fdrg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] build: avoid Paths.mk in hypervisor build
Message-Id: <E1vnyXo-000Vor-0n@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 12:33:12 +0000

commit 204f44257731a33083820a97de44fb330316a04f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:27:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:27:17 2026 +0100

    build: avoid Paths.mk in hypervisor build
    
    Its inclusion placed where it is, it affects the hypervisor build as well.
    The hypervisor build, in its _install rule, uses $(DEBUG_DIR), first in
    
            [ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)
    
    $(D) is an absolute directory (shorthand for $(DESTDIR)). $(DEBUG_DIR) as
    set by Paths.mk is, too. Both point into the build tree. The two simply
    shouldn't be glued together.
    
    Note that the earlier
    
            [ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR)
    
    continues to be working fine, as BOOT_DIR continues to be controlled by
    config/StdGNU.mk. Its DEBUG_DIR isn't taking effect anymore, when for the
    hypervisor build it should.
    
    And of course behavior now differs between building xen/ in a tree where
    tools/ was built before vs in an otherwise clean tree.
    
    Fixes: 82b9cc04a7c7 ("build: add make macro for making file from file.in")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 Config.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Config.mk b/Config.mk
index a3e219a0b8..fdc0245079 100644
--- a/Config.mk
+++ b/Config.mk
@@ -162,7 +162,9 @@ endef
 PATH_FILES := Paths.mk
 INC_FILES = $(foreach f, $(PATH_FILES), $(XEN_ROOT)/config/$(f))
 
+ifndef XEN_FULLVERSION
 -include $(INC_FILES)
+endif
 
 BUILD_MAKE_VARS = $(foreach f, $(PATH_FILES), $(shell awk '$$2 == ":=" { print $$1; }' $(XEN_ROOT)/config/$(f).in))
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 12:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 12:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221893.1530012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnyXz-0007Td-97; Thu, 05 Feb 2026 12:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221893.1530012; Thu, 05 Feb 2026 12: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 1vnyXz-0007TT-6J; Thu, 05 Feb 2026 12:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1221893;
 Thu, 05 Feb 2026 12: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 1vnyXy-0007TJ-DV
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 12: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 1vnyXy-004AfS-2K
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnyXy-000VpD-18
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12: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=tBhUvErase/jWYIgVcY6/I20C8V/ebF68uAF7YZfBoM=; b=a+qyOqWXZueVx1m7BcY9OV8Lu+
	ThHJSrZac2fDHEzc4eVfmPWgyfvSOvrM1jAKNnzfctIcc+fzZ4i6Pggc6rka5uNPIvCO/Rl7dJMMA
	by08AQNowoS9gPfEwWaynvSq2tvOyMwP0b9zKjHtqnmex2XASkt2tDhrvaTT5lAmIKtI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] MAINTAINERS: Add Jens as arm TEE reviewer
Message-Id: <E1vnyXy-000VpD-18@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 12:33:22 +0000

commit b2937439c5ef697a33d544b276cddcf82e304539
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Thu Feb 5 10:28:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:28:50 2026 +0100

    MAINTAINERS: Add Jens as arm TEE reviewer
    
    Add Jens as arm TEE reviewers so that he is informed of changes in FF-A
    or OPTEE changes in Xen and can review them.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 0ceb4bba21..ccc25a0e55 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -547,6 +547,7 @@ F:	stubdom/
 TEE MEDIATORS
 M:	Volodymyr Babchuk <volodymyr_babchuk@epam.com>
 M:	Bertrand Marquis <bertrand.marquis@arm.com>
+R:	Jens Wiklander <jens.wiklander@linaro.org>
 S:	Supported
 F:	xen/arch/arm/include/asm/tee/
 F:	xen/arch/arm/tee/
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 12:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 12:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221894.1530015 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnyY9-0007Vi-AO; Thu, 05 Feb 2026 12:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221894.1530015; Thu, 05 Feb 2026 12: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 1vnyY9-0007Va-7f; Thu, 05 Feb 2026 12:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1221894;
 Thu, 05 Feb 2026 12: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 1vnyY8-0007VT-Hl
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 12: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 1vnyY8-004Afo-2a
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnyY8-000Vpb-1P
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12: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=KfIbTTG+NoxkmO9gSpH/Na3U3Ia3dTZ8sW8/jjp+SjA=; b=sKXXaEwjmFMgOFjeDpucHoqamI
	9trTRH2v0KAcyIM+qHZlI6Kd1terAf+vUS7icJrvqhHL7rIB3tceIvUwmFIKwb7C3b/faLOa9kw9Y
	bu6BZfpoI1Xng5QU7gVVdyRXERSi6sc93bRZONZ6JRBZRVgQGpEYaU+taeKlSNt+PKOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/P2M: correct type use in p2m_put_gfn()
Message-Id: <E1vnyY8-000Vpb-1P@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 12:33:32 +0000

commit 0b6bad1d8f3da7b81901f82ebad09bdb9ebe922b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:29:20 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:29:20 2026 +0100

    x86/P2M: correct type use in p2m_put_gfn()
    
    Everywhere else gfn_t are passed into respective GFN locking macros: Do so
    here as well.
    
    Amends: 819cdc5a7301 ("x86/p2m: re-arrange {,__}put_gfn()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/mm/p2m.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 8d34357bcb..e915da26a8 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -338,9 +338,9 @@ mfn_t p2m_get_gfn_type_access(struct p2m_domain *p2m, gfn_t gfn,
 
 void p2m_put_gfn(struct p2m_domain *p2m, gfn_t gfn)
 {
-    ASSERT(gfn_locked_by_me(p2m, gfn_x(gfn)));
+    ASSERT(gfn_locked_by_me(p2m, gfn));
 
-    gfn_unlock(p2m, gfn_x(gfn), 0);
+    gfn_unlock(p2m, gfn, 0);
 }
 
 static struct page_info *get_page_from_mfn_and_type(
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 05 12:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Feb 2026 12:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1221895.1530020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vnyYJ-0007Y3-Bp; Thu, 05 Feb 2026 12:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1221895.1530020; Thu, 05 Feb 2026 12: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 1vnyYJ-0007Xv-92; Thu, 05 Feb 2026 12:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1221895;
 Thu, 05 Feb 2026 12: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 1vnyYI-0007Xn-J4
 for xen-changelog@lists.xenproject.org; Thu, 05 Feb 2026 12: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 1vnyYI-004Afs-2t
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vnyYI-000Vpx-1g
 for xen-changelog@lists.xenproject.org;
 Thu, 05 Feb 2026 12: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=iRA0WB9t0ZsJJgxkpGRxW+UYoy2N9tPnrCgPEvWBHTc=; b=Mw/6XZxry54ltb/72Xdz7ypVzW
	pOvhmsswLkhSJnYgSi4B45vjpEGgmSMyrmWzkuh7CKKw7ac3XYQo0/qPI5Lws15dRmGMaEEsvAsf5
	7JFqdSOdeTLhnlDXKA+nGwwPACPiowTgtJykmcKfRNBbs9l0DpwE95ZgEvp42dHhAxxI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: relax barrier in sync_vcpu_execstate()
Message-Id: <E1vnyYI-000Vpx-1g@xenbits.xenproject.org>
Date: Thu, 05 Feb 2026 12:33:42 +0000

commit 3d11d55e19b749697ea7c3799c264b83f5a57a80
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 5 10:29:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 5 10:29:53 2026 +0100

    Arm: relax barrier in sync_vcpu_execstate()
    
    The counterpart in vcpu_context_saved() is smp_wmb(), and here we don't
    really need any more than a read barrier: The concern expressed in the
    comment is void, as updates to the context are necessarily observed ahead
    of ->is_running going false, by virtue of said barrier in
    vcpu_context_saved().
    
    Amends: f6790389613c ("xen/arm: sched: Ensure the vCPU context is seen before vcpu_pause() returns")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/domain.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 507df807ed..2eca2b913d 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -342,11 +342,8 @@ void sync_vcpu_execstate(struct vcpu *v)
      * Per vcpu_context_saved(), the context can be observed when
      * v->is_running is false (the caller should check it before calling
      * this function).
-     *
-     * Note this is a full barrier to also prevent update of the context
-     * to happen before it was observed.
      */
-    smp_mb();
+    smp_rmb();
 }
 
 #define NEXT_ARG(fmt, args)                                                 \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1222912.1530588 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voHRb-0003bB-RX; Fri, 06 Feb 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 1222912.1530588; Fri, 06 Feb 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 1voHRb-0003b3-Oz; Fri, 06 Feb 2026 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1222912;
 Fri, 06 Feb 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 1voHRa-0003av-84
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voHRa-005gqk-1d
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 08:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voHRa-001efO-0Q
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=tzmflpdUqg9iUqyUOBXb1TbRVae3yYQADdiNDszpPYc=; b=4f4S5Ocy+COtgMgw/N96mGar5n
	7hU5bnZRxQrgNfQ1UGYQ32CIL3v4hzCkpt/KxsjBgmj0alT2bUPVia4+PIlhp/6GUwnxWt0LN17eM
	40vQJ9Q08YOc0LE3Em7xet5/ItXkzexcrL5pnC9vQq1BlGCccf907JxQQjgvKVpVxeCI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1voHRa-001efO-0Q@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 08:44:02 +0000

commit 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Feb 3 10:50:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index edb76366b5..8b2f33f1a0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -881,11 +881,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 01499582d2..d16583a745 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -247,6 +247,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 3fd907e274..de6fdf5923 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -307,7 +307,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 627ca0e071..93c0fd00c1 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1222913.1530592 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voHRl-0003cs-Sr; Fri, 06 Feb 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 1222913.1530592; Fri, 06 Feb 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 1voHRl-0003ck-QK; Fri, 06 Feb 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1222913;
 Fri, 06 Feb 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 1voHRk-0003cL-AA
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voHRk-005gqs-1y
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 08:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voHRk-001eh4-0i
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=sM+W5F/RlSKoVgElxsX72vpajNs8fQVFV8zYJvReVms=; b=Ys3faWgs+N0Gtd+kQHjuL+jhLB
	/f+QkdkBqY9L1q7uJjbN9XMe2lVZyyHlA7YMtYrANq7vGv8w8XxOOMUN9aDXME7Ponb462PKXEk1N
	/EHcPg0FQOkgm6kfj/1cTqbGuzlXgBQyVz8eIdv4buwnvX6uURarIz3VZ296NFx24gtQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: use BSD sed compatible regexp in SRCARCH
Message-Id: <E1voHRk-001eh4-0i@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 08:44:12 +0000

commit d44ec1b10cfac8593073a12200cd0a471e683eff
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Feb 5 15:54:34 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    xen/arm: use BSD sed compatible regexp in SRCARCH
    
    Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
    expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
    for not being a basic regular expression.  The usage of | alternations is
    not part of basic regexp support.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 13e336ba54..31352d4cd2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
 
 ARCH := $(XEN_TARGET_ARCH)
 SRCARCH := $(shell echo $(ARCH) | \
-    sed -e 's/x86.*/x86/' -e 's/arm\(32\|64\)/arm/g' \
+    sed -e 's/x86.*/x86/' -e 's/arm.*/arm/g' \
         -e 's/riscv.*/riscv/g' -e 's/ppc.*/ppc/g')
 export ARCH SRCARCH
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 08:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 08:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1222914.1530596 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voHRv-0003fE-UB; Fri, 06 Feb 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 1222914.1530596; Fri, 06 Feb 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 1voHRv-0003f6-Rd; Fri, 06 Feb 2026 08:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1222914;
 Fri, 06 Feb 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 1voHRu-0003es-EI
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voHRu-005gqy-2Q
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 08:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voHRu-001ej2-13
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=dlJaz2D4IifLcUv2GjKEhgzJqXdbeh6OBaH9QQaJ8is=; b=5JYfNb9+seDym52vFRsrRHxCfW
	Y4TpLrvAIuSMcdZ/Vnucd1p8DkGF8giSZknciXoPYwWLoX9ukoXlSxV6sY5A8ccmo3o/eDjm5r/Ib
	qTp0mlBrYfCS9R0Tc8/yGjExz8CC68Tu821UUXYGRRi/o/OZTFRz74mt6tC+45h113Mc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/ocaml: fix 32-bit truncation bug in stub_xc_domain_setmaxmem()
Message-Id: <E1voHRu-001ej2-13@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 08:44:22 +0000

commit 381b4ff16f7ff83a2dc44f16b8dd0208f3255ec7
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Thu Feb 5 13:56:45 2026 +0000
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    tools/ocaml: fix 32-bit truncation bug in stub_xc_domain_setmaxmem()
    
    Observed when attempting to boot a >4TiB VM:
    
    After a call to domain_setmaxmem with 6370254848 (KiB), the domain's maxmem
    got set to 2075287552, which is exactly 2^32 smaller.
    
    xc_domain_setmaxmem takes an uint64_t as a parameter, and the OCaml value
    is 64-bit already, so fix the C variable to match the type and avoid the
    truncation.
    
    Fixes: f5b43e95facd ("libxl: fix "xl mem-set" regression from 0c029c4da2")
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index ac2a7537d6..c55f73b265 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -947,7 +947,7 @@ CAMLprim value stub_xc_domain_setmaxmem(value xch_val, value domid,
 	int retval;
 
 	uint32_t c_domid = Int_val(domid);
-	unsigned int c_max_memkb = Int64_val(max_memkb);
+	uint64_t c_max_memkb = Int64_val(max_memkb);
 	caml_enter_blocking_section();
 	retval = xc_domain_setmaxmem(xch, c_domid, c_max_memkb);
 	caml_leave_blocking_section();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 10:22:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 10:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1223090.1530718 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voIyR-0003ib-Ok; Fri, 06 Feb 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 1223090.1530718; Fri, 06 Feb 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 1voIyR-0003iR-Lt; Fri, 06 Feb 2026 10:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1223090;
 Fri, 06 Feb 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 1voIyQ-0003iL-Eu
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voIyQ-005ip6-2K
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 10:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voIyQ-001k20-17
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=sn0yty+5XwFTmOkwgkLnwXJw+ganw3t16/Xok/ccpYI=; b=5C3ZkZArQFHGPqjNUb6spVyEPL
	K8nvT8rjF9IFt6f06Wa3j+RLPOswyLY6E71E8DpbWGDo7uz9LV3u22phLLziKj98+gMPvAxQEpDC5
	QqrCWTetRmL0PPK6ryLGmNVLwbD2Mr9GYUX64++q5JBGzCyCaNJuq57NRdmkGqgR0yrE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1voIyQ-001k20-17@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 10:22:02 +0000

commit 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Feb 3 10:50:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index edb76366b5..8b2f33f1a0 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -881,11 +881,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 01499582d2..d16583a745 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -247,6 +247,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 3fd907e274..de6fdf5923 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -307,7 +307,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 627ca0e071..93c0fd00c1 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 10:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 10:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1223092.1530723 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voIyb-0003kC-R1; Fri, 06 Feb 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 1223092.1530723; Fri, 06 Feb 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 1voIyb-0003k4-NI; Fri, 06 Feb 2026 10:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1223092;
 Fri, 06 Feb 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 1voIya-0003ju-Hq
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voIya-005ipC-2f
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 10:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voIya-001k2w-1P
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=343LbabWVC7UD42dl3RDh+5v3gH8d5BicN3/SExEcyU=; b=DTF/xFrpM7FbnxNFm2rWF1cKvD
	x2UZjOsQCGBWqA7ZgCpycqQNzbK0MnIqAPbQQY7CN21ZnQEQ0IAQv1xdKRP97I5+b4SRLbhyvbSeV
	4SgybkopYup6SrkZEqsV+73R7FdFBJ2vopDETLrJtx5l3zMMHxJVxhc5OSTn5fwkIzW0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: use BSD sed compatible regexp in SRCARCH
Message-Id: <E1voIya-001k2w-1P@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 10:22:12 +0000

commit d44ec1b10cfac8593073a12200cd0a471e683eff
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Feb 5 15:54:34 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    xen/arm: use BSD sed compatible regexp in SRCARCH
    
    Convert the ARM SRCARCH variable setting to use the more common 'arm.*'
    expression rather 'arm\(32\|64\)', as the later doesn't work with BSD sed
    for not being a basic regular expression.  The usage of | alternations is
    not part of basic regexp support.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 13e336ba54..31352d4cd2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -242,7 +242,7 @@ include $(XEN_ROOT)/Config.mk
 
 ARCH := $(XEN_TARGET_ARCH)
 SRCARCH := $(shell echo $(ARCH) | \
-    sed -e 's/x86.*/x86/' -e 's/arm\(32\|64\)/arm/g' \
+    sed -e 's/x86.*/x86/' -e 's/arm.*/arm/g' \
         -e 's/riscv.*/riscv/g' -e 's/ppc.*/ppc/g')
 export ARCH SRCARCH
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 10:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 10:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1223093.1530726 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voIyl-0003mq-RR; Fri, 06 Feb 2026 10:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1223093.1530726; Fri, 06 Feb 2026 10: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 1voIyl-0003mi-Oh; Fri, 06 Feb 2026 10:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1223093;
 Fri, 06 Feb 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 1voIyk-0003ma-M3
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 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 1voIyk-005ipG-3B
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 10:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voIyk-001k3M-1k
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 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=5qtr/9aHQuiFZ8QW0fFA0qq5f7jHIi3W3wQd2OJDhGg=; b=fr5wXjrJVEl9s0H0z5NtQG4HUa
	sv2zAUz83gBuraY6tg3kkjlvmhIq/MEwFDKK6Ye01TJ+rNCn/3BARRebfXa0VjDCWz8LxcJXWqUdD
	sEJNPVxVNH4D4Xyjbz8rNPXCowTxUjtBVJ+cymgSV8Hn6IoahA1zy9NVY9azOlS/+OEY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/ocaml: fix 32-bit truncation bug in stub_xc_domain_setmaxmem()
Message-Id: <E1voIyk-001k3M-1k@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 10:22:22 +0000

commit 381b4ff16f7ff83a2dc44f16b8dd0208f3255ec7
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Thu Feb 5 13:56:45 2026 +0000
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 5 21:27:40 2026 +0100

    tools/ocaml: fix 32-bit truncation bug in stub_xc_domain_setmaxmem()
    
    Observed when attempting to boot a >4TiB VM:
    
    After a call to domain_setmaxmem with 6370254848 (KiB), the domain's maxmem
    got set to 2075287552, which is exactly 2^32 smaller.
    
    xc_domain_setmaxmem takes an uint64_t as a parameter, and the OCaml value
    is 64-bit already, so fix the C variable to match the type and avoid the
    truncation.
    
    Fixes: f5b43e95facd ("libxl: fix "xl mem-set" regression from 0c029c4da2")
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index ac2a7537d6..c55f73b265 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -947,7 +947,7 @@ CAMLprim value stub_xc_domain_setmaxmem(value xch_val, value domid,
 	int retval;
 
 	uint32_t c_domid = Int_val(domid);
-	unsigned int c_max_memkb = Int64_val(max_memkb);
+	uint64_t c_max_memkb = Int64_val(max_memkb);
 	caml_enter_blocking_section();
 	retval = xc_domain_setmaxmem(xch, c_domid, c_max_memkb);
 	caml_leave_blocking_section();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 20:00:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 20:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1223832.1531197 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voRzn-0004wn-MG; Fri, 06 Feb 2026 20:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1223832.1531197; Fri, 06 Feb 2026 20: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 1voRzn-0004wK-JE; Fri, 06 Feb 2026 20:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1223832;
 Fri, 06 Feb 2026 20: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 1voRzm-0004d9-9c
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 2026 20: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 1voRzm-005uyf-1m
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 20:00:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voRzm-002N4R-0W
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 20: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=AG4z46GjPAaeyGGVBB4hLs+mzDj7SI4lW1OWjsP1uT0=; b=CLuqjZwez2Xu1pG+H/0N53YAso
	B7EuyrhDt0KBKtE9jJCQSEBPgZXzECJO6Byb8TCT+pI52UE9n+SGYwaflaWWuIA9EowCtVLv0WHND
	C1B2gizbiB9ZEVfqVVaixM0NgkKS2PIciKKWKzrLY6ngI2FQSsvbHPLekKVJ0Gj0SCpQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1voRzm-002N4R-0W@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 20:00:02 +0000

commit 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 6 19:19:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 6 20:56:16 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 06 21:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 06 Feb 2026 21:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1223951.1531303 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1voT6V-0004bb-Vo; Fri, 06 Feb 2026 21:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1223951.1531303; Fri, 06 Feb 2026 21: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 1voT6V-0004bR-T2; Fri, 06 Feb 2026 21:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1223951;
 Fri, 06 Feb 2026 21: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 1voT6T-0004bL-UC
 for xen-changelog@lists.xenproject.org; Fri, 06 Feb 2026 21: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 1voT6U-005wIU-0a
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 21:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1voT6T-002R76-2c
 for xen-changelog@lists.xenproject.org;
 Fri, 06 Feb 2026 21: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=WByN78QG3GFyiREuuaHUsaCPZUjlYT4ADirMejy5Rvs=; b=6lnBLiGLJ7gxtFBz6BVv0pSMBp
	6UKz+WGegPE444GWYnbJUKPZE2zaPdD7Um8eyfE/nhBRONTk4qWHc3f/piaiPdM8WOw/iSIzfPQ5C
	+PLlR5zkB72GpyuqjZzNG1dxAKKs/6afsRVnCfX1+SciQhqPS/yepXljHxXCM8EMir2o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1voT6T-002R76-2c@xenbits.xenproject.org>
Date: Fri, 06 Feb 2026 21:11:01 +0000

commit 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 6 19:19:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 6 20:56:16 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 08:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 08:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226111.1532646 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpipq-0005Ju-RL; Tue, 10 Feb 2026 08:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1226111.1532646; Tue, 10 Feb 2026 08: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 1vpipq-0005Jn-OF; Tue, 10 Feb 2026 08:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1226111;
 Tue, 10 Feb 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 1vpipq-0005Jh-1I
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpipp-001fMx-37
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 08:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpipp-001R7L-30
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 08: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=J3lEfikLR/19gn3Au3fp+FBeffkLMGYT2ZG6RINpKw8=; b=D09NRIBdQB8fFzHUU80iYhw0vs
	4faIYw3Mq42tX5koZaKicSnunnY7D0j9hPGN4as9rx5cVtMQNmJvXm6xIoh6J0cKveJxxdMjEWb6e
	fJlTy1+ycNCS74gR04Jxn2KcTHe8UJEvkSpqhvGl0M4PsU0as+pmO8FwJ/11VmKWPUeg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/hvm: short-circuit HVM shadow guest creation earlier
Message-Id: <E1vpipp-001R7L-30@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 08:11:01 +0000

commit ddd52db068bbeafc7e9ec1d20ae93cf64b44ebb2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Feb 9 15:38:15 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 10 08:58:25 2026 +0100

    x86/hvm: short-circuit HVM shadow guest creation earlier
    
    If shadow paging has been compiled out short circuit the creation of HVM
    guests that attempt to use shadow paging at arch_sanitise_domain_config().
    There's no need to further build the domain when creation is doomed to fail
    later on.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
 xen/arch/x86/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8b2f33f1a0..8eb1509782 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -627,6 +627,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( hvm && !hap && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
+    {
+        dprintk(XENLOG_INFO, "Shadow paging requested but not available\n");
+        return -EINVAL;
+    }
+
     if ( !hvm )
         /*
          * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 10:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 10:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226209.1532730 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vplDv-0002Sh-4T; Tue, 10 Feb 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 1226209.1532730; Tue, 10 Feb 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 1vplDv-0002ST-0q; Tue, 10 Feb 2026 10:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1226209;
 Tue, 10 Feb 2026 10: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 1vplDu-0002SN-3E
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 2026 10: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 1vplDu-001iPm-05
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vplDt-001aIb-36
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=YegGn5zu085wkFUccTSjCzYHmJP+HC+AJWNW4KQp9Vo=; b=Ob/7eD8JRGCsywlPODhQHFKqve
	+aKHZnmXuKRk4P2KvfL2swAtDTl/ThA/Yx4ERzEaURkfrvTHf7FCiKLv0BmXfsLFYBcGt44EaBxG+
	s7KlePR11cGpeYuTONXkmfXXwFvMo+JJJwYxZiWECCqQLRaRiq1fpL0BLf9mLtwBUF8Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/console: group conring code together
Message-Id: <E1vplDt-001aIb-36@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 10:44:01 +0000

commit 49f88b1db54002a58633d7f5c4a5fcf0a7b828c5
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Feb 10 10:22:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:22:27 2026 +0100

    xen/console: group conring code together
    
    Groups conring buffer management code in the console driver for ease of
    maintaining this code.
    
    Not a functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/char/console.c | 161 ++++++++++++++++++++++-----------------------
 1 file changed, 80 insertions(+), 81 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 2bdb4d5fb4..bcd6d26149 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -126,17 +126,6 @@ static int cf_check parse_console_timestamps(const char *s);
 custom_runtime_param("console_timestamps", parse_console_timestamps,
                      con_timestamp_mode_upd);
 
-/* conring_size: allows a large console ring than default (16kB). */
-static uint32_t __initdata opt_conring_size;
-size_param("conring_size", opt_conring_size);
-
-#define _CONRING_SIZE 16384
-#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
-static char __initdata _conring[_CONRING_SIZE];
-static char *__read_mostly conring = _conring;
-static uint32_t __read_mostly conring_size = _CONRING_SIZE;
-static uint32_t conringc, conringp;
-
 static int __read_mostly sercon_handle = -1;
 
 #ifdef CONFIG_X86
@@ -350,6 +339,17 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  * ********************************************************
  */
 
+/* conring_size: allows a larger console ring than default (16kB). */
+static uint32_t __initdata opt_conring_size;
+size_param("conring_size", opt_conring_size);
+
+#define _CONRING_SIZE 16384
+#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
+static char __initdata _conring[_CONRING_SIZE];
+static char *__read_mostly conring = _conring;
+static uint32_t __read_mostly conring_size = _CONRING_SIZE;
+static uint32_t conringc, conringp;
+
 static void cf_check conring_notify(void *unused)
 {
     send_global_virq(VIRQ_CON_RING);
@@ -416,47 +416,6 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
 }
 #endif /* CONFIG_SYSCTL */
 
-
-/*
- * *******************************************************
- * *************** ACCESS TO SERIAL LINE *****************
- * *******************************************************
- */
-
-/* Characters received over the serial line are buffered for domain 0. */
-#define SERIAL_RX_SIZE 128
-#define SERIAL_RX_MASK(_i) ((_i)&(SERIAL_RX_SIZE-1))
-static char serial_rx_ring[SERIAL_RX_SIZE];
-static unsigned int serial_rx_cons, serial_rx_prod;
-
-static void (*serial_steal_fn)(const char *str, size_t nr) = early_puts;
-
-int console_steal(int handle, void (*fn)(const char *str, size_t nr))
-{
-    if ( (handle == -1) || (handle != sercon_handle) )
-        return 0;
-
-    if ( serial_steal_fn != NULL )
-        return -EBUSY;
-
-    serial_steal_fn = fn;
-    return 1;
-}
-
-void console_giveback(int id)
-{
-    if ( id == 1 )
-        serial_steal_fn = NULL;
-}
-
-void console_serial_puts(const char *s, size_t nr)
-{
-    if ( serial_steal_fn != NULL )
-        serial_steal_fn(s, nr);
-    else
-        serial_puts(sercon_handle, s, nr);
-}
-
 /*
  * Flush contents of the conring to the selected console devices.
  */
@@ -501,6 +460,75 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
         printk("failed to dump console ring buffer: %d\n", rc);
 }
 
+void __init console_init_ring(void)
+{
+    char *ring;
+    unsigned int i, order, memflags;
+    unsigned long flags;
+
+    if ( !opt_conring_size )
+        return;
+
+    order = get_order_from_bytes(max(opt_conring_size, conring_size));
+    memflags = MEMF_bits(crashinfo_maxaddr_bits);
+    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
+    {
+        BUG_ON(order == 0);
+        order--;
+    }
+    opt_conring_size = PAGE_SIZE << order;
+
+    nrspin_lock_irqsave(&console_lock, flags);
+    for ( i = conringc ; i != conringp; i++ )
+        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
+    conring = ring;
+    smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
+    conring_size = opt_conring_size;
+    nrspin_unlock_irqrestore(&console_lock, flags);
+
+    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
+}
+
+/*
+ * *******************************************************
+ * *************** ACCESS TO SERIAL LINE *****************
+ * *******************************************************
+ */
+
+/* Characters received over the serial line are buffered for domain 0. */
+#define SERIAL_RX_SIZE 128
+#define SERIAL_RX_MASK(_i) ((_i)&(SERIAL_RX_SIZE-1))
+static char serial_rx_ring[SERIAL_RX_SIZE];
+static unsigned int serial_rx_cons, serial_rx_prod;
+
+static void (*serial_steal_fn)(const char *str, size_t nr) = early_puts;
+
+int console_steal(int handle, void (*fn)(const char *str, size_t nr))
+{
+    if ( (handle == -1) || (handle != sercon_handle) )
+        return 0;
+
+    if ( serial_steal_fn != NULL )
+        return -EBUSY;
+
+    serial_steal_fn = fn;
+    return 1;
+}
+
+void console_giveback(int id)
+{
+    if ( id == 1 )
+        serial_steal_fn = NULL;
+}
+
+void console_serial_puts(const char *s, size_t nr)
+{
+    if ( serial_steal_fn != NULL )
+        serial_steal_fn(s, nr);
+    else
+        serial_puts(sercon_handle, s, nr);
+}
+
 /*
  * CTRL-<switch_char> changes input direction, rotating among Xen, Dom0,
  * and the DomUs started from Xen at boot.
@@ -1125,35 +1153,6 @@ void __init console_init_preirq(void)
     }
 }
 
-void __init console_init_ring(void)
-{
-    char *ring;
-    unsigned int i, order, memflags;
-    unsigned long flags;
-
-    if ( !opt_conring_size )
-        return;
-
-    order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    memflags = MEMF_bits(crashinfo_maxaddr_bits);
-    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
-    {
-        BUG_ON(order == 0);
-        order--;
-    }
-    opt_conring_size = PAGE_SIZE << order;
-
-    nrspin_lock_irqsave(&console_lock, flags);
-    for ( i = conringc ; i != conringp; i++ )
-        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
-    conring = ring;
-    smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
-    conring_size = opt_conring_size;
-    nrspin_unlock_irqrestore(&console_lock, flags);
-
-    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
-}
-
 void __init console_init_irq(void)
 {
     serial_init_irq();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 10:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 10:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226210.1532733 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vplE5-0002UX-55; Tue, 10 Feb 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 1226210.1532733; Tue, 10 Feb 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 1vplE5-0002UP-2P; Tue, 10 Feb 2026 10:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1226210;
 Tue, 10 Feb 2026 10: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 1vplE4-0002UE-5N
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 2026 10: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 1vplE4-001iPq-0P
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vplE4-001aJo-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10: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=oKtwaRohJKtv3A1QlPCGj9tbNi36NZZcvtUKsvO5n8E=; b=noRyEkVB7no1oVzqCgL7v+Ytwm
	MkoRnbAABRsU8/4X7fqDti8dYTrOxN5hXEWI9V23yARgSfrJonU3iaaAR0uLulsVeRv2qYbCntOZs
	hOeuV2YxqOGcXZRh2TIKjXTnD/KRc4I9XDDh00979j8g23EPPqh/XdcFEibnFTiSnFFA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vplE4-001aJo-0G@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 10:44:12 +0000

commit f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Feb 10 10:22:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:22:53 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 31352d4cd2..a054315fa4 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 10:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 10:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226211.1532737 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vplEF-0002YM-66; Tue, 10 Feb 2026 10:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1226211.1532737; Tue, 10 Feb 2026 10: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 1vplEF-0002YF-3f; Tue, 10 Feb 2026 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1226211;
 Tue, 10 Feb 2026 10: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 1vplEE-0002Y7-7l
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 2026 10: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 1vplEE-001iPu-0g
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vplEE-001aKY-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10: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=+xWBQtRgLa5L5wxZVCuFu+Z3Gk/tcFPzyhfARoQ5rGE=; b=m4AYChaJo4rgjJfM0yPy4mcKt4
	idK/QNQpUVcrT4btn2FiOAJMfnA6HfDkz0+FVRONFieZb0hn0tac87J0aLERzGo53uxt3Zu7NqPyP
	x636TaPQEHYupe2WCdiZzQFlxWfwwU/X7dmcW46VXRS/0rF28hn/9bK1bRhyXGpQOh4U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/kconfig: Reflow the SHADOW help message
Message-Id: <E1vplEE-001aKY-0Z@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 10:44:22 +0000

commit 15da92361b71480e2e602451835c21756b4c475f
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Feb 10 10:23:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:23:10 2026 +0100

    x86/kconfig: Reflow the SHADOW help message
    
    Wasn't following the tab+2 spaces convention throughout the rest of the file.
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/Kconfig | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 61f58aa829..2ce4747f6e 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -148,20 +148,17 @@ config SHADOW_PAGING
 	default !PV_SHIM_EXCLUSIVE
 	depends on PV || HVM
 	help
+	  Shadow paging is a software alternative to hardware paging support
+	  (Intel EPT, AMD NPT).
 
-          Shadow paging is a software alternative to hardware paging support
-          (Intel EPT, AMD NPT).
+	  It is required for:
+	  * Running HVM guests on hardware lacking hardware paging support
+	    (First-generation Intel VT-x or AMD SVM).
+	  * Live migration of PV guests.
+	  * L1TF sidechannel mitigation for PV guests.
 
-          It is required for:
-            * Running HVM guests on hardware lacking hardware paging support
-              (First-generation Intel VT-x or AMD SVM).
-            * Live migration of PV guests.
-            * L1TF sidechannel mitigation for PV guests.
-
-          Under a small number of specific workloads, shadow paging may be
-          deliberately used as a performance optimisation.
-
-          If unsure, say Y.
+	  Under a small number of specific workloads, shadow paging may be
+	  deliberately used as a performance optimisation.
 
 config PAGING
 	def_bool HVM || SHADOW_PAGING
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 10:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 10:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226212.1532742 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vplEP-0002at-7T; Tue, 10 Feb 2026 10:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1226212.1532742; Tue, 10 Feb 2026 10: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 1vplEP-0002am-52; Tue, 10 Feb 2026 10:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1226212;
 Tue, 10 Feb 2026 10: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 1vplEO-0002af-An
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 2026 10: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 1vplEO-001iQJ-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vplEO-001aLn-0q
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 10: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=GGGOXFSUXo7zbmYf3UAbRrJ+28p+A4GUF2JNE3CwFOc=; b=xIVB3oRLapoEMSFAuif7WAUBLL
	YW5aJiBvFs7WJGsLYIYdOHhOyPqxjQy5Zw6J/f2TclDT7tp9r4SAuF7Wulp/CIZsm8XmfeUbZY3d5
	cTKgrydU9uFbzRAKe7nSSHwQX7rgyo5Le+HHKEHxv0LK0qXWzLSjCQ4gci44IMJ8NiPc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Add Darwin.mk
Message-Id: <E1vplEO-001aLn-0q@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 10:44:32 +0000

commit 2fa468919c39aac189623b6c580ce4ff8592d799
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Feb 10 10:24:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:24:18 2026 +0100

    xen: Add Darwin.mk
    
    Xen does not provide a Darwin build configuration useable on Mac OS.
    It is possible to build Xen Hypervisor (tools are not supported) with a
    toolchain able to produce ELF binaries (GCC or others).
    
    Add config/Darwin.mk to include StdGNU.mk and force
    XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow
    the cross-compile path so compiling on Mac OS is always handled as a
    cross compilation case.
    
    Only compiling the hypervisor has been tested !
    
    An example of how to build the hypervisor for arm64 on Mac OS
    (tools cannot be build for now) using a compiler from brew:
    - brew install aarch64-elf-gcc aarch64-elf-binutils
    - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang -C xen
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 config/Darwin.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/Darwin.mk b/config/Darwin.mk
new file mode 100644
index 0000000000..de4a0afab7
--- /dev/null
+++ b/config/Darwin.mk
@@ -0,0 +1,7 @@
+# Use GNU tool definitions as the tools we are using are either GNU compatible
+# or we only use features which are supported on Mac OS.
+include $(XEN_ROOT)/config/StdGNU.mk
+
+# Force cross compile on Mac OS: Only hypervisor build is supported, no tools,
+# and in the hypervisor the (plain) SVR4 ABI is in use.
+XEN_COMPILE_ARCH = unknown
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 11:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 11:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226317.1532856 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpm9z-0007Yv-3o; Tue, 10 Feb 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 1226317.1532856; Tue, 10 Feb 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 1vpm9z-0007Yo-1B; Tue, 10 Feb 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1226317;
 Tue, 10 Feb 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 1vpm9x-0007Ye-VJ
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpm9x-001jal-2x
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpm9x-001dUU-2n
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=IB6UoGDdyyKNLc3lna/DznylNav3UvOm5wZFSUY8IKc=; b=4fuqpPEuo3rP6oq0/Vb+v8lQoN
	mz0npcUq0zSu21LUxt55qod2q7Hjpbz8DSZeU875WYE9Ohg+PbBtlrZP+rAwY3XYOWkVDG5NBj8yI
	KPmJ7aa8x/nF5iYXZmO4JhKHnWD5Z3Fs4UEi+zlAonkYr7Vl6Pxw5u8J/Tog3TBJhnOU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/hvm: short-circuit HVM shadow guest creation earlier
Message-Id: <E1vpm9x-001dUU-2n@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 11:44:01 +0000

commit ddd52db068bbeafc7e9ec1d20ae93cf64b44ebb2
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Feb 9 15:38:15 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 10 08:58:25 2026 +0100

    x86/hvm: short-circuit HVM shadow guest creation earlier
    
    If shadow paging has been compiled out short circuit the creation of HVM
    guests that attempt to use shadow paging at arch_sanitise_domain_config().
    There's no need to further build the domain when creation is doomed to fail
    later on.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
 xen/arch/x86/domain.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 8b2f33f1a0..8eb1509782 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -627,6 +627,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
+    if ( hvm && !hap && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
+    {
+        dprintk(XENLOG_INFO, "Shadow paging requested but not available\n");
+        return -EINVAL;
+    }
+
     if ( !hvm )
         /*
          * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226318.1532860 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpmA9-0007bO-5U; Tue, 10 Feb 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 1226318.1532860; Tue, 10 Feb 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 1vpmA9-0007bG-2s; Tue, 10 Feb 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1226318;
 Tue, 10 Feb 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 1vpmA8-0007bA-28
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpmA8-001jaq-04
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpmA7-001dVn-39
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=ho4fs+aHNY2tPCNagWiSw3gOc3u/tztvhMdI/EdYwz4=; b=Q7mXTTc6yw2Snv/ho2IjPKcggO
	JN5rVrfRS0L3G6k29lNJQaYd5OrJbUebsvHuo6B+6ZPJWtbWmVrTyw+lcqrha7JKMvR2RGes9EsCC
	VVEVYGdImCqghPGveCiH2d5zyacgc5lw45xU9ANR28/ClEesJa3S+E0KrsUIkGDRzW/M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/console: group conring code together
Message-Id: <E1vpmA7-001dVn-39@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 11:44:11 +0000

commit 49f88b1db54002a58633d7f5c4a5fcf0a7b828c5
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Tue Feb 10 10:22:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:22:27 2026 +0100

    xen/console: group conring code together
    
    Groups conring buffer management code in the console driver for ease of
    maintaining this code.
    
    Not a functional change.
    
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/char/console.c | 161 ++++++++++++++++++++++-----------------------
 1 file changed, 80 insertions(+), 81 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 2bdb4d5fb4..bcd6d26149 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -126,17 +126,6 @@ static int cf_check parse_console_timestamps(const char *s);
 custom_runtime_param("console_timestamps", parse_console_timestamps,
                      con_timestamp_mode_upd);
 
-/* conring_size: allows a large console ring than default (16kB). */
-static uint32_t __initdata opt_conring_size;
-size_param("conring_size", opt_conring_size);
-
-#define _CONRING_SIZE 16384
-#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
-static char __initdata _conring[_CONRING_SIZE];
-static char *__read_mostly conring = _conring;
-static uint32_t __read_mostly conring_size = _CONRING_SIZE;
-static uint32_t conringc, conringp;
-
 static int __read_mostly sercon_handle = -1;
 
 #ifdef CONFIG_X86
@@ -350,6 +339,17 @@ static void cf_check do_dec_thresh(unsigned char key, bool unused)
  * ********************************************************
  */
 
+/* conring_size: allows a larger console ring than default (16kB). */
+static uint32_t __initdata opt_conring_size;
+size_param("conring_size", opt_conring_size);
+
+#define _CONRING_SIZE 16384
+#define CONRING_IDX_MASK(i) ((i)&(conring_size-1))
+static char __initdata _conring[_CONRING_SIZE];
+static char *__read_mostly conring = _conring;
+static uint32_t __read_mostly conring_size = _CONRING_SIZE;
+static uint32_t conringc, conringp;
+
 static void cf_check conring_notify(void *unused)
 {
     send_global_virq(VIRQ_CON_RING);
@@ -416,47 +416,6 @@ long read_console_ring(struct xen_sysctl_readconsole *op)
 }
 #endif /* CONFIG_SYSCTL */
 
-
-/*
- * *******************************************************
- * *************** ACCESS TO SERIAL LINE *****************
- * *******************************************************
- */
-
-/* Characters received over the serial line are buffered for domain 0. */
-#define SERIAL_RX_SIZE 128
-#define SERIAL_RX_MASK(_i) ((_i)&(SERIAL_RX_SIZE-1))
-static char serial_rx_ring[SERIAL_RX_SIZE];
-static unsigned int serial_rx_cons, serial_rx_prod;
-
-static void (*serial_steal_fn)(const char *str, size_t nr) = early_puts;
-
-int console_steal(int handle, void (*fn)(const char *str, size_t nr))
-{
-    if ( (handle == -1) || (handle != sercon_handle) )
-        return 0;
-
-    if ( serial_steal_fn != NULL )
-        return -EBUSY;
-
-    serial_steal_fn = fn;
-    return 1;
-}
-
-void console_giveback(int id)
-{
-    if ( id == 1 )
-        serial_steal_fn = NULL;
-}
-
-void console_serial_puts(const char *s, size_t nr)
-{
-    if ( serial_steal_fn != NULL )
-        serial_steal_fn(s, nr);
-    else
-        serial_puts(sercon_handle, s, nr);
-}
-
 /*
  * Flush contents of the conring to the selected console devices.
  */
@@ -501,6 +460,75 @@ static void cf_check conring_dump_keyhandler(unsigned char key)
         printk("failed to dump console ring buffer: %d\n", rc);
 }
 
+void __init console_init_ring(void)
+{
+    char *ring;
+    unsigned int i, order, memflags;
+    unsigned long flags;
+
+    if ( !opt_conring_size )
+        return;
+
+    order = get_order_from_bytes(max(opt_conring_size, conring_size));
+    memflags = MEMF_bits(crashinfo_maxaddr_bits);
+    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
+    {
+        BUG_ON(order == 0);
+        order--;
+    }
+    opt_conring_size = PAGE_SIZE << order;
+
+    nrspin_lock_irqsave(&console_lock, flags);
+    for ( i = conringc ; i != conringp; i++ )
+        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
+    conring = ring;
+    smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
+    conring_size = opt_conring_size;
+    nrspin_unlock_irqrestore(&console_lock, flags);
+
+    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
+}
+
+/*
+ * *******************************************************
+ * *************** ACCESS TO SERIAL LINE *****************
+ * *******************************************************
+ */
+
+/* Characters received over the serial line are buffered for domain 0. */
+#define SERIAL_RX_SIZE 128
+#define SERIAL_RX_MASK(_i) ((_i)&(SERIAL_RX_SIZE-1))
+static char serial_rx_ring[SERIAL_RX_SIZE];
+static unsigned int serial_rx_cons, serial_rx_prod;
+
+static void (*serial_steal_fn)(const char *str, size_t nr) = early_puts;
+
+int console_steal(int handle, void (*fn)(const char *str, size_t nr))
+{
+    if ( (handle == -1) || (handle != sercon_handle) )
+        return 0;
+
+    if ( serial_steal_fn != NULL )
+        return -EBUSY;
+
+    serial_steal_fn = fn;
+    return 1;
+}
+
+void console_giveback(int id)
+{
+    if ( id == 1 )
+        serial_steal_fn = NULL;
+}
+
+void console_serial_puts(const char *s, size_t nr)
+{
+    if ( serial_steal_fn != NULL )
+        serial_steal_fn(s, nr);
+    else
+        serial_puts(sercon_handle, s, nr);
+}
+
 /*
  * CTRL-<switch_char> changes input direction, rotating among Xen, Dom0,
  * and the DomUs started from Xen at boot.
@@ -1125,35 +1153,6 @@ void __init console_init_preirq(void)
     }
 }
 
-void __init console_init_ring(void)
-{
-    char *ring;
-    unsigned int i, order, memflags;
-    unsigned long flags;
-
-    if ( !opt_conring_size )
-        return;
-
-    order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    memflags = MEMF_bits(crashinfo_maxaddr_bits);
-    while ( (ring = alloc_xenheap_pages(order, memflags)) == NULL )
-    {
-        BUG_ON(order == 0);
-        order--;
-    }
-    opt_conring_size = PAGE_SIZE << order;
-
-    nrspin_lock_irqsave(&console_lock, flags);
-    for ( i = conringc ; i != conringp; i++ )
-        ring[i & (opt_conring_size - 1)] = conring[i & (conring_size - 1)];
-    conring = ring;
-    smp_wmb(); /* Allow users of console_force_unlock() to see larger buffer. */
-    conring_size = opt_conring_size;
-    nrspin_unlock_irqrestore(&console_lock, flags);
-
-    printk("Allocated console ring of %u KiB.\n", opt_conring_size >> 10);
-}
-
 void __init console_init_irq(void)
 {
     serial_init_irq();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 11:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226319.1532864 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpmAJ-0007fs-8M; Tue, 10 Feb 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 1226319.1532864; Tue, 10 Feb 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 1vpmAJ-0007fk-5k; Tue, 10 Feb 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1226319;
 Tue, 10 Feb 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 1vpmAI-0007fc-4r
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpmAI-001jau-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpmAI-001dXR-0E
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=S00tl3g1/4h8JK59Oq0mCwepH0K4I4ZpXlQvTdyMqHI=; b=fDc6sJceLkTWzIVBjMFTka1QR3
	SRWusHRHgsbWFUQpFOLYXPBeJ2f/UPVFNjj1CPhUdFfNtzbAySJabWbqgk5qGnmT+UT2X/L4H5nl1
	Puu28y13G1+Q9EzohHxnfCTM4aZ7EimulBUI7HkPnX3xbqDOzUbhejfL9fiLv+hEkpG4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vpmAI-001dXR-0E@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 11:44:22 +0000

commit f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Feb 10 10:22:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:22:53 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 31352d4cd2..a054315fa4 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 11:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 11:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226320.1532867 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpmAT-0007i1-9Y; Tue, 10 Feb 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 1226320.1532867; Tue, 10 Feb 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 1vpmAT-0007ht-74; Tue, 10 Feb 2026 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1226320;
 Tue, 10 Feb 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 1vpmAS-0007hl-7f
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpmAS-001jbJ-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpmAS-001dZ1-0Y
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=wuNHyyGLfXBu46Nb7oZOCvzJuNu8P7IDEk0nTXBWmD8=; b=L6ib8UQwuSq3lcXiXpT7xMVQtW
	WV1sJUJcaPKNvfdI5rurhtKvzj2cRDy93mVaLNT1tDMNjUiCkv6g4UVN4hpkT/zrcOR0YpFc+jJlh
	7Ddhu2E66hqPn8bQgXt9LwYayo863xK2sMErT5pORAnpQ+hXA6N1XnUSB4754rKSVb48=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/kconfig: Reflow the SHADOW help message
Message-Id: <E1vpmAS-001dZ1-0Y@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 11:44:32 +0000

commit 15da92361b71480e2e602451835c21756b4c475f
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Tue Feb 10 10:23:10 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:23:10 2026 +0100

    x86/kconfig: Reflow the SHADOW help message
    
    Wasn't following the tab+2 spaces convention throughout the rest of the file.
    
    Not a functional change.
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/Kconfig | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 61f58aa829..2ce4747f6e 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -148,20 +148,17 @@ config SHADOW_PAGING
 	default !PV_SHIM_EXCLUSIVE
 	depends on PV || HVM
 	help
+	  Shadow paging is a software alternative to hardware paging support
+	  (Intel EPT, AMD NPT).
 
-          Shadow paging is a software alternative to hardware paging support
-          (Intel EPT, AMD NPT).
+	  It is required for:
+	  * Running HVM guests on hardware lacking hardware paging support
+	    (First-generation Intel VT-x or AMD SVM).
+	  * Live migration of PV guests.
+	  * L1TF sidechannel mitigation for PV guests.
 
-          It is required for:
-            * Running HVM guests on hardware lacking hardware paging support
-              (First-generation Intel VT-x or AMD SVM).
-            * Live migration of PV guests.
-            * L1TF sidechannel mitigation for PV guests.
-
-          Under a small number of specific workloads, shadow paging may be
-          deliberately used as a performance optimisation.
-
-          If unsure, say Y.
+	  Under a small number of specific workloads, shadow paging may be
+	  deliberately used as a performance optimisation.
 
 config PAGING
 	def_bool HVM || SHADOW_PAGING
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 10 11:44:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 10 Feb 2026 11:44:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1226323.1532872 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vpmAd-0007kP-B7; Tue, 10 Feb 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 1226323.1532872; Tue, 10 Feb 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 1vpmAd-0007kH-8P; Tue, 10 Feb 2026 11:44:43 +0000
Received: by outflank-mailman (input) for mailman id 1226323;
 Tue, 10 Feb 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 1vpmAc-0007kA-A6
 for xen-changelog@lists.xenproject.org; Tue, 10 Feb 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 1vpmAc-001jbN-0u
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 2026 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vpmAc-001dah-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 10 Feb 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=0xdzuKi7p2hcVXkWHOCc8zyFKNp5Rdup0d3+hZTKLEc=; b=2vOU9H5VBFbdqzI2CyYoTbb9ue
	XjkxN/L+2Xc+1dtK+m/mxIyRcs4RxW2/rHxhvmn+5dYympIEi/ekAj94pLJRxw5uciDcJteSuWy2j
	4U2OLEW/tiTpEqnJ8i9a9rZN7jcMwt/gIt0cxsam2DBFkXL/oW4Q6ykL7AVfJIj6+eUo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Add Darwin.mk
Message-Id: <E1vpmAc-001dah-0p@xenbits.xenproject.org>
Date: Tue, 10 Feb 2026 11:44:42 +0000

commit 2fa468919c39aac189623b6c580ce4ff8592d799
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Tue Feb 10 10:24:18 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 10 10:24:18 2026 +0100

    xen: Add Darwin.mk
    
    Xen does not provide a Darwin build configuration useable on Mac OS.
    It is possible to build Xen Hypervisor (tools are not supported) with a
    toolchain able to produce ELF binaries (GCC or others).
    
    Add config/Darwin.mk to include StdGNU.mk and force
    XEN_COMPILE_ARCH=unknown, ensuring Darwin builds always follow
    the cross-compile path so compiling on Mac OS is always handled as a
    cross compilation case.
    
    Only compiling the hypervisor has been tested !
    
    An example of how to build the hypervisor for arm64 on Mac OS
    (tools cannot be build for now) using a compiler from brew:
    - brew install aarch64-elf-gcc aarch64-elf-binutils
    - make XEN_TARGET_ARCH=arm64 CROSS_COMPILE=aarch64-elf- HOSTCC=clang -C xen
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 config/Darwin.mk | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/Darwin.mk b/config/Darwin.mk
new file mode 100644
index 0000000000..de4a0afab7
--- /dev/null
+++ b/config/Darwin.mk
@@ -0,0 +1,7 @@
+# Use GNU tool definitions as the tools we are using are either GNU compatible
+# or we only use features which are supported on Mac OS.
+include $(XEN_ROOT)/config/StdGNU.mk
+
+# Force cross compile on Mac OS: Only hypervisor build is supported, no tools,
+# and in the hypervisor the (plain) SVR4 ABI is in use.
+XEN_COMPILE_ARCH = unknown
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 09:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 09:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227154.1533491 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq6w4-0003Qu-1Y; Wed, 11 Feb 2026 09:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227154.1533491; Wed, 11 Feb 2026 09: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 1vq6w3-0003Qm-VF; Wed, 11 Feb 2026 09:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1227154;
 Wed, 11 Feb 2026 09: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 1vq6w2-0003Qe-Is
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 09: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 1vq6w2-003PFk-1f
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq6w2-00335X-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09: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=eHhL1Y09XBzws0+1VApSVr34JmwxTvbat7e+WA4zzFA=; b=Y1XyBzBMhj0Z6D+APFJnpZ+fKG
	YCpCtPX5C1TK+YiFn8ggtcWU7htvyAexR6pHuTAdmwXcMsgnevHUlgfGJtH4gWD6+w34gzCJEc2ab
	ePy8k+QotjAFTKhM99JGYln/nn9sy6GdzSy2qcGJvTzN7kCI9o0wqq/Ewh7JGOP8cF5c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] non-x86/symbols: check table sizes don't change between linking passes 2 and 3
Message-Id: <E1vq6w2-00335X-1P@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 09:55:02 +0000

commit aa786d6e3467b4219851a896d73417b70285a7ce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 09:20:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:20:08 2026 +0100

    non-x86/symbols: check table sizes don't change between linking passes 2 and 3
    
    Extend commit 1df11ccceb1a ("symbols: check table sizes don't change
    between linking passes 2 and 3") to other ports as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/Makefile   | 1 +
 xen/arch/ppc/Makefile   | 1 +
 xen/arch/riscv/Makefile | 1 +
 3 files changed, 3 insertions(+)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 95bc7ad25e..69200b2728 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -99,6 +99,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 92d68cb808..fea39ae732 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -26,6 +26,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 0df139b274..1eb9ab090b 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -40,6 +40,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 09:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 09:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227155.1533496 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq6wE-0003Sy-2w; Wed, 11 Feb 2026 09:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227155.1533496; Wed, 11 Feb 2026 09: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 1vq6wE-0003Sq-0L; Wed, 11 Feb 2026 09:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1227155;
 Wed, 11 Feb 2026 09: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 1vq6wC-0003Sf-Kt
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 09: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 1vq6wC-003PFr-1z
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq6wC-003370-1p
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09: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=urMfobUFHnLxcUGjX1/8p2Cxa0WLXCzvo3WZ229/CJU=; b=CvFOw2qH3X1zP1q1rRv15wqQ9b
	1YiapsIJEuK4ikDKgGYBMljTzPY1TYkz8V9N2vCs6qy0RylTENSgrsmoZA/seq/Ri/Vvnm/kbnqMD
	ypfOgACx3XL1i167q0E6G2JncvnlxeqB0qQzMuP9Dbrrb7B5gI9SPmQvAPPwbEdgs1YE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: avoid reading hstateen0 when Smstateen is not implemented
Message-Id: <E1vq6wC-003370-1p@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 09:55:12 +0000

commit e1689365dad3feda6400addd7396896796908e5d
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 11 09:20:51 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:20:51 2026 +0100

    xen/riscv: avoid reading hstateen0 when Smstateen is not implemented
    
    If the Smstateen extension is not implemented, the hstateen0 CSR is
    considered non-existent. Any attempt to access it will raise an
    illegal-instruction exception.
    
    Guard the hstateen0 dump with a runtime check for Smstateen support to
    avoid triggering traps when dumping CSRs on systems that do not
    implement this extension.
    
    Fixes: 3babc8d2e546 ("xen/riscv: dump GPRs and CSRs on unexpected traps")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c             | 1 +
 xen/arch/riscv/include/asm/cpufeature.h | 1 +
 xen/arch/riscv/traps.c                  | 8 +++++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 02b68aeaa4..03e27b037b 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -137,6 +137,7 @@ const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
     RISCV_ISA_EXT_DATA(zbb),
     RISCV_ISA_EXT_DATA(zbs),
     RISCV_ISA_EXT_DATA(smaia),
+    RISCV_ISA_EXT_DATA(smstateen),
     RISCV_ISA_EXT_DATA(ssaia),
     RISCV_ISA_EXT_DATA(svade),
     RISCV_ISA_EXT_DATA(svpbmt),
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index b696160388..ef02a3e26d 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -36,6 +36,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_zbb,
     RISCV_ISA_EXT_zbs,
     RISCV_ISA_EXT_smaia,
+    RISCV_ISA_EXT_smstateen,
     RISCV_ISA_EXT_ssaia,
     RISCV_ISA_EXT_svade,
     RISCV_ISA_EXT_svpbmt,
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 34920f4e56..c81a4f79a0 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -11,6 +11,7 @@
 #include <xen/nospec.h>
 #include <xen/sched.h>
 
+#include <asm/cpufeature.h>
 #include <asm/intc.h>
 #include <asm/processor.h>
 #include <asm/riscv_encoding.h>
@@ -144,7 +145,12 @@ static void dump_csrs(const char *ctx)
       (v & HSTATUS_SPV)  ? " SPV"  : "",
       (v & HSTATUS_GVA)  ? " GVA"  : "");
     X(hgatp, CSR_HGATP, "\n");
-    X(hstateen0, CSR_HSTATEEN0, "\n");
+
+    if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_smstateen) )
+    {
+        X(hstateen0, CSR_HSTATEEN0, "\n");
+    }
+
     X(stvec, CSR_STVEC, " "); X(vstvec, CSR_VSTVEC, "\n");
     X(sepc, CSR_SEPC, " "); X(vsepc, CSR_VSEPC, "\n");
     X(stval, CSR_STVAL, " "); X(vstval, CSR_VSTVAL, "\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 09:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 09:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227156.1533499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq6wO-0003VJ-4R; Wed, 11 Feb 2026 09:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227156.1533499; Wed, 11 Feb 2026 09: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 1vq6wO-0003VB-1p; Wed, 11 Feb 2026 09:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1227156;
 Wed, 11 Feb 2026 09: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 1vq6wM-0003V3-NW
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 09: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 1vq6wM-003PFx-2G
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq6wM-00337s-29
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 09: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=6MUWYY7H1U+bEGCFp3UIU57yilhI35PqmEmca0YKAHE=; b=YP6Gxc2mDPq91/lRt8Mrkgvgx8
	7ci3zg7rWjBCMDPLxJ3RuKfIg5noTxpuf8qbt3SKXtzswWDsmPAqstNU5hnrl8TSiThX/7Iy1Rjwt
	F9adq8Yu9cuKhxJAUIlMeADaEuCrpXrL+R859MoI3XDhzuPCr6A6r825PLEagExxs6E0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/PCI: avoid re-evaluation of extended config space accessibility
Message-Id: <E1vq6wM-00337s-29@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 09:55:22 +0000

commit d96694508a2867726162941f163400368a07c91b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 09:21:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:21:35 2026 +0100

    x86/PCI: avoid re-evaluation of extended config space accessibility
    
    When, during boot, we have already correctly determined availability of
    the MMCFG access method for a given bus range, there's then no need to
    invoke pci_check_extcfg() again for every of the devices. This in
    particular avoids ->ext_cfg to transiently indicate the wrong state.
    
    Switch to using Xen style on lines being touched and immediately adjacent
    ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/physdev.c                |  2 ++
 xen/arch/x86/x86_64/mmconfig-shared.c | 16 +++++++++-------
 xen/arch/x86/x86_64/mmconfig.h        |  2 +-
 xen/arch/x86/x86_64/mmconfig_64.c     | 10 +++++++---
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index f6014e2f49..8496011b59 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -528,6 +528,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !ret )
             ret = pci_segment_iterate(info.segment, physdev_check_pci_extcfg,
                                       &info);
+        else if ( ret > 0 ) /* Indication of "no change". */
+            ret = 0;
 
         if ( !ret && has_vpci(currd) && (info.flags & XEN_PCI_MMCFG_RESERVED) )
         {
diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c
index d53da1e2a7..ab082b5f5b 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -388,8 +388,9 @@ static bool __init pci_mmcfg_reject_broken(void)
                (unsigned int)cfg->start_bus_number,
                (unsigned int)cfg->end_bus_number);
 
-        if (!is_mmconf_reserved(addr, size, i, cfg) ||
-            pci_mmcfg_arch_enable(i)) {
+        if ( !is_mmconf_reserved(addr, size, i, cfg) ||
+             pci_mmcfg_arch_enable(i) < 0 )
+        {
             pci_mmcfg_arch_disable(i);
             valid = 0;
         }
@@ -417,8 +418,8 @@ void __init acpi_mmcfg_init(void)
         unsigned int i;
 
         pci_mmcfg_arch_init();
-        for (i = 0; i < pci_mmcfg_config_num; ++i)
-            if (pci_mmcfg_arch_enable(i))
+        for ( i = 0; i < pci_mmcfg_config_num; ++i )
+            if ( pci_mmcfg_arch_enable(i) < 0 )
                 valid = 0;
     } else {
         acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);
@@ -458,10 +459,11 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        segment, start_bus, end_bus, address, cfg->address);
                 return -EIO;
             }
-            if (flags & XEN_PCI_MMCFG_RESERVED)
+
+            if ( flags & XEN_PCI_MMCFG_RESERVED )
                 return pci_mmcfg_arch_enable(i);
-            pci_mmcfg_arch_disable(i);
-            return 0;
+
+            return pci_mmcfg_arch_disable(i);
         }
     }
 
diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h
index 722bf67975..27c0ae5cb1 100644
--- a/xen/arch/x86/x86_64/mmconfig.h
+++ b/xen/arch/x86/x86_64/mmconfig.h
@@ -74,6 +74,6 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        unsigned int flags);
 int pci_mmcfg_arch_init(void);
 int pci_mmcfg_arch_enable(unsigned int idx);
-void pci_mmcfg_arch_disable(unsigned int idx);
+int pci_mmcfg_arch_disable(unsigned int idx);
 
 #endif /* X86_64_MMCONFIG_H */
diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index ffdc62700d..940cf6d747 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -138,8 +138,9 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
     unsigned long start_mfn, end_mfn;
 
-    if (pci_mmcfg_virt[idx].virt)
-        return 0;
+    if ( pci_mmcfg_virt[idx].virt )
+        return 1;
+
     pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, idx, PAGE_HYPERVISOR_UC);
     if (!pci_mmcfg_virt[idx].virt) {
         printk(KERN_ERR "PCI: Cannot map MCFG aperture for segment %04x\n",
@@ -160,9 +161,10 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     return 0;
 }
 
-void pci_mmcfg_arch_disable(unsigned int idx)
+int pci_mmcfg_arch_disable(unsigned int idx)
 {
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
+    int ret = !pci_mmcfg_virt[idx].virt;
 
     pci_mmcfg_virt[idx].virt = NULL;
     /*
@@ -173,6 +175,8 @@ void pci_mmcfg_arch_disable(unsigned int idx)
     mcfg_ioremap(cfg, idx, 0);
     printk(KERN_WARNING "PCI: Not using MCFG for segment %04x bus %02x-%02x\n",
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
+
+    return ret;
 }
 
 bool pci_mmcfg_decode(unsigned long mfn, unsigned int *seg, unsigned int *bdf)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 10:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 10:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227282.1533620 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq7s7-0007sh-5J; Wed, 11 Feb 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 1227282.1533620; Wed, 11 Feb 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 1vq7s7-0007sZ-2i; Wed, 11 Feb 2026 10:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1227282;
 Wed, 11 Feb 2026 10: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 1vq7s5-0007sT-NN
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 10: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 1vq7s5-003QYV-26
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq7s5-0036lD-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10: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=DC2Tm0uDXmOZ62B3s85ZMOs9O2Z/sMDcK0HrXa15lTs=; b=m4ucH97sm2sP3XX9C0Ye5Y215N
	Sj+BUADAkEa5asdgH7HfBCwIZHCPGYD/gkKf4ZFR2Mky7kncgH9O0t0yj2mM+h4hJpBCtW6lvMMOa
	KLXBGA22XwkeQBbKaLGba/SU3OUTmlJS0jAS6XTEuyzl3+NEw7lEx0W5iR22bUOy0J8s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] non-x86/symbols: check table sizes don't change between linking passes 2 and 3
Message-Id: <E1vq7s5-0036lD-1v@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 10:55:01 +0000

commit aa786d6e3467b4219851a896d73417b70285a7ce
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 09:20:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:20:08 2026 +0100

    non-x86/symbols: check table sizes don't change between linking passes 2 and 3
    
    Extend commit 1df11ccceb1a ("symbols: check table sizes don't change
    between linking passes 2 and 3") to other ports as well.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/arm/Makefile   | 1 +
 xen/arch/ppc/Makefile   | 1 +
 xen/arch/riscv/Makefile | 1 +
 3 files changed, 3 insertions(+)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 95bc7ad25e..69200b2728 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -99,6 +99,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
diff --git a/xen/arch/ppc/Makefile b/xen/arch/ppc/Makefile
index 92d68cb808..fea39ae732 100644
--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -26,6 +26,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 0df139b274..1eb9ab090b 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -40,6 +40,7 @@ $(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)
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \
 	    $(dot-target).2.o -o $@
 	$(NM) -pa --format=sysv $@ \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 10:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 10:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227283.1533624 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq7sH-0007up-6W; Wed, 11 Feb 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 1227283.1533624; Wed, 11 Feb 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 1vq7sH-0007ui-40; Wed, 11 Feb 2026 10:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1227283;
 Wed, 11 Feb 2026 10: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 1vq7sF-0007uA-P1
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 10: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 1vq7sF-003QZg-2P
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10:55:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq7sF-0036lu-2H
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10: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=K3lH01M1FdviRgazzhST2F4ECH2/9xQCJBfSF7zY874=; b=R+u2tf87NHkuL9fBUx9+Nvk85L
	SZcXe2bKLbUIsVmMrfzmrza19PjSY3Vb/2eTm+D65LYqrYegDFD+DoCHggPC47JJuLvBazaRoHT2Z
	ncLj5Bgz3aIWQg5Zju44f/qw5ZH9TpfSHhoHXxNIvGcd0Xk4uzdjSyA0LPBDUxvgF8IU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: avoid reading hstateen0 when Smstateen is not implemented
Message-Id: <E1vq7sF-0036lu-2H@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 10:55:11 +0000

commit e1689365dad3feda6400addd7396896796908e5d
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 11 09:20:51 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:20:51 2026 +0100

    xen/riscv: avoid reading hstateen0 when Smstateen is not implemented
    
    If the Smstateen extension is not implemented, the hstateen0 CSR is
    considered non-existent. Any attempt to access it will raise an
    illegal-instruction exception.
    
    Guard the hstateen0 dump with a runtime check for Smstateen support to
    avoid triggering traps when dumping CSRs on systems that do not
    implement this extension.
    
    Fixes: 3babc8d2e546 ("xen/riscv: dump GPRs and CSRs on unexpected traps")
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/cpufeature.c             | 1 +
 xen/arch/riscv/include/asm/cpufeature.h | 1 +
 xen/arch/riscv/traps.c                  | 8 +++++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/cpufeature.c b/xen/arch/riscv/cpufeature.c
index 02b68aeaa4..03e27b037b 100644
--- a/xen/arch/riscv/cpufeature.c
+++ b/xen/arch/riscv/cpufeature.c
@@ -137,6 +137,7 @@ const struct riscv_isa_ext_data __initconst riscv_isa_ext[] = {
     RISCV_ISA_EXT_DATA(zbb),
     RISCV_ISA_EXT_DATA(zbs),
     RISCV_ISA_EXT_DATA(smaia),
+    RISCV_ISA_EXT_DATA(smstateen),
     RISCV_ISA_EXT_DATA(ssaia),
     RISCV_ISA_EXT_DATA(svade),
     RISCV_ISA_EXT_DATA(svpbmt),
diff --git a/xen/arch/riscv/include/asm/cpufeature.h b/xen/arch/riscv/include/asm/cpufeature.h
index b696160388..ef02a3e26d 100644
--- a/xen/arch/riscv/include/asm/cpufeature.h
+++ b/xen/arch/riscv/include/asm/cpufeature.h
@@ -36,6 +36,7 @@ enum riscv_isa_ext_id {
     RISCV_ISA_EXT_zbb,
     RISCV_ISA_EXT_zbs,
     RISCV_ISA_EXT_smaia,
+    RISCV_ISA_EXT_smstateen,
     RISCV_ISA_EXT_ssaia,
     RISCV_ISA_EXT_svade,
     RISCV_ISA_EXT_svpbmt,
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 34920f4e56..c81a4f79a0 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -11,6 +11,7 @@
 #include <xen/nospec.h>
 #include <xen/sched.h>
 
+#include <asm/cpufeature.h>
 #include <asm/intc.h>
 #include <asm/processor.h>
 #include <asm/riscv_encoding.h>
@@ -144,7 +145,12 @@ static void dump_csrs(const char *ctx)
       (v & HSTATUS_SPV)  ? " SPV"  : "",
       (v & HSTATUS_GVA)  ? " GVA"  : "");
     X(hgatp, CSR_HGATP, "\n");
-    X(hstateen0, CSR_HSTATEEN0, "\n");
+
+    if ( riscv_isa_extension_available(NULL, RISCV_ISA_EXT_smstateen) )
+    {
+        X(hstateen0, CSR_HSTATEEN0, "\n");
+    }
+
     X(stvec, CSR_STVEC, " "); X(vstvec, CSR_VSTVEC, "\n");
     X(sepc, CSR_SEPC, " "); X(vsepc, CSR_VSEPC, "\n");
     X(stval, CSR_STVAL, " "); X(vstval, CSR_VSTVAL, "\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 10:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 10:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227284.1533628 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq7sR-0007wz-8g; Wed, 11 Feb 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 1227284.1533628; Wed, 11 Feb 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 1vq7sR-0007wr-5k; Wed, 11 Feb 2026 10:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1227284;
 Wed, 11 Feb 2026 10: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 1vq7sP-0007wi-SP
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 10: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 1vq7sP-003QZm-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10:55:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq7sP-0036mR-2a
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 10: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=ixh9CnWCPYC4cIfXx7PjNjB4Y6sMv8ahTHYUU8njdpc=; b=OlQ5P4+HMtsH5ZJr91pdYcJr7D
	30noitnxmnqY9JOoCW5Q4m4rfwPU1PmxUkGMCTO7EpqaLZ1n5v2gdZOOSP9RYRZ9PY7s/9StPYruH
	6A5HIHLdbNS5Q+cOALMOyXbONjMQc5SgQsxbXXBvTOuuKe7peeJnf09PmHQPTGY8OE/w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/PCI: avoid re-evaluation of extended config space accessibility
Message-Id: <E1vq7sP-0036mR-2a@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 10:55:21 +0000

commit d96694508a2867726162941f163400368a07c91b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 09:21:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 09:21:35 2026 +0100

    x86/PCI: avoid re-evaluation of extended config space accessibility
    
    When, during boot, we have already correctly determined availability of
    the MMCFG access method for a given bus range, there's then no need to
    invoke pci_check_extcfg() again for every of the devices. This in
    particular avoids ->ext_cfg to transiently indicate the wrong state.
    
    Switch to using Xen style on lines being touched and immediately adjacent
    ones.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
 xen/arch/x86/physdev.c                |  2 ++
 xen/arch/x86/x86_64/mmconfig-shared.c | 16 +++++++++-------
 xen/arch/x86/x86_64/mmconfig.h        |  2 +-
 xen/arch/x86/x86_64/mmconfig_64.c     | 10 +++++++---
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index f6014e2f49..8496011b59 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -528,6 +528,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         if ( !ret )
             ret = pci_segment_iterate(info.segment, physdev_check_pci_extcfg,
                                       &info);
+        else if ( ret > 0 ) /* Indication of "no change". */
+            ret = 0;
 
         if ( !ret && has_vpci(currd) && (info.flags & XEN_PCI_MMCFG_RESERVED) )
         {
diff --git a/xen/arch/x86/x86_64/mmconfig-shared.c b/xen/arch/x86/x86_64/mmconfig-shared.c
index d53da1e2a7..ab082b5f5b 100644
--- a/xen/arch/x86/x86_64/mmconfig-shared.c
+++ b/xen/arch/x86/x86_64/mmconfig-shared.c
@@ -388,8 +388,9 @@ static bool __init pci_mmcfg_reject_broken(void)
                (unsigned int)cfg->start_bus_number,
                (unsigned int)cfg->end_bus_number);
 
-        if (!is_mmconf_reserved(addr, size, i, cfg) ||
-            pci_mmcfg_arch_enable(i)) {
+        if ( !is_mmconf_reserved(addr, size, i, cfg) ||
+             pci_mmcfg_arch_enable(i) < 0 )
+        {
             pci_mmcfg_arch_disable(i);
             valid = 0;
         }
@@ -417,8 +418,8 @@ void __init acpi_mmcfg_init(void)
         unsigned int i;
 
         pci_mmcfg_arch_init();
-        for (i = 0; i < pci_mmcfg_config_num; ++i)
-            if (pci_mmcfg_arch_enable(i))
+        for ( i = 0; i < pci_mmcfg_config_num; ++i )
+            if ( pci_mmcfg_arch_enable(i) < 0 )
                 valid = 0;
     } else {
         acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg);
@@ -458,10 +459,11 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        segment, start_bus, end_bus, address, cfg->address);
                 return -EIO;
             }
-            if (flags & XEN_PCI_MMCFG_RESERVED)
+
+            if ( flags & XEN_PCI_MMCFG_RESERVED )
                 return pci_mmcfg_arch_enable(i);
-            pci_mmcfg_arch_disable(i);
-            return 0;
+
+            return pci_mmcfg_arch_disable(i);
         }
     }
 
diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h
index 722bf67975..27c0ae5cb1 100644
--- a/xen/arch/x86/x86_64/mmconfig.h
+++ b/xen/arch/x86/x86_64/mmconfig.h
@@ -74,6 +74,6 @@ int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
                        unsigned int flags);
 int pci_mmcfg_arch_init(void);
 int pci_mmcfg_arch_enable(unsigned int idx);
-void pci_mmcfg_arch_disable(unsigned int idx);
+int pci_mmcfg_arch_disable(unsigned int idx);
 
 #endif /* X86_64_MMCONFIG_H */
diff --git a/xen/arch/x86/x86_64/mmconfig_64.c b/xen/arch/x86/x86_64/mmconfig_64.c
index ffdc62700d..940cf6d747 100644
--- a/xen/arch/x86/x86_64/mmconfig_64.c
+++ b/xen/arch/x86/x86_64/mmconfig_64.c
@@ -138,8 +138,9 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
     unsigned long start_mfn, end_mfn;
 
-    if (pci_mmcfg_virt[idx].virt)
-        return 0;
+    if ( pci_mmcfg_virt[idx].virt )
+        return 1;
+
     pci_mmcfg_virt[idx].virt = mcfg_ioremap(cfg, idx, PAGE_HYPERVISOR_UC);
     if (!pci_mmcfg_virt[idx].virt) {
         printk(KERN_ERR "PCI: Cannot map MCFG aperture for segment %04x\n",
@@ -160,9 +161,10 @@ int pci_mmcfg_arch_enable(unsigned int idx)
     return 0;
 }
 
-void pci_mmcfg_arch_disable(unsigned int idx)
+int pci_mmcfg_arch_disable(unsigned int idx)
 {
     const typeof(pci_mmcfg_config[0]) *cfg = pci_mmcfg_virt[idx].cfg;
+    int ret = !pci_mmcfg_virt[idx].virt;
 
     pci_mmcfg_virt[idx].virt = NULL;
     /*
@@ -173,6 +175,8 @@ void pci_mmcfg_arch_disable(unsigned int idx)
     mcfg_ioremap(cfg, idx, 0);
     printk(KERN_WARNING "PCI: Not using MCFG for segment %04x bus %02x-%02x\n",
            cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number);
+
+    return ret;
 }
 
 bool pci_mmcfg_decode(unsigned long mfn, unsigned int *seg, unsigned int *bdf)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227358.1533696 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8St-0008GF-Ix; Wed, 11 Feb 2026 11:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227358.1533696; Wed, 11 Feb 2026 11: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 1vq8St-0008G7-GD; Wed, 11 Feb 2026 11:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1227358;
 Wed, 11 Feb 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 1vq8Ss-0008G1-Od
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vq8Ss-003RLe-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Ss-0039I0-21
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=Zbh8+yToUmiwhaqh/9KFMY90NdCNPixienDMkS1hlkk=; b=b8uiCPpzPYungipkZY06Sjeadf
	8v24BEV2lU61XUKsms4AkO/lRI3wNjKyNypiZAuizPkg276h8zjCzzhccPfZxGTOGHejTAi47lnBy
	EhtU0GBcJYAza8f+CZl3CcKgDuD5fToRCn3rvYD3O9S1MT12m6/yyNNC773JclnQCxhQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vq8Ss-0039I0-21@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:02 +0000

commit 74b26c53d32ec1ff78d63e6c9827c41e2972f9b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:15:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:15:49 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 527872a6db..abd3ef2ae2 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -347,6 +347,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227359.1533700 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8T3-0008IV-KC; Wed, 11 Feb 2026 11:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227359.1533700; Wed, 11 Feb 2026 11: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 1vq8T3-0008IM-Ha; Wed, 11 Feb 2026 11:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1227359;
 Wed, 11 Feb 2026 11: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 1vq8T2-0008Hy-QO
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11: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 1vq8T2-003RLi-2Y
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8T2-0039LS-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11: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=j92kk4nBmFCqH34q+8kdXWDizNTbYvKZ9GZ13VPgFvU=; b=TOoIhvlWrsHOrglTZVJ4fVrtiz
	b1ojTFBJuOQViw6RymjyclKGlot7uw5u2dJlz04fQlDWW5iFZ3ZkaND2bzPhl4SdrfDdQ1mDyh+w3
	Jee6FgMvwAFL1UeojMjKyIPGV4ZlZoxKWammPTQ3KnP8a7Z99rX6/dyzPTCxzGhMJUA8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vq8T2-0039LS-2Q@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:12 +0000

commit 39c90c8deebf4c4d46bcc08d2f1334283ab196f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:16:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:16:13 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index fc2372c523..7858c9418c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -436,6 +436,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227360.1533704 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8TD-0008Kb-Lm; Wed, 11 Feb 2026 11:33:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227360.1533704; Wed, 11 Feb 2026 11: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 1vq8TD-0008KT-It; Wed, 11 Feb 2026 11:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1227360;
 Wed, 11 Feb 2026 11: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 1vq8TC-0008KL-Ta
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11: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 1vq8TC-003ROA-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8TC-0039M8-2j
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11: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=jDcxwm0wkJ+bpI9ZRmkZhUlI54hq4kvo2dBcWSRGa60=; b=tlzbTkFwgorZfSIJZbunFa/6Kq
	mqdltT92Bp7LptW99NVTRTjESKuduxeWBbfm0Q0nL0s1njvWl3ovpWQ9rzzl5qQJLTGxFtbGiZ+Xh
	A9Egwa5y6O1kOsR3HSVUxaszPbERZX0lx6iSqUZG1ug8oEB6i9yn5glJNb3EQ6uZLH3g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vq8TC-0039M8-2j@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:22 +0000

commit 15cd2b8f1bac5f4adf0f8303ae79298a612b53e1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:16:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:16:37 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 7a93dad2ed..ee1f60c59e 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -144,6 +144,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -163,13 +166,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #if defined(CONFIG_ARM_64) || defined(CONFIG_MPU)
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a33eeec43b..82a9551082 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -57,6 +57,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -75,13 +78,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 9283616c02..4c37d87508 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -247,19 +247,15 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 08153e6d6f..d35086e31e 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2efc11ce09..2ee249ac36 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -170,7 +170,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227361.1533708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8TN-0008Mh-Mz; Wed, 11 Feb 2026 11:33:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227361.1533708; Wed, 11 Feb 2026 11: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 1vq8TN-0008MZ-KP; Wed, 11 Feb 2026 11:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1227361;
 Wed, 11 Feb 2026 11:33: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 1vq8TN-0008MT-0C
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:33: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 1vq8TM-003ROE-39
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8TM-0039Mw-33
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11: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=S1pRtS1pGZnvaePjDyTs7OnEMPvILOZ3Bn/N2Ow1BBM=; b=ngG29vF0J79IUcEEH2SR7iFnjc
	7Lgv+/YnQS6PaVNTuWUl87cf8mwJfg8f8zR6B/2770610lYuunGOBjVRXroNyQB8qKOU9PUIVCQ8l
	qzdWKs3Qu1v7tDPP2WsfkvcS1CH06w3gXe4fgvxHy4xlcbfb0npk4OCf9K1paMIRL7BA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vq8TM-0039Mw-33@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:32 +0000

commit 6228ea8acddadbd815f958fb1a867f54c01ddf78
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:01 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  23 +++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  10 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 775c339285..e7afda0570 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -575,6 +575,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -636,6 +648,7 @@ static int domain_teardown(struct domain *d)
 
         /* Trivial teardown, not long-running enough to need a preemption check. */
         domain_llc_coloring_free(d);
+        domain_pending_scrub_free(d);
 
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
@@ -679,6 +692,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1644,6 +1658,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..9240a6005e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -159,6 +159,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -275,7 +342,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -286,6 +365,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j], true);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2ee249ac36..588b5b99cb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -792,7 +792,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 # define scrub_page_cold clear_page_cold
 #endif
 
-static void scrub_one_page(const struct page_info *pg, bool cold)
+void scrub_one_page(const struct page_info *pg, bool cold)
 {
     void *ptr;
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b968f47b87..49c34248f9 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -145,6 +145,16 @@ unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
 
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg, bool cold);
+
 int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 610f3d4c0d..c89b930cbd 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -662,6 +662,11 @@ struct domain
         /* Permission to take ownership of the physical console input. */
         bool input_allowed;
     } console;
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227362.1533712 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8TX-0008Oi-OX; Wed, 11 Feb 2026 11:33:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227362.1533712; Wed, 11 Feb 2026 11: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 1vq8TX-0008OY-Lp; Wed, 11 Feb 2026 11:33:43 +0000
Received: by outflank-mailman (input) for mailman id 1227362;
 Wed, 11 Feb 2026 11:33: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 1vq8TX-0008OS-35
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:33: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 1vq8TX-003ROI-0D
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8TX-0039O5-07
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33: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=KjEn5Xl93kvk4WZPxIFtPQd1Dv4cpA4gjkn76UDqWBs=; b=6daJwGd5MoE+iOgtP2aDYNvplG
	cjXuk2cPRhmxvn3s332/2xgZ8+YarNwi6uEk701eDgkQKX6qWwfyW140TjC+sWyE2gf3U+Op4UjoR
	ylvbgH6UCViYeqGKiMKdDIANDYPrynuPyBAn3iqdKPNYiYs91PFaLbc8Kj/6AiwtDpdQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vq8TX-0039O5-07@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:43 +0000

commit d2a64135502263f1bd41e16901d55eaf533e4842
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:32 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d8cf91ba34..d488f08aff 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -914,11 +914,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 9c4785c187..a97831efe9 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -247,6 +247,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e7afda0570..6ae7c46b40 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -306,7 +306,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 8aab05ae93..613b5762b5 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -91,6 +91,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:33:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:33:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227363.1533716 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Th-0008RN-RV; Wed, 11 Feb 2026 11:33:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227363.1533716; Wed, 11 Feb 2026 11:33: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 1vq8Th-0008RF-Od; Wed, 11 Feb 2026 11:33:53 +0000
Received: by outflank-mailman (input) for mailman id 1227363;
 Wed, 11 Feb 2026 11: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 1vq8Th-0008R9-6f
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:33: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 1vq8Th-003ROc-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Th-0039Ow-0N
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:33: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=MIWBr52KIKarwjeECX7EQCoz4Qu9jsMI4K8BVrzJ3Y8=; b=cJsvVS52Bi05OGPFu6E+ypF4We
	+diMvWdk/AhyXHB67wAiSzHrGnF/EK6Pr3B/mOFw4WzInT04yeddEQBbiVt9hA5FU3M8BJ3adP8dq
	J04NKhpar5Kv8Zd1F80uhKuyAemIT/D79jUel36ePslWsKQ7H5wSo1Rs29rBfm8P5Ekw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vq8Th-0039Ow-0N@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:33:53 +0000

commit 867b7d3f97cc65a31738697bcb05bb3d3f604188
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:57 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227364.1533720 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Tr-0008TV-Sm; Wed, 11 Feb 2026 11:34:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227364.1533720; Wed, 11 Feb 2026 11:34: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 1vq8Tr-0008TN-Px; Wed, 11 Feb 2026 11:34:03 +0000
Received: by outflank-mailman (input) for mailman id 1227364;
 Wed, 11 Feb 2026 11: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 1vq8Tr-0008TH-9P
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11: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 1vq8Tr-003ROr-0q
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Tr-0039Qb-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34: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=sXH6egBDDzDl3x5EKNd/L2s347AaG0YRergLeXtTBnE=; b=SdEp3SCvqGcoCcSh+6RyIChTXX
	LHYZ6QydVAmcuw2SJkxM+ESnxukexz3iexTrN3nNnCiekqVqgaftcbgK3Z+MNC99+iQJOCp8CzVdg
	6woeCQFhBnIFbXB6x0uzlHSYO74XjOetON7tXKLNPNsOtm9NvYTLiBFxlaN7w8s2Q0/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vq8Tr-0039Qb-0j@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:03 +0000

commit 056103e7ada5937bf40d4ec582f3021bca96a24a
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:18:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:18:12 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index bbe7c4d379..9ed5853020 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227365.1533724 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8U2-0008Vv-U4; Wed, 11 Feb 2026 11:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227365.1533724; Wed, 11 Feb 2026 11: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 1vq8U2-0008Vn-RM; Wed, 11 Feb 2026 11:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1227365;
 Wed, 11 Feb 2026 11: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 1vq8U1-0008Vh-PB
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11: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 1vq8U1-003ROw-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8U1-0039SY-2J
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34: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=BBDhGs/CdtSPxZx3sXXyZLl/s4XD0MvupsOQXrpmw7o=; b=VaFYIE9BhImBNXuU3BOBB+X51x
	O2cTcryCUeCmwv55ZuOQ+GgqRKxTZ75R5k+GbWz5nZ0hyi/fikHhsUcdxhK1ojDipLY9zi8hQO4RW
	Em40SMERKLkYeVMCImB+JYWoec3NfsNRxDwYOseh5xKomNNCOWYKPxqvdDqJJHhjEYWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vq8U1-0039SY-2J@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:13 +0000

commit 816e71923fb8f99ecac8f7705d99f9aa82d380c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:18:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:18:56 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index f13655567a..c19682721d 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -340,6 +340,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:25 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227366.1533728 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8UC-000080-WF; Wed, 11 Feb 2026 11:34:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227366.1533728; Wed, 11 Feb 2026 11: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 1vq8UC-00007s-Sf; Wed, 11 Feb 2026 11:34:24 +0000
Received: by outflank-mailman (input) for mailman id 1227366;
 Wed, 11 Feb 2026 11: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 1vq8UB-00007k-TV
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11: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 1vq8UB-003RP1-2r
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8UB-0039TV-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11: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=c3VBcyVL+W3O2SEiNcZy5q6/XC33GMRbPX+TvseVByI=; b=2ooIb8twfbnGo4QfmxVZoE1tGo
	LwvW+YML3JhV4s27XOdwU9YAmnz1t2ly9OonKP/n6nygbrV0i4J14GJjzj1JpHJ2uvXlT4jHWesPV
	rHxQjh5Eba5XP7RcqBk9tgOo33NOtc0cV4hmAo2VIRVayqkbK0QRdK5nLDMEyovvb/nU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vq8UB-0039TV-2c@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:23 +0000

commit 9bdc49871fda2720cd6fe9b63407964c2b4e44e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:19:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:05 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 651bf2b448..7410dfdfcb 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -442,6 +442,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:35 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227367.1533731 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8UN-0000AR-0P; Wed, 11 Feb 2026 11:34:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227367.1533731; Wed, 11 Feb 2026 11: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 1vq8UM-0000AC-U3; Wed, 11 Feb 2026 11:34:34 +0000
Received: by outflank-mailman (input) for mailman id 1227367;
 Wed, 11 Feb 2026 11:34:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8UM-0000A2-0I
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:34:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8UL-003RP5-3B
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8UL-0039U7-34
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11: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=pcEWvuYBEy4epNHOenSwLOhrEsTE7DMqrGV56uyn7Nc=; b=BmBn9vBahNGWMtgpkmjHKlsHQJ
	hED39hrqzXkhdOGDP2HfULzaHyuNTavNzHWdnKktJhG9CPt++vxomXnSQtMnynoquEhW+I5Q33Y0U
	dvmzYSnzNPp41k19nArXYy7UBw0K1ZCvBObVyULdeRcHWuoLpk+G/LCJ95v1Mzbqo7dc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vq8UL-0039U7-34@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:33 +0000

commit 7e10bb1501c0289988d27772823c5eaf52f1b6a5
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:19:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:30 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index a0d8e5afe9..efbe19aba4 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -150,6 +150,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -169,13 +172,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a433936076..9b654945de 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -58,6 +58,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -76,13 +79,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 292aa48fc1..70849ce2e6 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -221,19 +221,15 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 6c7e66ee21..30e993baba 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 6919722e9a..60c33b2609 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -169,7 +169,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:45 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227368.1533736 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8UX-0000CT-25; Wed, 11 Feb 2026 11:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227368.1533736; Wed, 11 Feb 2026 11:34: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 1vq8UW-0000CL-VW; Wed, 11 Feb 2026 11:34:44 +0000
Received: by outflank-mailman (input) for mailman id 1227368;
 Wed, 11 Feb 2026 11:34:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8UW-0000CD-39
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:34:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8UW-003RP9-0E
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8UW-0039V2-09
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Zt0HdnesuJRdQU/FjJRcH4EYSd41n0CcBdQjNC683xE=; b=wBbqp8BSJGoyp598nikIKNgbzm
	WDWHnSecqlXvp9iojt00owzsg5P7QqCCierLtwXo2CsrKdRhRJQJmqx+UX+6GeaeG1Zw+z/evFnal
	8zTAQHoDRh1fHJcte8/U9pFjptWEvmCn7wXaOKzhiRdMVN54yN+l5A0HPEiLI4f+ALt8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vq8UW-0039V2-09@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:44 +0000

commit b304f948427218421af24abcb04b40d3c34fefbf
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:19:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:54 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  25 ++++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  11 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 146 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0c4cc77111..0df41f6950 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -446,6 +446,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -505,6 +517,9 @@ static int domain_teardown(struct domain *d)
     case PROG_none:
         BUILD_BUG_ON(PROG_none != 0);
 
+        /* Trivial teardown, not long-running enough to need a preemption check. */
+        domain_pending_scrub_free(d);
+
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
         if ( rc )
@@ -547,6 +562,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1478,6 +1494,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c78f0dcd0a..00ba0d61dc 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -157,6 +157,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -273,7 +340,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -284,6 +363,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j]);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 60c33b2609..cab35bc39c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -764,7 +764,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 #endif
 #define SCRUB_BYTE_PATTERN   (SCRUB_PATTERN & 0xff)
 
-static void scrub_one_page(const struct page_info *pg)
+void scrub_one_page(const struct page_info *pg)
 {
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 16f733281a..e8f4a2fba3 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -144,6 +144,17 @@ unsigned long avail_domheap_pages(void);
 unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
+
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg);
+
 unsigned int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index de621eb123..e664221184 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -646,6 +646,11 @@ struct domain
     unsigned int num_llc_colors;
     const unsigned int *llc_colors;
 #endif
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 };
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:34:55 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:34:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227369.1533740 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Uh-0000FM-4s; Wed, 11 Feb 2026 11:34:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227369.1533740; Wed, 11 Feb 2026 11:34: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 1vq8Uh-0000FF-27; Wed, 11 Feb 2026 11:34:55 +0000
Received: by outflank-mailman (input) for mailman id 1227369;
 Wed, 11 Feb 2026 11:34:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8Ug-0000F7-65
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:34:54 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Ug-003RPX-0W
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:54 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Ug-0039WM-0Q
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:34:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=3andpZC7P4eDHFemd9HNYss6jmq7FWywb2OTh/lRR4g=; b=fAFURpBA7ilff1llMKXuYKYAeg
	7lMMtSsS/b+LwVGZjUs435dRFRiEZiQb16YLi3cG7O9u2UZaRG2PxyCf3/J+jFFA+pGY36XbDBjiA
	Flj2GV1essN7sMxGWWhj2FroK53/epWqXVZwqO+xvH/eZzwM68kqlTbkx3ikGcFSlFbM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vq8Ug-0039WM-0Q@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:34:54 +0000

commit 6143f6f64d455624857d67b857da283315cace40
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:20:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:17 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 93580b9a58..60e14b3a49 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -845,11 +845,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 7aef628f55..745c1dbb21 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -246,6 +246,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0df41f6950..68e8677962 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -177,7 +177,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3de5635291..ae2b72d5c6 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227370.1533744 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Ur-0000HY-6A; Wed, 11 Feb 2026 11:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227370.1533744; Wed, 11 Feb 2026 11:35: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 1vq8Ur-0000HQ-3Z; Wed, 11 Feb 2026 11:35:05 +0000
Received: by outflank-mailman (input) for mailman id 1227370;
 Wed, 11 Feb 2026 11:35: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 1vq8Uq-0000HI-8X
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Uq-003RPr-0m
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:04 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Uq-0039XY-0g
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:04 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=FQvzg06IZu4VYtOuYth9HECDigiKB+AvpOVWG7NQRfA=; b=dy8CMWvRU2cXLWSpCF7JSdBAJV
	idx3ZyJGMdnD99EVXbYxduvk/ZCfRDZ8g45KOGJ9MW4OxRwMl8+iC9oZyJNHHoRxYebzbDDjrdWwf
	6WsQTDRFlpUk4w8ShKBd9r1c3jOwe4IwM2EH6niXAY5YrNxFCRmNXbcOkztZZmDyQ9C8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vq8Uq-0039XY-0g@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:04 +0000

commit 80ff08137eac9c96341cf94a71a6e1f8479c7d9d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:20:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:39 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227371.1533747 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8V1-0000Ju-7U; Wed, 11 Feb 2026 11:35:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227371.1533747; Wed, 11 Feb 2026 11:35: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 1vq8V1-0000Jm-4q; Wed, 11 Feb 2026 11:35:15 +0000
Received: by outflank-mailman (input) for mailman id 1227371;
 Wed, 11 Feb 2026 11:35: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 1vq8V0-0000Jf-B2
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35: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 1vq8V0-003RPv-11
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:14 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8V0-0039Ys-0v
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35: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=rv1001zkMhHBNCETSBI2ngr7TPzkS0o3oTGALcxjfvY=; b=HBq7qbKcOIb2fJxOKi2cy1U9+z
	oWx6qcvxhq5J4wJFWa1bKNSX3PBCv++VynrS1J3ntH81p3ESOXIfgAc2Y3XDs40bSctKDE8H3xWQi
	QI7WIcKIz6L0nIUvduHnhyrpJt85d3c42Dk/6TGc+OZaJGYtznT53scAJj+76CbShd60=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vq8V0-0039Ys-0v@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:14 +0000

commit 4bb46b8558cb123c84ebbf55dc0b6c3d7b572832
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:20:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:56 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 074052d0b0..b7b5941159 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:26 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227372.1533751 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VC-0000Lx-8i; Wed, 11 Feb 2026 11:35:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227372.1533751; Wed, 11 Feb 2026 11:35:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VC-0000Lp-6C; Wed, 11 Feb 2026 11:35:26 +0000
Received: by outflank-mailman (input) for mailman id 1227372;
 Wed, 11 Feb 2026 11:35: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 1vq8VA-0000Li-PE
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35: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 1vq8VA-003RQ1-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:24 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8VA-0039b6-2L
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35: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=LbwBjh2NCrMdOOxqSbMvhN7VaxCA60f6bHXLLXNh5Zc=; b=0uHxv4ymTipf9WboFnJbJuHziS
	ahEQrlSJU4FhKYRZf8fV118TIVQTQ86Y0Y0S8U2QWxk38WG6+njZbjd0Zwt6VoYHLXMxm2IwNI7RQ
	wmpbfVq5zopCl8SlKIldQVR/5zcWvDyoK57eduzOKLwJlfcHgqXLr92+JyagW6ZU0a74=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vq8VA-0039b6-2L@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:24 +0000

commit 7f9cde0f977515d2e108da37c34bdb4f7d69a1cd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:21:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:21:47 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 29de0e7452..95fce0346f 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -346,6 +346,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:36 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227373.1533756 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VM-0000OM-Ag; Wed, 11 Feb 2026 11:35:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227373.1533756; Wed, 11 Feb 2026 11:35:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VM-0000OD-7i; Wed, 11 Feb 2026 11:35:36 +0000
Received: by outflank-mailman (input) for mailman id 1227373;
 Wed, 11 Feb 2026 11:35:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8VK-0000O6-Rm
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35:34 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8VK-003RQA-2h
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:34 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8VK-0039cM-2b
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:34 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=JLp/S5XTopnBRCl1Ta7fQOxGN/hUs60r/wbKClEdjLY=; b=a4QTZTbkkKVZW7v0olhm/CfYqD
	2YPjAHWiPBpHDKzxMNPevfZsrBFPnpsIG+0ne13RzXw8fZKSEJ0io0TbLwTEfENumylPoxBEwjUbf
	uNA8AaQsYGGxPleV3RA8eeE9x6q9BiJM6HbXtGEXK5UTLKAg1mkvycpreNmXFkORn5ys=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vq8VK-0039cM-2b@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:34 +0000

commit 2f7bd87bd4aeac8141014fae41864d74ab88e9b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:21:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:21:57 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 1633825738..bd144aa59c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -439,6 +439,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:46 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227374.1533759 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VW-0000QP-By; Wed, 11 Feb 2026 11:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227374.1533759; Wed, 11 Feb 2026 11:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8VW-0000QH-98; Wed, 11 Feb 2026 11:35:46 +0000
Received: by outflank-mailman (input) for mailman id 1227374;
 Wed, 11 Feb 2026 11:35:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8VU-0000Q9-UL
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35:44 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8VU-003RQF-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:44 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8VU-0039dU-2s
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:44 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=uPr/nNF4AQNyVW00lYqyclWCZc2XBItMIozePqHktY8=; b=D9TKZGqcrHYNRWvZV1Pst7+B0X
	nxwUVGlZ0Bz1kZiyfmbmRuREfkyeL12gn7eia/CihkQW4q8UDOC79vowypiGiJlN++w5tROfIogEv
	pEha0V/xKCF8ofta7dKXNKZhwJyrA2Rvy/PdbQl0kofqQHtMZeExroE/pbEQEZNUMPI0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vq8VU-0039dU-2s@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:44 +0000

commit 49a4deb467caea989d81f3692ed19a406ef6ee83
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:15 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:15 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h | 10 +++-------
 xen/arch/ppc/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h | 18 +++++++-----------
 xen/common/page_alloc.c       |  6 ++++--
 4 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 48538b5337..ed71cf9bca 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -145,6 +145,9 @@ struct page_info
 #else
 #define PGC_static     0
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -164,13 +167,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a433936076..9b654945de 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -58,6 +58,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -76,13 +79,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 98b66edaca..52d2d5ff60 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index bbb8578459..4304c3dbd4 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2364,7 +2364,8 @@ int assign_pages(
 
         for ( i = 0; i < nr; i++ )
         {
-            ASSERT(!(pg[i].count_info & ~(PGC_extra | PGC_static)));
+            ASSERT(!(pg[i].count_info &
+                     ~(PGC_extra | PGC_static | PGC_need_scrub)));
             if ( pg[i].count_info & PGC_extra )
                 extra_pages++;
         }
@@ -2424,7 +2425,8 @@ int assign_pages(
         page_set_owner(&pg[i], d);
         smp_wmb(); /* Domain pointer must be visible before updating refcnt. */
         pg[i].count_info =
-            (pg[i].count_info & (PGC_extra | PGC_static)) | PGC_allocated | 1;
+            (pg[i].count_info & (PGC_extra | PGC_static | PGC_need_scrub)) |
+            PGC_allocated | 1;
 
         page_list_add_tail(&pg[i], page_to_list(d, &pg[i]));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:35:56 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:35:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227375.1533763 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Vg-0000SS-DO; Wed, 11 Feb 2026 11:35:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227375.1533763; Wed, 11 Feb 2026 11:35:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Vg-0000SL-AV; Wed, 11 Feb 2026 11:35:56 +0000
Received: by outflank-mailman (input) for mailman id 1227375;
 Wed, 11 Feb 2026 11:35:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8Vf-0000SE-0y
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:35:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Vf-003RQZ-01
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:55 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Ve-0039ei-39
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:35:54 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=SzeAyz4xUwsMDzXvGFB38/5TUVTSwrRjqov3XDh1aY0=; b=ogQOYdLBTZozNyLpJA9uzskrTC
	twjhaWRXrzIePzT5g9XrZvt3ruSCkm6V0kOf5TVDwHpqiLC2NWGW3/OxpMA+LUmwfk5icGpqsgvZB
	mpHWnnRA8Qvef7ExUjTdMWh73I8NssXCcGeg9f1FocCko+wWspdNoJBDjAVQuYHjLPik=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vq8Ve-0039ei-39@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:35:54 +0000

commit 52f3b7c6f89abe1f8fd4fc702f150cf3ec1fe89f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:33 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  25 ++++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/mm.h    |   9 +++++
 xen/include/xen/sched.h |   5 +++
 4 files changed, 143 insertions(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index fb262dcec9..f0583aeb73 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -392,6 +392,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -451,6 +463,9 @@ static int domain_teardown(struct domain *d)
     case PROG_none:
         BUILD_BUG_ON(PROG_none != 0);
 
+        /* Trivial teardown, not long-running enough to need a preemption check. */
+        domain_pending_scrub_free(d);
+
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
         if ( rc )
@@ -493,6 +508,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1420,6 +1436,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9b23cd0bdb..09bb1198bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -155,6 +155,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -271,7 +338,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -282,6 +361,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j]);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 7561297a75..fe32ef81cb 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -142,6 +142,15 @@ unsigned long avail_domheap_pages(void);
 unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
+
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
 unsigned int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2a83b9dacf..ff831c7254 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -636,6 +636,11 @@ struct domain
     } ioreq_server;
 #endif
 
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
+
     /* Holding CDF_* constant. Internal flags for domain creation. */
     unsigned int cdf;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:36:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:36:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227376.1533768 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Vq-0000Uz-Fz; Wed, 11 Feb 2026 11:36:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227376.1533768; Wed, 11 Feb 2026 11:36:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8Vq-0000Us-DK; Wed, 11 Feb 2026 11:36:06 +0000
Received: by outflank-mailman (input) for mailman id 1227376;
 Wed, 11 Feb 2026 11:36:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8Vp-0000Uk-3r
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:36:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Vp-003RQr-0I
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:05 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Vp-0039fv-0C
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:05 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=ExHyGA7mTwiK4bCIcb7rH/qRTsiB0v6cqByBrmPD8qw=; b=4qMSA90WxfqU8C+sLXW2eRXGOm
	uMHvzZu31v1PSk8W7ZewafcZaHAHvxgGZhBIxDZy6xJDZj5RqpL+kjMjTCVdtCkEeFlX34J2j9nj0
	ITDj/mzSsozeHsRaH+SmnBb8lrHmVgy+DvtFI/4RMzai558ow0GT3q0V/RoAUDh3MHOM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vq8Vp-0039fv-0C@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:36:05 +0000

commit 2fd843630188ca11fc455794c1213b0abe2d1d22
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:53 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4c60117215..fb413d4ab2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -855,11 +855,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 2a445bb17b..5302f7b366 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -245,6 +245,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index f0583aeb73..168f709423 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -123,7 +123,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3de5635291..ae2b72d5c6 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:36:16 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:36:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227377.1533771 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8W0-0000Xp-HY; Wed, 11 Feb 2026 11:36:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227377.1533771; Wed, 11 Feb 2026 11:36:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8W0-0000Xh-Eu; Wed, 11 Feb 2026 11:36:16 +0000
Received: by outflank-mailman (input) for mailman id 1227377;
 Wed, 11 Feb 2026 11:36:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8Vz-0000Xa-6R
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:36:15 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Vz-003RQy-0Y
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:15 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8Vz-0039gp-0S
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:15 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=PD3cOuPnFs19A8/O//R1y25W9tT6WaBSYqDoLzm71lU=; b=RhbZmyE5BO1n5/+Kn4eYMU7tJ3
	dpcT0ebxUMMxnV55wjyHsNkchrqgPVFef43CgbLex5UWzilULjzB25L5nYoKPHJ0FvV6BB6dHLx6J
	e+QK6OcFbCHNQO9ATOFIqt6opXjPas53myetEBHFtAUFQIKQcWgXX6dbF5je0HMix+ZE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vq8Vz-0039gp-0S@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:36:15 +0000

commit 60f5b47d487b13efc8785c3950b453c4355a57d8
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:23:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:23:13 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 11:36:26 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 11:36:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227378.1533776 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8WA-0000Zw-JB; Wed, 11 Feb 2026 11:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227378.1533776; Wed, 11 Feb 2026 11:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vq8WA-0000Zp-GG; Wed, 11 Feb 2026 11:36:26 +0000
Received: by outflank-mailman (input) for mailman id 1227378;
 Wed, 11 Feb 2026 11:36:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <infra@xenproject.org>) id 1vq8W9-0000Zh-8q
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 11:36:25 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8W9-003RR7-0n
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:25 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vq8W9-0039iU-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 11:36:25 +0000
X-BeenThere: xen-changelog@lists.xenproject.org
List-Id: "Change log for Mercurial \(receive only\)"
 <xen-changelog.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xenproject.org>
List-Help: <mailto:xen-changelog-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-changelog>, 
 <mailto:xen-changelog-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-changelog-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-changelog" <xen-changelog-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:Message-Id:Subject:Reply-To:To:From;
	bh=Fgc4B0h1cGTBcGW1L3CJ22EDyjgVRvdP44xe0dHOzHk=; b=tK/T4jiD8AAAlOjRddxfBecZ2H
	+VFx3NfHtYy2RhWPiBd3wI9FZbI5n0OUbISoSDwQee5uRVfUyK3ELeXj7Iq35EiYrNgZRUvjHlOpr
	664+duQDkwIAUNOHDHAtQXUO39NSWTcqukzSRcX2KS5Ls50JibVEIK44dK3M6Ti3P2Q4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vq8W9-0039iU-0i@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 11:36:25 +0000

commit 86569656504c3b6370ace08cd535f917a9d28a61
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:23:24 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:23:24 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 61a7dced35..b83e8827a4 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -117,10 +117,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227618.1534002 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAAN-00061X-2l; Wed, 11 Feb 2026 13:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227618.1534002; Wed, 11 Feb 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 1vqAAM-00061N-WD; Wed, 11 Feb 2026 13:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1227618;
 Wed, 11 Feb 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 1vqAAM-00061H-8v
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAAM-003TaT-0i
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAAM-003HTU-0N
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=GVn0IdG2dz9nisAl2MU1tJJ9wHrv/BqU7apvJjCT0kI=; b=zOHzzvISjYGrgmgoo/EB9ZnER1
	oPfEFrVEIqShUMYMz6IwfJ5Ee0KEYyxZNhyW5DXQi/h1uB9nz1CfoL3f2lJ2P4b40U4MFVPYktkU3
	tnK9KIhrrN6u+AzDg7YXUIqDj2+oWNuwzJls1/8GUyJLbLwIzk/+FBHTJzBt1m7TPRPA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vqAAM-003HTU-0N@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:02 +0000

commit 74b26c53d32ec1ff78d63e6c9827c41e2972f9b4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:15:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:15:49 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 527872a6db..abd3ef2ae2 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -347,6 +347,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227619.1534006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAAX-00063K-4V; Wed, 11 Feb 2026 13:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227619.1534006; Wed, 11 Feb 2026 13: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 1vqAAX-00063D-1G; Wed, 11 Feb 2026 13:22:13 +0000
Received: by outflank-mailman (input) for mailman id 1227619;
 Wed, 11 Feb 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 1vqAAW-000633-B8
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAAW-003TaY-11
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAAW-003HU7-0t
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=8LttY52vbDTBPVF8YNA/mNvHX16SsMZJYFCLqqozhSU=; b=VjsdXTim7+Jl2azXZluFJHRcBU
	whrnrocVH1GgfuDlnsMMjZnQmIrMIqHq6n2Nzke4UqR82Lpnfe9YngDvvQXDZNVeXy24qPuYcAZJP
	5cUrN55fFMqMpwdvzS0k0LVo2Qfc1HsYI1iMlXNV8pE+GZYPD3Npk24B6Gu8pp0nO2Io=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vqAAW-003HU7-0t@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:12 +0000

commit 39c90c8deebf4c4d46bcc08d2f1334283ab196f2
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:16:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:16:13 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index fc2372c523..7858c9418c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -436,6 +436,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227620.1534010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAAh-00065r-5a; Wed, 11 Feb 2026 13:22:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227620.1534010; Wed, 11 Feb 2026 13: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 1vqAAh-00065j-2h; Wed, 11 Feb 2026 13:22:23 +0000
Received: by outflank-mailman (input) for mailman id 1227620;
 Wed, 11 Feb 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 1vqAAg-00065c-Fi
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAAg-003Tae-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAAg-003HVE-1C
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=sbiM/+uR8ZGS1tzNfRTTUXcA5s+WVBv961Fil5MTRVc=; b=GBPbIzcxXxzb48xMjBUmcJmJf/
	SEWhfvNHMhPL0+01V3tC1mO7soF6VQ5SBIxH2DxVO6JX4fh010TWu0iJBcu131XNZ2zyN7lDjDaXc
	neNKYsmCBnRMLE8fFxpojqcu/0nAtacMNn5IYPK/PCNzhelZOljtkOm6DuwrNnNOehn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vqAAg-003HVE-1C@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:22 +0000

commit 15cd2b8f1bac5f4adf0f8303ae79298a612b53e1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:16:37 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:16:37 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 7a93dad2ed..ee1f60c59e 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -144,6 +144,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -163,13 +166,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #if defined(CONFIG_ARM_64) || defined(CONFIG_MPU)
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a33eeec43b..82a9551082 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -57,6 +57,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -75,13 +78,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 9283616c02..4c37d87508 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -247,19 +247,15 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 08153e6d6f..d35086e31e 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2efc11ce09..2ee249ac36 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -170,7 +170,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227621.1534014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAAr-00067v-6b; Wed, 11 Feb 2026 13:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227621.1534014; Wed, 11 Feb 2026 13: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 1vqAAr-00067n-43; Wed, 11 Feb 2026 13:22:33 +0000
Received: by outflank-mailman (input) for mailman id 1227621;
 Wed, 11 Feb 2026 13: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 1vqAAq-00067h-Gz
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13: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 1vqAAq-003Tak-1b
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAAq-003HVn-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13: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=jL/8ZPyjEzdezmq0BXmj7+5sChtHt30wF2edBxhY2e4=; b=UMlhkqFRhxJRsW9F01lwmUmFs9
	Wjt5xkJgBsKALWQmo5vYay/Won+SzCQyin42Oeiu7rJMPyKU28rSoIAHAD/jjxHPrAamd9hJ5MWM8
	SwFlQuoggAZ2z3LCTlNWE6QDduIr7gjVXtC2n4WLT0AHLjYp7FFgXL9cawO+oDZObkDk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vqAAq-003HVn-1U@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:32 +0000

commit 6228ea8acddadbd815f958fb1a867f54c01ddf78
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:01 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  23 +++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  10 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 143 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 775c339285..e7afda0570 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -575,6 +575,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -636,6 +648,7 @@ static int domain_teardown(struct domain *d)
 
         /* Trivial teardown, not long-running enough to need a preemption check. */
         domain_llc_coloring_free(d);
+        domain_pending_scrub_free(d);
 
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
@@ -679,6 +692,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1644,6 +1658,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 10becf7c1f..9240a6005e 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -159,6 +159,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -275,7 +342,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -286,6 +365,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j], true);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 2ee249ac36..588b5b99cb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -792,7 +792,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 # define scrub_page_cold clear_page_cold
 #endif
 
-static void scrub_one_page(const struct page_info *pg, bool cold)
+void scrub_one_page(const struct page_info *pg, bool cold)
 {
     void *ptr;
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index b968f47b87..49c34248f9 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -145,6 +145,16 @@ unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
 
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg, bool cold);
+
 int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 610f3d4c0d..c89b930cbd 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -662,6 +662,11 @@ struct domain
         /* Permission to take ownership of the physical console input. */
         bool input_allowed;
     } console;
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 } __aligned(PAGE_SIZE);
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227622.1534018 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAB2-0006A4-9f; Wed, 11 Feb 2026 13:22:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227622.1534018; Wed, 11 Feb 2026 13: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 1vqAB2-00069w-5U; Wed, 11 Feb 2026 13:22:44 +0000
Received: by outflank-mailman (input) for mailman id 1227622;
 Wed, 11 Feb 2026 13: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 1vqAB0-00069o-Kj
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13: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 1vqAB0-003Tay-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAB0-003HWx-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13: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=ENyvG5EyPQjGj5iulX7L6SCrOMiU/kiOzyS6cx4PN34=; b=K9OIe/XNru/iBhXIT7I4S8eF0E
	Xx9w2J8rzxKJY8RWRQaStiL9Su6HqOvyZSaoOhh4ZDOLY23AQ4KPR/fXVjpKy/a9anfzhWQPwNqnV
	FQGysrVJSY4jPveRE2swEJNRvXdKBA3aAqqG0D6JZGY7TYMMuw548JqguEz4G/veK3S0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vqAB0-003HWx-1o@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:42 +0000

commit d2a64135502263f1bd41e16901d55eaf533e4842
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:32 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d8cf91ba34..d488f08aff 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -914,11 +914,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 9c4785c187..a97831efe9 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -247,6 +247,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e7afda0570..6ae7c46b40 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -306,7 +306,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 8aab05ae93..613b5762b5 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -91,6 +91,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:22:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:22:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227623.1534022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqABC-0006Cd-Bm; Wed, 11 Feb 2026 13:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227623.1534022; Wed, 11 Feb 2026 13: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 1vqABC-0006CV-9I; Wed, 11 Feb 2026 13:22:54 +0000
Received: by outflank-mailman (input) for mailman id 1227623;
 Wed, 11 Feb 2026 13: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 1vqABA-0006CM-Ne
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13: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 1vqABA-003Tb4-2G
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:22:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABA-003HYR-29
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13: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=F6y8sUa/DbYo2oHBw9U+t8qTSJxlgxpt1zo8rTCa3rA=; b=azT1+mub6AYWWqzC588Ft1YOje
	o/cAJWQ0JvK2fKfq3tHAfEJIZ2WDJ9A2nSOAOaHbgn3nnxzEoIA4eRn5gH9QdL6pWSiZm0Zt8RON5
	xUbLhde/4I/O4TTtUsMC7QFfPHsnctO4fSR8VZvOYzepq9XEsmMJuo4TSRo7TikgMDUY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vqABA-003HYR-29@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:22:52 +0000

commit 867b7d3f97cc65a31738697bcb05bb3d3f604188
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:17:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:17:57 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227624.1534026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqABM-0006Ei-D1; Wed, 11 Feb 2026 13:23:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227624.1534026; Wed, 11 Feb 2026 13: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 1vqABM-0006Ea-AZ; Wed, 11 Feb 2026 13:23:04 +0000
Received: by outflank-mailman (input) for mailman id 1227624;
 Wed, 11 Feb 2026 13: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 1vqABK-0006ER-Qf
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13: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 1vqABK-003Tbk-2a
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABK-003HaI-2S
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13: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=LIdWHH1JdSgeKAcFDwwgsVXtHAZjI4jNs/CPvztjp9M=; b=peWxnfswRE0B2q8n55U82QTKeB
	TGN6pAak9pfkuRfifNpMXaDu207Psq+3ZimoZCL9z8HQRHNFkJv1gnvTjiUt8kDhls9CSq9VTBeAv
	LxGHhRewp6AgFHt0SgiN65yIKFjRyBsmNWk8p7hkBUHwtT3WHzCcBf5h1ad4Umyu6nCk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vqABK-003HaI-2S@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:02 +0000

commit 056103e7ada5937bf40d4ec582f3021bca96a24a
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:18:12 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:18:12 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index bbe7c4d379..9ed5853020 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227625.1534030 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqABW-0006H3-EU; Wed, 11 Feb 2026 13:23:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227625.1534030; Wed, 11 Feb 2026 13:23: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 1vqABW-0006Gv-Bq; Wed, 11 Feb 2026 13:23:14 +0000
Received: by outflank-mailman (input) for mailman id 1227625;
 Wed, 11 Feb 2026 13:23: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 1vqABV-0006GX-8o
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:23: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 1vqABV-003Tbo-0k
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABV-003Hej-0e
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23: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=5g4PnLvZGDecYqJbO4J0bG8cF4jj9kwWeUKSYRBXJZo=; b=NzAhZ5cKILA2amPa9vFx3LflIh
	buEz+wpYtN7pSBaWhwod73Mr45t0wh4+vb4ALYxqiluDZ/KMDxP1iNPlZuTWoX1Y20mVKS1sxS7I8
	j1cpUUCZtg6KZlcP7dHsr9WH/jgc4Ieq05fn2FXhXvbSmvW/MAotra8FHtg5jN3gmCDM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vqABV-003Hej-0e@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:13 +0000

commit 816e71923fb8f99ecac8f7705d99f9aa82d380c8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:18:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:18:56 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index f13655567a..c19682721d 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -340,6 +340,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227626.1534034 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqABg-0006J7-Fo; Wed, 11 Feb 2026 13:23:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227626.1534034; Wed, 11 Feb 2026 13:23: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 1vqABg-0006Iz-DB; Wed, 11 Feb 2026 13:23:24 +0000
Received: by outflank-mailman (input) for mailman id 1227626;
 Wed, 11 Feb 2026 13:23: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 1vqABf-0006Ir-B5
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:23: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 1vqABf-003TeF-11
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABf-003HfT-0u
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23: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=+bVj6BxhMlbKt899QlwC24k2lQ9WFYx6oKI1csMMBHA=; b=IXINaLm7PSIvWb20CcKkZHXrES
	zkQeN1ZPsdYiCYiRTEVMpMXW7RrClwlVEHJPB16jU1xAM3CjR7e0K41iTdVx8KrazCRmzVURbkiK7
	lys9apJzo2/Ta02/ZMbP3TGnvNtO0CEfhq8X3VBNV0qIKgRlr0yJg4BolgSb1gIEb2HE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vqABf-003HfT-0u@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:23 +0000

commit 9bdc49871fda2720cd6fe9b63407964c2b4e44e5
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:19:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:05 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 651bf2b448..7410dfdfcb 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -442,6 +442,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227627.1534038 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqABq-0006LD-HB; Wed, 11 Feb 2026 13:23:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227627.1534038; Wed, 11 Feb 2026 13:23: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 1vqABq-0006L5-EU; Wed, 11 Feb 2026 13:23:34 +0000
Received: by outflank-mailman (input) for mailman id 1227627;
 Wed, 11 Feb 2026 13:23: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 1vqABp-0006Kt-EE
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:23: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 1vqABp-003TeL-1K
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABp-003Hgl-1D
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23: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=P1WvkIE2pZnZJUWxBsJpRs3rTapXTjubKuH/Lp9t8/A=; b=sS72uPgvRWm25yLaRP9d8JFAIl
	XW868KgnF/O2ZJWqQ5QOqBOxlNzie0jHwN8xEQZkNMgODAKZfaISvJ9nPaoUzmMvySe5WNN2P0HmL
	IVm4+kNHqJ2jzt69smCgI8Jg2OlZpaPqF+jtxJI4TDbzwNw5OQ+DQuIYQRFfoFmMVoyE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vqABp-003Hgl-1D@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:33 +0000

commit 7e10bb1501c0289988d27772823c5eaf52f1b6a5
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:19:30 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:30 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h   | 10 +++-------
 xen/arch/ppc/include/asm/mm.h   | 10 +++-------
 xen/arch/riscv/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h   | 18 +++++++-----------
 xen/common/page_alloc.c         |  2 +-
 5 files changed, 17 insertions(+), 33 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index a0d8e5afe9..efbe19aba4 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -150,6 +150,9 @@ struct page_info
 #define _PGC_colored      PG_shift(4)
 #define PGC_colored       PG_mask(1, 4)
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -169,13 +172,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a433936076..9b654945de 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -58,6 +58,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -76,13 +79,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 292aa48fc1..70849ce2e6 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -221,19 +221,15 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 #define PGT_count_width   PG_shift(2)
 #define PGT_count_mask    ((1UL << PGT_count_width) - 1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 /* Cleared when the owning guest 'frees' this page. */
 #define _PGC_allocated    PG_shift(1)
 #define PGC_allocated     PG_mask(1, 1)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(4)
+#define PGC_need_scrub    PG_mask(1, 4)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 6c7e66ee21..30e993baba 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 6919722e9a..60c33b2609 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -169,7 +169,7 @@
 /*
  * Flags that are preserved in assign_pages() (and only there)
  */
-#define PGC_preserved (PGC_extra | PGC_static | PGC_colored)
+#define PGC_preserved (PGC_extra | PGC_static | PGC_colored | PGC_need_scrub)
 
 #ifndef PGT_TYPE_INFO_INITIALIZER
 #define PGT_TYPE_INFO_INITIALIZER 0
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227628.1534043 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAC0-0006NE-JH; Wed, 11 Feb 2026 13:23:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227628.1534043; Wed, 11 Feb 2026 13:23: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 1vqAC0-0006N6-Fy; Wed, 11 Feb 2026 13:23:44 +0000
Received: by outflank-mailman (input) for mailman id 1227628;
 Wed, 11 Feb 2026 13:23: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 1vqABz-0006My-HE
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:23: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 1vqABz-003TeX-1d
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqABz-003Hi1-1W
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23: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=cCrXUdnVjAxaR7Lhh9plxvh2ppytzUzrGT/R+sDPXng=; b=EWUPX03phGXKNtg+NN3WBvlM1M
	BWpC7KESE3ihZ9cMXxlcYirk9QsrqFFWuU9dMV9glHj1u0Q4+/yy4C7YgAU1G8FJj3B6EPPh09KWJ
	Etw7eSCi3fJpTpFe0m0x+B/oTBHKngi8c/SSKDalJ5/1zu1c843TUSonTvRmW+ujP5Yc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vqABz-003Hi1-1W@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:43 +0000

commit b304f948427218421af24abcb04b40d3c34fefbf
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:19:54 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:19:54 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  25 ++++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/common/page_alloc.c |   2 +-
 xen/include/xen/mm.h    |  11 +++++
 xen/include/xen/sched.h |   5 +++
 5 files changed, 146 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0c4cc77111..0df41f6950 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -446,6 +446,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -505,6 +517,9 @@ static int domain_teardown(struct domain *d)
     case PROG_none:
         BUILD_BUG_ON(PROG_none != 0);
 
+        /* Trivial teardown, not long-running enough to need a preemption check. */
+        domain_pending_scrub_free(d);
+
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
         if ( rc )
@@ -547,6 +562,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1478,6 +1494,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index c78f0dcd0a..00ba0d61dc 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -157,6 +157,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -273,7 +340,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -284,6 +363,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j]);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 60c33b2609..cab35bc39c 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -764,7 +764,7 @@ static void page_list_add_scrub(struct page_info *pg, unsigned int node,
 #endif
 #define SCRUB_BYTE_PATTERN   (SCRUB_PATTERN & 0xff)
 
-static void scrub_one_page(const struct page_info *pg)
+void scrub_one_page(const struct page_info *pg)
 {
     if ( unlikely(pg->count_info & PGC_broken) )
         return;
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 16f733281a..e8f4a2fba3 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -144,6 +144,17 @@ unsigned long avail_domheap_pages(void);
 unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
+
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
+void scrub_one_page(const struct page_info *pg);
+
 unsigned int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index de621eb123..e664221184 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -646,6 +646,11 @@ struct domain
     unsigned int num_llc_colors;
     const unsigned int *llc_colors;
 #endif
+
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
 };
 
 static inline struct page_list_head *page_to_list(
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:23:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:23:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227632.1534046 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqACA-0006Q7-Lt; Wed, 11 Feb 2026 13:23:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227632.1534046; Wed, 11 Feb 2026 13:23: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 1vqACA-0006Pz-JM; Wed, 11 Feb 2026 13:23:54 +0000
Received: by outflank-mailman (input) for mailman id 1227632;
 Wed, 11 Feb 2026 13:23: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 1vqAC9-0006Pr-Jy
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:23: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 1vqAC9-003Tet-1u
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAC9-003Hjp-1o
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:23: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=1APgcfiKB7TFbIXzzOEnW0LiTwVMgQVwt9tMfhDadOM=; b=AOGTK07ebSg8YP5joECYzfenO8
	IZbeMHTY69eZ6oF9r5Lm9VOJNDPVHT5QvTpbUY4ricxGcboH6wOrskJeP0XOemh4R0GbB4gG0EPrt
	57PUAB8uRjSfX7KFGHXVPRQ1zwL0+gDm6jlWFppUrPQAK409bL1AKcb4wGhjckLxJJIQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vqAC9-003Hjp-1o@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:23:53 +0000

commit 6143f6f64d455624857d67b857da283315cace40
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:20:17 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:17 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 93580b9a58..60e14b3a49 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -845,11 +845,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 7aef628f55..745c1dbb21 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -246,6 +246,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 0df41f6950..68e8677962 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -177,7 +177,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3de5635291..ae2b72d5c6 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:24:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:24:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227634.1534050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqACK-0006SK-NI; Wed, 11 Feb 2026 13:24:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227634.1534050; Wed, 11 Feb 2026 13:24: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 1vqACK-0006SC-Kh; Wed, 11 Feb 2026 13:24:04 +0000
Received: by outflank-mailman (input) for mailman id 1227634;
 Wed, 11 Feb 2026 13:24: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 1vqACJ-0006S2-MZ
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:24: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 1vqACJ-003Tf8-2A
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:24:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqACJ-003Hli-25
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:24: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=q/NyI1A9zO/Uade+aHemUD6IStGmR5v4vsgypTD8qs8=; b=kR9UVjn1xoifj/p1zruVnPFiVv
	M5JwMNfUAn3VpwCiHEo/hybfedjYdeC3utjKVR53LGpdboGMywF6XQTgt0zPqmDjyRgMZIS0o0shj
	VZ4+varrn2ffbjthaBDGT2I+uBgrLu6VrNpKAL8B494DCIX5WIa/KHQKYuGWB+sEw5kg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vqACJ-003Hli-25@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:24:03 +0000

commit 80ff08137eac9c96341cf94a71a6e1f8479c7d9d
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:20:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:39 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:24:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:24:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227635.1534054 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqACU-0006Ut-Oa; Wed, 11 Feb 2026 13:24:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1227635.1534054; Wed, 11 Feb 2026 13:24: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 1vqACU-0006Ul-M1; Wed, 11 Feb 2026 13:24:14 +0000
Received: by outflank-mailman (input) for mailman id 1227635;
 Wed, 11 Feb 2026 13:24: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 1vqACT-0006UL-P7
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 2026 13:24: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 1vqACT-003TfD-2P
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:24:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqACT-003Hmd-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:24: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=j1pRfZnjX9/dCfZWdVSlRkvXYzxBimFxy0nOtKEFycM=; b=Utge1yExrITdohlMNP7eQ2b5Nl
	EEfxXYA/AGxo+2mEB5nHyVOOMUwr934EahGbXP2YQCvzJ39hPXIuJYBF4NXs5cTz2A8JTa4dY36bL
	Z5a59vE9v0bcIr3ufC4WQ3cEKcjdx1ddEXcJsU61+JPIYe3Rr9mtFcTAo0x8tgyq/aec=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vqACT-003Hmd-2K@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:24:13 +0000

commit 4bb46b8558cb123c84ebbf55dc0b6c3d7b572832
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:20:56 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:20:56 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 074052d0b0..b7b5941159 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -113,10 +113,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227684.1534107 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAVg-0005k1-BZ; Wed, 11 Feb 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 1227684.1534107; Wed, 11 Feb 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 1vqAVg-0005jt-8v; Wed, 11 Feb 2026 13:44:04 +0000
Received: by outflank-mailman (input) for mailman id 1227684;
 Wed, 11 Feb 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 1vqAVe-0005jh-Dj
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAVe-003U5y-1F
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAVe-003JQc-18
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=0wtFhDJhUDONYN5pevLGNNHMlFjvBsbvRajRRnEq/2k=; b=Wp5v6BjbogLAQfYedLBGgd+WVi
	grEr/d53Bece+6FdP0H0k+88huHjWM/NkEicvGW71jS+ZP4/eu2XftFcmH7Qt5VWVBMAsn1wO8c8m
	/3xf9PdMojwP9bDlfuDl0G4K5+NkEZa57Rq67fWq1wNYz2MaQkNCGXzMXyHFiDuajwFY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/EFI: correct symbol table generation with older GNU ld
Message-Id: <E1vqAVe-003JQc-18@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:02 +0000

commit 7f9cde0f977515d2e108da37c34bdb4f7d69a1cd
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:21:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:21:47 2026 +0100

    x86/EFI: correct symbol table generation with older GNU ld
    
    See the extensive code comment. This isn't really nice, but unless I'm
    overlooking something there doesn't look to be a way to have the linker
    strip individual symbols while doing its work.
    
    Fixes: bf6501a62e80 ("x86-64: EFI boot code")
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    master commit: 45bb2789349b996bef19eeb098b6fe47a2b32f5f
    master date: 2026-02-02 09:03:05 +0100
---
 xen/arch/x86/xen.lds.S | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 29de0e7452..95fce0346f 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -346,6 +346,25 @@ SECTIONS
     *(.reloc)
     __base_relocs_end = .;
   }
+
+  /*
+   * When efi/relocs-dummy.o is linked into the first-pass binary, the two
+   * symbols supplied by it (for ./Makefile to use) may appear in the symbol
+   * table (GNU ld 2.37 and newer strip them, for not being properly
+   * representable).  No such symbols would appear during subsequent passes.
+   * At least some of those older ld versions emit VIRT_START as absolute, but
+   * ALT_START as if it was part of .text.  The symbols tool generating our
+   * own symbol table would hence not ignore it when passed --all-symbols,
+   * leading to the 2nd pass binary having one more symbol than the final (3rd
+   * pass) one.
+   *
+   * Arrange for both (just in case) symbols to always be there, and to always
+   * be absolute (zero).
+   */
+  PROVIDE(VIRT_START = 0);
+  PROVIDE(ALT_START = 0);
+  VIRT_START &= 0;
+  ALT_START &= 0;
 #elif defined(XEN_BUILD_EFI)
   /*
    * Due to the way EFI support is currently implemented, these two symbols
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227685.1534112 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAVq-0005ma-D4; Wed, 11 Feb 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 1227685.1534112; Wed, 11 Feb 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 1vqAVq-0005mR-AF; Wed, 11 Feb 2026 13:44:14 +0000
Received: by outflank-mailman (input) for mailman id 1227685;
 Wed, 11 Feb 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 1vqAVo-0005m8-GU
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAVo-003U67-1X
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAVo-003JS6-1P
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=Op7cVVBhHdXQBt3ksqIDth3z0IAnZNr4lJ86I5RN5NQ=; b=lJTUvGMoQVx7NxOk4r2c53Np4K
	Qc0m5NrNpavkkQJSwwVZFhpDL+rLeYMf/QGigoBAsD5+Fh3PoaJqjyFiwOZc/aJ07tCFUC0prAloA
	A6EuvcCEtNyilru0fG3adkgz7tX84RKeKE7SSK/f4yD2zwGur9w/MN5Q4OH5VpIwtO8Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] PCI: handle PCI->PCIe bridges as well in free_pdev()
Message-Id: <E1vqAVo-003JS6-1P@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:12 +0000

commit 2f7bd87bd4aeac8141014fae41864d74ab88e9b0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 11 12:21:57 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:21:57 2026 +0100

    PCI: handle PCI->PCIe bridges as well in free_pdev()
    
    Don't know how I managed to overlook the freeing side when adding the case
    to alloc_pdev().
    
    Fixes: cd2b9f0b1986 ("PCI: handle PCI->PCIe bridges as well in alloc_pdev()")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    master commit: 74f984159f0065aa5c7a395ef04263f162b87e62
    master date: 2026-02-02 09:06:42 +0100
---
 xen/drivers/passthrough/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 1633825738..bd144aa59c 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -439,6 +439,7 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
         unsigned long flags;
 
         case DEV_TYPE_PCIe2PCI_BRIDGE:
+        case DEV_TYPE_PCI2PCIe_BRIDGE:
         case DEV_TYPE_LEGACY_PCI_BRIDGE:
             sec_bus = pci_conf_read8(pdev->sbdf, PCI_SECONDARY_BUS);
             sub_bus = pci_conf_read8(pdev->sbdf, PCI_SUBORDINATE_BUS);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227686.1534116 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAW0-0005qv-EN; Wed, 11 Feb 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 1227686.1534116; Wed, 11 Feb 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 1vqAW0-0005qn-Bc; Wed, 11 Feb 2026 13:44:24 +0000
Received: by outflank-mailman (input) for mailman id 1227686;
 Wed, 11 Feb 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 1vqAVy-0005qc-JN
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAVy-003U6N-1q
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAVy-003JTd-1j
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=fnyMMhJo0z4nQ1DUy8RwkDnw/Xqtdbyg89XD7/69qEg=; b=hI0VWcIihB1Lv73raUOLAwykk9
	Dqrhs+n6EHN8fIrfN6pxXSaU0vwWNpvb9uL8VlMIZpjCG6YFUHHgz+Gmq38pw/YH5MlC5liI69hWW
	ynhEARVd0SBlEFs5EymEErlVbiKnnKMBokZDjgMaq9m20oeb4eR6NffHTiLblD1JNgaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
Message-Id: <E1vqAVy-003JTd-1j@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:22 +0000

commit 49a4deb467caea989d81f3692ed19a406ef6ee83
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:15 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:15 2026 +0100

    xen/mm: remove aliasing of PGC_need_scrub over PGC_allocated
    
    Future changes will care about the state of the PGC_need_scrub flag even
    when pages have the PGC_allocated set, and hence it's no longer possible to
    alias both values.  Also introduce PGC_need_scrub to the set of preserved
    flags, so it's not dropped by assign_pages().
    
    No functional change intended, albeit the page counter on x86 looses a bit.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: cbb484d008e1c7982e0038b1331ff59f94201be5
    master date: 2026-02-05 08:53:07 +0100
---
 xen/arch/arm/include/asm/mm.h | 10 +++-------
 xen/arch/ppc/include/asm/mm.h | 10 +++-------
 xen/arch/x86/include/asm/mm.h | 18 +++++++-----------
 xen/common/page_alloc.c       |  6 ++++--
 4 files changed, 17 insertions(+), 27 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index 48538b5337..ed71cf9bca 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -145,6 +145,9 @@ struct page_info
 #else
 #define PGC_static     0
 #endif
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(5)
+#define PGC_need_scrub    PG_mask(1, 5)
 /* ... */
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
@@ -164,13 +167,6 @@ struct page_info
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifdef CONFIG_ARM_32
 #define is_xen_heap_page(page) is_xen_heap_mfn(page_to_mfn(page))
 #define is_xen_heap_mfn(mfn) ({                                 \
diff --git a/xen/arch/ppc/include/asm/mm.h b/xen/arch/ppc/include/asm/mm.h
index a433936076..9b654945de 100644
--- a/xen/arch/ppc/include/asm/mm.h
+++ b/xen/arch/ppc/include/asm/mm.h
@@ -58,6 +58,9 @@ static inline struct page_info *virt_to_page(const void *v)
 /* Page is Xen heap? */
 #define _PGC_xen_heap     PG_shift(2)
 #define PGC_xen_heap      PG_mask(1, 2)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(3)
+#define PGC_need_scrub    PG_mask(1, 3)
 /* Page is broken? */
 #define _PGC_broken       PG_shift(7)
 #define PGC_broken        PG_mask(1, 7)
@@ -76,13 +79,6 @@ static inline struct page_info *virt_to_page(const void *v)
 #define PGC_count_width   PG_shift(10)
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #define is_xen_heap_page(page) ((page)->count_info & PGC_xen_heap)
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
diff --git a/xen/arch/x86/include/asm/mm.h b/xen/arch/x86/include/asm/mm.h
index 98b66edaca..52d2d5ff60 100644
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -83,29 +83,25 @@
 #define PGC_state_offlined  PG_mask(2, 6)
 #define PGC_state_free      PG_mask(3, 6)
 #define page_state_is(pg, st) (((pg)->count_info&PGC_state) == PGC_state_##st)
+/* Page needs to be scrubbed. */
+#define _PGC_need_scrub   PG_shift(7)
+#define PGC_need_scrub    PG_mask(1, 7)
 #ifdef CONFIG_SHADOW_PAGING
  /* Set when a page table page has been shadowed. */
-#define _PGC_shadowed_pt  PG_shift(7)
-#define PGC_shadowed_pt   PG_mask(1, 7)
+#define _PGC_shadowed_pt  PG_shift(8)
+#define PGC_shadowed_pt   PG_mask(1, 8)
 #else
 #define PGC_shadowed_pt   0
 #endif
 
 /* Count of references to this frame. */
 #if PGC_shadowed_pt
-#define PGC_count_width   PG_shift(7)
+#define PGC_count_width   PG_shift(8)
 #else
-#define PGC_count_width   PG_shift(6)
+#define PGC_count_width   PG_shift(7)
 #endif
 #define PGC_count_mask    ((1UL<<PGC_count_width)-1)
 
-/*
- * Page needs to be scrubbed. Since this bit can only be set on a page that is
- * free (i.e. in PGC_state_free) we can reuse PGC_allocated bit.
- */
-#define _PGC_need_scrub   _PGC_allocated
-#define PGC_need_scrub    PGC_allocated
-
 #ifndef CONFIG_BIGMEM
 /*
  * This definition is solely for the use in struct page_info (and
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index bbb8578459..4304c3dbd4 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2364,7 +2364,8 @@ int assign_pages(
 
         for ( i = 0; i < nr; i++ )
         {
-            ASSERT(!(pg[i].count_info & ~(PGC_extra | PGC_static)));
+            ASSERT(!(pg[i].count_info &
+                     ~(PGC_extra | PGC_static | PGC_need_scrub)));
             if ( pg[i].count_info & PGC_extra )
                 extra_pages++;
         }
@@ -2424,7 +2425,8 @@ int assign_pages(
         page_set_owner(&pg[i], d);
         smp_wmb(); /* Domain pointer must be visible before updating refcnt. */
         pg[i].count_info =
-            (pg[i].count_info & (PGC_extra | PGC_static)) | PGC_allocated | 1;
+            (pg[i].count_info & (PGC_extra | PGC_static | PGC_need_scrub)) |
+            PGC_allocated | 1;
 
         page_list_add_tail(&pg[i], page_to_list(d, &pg[i]));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227687.1534120 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAWA-0005t9-G1; Wed, 11 Feb 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 1227687.1534120; Wed, 11 Feb 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 1vqAWA-0005t2-Cx; Wed, 11 Feb 2026 13:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1227687;
 Wed, 11 Feb 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 1vqAW8-0005su-MF
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAW8-003U6X-28
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAW8-003JUh-21
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=6I5niPDoq+X5FggaDoyu2Af7fuMh5lRDu7OlOgUtP+I=; b=VC4QA7v1HGdjWlGWqovJp87FIe
	KQGwuF7f020ZPFufrR7XjEVz3RP2BCyn67SOxYMa02jfi2dh/6kkP0fTeRCF3vSECDlm9eMWsprHf
	EpoJAd/izZM3GjPBwZU9doGIV/h6veVb/QAb41oQOsNf2jWuM9P+GzQnQMt4TNoPiXJQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/mm: allow deferred scrub of physmap populate allocated pages
Message-Id: <E1vqAW8-003JUh-21@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:32 +0000

commit 52f3b7c6f89abe1f8fd4fc702f150cf3ec1fe89f
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:33 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:33 2026 +0100

    xen/mm: allow deferred scrub of physmap populate allocated pages
    
    Physmap population has the need to use pages as big as possible to reduce
    p2m shattering.  However that triggers issues when big enough pages are not
    yet scrubbed, and so scrubbing must be done at allocation time.  On some
    scenarios with added contention the watchdog can trigger:
    
    Watchdog timer detects that CPU55 is stuck!
    ----[ Xen-4.17.5-21  x86_64  debug=n  Not tainted ]----
    CPU:    55
    RIP:    e008:[<ffff82d040204c4a>] clear_page_sse2+0x1a/0x30
    RFLAGS: 0000000000000202   CONTEXT: hypervisor (d0v12)
    [...]
    Xen call trace:
       [<ffff82d040204c4a>] R clear_page_sse2+0x1a/0x30
       [<ffff82d04022a121>] S clear_domain_page+0x11/0x20
       [<ffff82d04022c170>] S common/page_alloc.c#alloc_heap_pages+0x400/0x5a0
       [<ffff82d04022d4a7>] S alloc_domheap_pages+0x67/0x180
       [<ffff82d040226f9f>] S common/memory.c#populate_physmap+0x22f/0x3b0
       [<ffff82d040228ec8>] S do_memory_op+0x728/0x1970
    
    Introduce a mechanism to preempt page scrubbing in populate_physmap().  It
    relies on stashing the dirty page in the domain struct temporarily to
    preempt to guest context, so the scrubbing can resume when the domain
    re-enters the hypercall.  The added deferral mechanism will only be used for
    domain construction, and is designed to be used with a single threaded
    domain builder.  If the toolstack makes concurrent calls to
    XENMEM_populate_physmap for the same target domain it will trash stashed
    pages, resulting in slow domain physmap population.
    
    Note a similar issue is present in increase reservation.  However that
    hypercall is likely to only be used once the domain is already running and
    the known implementations use 4K pages. It will be deal with in a separate
    patch using a different approach, that will also take care of the
    allocation in populate_physmap() once the domain is running.
    
    Fixes: 74d2e11ccfd2 ("mm: Scrub pages in alloc_heap_pages() if needed")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 83a784a15b479827ad21a519b4b685b65ee6d781
    master date: 2026-02-05 08:53:07 +0100
---
 xen/common/domain.c     |  25 ++++++++++++
 xen/common/memory.c     | 105 +++++++++++++++++++++++++++++++++++++++++++++++-
 xen/include/xen/mm.h    |   9 +++++
 xen/include/xen/sched.h |   5 +++
 4 files changed, 143 insertions(+), 1 deletion(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index fb262dcec9..f0583aeb73 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -392,6 +392,18 @@ static int __init cf_check parse_dom0_param(const char *s)
 }
 custom_param("dom0", parse_dom0_param);
 
+static void domain_pending_scrub_free(struct domain *d)
+{
+    rspin_lock(&d->page_alloc_lock);
+    if ( d->pending_scrub )
+    {
+        FREE_DOMHEAP_PAGES(d->pending_scrub, d->pending_scrub_order);
+        d->pending_scrub_order = 0;
+        d->pending_scrub_index = 0;
+    }
+    rspin_unlock(&d->page_alloc_lock);
+}
+
 /*
  * Release resources held by a domain.  There may or may not be live
  * references to the domain, and it may or may not be fully constructed.
@@ -451,6 +463,9 @@ static int domain_teardown(struct domain *d)
     case PROG_none:
         BUILD_BUG_ON(PROG_none != 0);
 
+        /* Trivial teardown, not long-running enough to need a preemption check. */
+        domain_pending_scrub_free(d);
+
     PROGRESS(gnttab_mappings):
         rc = gnttab_release_mappings(d);
         if ( rc )
@@ -493,6 +508,7 @@ static void _domain_destroy(struct domain *d)
 {
     BUG_ON(!d->is_dying);
     BUG_ON(atomic_read(&d->refcnt) != DOMAIN_DESTROYED);
+    ASSERT(!d->pending_scrub);
 
     xfree(d->pbuf);
 
@@ -1420,6 +1436,15 @@ int domain_unpause_by_systemcontroller(struct domain *d)
      */
     if ( new == 0 && !d->creation_finished )
     {
+        if ( d->pending_scrub )
+        {
+            printk(XENLOG_ERR
+                   "%pd: cannot be started with pending unscrubbed pages, destroying\n",
+                   d);
+            domain_crash(d);
+            domain_pending_scrub_free(d);
+            return -EBUSY;
+        }
         d->creation_finished = true;
         arch_domain_creation_finished(d);
     }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 9b23cd0bdb..09bb1198bb 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -155,6 +155,73 @@ static void increase_reservation(struct memop_args *a)
     a->nr_done = i;
 }
 
+/*
+ * Temporary storage for a domain assigned page that's not been fully scrubbed.
+ * Stored pages must be domheap ones.
+ *
+ * The stashed page can be freed at any time by Xen, the caller must pass the
+ * order and NUMA node requirement to the fetch function to ensure the
+ * currently stashed page matches it's requirements.
+ */
+static void stash_allocation(struct domain *d, struct page_info *page,
+                             unsigned int order, unsigned int scrub_index)
+{
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * Drop the passed page in preference for the already stashed one.  This
+     * interface is designed to be used for single-threaded domain creation.
+     */
+    if ( d->pending_scrub || d->is_dying )
+        free_domheap_pages(page, order);
+    else
+    {
+        d->pending_scrub_index = scrub_index;
+        d->pending_scrub_order = order;
+        d->pending_scrub = page;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+}
+
+static struct page_info *get_stashed_allocation(struct domain *d,
+                                                unsigned int order,
+                                                nodeid_t node,
+                                                unsigned int *scrub_index)
+{
+    struct page_info *page = NULL;
+
+    rspin_lock(&d->page_alloc_lock);
+
+    /*
+     * If there's a pending page to scrub check if it satisfies the current
+     * request.  If it doesn't free it and return NULL.
+     */
+    if ( d->pending_scrub )
+    {
+        if ( d->pending_scrub_order == order &&
+             (node == NUMA_NO_NODE || node == page_to_nid(d->pending_scrub)) )
+        {
+            page = d->pending_scrub;
+            *scrub_index = d->pending_scrub_index;
+        }
+        else
+            free_domheap_pages(d->pending_scrub, d->pending_scrub_order);
+
+        /*
+         * The caller now owns the page or it has been freed, clear stashed
+         * information.  Prevent concurrent usages of get_stashed_allocation()
+         * from returning the same page to different contexts.
+         */
+        d->pending_scrub_index = 0;
+        d->pending_scrub_order = 0;
+        d->pending_scrub = NULL;
+    }
+
+    rspin_unlock(&d->page_alloc_lock);
+    return page;
+}
+
 static void populate_physmap(struct memop_args *a)
 {
     struct page_info *page;
@@ -271,7 +338,19 @@ static void populate_physmap(struct memop_args *a)
             }
             else
             {
-                page = alloc_domheap_pages(d, a->extent_order, a->memflags);
+                unsigned int scrub_start = 0;
+                unsigned int memflags =
+                    a->memflags | (d->creation_finished ? 0
+                                                        : MEMF_no_scrub);
+                nodeid_t node =
+                    (a->memflags & MEMF_exact_node) ? MEMF_get_node(a->memflags)
+                                                    : NUMA_NO_NODE;
+
+                page = get_stashed_allocation(d, a->extent_order, node,
+                                              &scrub_start);
+
+                if ( !page )
+                    page = alloc_domheap_pages(d, a->extent_order, memflags);
 
                 if ( unlikely(!page) )
                 {
@@ -282,6 +361,30 @@ static void populate_physmap(struct memop_args *a)
                     goto out;
                 }
 
+                if ( memflags & MEMF_no_scrub )
+                {
+                    unsigned int dirty_cnt = 0;
+
+                    /* Check if there's anything to scrub. */
+                    for ( j = scrub_start; j < (1U << a->extent_order); j++ )
+                    {
+                        if ( !test_and_clear_bit(_PGC_need_scrub,
+                                                 &page[j].count_info) )
+                            continue;
+
+                        scrub_one_page(&page[j]);
+
+                        if ( (j + 1) != (1U << a->extent_order) &&
+                             !(++dirty_cnt & 0xff) &&
+                             hypercall_preempt_check() )
+                        {
+                            a->preempted = 1;
+                            stash_allocation(d, page, a->extent_order, j + 1);
+                            goto out;
+                        }
+                    }
+                }
+
                 if ( unlikely(a->memflags & MEMF_no_tlbflush) )
                 {
                     for ( j = 0; j < (1U << a->extent_order); j++ )
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index 7561297a75..fe32ef81cb 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -142,6 +142,15 @@ unsigned long avail_domheap_pages(void);
 unsigned long avail_node_heap_pages(unsigned int nodeid);
 #define alloc_domheap_page(d,f) (alloc_domheap_pages(d,0,f))
 #define free_domheap_page(p)  (free_domheap_pages(p,0))
+
+/* Free an allocation, and zero the pointer to it. */
+#define FREE_DOMHEAP_PAGES(p, o) do { \
+    void *_ptr_ = (p);                \
+    (p) = NULL;                       \
+    free_domheap_pages(_ptr_, o);     \
+} while ( false )
+#define FREE_DOMHEAP_PAGE(p) FREE_DOMHEAP_PAGES(p, 0)
+
 unsigned int online_page(mfn_t mfn, uint32_t *status);
 int offline_page(mfn_t mfn, int broken, uint32_t *status);
 int query_page_offline(mfn_t mfn, uint32_t *status);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 2a83b9dacf..ff831c7254 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -636,6 +636,11 @@ struct domain
     } ioreq_server;
 #endif
 
+    /* Pointer to allocated domheap page that possibly needs scrubbing. */
+    struct page_info *pending_scrub;
+    unsigned int pending_scrub_order;
+    unsigned int pending_scrub_index;
+
     /* Holding CDF_* constant. Internal flags for domain creation. */
     unsigned int cdf;
 };
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227688.1534124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAWK-0005vz-IP; Wed, 11 Feb 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 1227688.1534124; Wed, 11 Feb 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 1vqAWK-0005vr-Fl; Wed, 11 Feb 2026 13:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1227688;
 Wed, 11 Feb 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 1vqAWI-0005vh-PP
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAWI-003U6b-2R
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAWI-003JVl-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=jV445DBOZ5i3nuFtn83LtOHCrTUrP2YHPiaw1Po7PIw=; b=c4rxpieidxK1W/V5ki0fyq2GhP
	CvRfZKDbrcURDhZLDgdrA6sIFseO/wHS4A+Byb7lykD3d0AMRsqywKruF4zLCwWnMAUlb2lYVy7Xn
	7P7tQKyDl1agdIuxK4dsSuDjWHzUdbl0stnrShSPFogGaRacKkknsMGRfrNGjOIBYtaw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] x86/domain: adjust limitation on shared_info allocation below 4G
Message-Id: <E1vqAWI-003JVl-2K@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:42 +0000

commit 2fd843630188ca11fc455794c1213b0abe2d1d22
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:22:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:22:53 2026 +0100

    x86/domain: adjust limitation on shared_info allocation below 4G
    
    The limitation of shared_info being allocated below 4G to fit in the
    start_info field only applies to 32bit PV guests.  On 64bit PV guests the
    start_info field is 64bits wide.  HVM guests don't use start_info at all.
    
    Drop the restriction in arch_domain_create() and instead free and
    re-allocate the page from memory below 4G if needed in switch_compat(),
    when the guest is set to run in 32bit PV mode.
    
    Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is advertised to 32-bit guests via a 32-bit machine address field in start_info.")
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 8a9255405ca60b58d69ebb1a2dcdeb23cc42df1f
    master date: 2026-02-05 21:27:40 +0100
---
 xen/arch/x86/domain.c    |  6 +-----
 xen/arch/x86/pv/domain.c | 28 ++++++++++++++++++++++++++++
 xen/common/domain.c      |  2 +-
 xen/include/xen/domain.h |  2 ++
 4 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 4c60117215..fb413d4ab2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -855,11 +855,7 @@ int arch_domain_create(struct domain *d,
     if ( d->arch.ioport_caps == NULL )
         goto fail;
 
-    /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
-     */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info = alloc_xenheap_page()) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 2a445bb17b..5302f7b366 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -245,6 +245,34 @@ int switch_compat(struct domain *d)
     d->arch.has_32bit_shinfo = 1;
     d->arch.pv.is_32bit = true;
 
+    /*
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure.  We might need to free
+     * the current page and allocate a new one that fulfills this requirement.
+     */
+    if ( virt_to_maddr(d->shared_info) >> 32 )
+    {
+        shared_info_t *prev = d->shared_info;
+
+        d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32));
+        if ( !d->shared_info )
+        {
+            d->shared_info = prev;
+            rc = -ENOMEM;
+            goto undo_and_fail;
+        }
+        clear_page(d->shared_info);
+        share_xen_page_with_guest(virt_to_page(d->shared_info), d, SHARE_rw);
+        /*
+         * Ensure all pointers to the old shared_info page are replaced.  vCPUs
+         * below XEN_LEGACY_MAX_VCPUS may have stashed a pointer to
+         * shared_info->vcpu_info[id].
+         */
+        for_each_vcpu ( d, v )
+            vcpu_info_reset(v);
+        put_page(virt_to_page(prev));
+    }
+
     for_each_vcpu( d, v )
     {
         if ( (rc = setup_compat_arg_xlat(v)) ||
diff --git a/xen/common/domain.c b/xen/common/domain.c
index f0583aeb73..168f709423 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -123,7 +123,7 @@ static void vcpu_check_shutdown(struct vcpu *v)
     spin_unlock(&d->shutdown_lock);
 }
 
-static void vcpu_info_reset(struct vcpu *v)
+void vcpu_info_reset(struct vcpu *v)
 {
     struct domain *d = v->domain;
 
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3de5635291..ae2b72d5c6 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -83,6 +83,8 @@ void cf_check free_pirq_struct(void *ptr);
 int  arch_vcpu_create(struct vcpu *v);
 void arch_vcpu_destroy(struct vcpu *v);
 
+void vcpu_info_reset(struct vcpu *v);
+
 int map_guest_area(struct vcpu *v, paddr_t gaddr, unsigned int size,
                    struct guest_area *area,
                    void (*populate)(void *dst, struct vcpu *v));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227689.1534128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAWU-0005yI-Jr; Wed, 11 Feb 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 1227689.1534128; Wed, 11 Feb 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 1vqAWU-0005y8-HC; Wed, 11 Feb 2026 13:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1227689;
 Wed, 11 Feb 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 1vqAWS-0005xy-S5
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAWS-003U6h-2i
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAWS-003JWn-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=1yBIwuhqMD35Zz9gJihSE2KIvzzgeEvWMQSPil85Cgo=; b=2VoXMaZykF+80GL2Oru8V/RZzg
	Zdj77qH6G267PY5+/zjpPJISMCPrOkhignHHPZJIRyxnK/ppJsfnybFWSKncLxbEokJVIJc0Am95w
	PaCb37BDP3h6o7Xz6Z4EF/NCi1iXgDu6qyA+7TbWlJw7XtetThU3AUMYCsy0Wj7ZmVLs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen/kexec: return error code for unknown hypercalls
Message-Id: <E1vqAWS-003JWn-2c@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:44:52 +0000

commit 60f5b47d487b13efc8785c3950b453c4355a57d8
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 12:23:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:23:13 2026 +0100

    xen/kexec: return error code for unknown hypercalls
    
    Currently do_kexec_op_internal() will return 0 for unknown hypercalls.  Fix
    this by returning -EOPNOTSUPP instead.
    
    While there remove the pointless initialization of ret to -EINVAL; it just
    makes the code confusing.
    
    Fixes: d046f361dc93 ("Xen Security Modules: XSM")
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 1ee8b11c1106dca6b8fe0d54c0e79146bb6545f0
    master date: 2026-02-06 20:56:16 +0100
---
 xen/common/kexec.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/common/kexec.c b/xen/common/kexec.c
index 84fe8c3597..1a3a20e1c9 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
                                 XEN_GUEST_HANDLE_PARAM(void) uarg,
                                 bool compat)
 {
-    int ret = -EINVAL;
+    int ret;
 
     ret = xsm_kexec(XSM_PRIV);
     if ( ret )
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
     case KEXEC_CMD_kexec_status:
         ret = kexec_status(uarg);
         break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
     }
 
     clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Wed Feb 11 13:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 11 Feb 2026 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1227690.1534132 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqAWe-00060R-L3; Wed, 11 Feb 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 1227690.1534132; Wed, 11 Feb 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 1vqAWe-00060J-IW; Wed, 11 Feb 2026 13:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1227690;
 Wed, 11 Feb 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 1vqAWc-00060A-Ui
 for xen-changelog@lists.xenproject.org; Wed, 11 Feb 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 1vqAWc-003U7a-2z
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 2026 13:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqAWc-003JYM-2s
 for xen-changelog@lists.xenproject.org;
 Wed, 11 Feb 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=boIaKNBfEwB1To/GLY10mieLst85iNdt88P5Ln2grh8=; b=CULtv9I66yp26ZA8oQffc8DOAJ
	pOahWHisGdxThBhoDOIcgutGZqd6kOZTWZmOowasw5RHJR2wCddiC0vpGwKCMOT3q6tF4jV5OBVPT
	aIyOL+0MbkwTHh1eu09jPd19f48nPTTTxondhKQXlezQZVulEd3sGpLWK+XkYjAmNiB4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] xen: Use MFLAGS for silent-mode detection
Message-Id: <E1vqAWc-003JYM-2s@xenbits.xenproject.org>
Date: Wed, 11 Feb 2026 13:45:02 +0000

commit 86569656504c3b6370ace08cd535f917a9d28a61
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 12:23:24 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 11 12:23:24 2026 +0100

    xen: Use MFLAGS for silent-mode detection
    
    GNU make 4.4+ exposes variable overrides in MAKEFLAGS after "--" (e.g.
    O=/path, FOO=bar). The silent-mode check searches for "s" and can match
    an override value, forcing silent output even without -s.
    
    Use MFLAGS for short options and filter out any long options before
    searching for "s". This preserves -s detection while avoiding false
    positives from overrides.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: f2a31b7d7c80bcba40c6adb88668aa2733c68ad2
    master date: 2026-02-10 10:22:53 +0100
---
 xen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/Makefile b/xen/Makefile
index 61a7dced35..b83e8827a4 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -117,10 +117,11 @@ else
     Q := @
 endif
 
-# If the user is running make -s (silent mode), suppress echoing of
-# commands
-
-ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
+# If the user is running make -s (silent mode), suppress echoing of commands.
+# Use MFLAGS (options only). MAKEFLAGS may include variable overrides after
+# “--” (GNU make 4.4 and newer), which can contain an “s” and falsely trigger
+# silent mode.
+ifneq ($(findstring s,$(filter-out --%,$(MFLAGS))),)
     quiet := silent_
 endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 11:55:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 11:55:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228836.1534926 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqVHk-0008Q1-9N; Thu, 12 Feb 2026 11:55:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228836.1534926; Thu, 12 Feb 2026 11: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 1vqVHk-0008Ps-6l; Thu, 12 Feb 2026 11:55:04 +0000
Received: by outflank-mailman (input) for mailman id 1228836;
 Thu, 12 Feb 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 1vqVHi-0008Pm-Fl
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqVHi-005ATP-1S
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqVHi-004hWa-1L
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=PNICozfhCIPYYPdoJIIRcxruNG6n6tQK1JIOOD5fnOs=; b=H+xOk0UTRJcrgmSCE0EA0lfZtB
	nN+bL3BHoSueUKtmlTcD2NzbZil0EErRm0ows2wqnq4/Z/4aG1NdDtxvxmIeUo/1TKsx9nGRCTAod
	PnCUUsUjTuiaMi7LgEEx0WemK330TqUasmCX7Oz3NS3Hf2LY8PR73rrumCLxLkSOsItQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] sched: move vCPU exec state barriers
Message-Id: <E1vqVHi-004hWa-1L@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 11:55:02 +0000

commit c3f76328d572e33029bbf413143e814b25a04cf1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 11:32:00 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:32:00 2026 +0100

    sched: move vCPU exec state barriers
    
    The barrier in vcpu_context_saved() is specifically about the clearing of
    ->is_running. It isn't needed when we don't clear the flag.
    
    Furthermore, one side of the barrier being in common code, the other would
    better be, too. This way, all architectures are covered (beyond any
    specific needs they may have).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/domain.c   | 12 +-----------
 xen/common/sched/core.c | 11 ++++++++---
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2eca2b913d..94b9858ad2 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -333,17 +333,7 @@ void sync_local_execstate(void)
 
 void sync_vcpu_execstate(struct vcpu *v)
 {
-    /*
-     * We don't support lazy switching.
-     *
-     * However the context may have been saved from a remote pCPU so we
-     * need a barrier to ensure it is observed before continuing.
-     *
-     * Per vcpu_context_saved(), the context can be observed when
-     * v->is_running is false (the caller should check it before calling
-     * this function).
-     */
-    smp_rmb();
+    /* Nothing to do -- no lazy switching */
 }
 
 #define NEXT_ARG(fmt, args)                                                 \
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ec2448cfa1..a57d5dd929 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -956,6 +956,9 @@ void vcpu_sleep_sync(struct vcpu *v)
     while ( !vcpu_runnable(v) && v->is_running )
         cpu_relax();
 
+    /* Sync state /after/ observing the running flag clear. */
+    smp_rmb();
+
     sync_vcpu_execstate(v);
 }
 
@@ -2308,11 +2311,13 @@ static struct sched_unit *do_schedule(struct sched_unit *prev, s_time_t now,
 
 static void vcpu_context_saved(struct vcpu *vprev, struct vcpu *vnext)
 {
-    /* Clear running flag /after/ writing context to memory. */
-    smp_wmb();
-
     if ( vprev != vnext )
+    {
+        /* Clear running flag /after/ writing context to memory. */
+        smp_wmb();
+
         vprev->is_running = false;
+    }
 }
 
 static void unit_context_saved(struct sched_resource *sr)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 11:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 11:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228837.1534930 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqVHu-0008S6-Ai; Thu, 12 Feb 2026 11:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228837.1534930; Thu, 12 Feb 2026 11: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 1vqVHu-0008Rw-87; Thu, 12 Feb 2026 11:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1228837;
 Thu, 12 Feb 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 1vqVHs-0008Rm-JV
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqVHs-005ATm-1n
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqVHs-004hXC-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=LCjKUmRswHyiUYZ69maiRVBGAT8ap+TW7ExzFwohDAQ=; b=7OCyc09LYaG0TnFQajUycYr6ce
	/Bt5TYZW2of8/zE5EizkLW6TJQQaRrGxZ4vpRyK82ziZIfbfWedoL7ER6dkAtlpQhnMZQzEvAx3BK
	wtJB0T/puEHQPy9brpJD7wsRRL5UIHK1Jr0DYBaxa1Mz3XuVeca3iEejdfc+xftYcZI0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add support for local guest TLB flush using HFENCE.VVMA
Message-Id: <E1vqVHs-004hXC-1d@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 11:55:12 +0000

commit 8173a23dd6e2d2451686f538d04119d497f2831e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Feb 12 11:32:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:33:46 2026 +0100

    xen/riscv: add support for local guest TLB flush using HFENCE.VVMA
    
    Introduce flush_tlb_guest_local() to perform a local TLB flush of the guest's
    address space for the current hart. This leverages the RISC-V HFENCE.VVMA
    instruction, which is used to invalidate translations in the VS-stage of
    address translation.
    
    As for RISC-V binutils >= 2.39 is choosen, we can use hfence.vvma mnemonics
    instead of defining hfence.vvma using .insn.
    
    Although it would be possible to use sbi_remote_hfence_vvma() for this purpose,
    it is unnecessary in this context since the flush is required only on the
    local hart. Using the SBI call would introduce additional overhead without
    benefit, resulting in unnecessary performance loss.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/flushtlb.h  |  7 +++++++
 xen/arch/riscv/include/asm/insn-defs.h | 10 ++++++++++
 2 files changed, 17 insertions(+)

diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index 4f64f97570..b0112d416d 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,6 +5,7 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+#include <asm/insn-defs.h>
 #include <asm/sbi.h>
 
 struct page_info;
@@ -14,6 +15,12 @@ static inline void local_hfence_gvma_all(void)
     asm volatile ( "hfence.gvma zero, zero" ::: "memory" );
 }
 
+/* Flush VS-stage TLB for current hart. */
+static inline void flush_tlb_guest_local(void)
+{
+    HFENCE_VVMA(0, 0);
+}
+
 /* Flush TLB of local processor for address va. */
 static inline void flush_tlb_one_local(vaddr_t va)
 {
diff --git a/xen/arch/riscv/include/asm/insn-defs.h b/xen/arch/riscv/include/asm/insn-defs.h
new file mode 100644
index 0000000000..61aaa202fd
--- /dev/null
+++ b/xen/arch/riscv/include/asm/insn-defs.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef ASM_RISCV_INSN_DEFS_H
+#define ASM_RISCV_INSN_DEFS_H
+
+#define HFENCE_VVMA(vaddr, asid) \
+    asm volatile ( "hfence.vvma %z0, %z1" \
+                  :: "rJ" (vaddr), "rJ" (asid) : "memory" )
+
+#endif /* ASM_RISCV_INSN_DEFS_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 11:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 11:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228838.1534933 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqVI4-0008UO-CC; Thu, 12 Feb 2026 11:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228838.1534933; Thu, 12 Feb 2026 11: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 1vqVI4-0008UG-9V; Thu, 12 Feb 2026 11:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1228838;
 Thu, 12 Feb 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 1vqVI2-0008U6-M7
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqVI2-005ATt-27
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqVI2-004hXZ-1y
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=7uX7KWxrpRWPXioqNopLoZkQ7vf+YRShRu58P2NcuXg=; b=Y+GLnzg4xRU0n6jNkU6asRImbD
	p+GvuQxGnhGXiyBgDpN6Y6kXA0AeRXaP2SvNu1nUW9YHzGIaoysNFJO9T1/zpmgNhPGUXMDO0F7Dr
	YKJm2twVv4ysKZSRVdeJVyjPT+vEKhlTsj1epBfdbR3tNRSS0FGDTxk2xbl78yin0Ohk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/domctl: Conditionalise x86 domctl using DCE rather than ifdef
Message-Id: <E1vqVI2-004hXZ-1y@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 11:55:22 +0000

commit 5513bfd054dbbcd15dfa95fef698d24446ff1f84
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Feb 12 11:34:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:34:44 2026 +0100

    x86/domctl: Conditionalise x86 domctl using DCE rather than ifdef
    
    Make them uniformly return EOPNOTSUPP when their dependent features
    are absent. Otherwise the compiler loses context and they might return
    ENOSYS instead.
    
    debug_op, mem_sharing_op, p2m_audit and psr_alloc change behaviour and
    return EOPNOTSUPP when compiled out, rather than ENOSYS.
    
    While at it, remove the public headers from mem_sharing.h (forward
    declarations are fine) and add a missing xen/sched.h include (for
    complete struct domain definition).
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c                  | 33 +++++++++++++++++++--------------
 xen/arch/x86/include/asm/mem_sharing.h | 12 ++++++++----
 xen/arch/x86/include/asm/p2m.h         |  8 ++------
 3 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d9521808dc..942f41c584 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -220,15 +220,15 @@ long arch_do_domctl(
     {
 
     case XEN_DOMCTL_shadow_op:
-#ifdef CONFIG_PAGING
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_PAGING) )
+            break;
+
         ret = paging_domctl(d, &domctl->u.shadow_op, u_domctl, 0);
         if ( ret == -ERESTART )
             return hypercall_create_continuation(
                        __HYPERVISOR_paging_domctl_cont, "h", u_domctl);
         copyback = true;
-#else
-        ret = -EOPNOTSUPP;
-#endif
         break;
 
     case XEN_DOMCTL_ioport_permission:
@@ -842,11 +842,14 @@ long arch_do_domctl(
         }
         break;
 
-#ifdef CONFIG_HVM
     case XEN_DOMCTL_debug_op:
     {
         struct vcpu *v;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_HVM) )
+            break;
+
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
@@ -860,7 +863,6 @@ long arch_do_domctl(
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
         break;
     }
-#endif
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     case XEN_DOMCTL_gdbsx_pausevcpu:
@@ -1033,15 +1035,18 @@ long arch_do_domctl(
         break;
     }
 
-#ifdef CONFIG_MEM_SHARING
     case XEN_DOMCTL_mem_sharing_op:
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MEM_SHARING) )
+            break;
+
         ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
         break;
-#endif
 
-#if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
-        if ( d == currd )
+        if ( !P2M_AUDIT )
+            ret = -EOPNOTSUPP;
+        else if ( d == currd )
             ret = -EPERM;
         else
         {
@@ -1052,7 +1057,6 @@ long arch_do_domctl(
             copyback = true;
         }
         break;
-#endif /* P2M_AUDIT */
 
     case XEN_DOMCTL_set_broken_page_p2m:
     {
@@ -1240,9 +1244,12 @@ long arch_do_domctl(
         break;
 
     case XEN_DOMCTL_psr_alloc:
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_X86_PSR) )
+            break;
+
         switch ( domctl->u.psr_alloc.cmd )
         {
-#ifdef CONFIG_X86_PSR
         case XEN_DOMCTL_PSR_SET_L3_CBM:
             ret = psr_set_val(d, domctl->u.psr_alloc.target,
                               domctl->u.psr_alloc.data,
@@ -1305,8 +1312,6 @@ long arch_do_domctl(
 
 #undef domctl_psr_get_val
 
-#endif /* CONFIG_X86_PSR */
-
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/arch/x86/include/asm/mem_sharing.h b/xen/arch/x86/include/asm/mem_sharing.h
index 040962f690..3c67acfa09 100644
--- a/xen/arch/x86/include/asm/mem_sharing.h
+++ b/xen/arch/x86/include/asm/mem_sharing.h
@@ -9,10 +9,12 @@
 #ifndef __MEM_SHARING_H__
 #define __MEM_SHARING_H__
 
-#include <public/domctl.h>
-#include <public/memory.h>
+struct xen_domctl_mem_sharing_op;
 
 #ifdef CONFIG_MEM_SHARING
+#include <xen/sched.h>
+
+struct xen_mem_sharing_op;
 
 #define mem_sharing_enabled(d) ((d)->arch.hvm.mem_sharing.enabled)
 
@@ -92,8 +94,6 @@ int mem_sharing_fork_reset(struct domain *d, bool reset_state,
 int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
                               bool allow_sleep);
 int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg);
-int mem_sharing_domctl(struct domain *d,
-                       struct xen_domctl_mem_sharing_op *mec);
 
 /*
  * Scans the p2m and relinquishes any shared pages, destroying
@@ -103,6 +103,7 @@ int mem_sharing_domctl(struct domain *d,
 int relinquish_shared_pages(struct domain *d);
 
 #else
+struct domain;
 
 #define mem_sharing_enabled(d) false
 
@@ -147,4 +148,7 @@ static inline int mem_sharing_fork_reset(struct domain *d, bool reset_state,
 
 #endif
 
+int mem_sharing_domctl(struct domain *d,
+                       struct xen_domctl_mem_sharing_op *mec);
+
 #endif /* __MEM_SHARING_H__ */
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 9016e88411..ef6b02ff0b 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -806,12 +806,8 @@ static inline void p2m_pt_init(struct p2m_domain *p2m) {}
 void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
                      p2m_query_t q, uint32_t *pfec);
 
-#if P2M_AUDIT
-extern void audit_p2m(struct domain *d,
-                      uint64_t *orphans,
-                      uint64_t *m2p_bad,
-                      uint64_t *p2m_bad);
-#endif /* P2M_AUDIT */
+void audit_p2m(struct domain *d, uint64_t *orphans,
+               uint64_t *m2p_bad, uint64_t *p2m_bad);
 
 /* Printouts */
 #define P2M_PRINTK(f, a...)                                \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 11:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 11:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228839.1534938 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqVIE-00005d-F3; Thu, 12 Feb 2026 11:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228839.1534938; Thu, 12 Feb 2026 11: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 1vqVIE-00005V-C8; Thu, 12 Feb 2026 11:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1228839;
 Thu, 12 Feb 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 1vqVIC-00005L-P5
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqVIC-005ATx-2P
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 11:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqVIC-004hYC-2I
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=/f8WAk5hhfywRLttmsskWIV5twQEoV1WQBqif/pkxQA=; b=6ctKA4wRCFwUdP1h08P/pNprP6
	vrk4CA2XWPqTgWlqr7TibrbRKf1EqPskX/udUWYBESbY2W0nwaOwTiV3hAyTbx2fuDnk8U84PaChb
	C1rMhTpJEgApfvPI5dPqXm2Pl5D8Qv+uk+lVtYZwLLm1z/Q1ss9wLKc1MKs3Mvn/MeTg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] EFI: Fix relocating ESRT for dom0
Message-Id: <E1vqVIC-004hYC-2I@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 11:55:32 +0000

commit 3ea44aa78c8170ca8010a89d24717d6f6ccfe564
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Thu Feb 12 11:35:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:35:05 2026 +0100

    EFI: Fix relocating ESRT for dom0
    
    Fix calculating the table size - it consists of a header + entries, not
    just entries.
    This bug caused the last entry to have garbage in its final fields,
    including LowestSupportedFwVersion and CapsuleFlags, which (usually)
    made fwupd able to detect firmware update availability, but refuse
    actually installing it.
    
    Fixes: dc7da0874ba4 ("EFI: preserve the System Resource Table for dom0")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8adba7bd4d..967094994d 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -675,7 +675,8 @@ static size_t __init get_esrt_size(const EFI_MEMORY_DESCRIPTOR *desc)
     if ( esrt_ptr->FwResourceCount > available_len / sizeof(esrt_ptr->Entries[0]) )
         return 0;
 
-    return esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
+    return offsetof(EFI_SYSTEM_RESOURCE_TABLE,
+                    Entries[esrt_ptr->FwResourceCount]);
 }
 
 static EFI_GUID __initdata esrt_guid = EFI_SYSTEM_RESOURCE_TABLE_GUID;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 12:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 12:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228915.1534971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWDn-0000bU-5t; Thu, 12 Feb 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228915.1534971; Thu, 12 Feb 2026 12: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 1vqWDn-0000bM-3G; Thu, 12 Feb 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1228915;
 Thu, 12 Feb 2026 12: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 1vqWDm-0000bG-6S
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 12: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 1vqWDm-005BeR-0S
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWDm-004lDt-0H
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12: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=p9yV5h5ETT7vSpJVX6ZsPpMrkgqAc2fBktwJheSsMdQ=; b=L5peiMk6ChqHu6gnPSx6tmc/5n
	/9RBttvTo92fPtyre/TLgmELlboJVpyXh38vP8CzfdU/5VH/NCueqRUF+psSw4bzJJwCmrYw85QV4
	W0EkUKv0S4h/TX6fFuynIfVwgirMKT1P64/FQYzGemQ5YjDYuta9bIFnVUOs2qzVvKn0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] sched: move vCPU exec state barriers
Message-Id: <E1vqWDm-004lDt-0H@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 12:55:02 +0000

commit c3f76328d572e33029bbf413143e814b25a04cf1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 11:32:00 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:32:00 2026 +0100

    sched: move vCPU exec state barriers
    
    The barrier in vcpu_context_saved() is specifically about the clearing of
    ->is_running. It isn't needed when we don't clear the flag.
    
    Furthermore, one side of the barrier being in common code, the other would
    better be, too. This way, all architectures are covered (beyond any
    specific needs they may have).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Julien Grall <julien@xen.org>
---
 xen/arch/arm/domain.c   | 12 +-----------
 xen/common/sched/core.c | 11 ++++++++---
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2eca2b913d..94b9858ad2 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -333,17 +333,7 @@ void sync_local_execstate(void)
 
 void sync_vcpu_execstate(struct vcpu *v)
 {
-    /*
-     * We don't support lazy switching.
-     *
-     * However the context may have been saved from a remote pCPU so we
-     * need a barrier to ensure it is observed before continuing.
-     *
-     * Per vcpu_context_saved(), the context can be observed when
-     * v->is_running is false (the caller should check it before calling
-     * this function).
-     */
-    smp_rmb();
+    /* Nothing to do -- no lazy switching */
 }
 
 #define NEXT_ARG(fmt, args)                                                 \
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ec2448cfa1..a57d5dd929 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -956,6 +956,9 @@ void vcpu_sleep_sync(struct vcpu *v)
     while ( !vcpu_runnable(v) && v->is_running )
         cpu_relax();
 
+    /* Sync state /after/ observing the running flag clear. */
+    smp_rmb();
+
     sync_vcpu_execstate(v);
 }
 
@@ -2308,11 +2311,13 @@ static struct sched_unit *do_schedule(struct sched_unit *prev, s_time_t now,
 
 static void vcpu_context_saved(struct vcpu *vprev, struct vcpu *vnext)
 {
-    /* Clear running flag /after/ writing context to memory. */
-    smp_wmb();
-
     if ( vprev != vnext )
+    {
+        /* Clear running flag /after/ writing context to memory. */
+        smp_wmb();
+
         vprev->is_running = false;
+    }
 }
 
 static void unit_context_saved(struct sched_resource *sr)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 12:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 12:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228916.1534976 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWDx-0000dC-7K; Thu, 12 Feb 2026 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228916.1534976; Thu, 12 Feb 2026 12: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 1vqWDx-0000d4-4c; Thu, 12 Feb 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1228916;
 Thu, 12 Feb 2026 12: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 1vqWDw-0000cu-8k
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 12: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 1vqWDw-005BeY-0m
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWDw-004lEN-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12: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=+BpHLfqu9tRj5HDyKPZzRObM0DHuvNNecgiJTq5ng/g=; b=wpakTud3pASkgZR9TFuxFJETFd
	fUZd7UPidwutc9HtIS2j1yJz6gruAEEK6tUhCQxsHMwrrRCE7y9SxKZ4IuaI3EwBQatsr2YP/suAa
	JNPeWMawvpRwnaOJ8Xdt9aq7lgUJgd1UnVlS180LdrkRdzSMsAtT8Z8KLCdW9UrRWgh4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add support for local guest TLB flush using HFENCE.VVMA
Message-Id: <E1vqWDw-004lEN-0c@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 12:55:12 +0000

commit 8173a23dd6e2d2451686f538d04119d497f2831e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Thu Feb 12 11:32:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:33:46 2026 +0100

    xen/riscv: add support for local guest TLB flush using HFENCE.VVMA
    
    Introduce flush_tlb_guest_local() to perform a local TLB flush of the guest's
    address space for the current hart. This leverages the RISC-V HFENCE.VVMA
    instruction, which is used to invalidate translations in the VS-stage of
    address translation.
    
    As for RISC-V binutils >= 2.39 is choosen, we can use hfence.vvma mnemonics
    instead of defining hfence.vvma using .insn.
    
    Although it would be possible to use sbi_remote_hfence_vvma() for this purpose,
    it is unnecessary in this context since the flush is required only on the
    local hart. Using the SBI call would introduce additional overhead without
    benefit, resulting in unnecessary performance loss.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/flushtlb.h  |  7 +++++++
 xen/arch/riscv/include/asm/insn-defs.h | 10 ++++++++++
 2 files changed, 17 insertions(+)

diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index 4f64f97570..b0112d416d 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,6 +5,7 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+#include <asm/insn-defs.h>
 #include <asm/sbi.h>
 
 struct page_info;
@@ -14,6 +15,12 @@ static inline void local_hfence_gvma_all(void)
     asm volatile ( "hfence.gvma zero, zero" ::: "memory" );
 }
 
+/* Flush VS-stage TLB for current hart. */
+static inline void flush_tlb_guest_local(void)
+{
+    HFENCE_VVMA(0, 0);
+}
+
 /* Flush TLB of local processor for address va. */
 static inline void flush_tlb_one_local(vaddr_t va)
 {
diff --git a/xen/arch/riscv/include/asm/insn-defs.h b/xen/arch/riscv/include/asm/insn-defs.h
new file mode 100644
index 0000000000..61aaa202fd
--- /dev/null
+++ b/xen/arch/riscv/include/asm/insn-defs.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef ASM_RISCV_INSN_DEFS_H
+#define ASM_RISCV_INSN_DEFS_H
+
+#define HFENCE_VVMA(vaddr, asid) \
+    asm volatile ( "hfence.vvma %z0, %z1" \
+                  :: "rJ" (vaddr), "rJ" (asid) : "memory" )
+
+#endif /* ASM_RISCV_INSN_DEFS_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 12:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 12:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228917.1534980 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWE8-0000fW-8a; Thu, 12 Feb 2026 12:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228917.1534980; Thu, 12 Feb 2026 12: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 1vqWE8-0000fO-5y; Thu, 12 Feb 2026 12:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1228917;
 Thu, 12 Feb 2026 12: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 1vqWE6-0000fG-CO
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 12: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 1vqWE6-005Bex-16
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWE6-004lEl-0w
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12: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=xoBepoR0rFh4btNjvMlPF+nDd62iek5GbPRd5MJtGkM=; b=VE8o/jnFyXgY2hv3w2GHBhVmtL
	CViROy4pUZwFs6tB7D/A28AtU1tsP1lZ+bLD81g+RMz+KXUkdngLBJ/lbSyyBnHWFk6J5Y1tIQKTR
	jdRGk0JWJvB6brd7Lr8FTC5SqoNZ+yT1fDb9kSGkpHPNDVNsuQVWj7MqXO9ktgSRzYUI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/domctl: Conditionalise x86 domctl using DCE rather than ifdef
Message-Id: <E1vqWE6-004lEl-0w@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 12:55:22 +0000

commit 5513bfd054dbbcd15dfa95fef698d24446ff1f84
Author:     Alejandro Vallejo <alejandro.garciavallejo@amd.com>
AuthorDate: Thu Feb 12 11:34:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:34:44 2026 +0100

    x86/domctl: Conditionalise x86 domctl using DCE rather than ifdef
    
    Make them uniformly return EOPNOTSUPP when their dependent features
    are absent. Otherwise the compiler loses context and they might return
    ENOSYS instead.
    
    debug_op, mem_sharing_op, p2m_audit and psr_alloc change behaviour and
    return EOPNOTSUPP when compiled out, rather than ENOSYS.
    
    While at it, remove the public headers from mem_sharing.h (forward
    declarations are fine) and add a missing xen/sched.h include (for
    complete struct domain definition).
    
    Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c                  | 33 +++++++++++++++++++--------------
 xen/arch/x86/include/asm/mem_sharing.h | 12 ++++++++----
 xen/arch/x86/include/asm/p2m.h         |  8 ++------
 3 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d9521808dc..942f41c584 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -220,15 +220,15 @@ long arch_do_domctl(
     {
 
     case XEN_DOMCTL_shadow_op:
-#ifdef CONFIG_PAGING
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_PAGING) )
+            break;
+
         ret = paging_domctl(d, &domctl->u.shadow_op, u_domctl, 0);
         if ( ret == -ERESTART )
             return hypercall_create_continuation(
                        __HYPERVISOR_paging_domctl_cont, "h", u_domctl);
         copyback = true;
-#else
-        ret = -EOPNOTSUPP;
-#endif
         break;
 
     case XEN_DOMCTL_ioport_permission:
@@ -842,11 +842,14 @@ long arch_do_domctl(
         }
         break;
 
-#ifdef CONFIG_HVM
     case XEN_DOMCTL_debug_op:
     {
         struct vcpu *v;
 
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_HVM) )
+            break;
+
         ret = -EINVAL;
         if ( (domctl->u.debug_op.vcpu >= d->max_vcpus) ||
              ((v = d->vcpu[domctl->u.debug_op.vcpu]) == NULL) )
@@ -860,7 +863,6 @@ long arch_do_domctl(
         ret = hvm_debug_op(v, domctl->u.debug_op.op);
         break;
     }
-#endif
 
     case XEN_DOMCTL_gdbsx_guestmemio:
     case XEN_DOMCTL_gdbsx_pausevcpu:
@@ -1033,15 +1035,18 @@ long arch_do_domctl(
         break;
     }
 
-#ifdef CONFIG_MEM_SHARING
     case XEN_DOMCTL_mem_sharing_op:
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_MEM_SHARING) )
+            break;
+
         ret = mem_sharing_domctl(d, &domctl->u.mem_sharing_op);
         break;
-#endif
 
-#if P2M_AUDIT
     case XEN_DOMCTL_audit_p2m:
-        if ( d == currd )
+        if ( !P2M_AUDIT )
+            ret = -EOPNOTSUPP;
+        else if ( d == currd )
             ret = -EPERM;
         else
         {
@@ -1052,7 +1057,6 @@ long arch_do_domctl(
             copyback = true;
         }
         break;
-#endif /* P2M_AUDIT */
 
     case XEN_DOMCTL_set_broken_page_p2m:
     {
@@ -1240,9 +1244,12 @@ long arch_do_domctl(
         break;
 
     case XEN_DOMCTL_psr_alloc:
+        ret = -EOPNOTSUPP;
+        if ( !IS_ENABLED(CONFIG_X86_PSR) )
+            break;
+
         switch ( domctl->u.psr_alloc.cmd )
         {
-#ifdef CONFIG_X86_PSR
         case XEN_DOMCTL_PSR_SET_L3_CBM:
             ret = psr_set_val(d, domctl->u.psr_alloc.target,
                               domctl->u.psr_alloc.data,
@@ -1305,8 +1312,6 @@ long arch_do_domctl(
 
 #undef domctl_psr_get_val
 
-#endif /* CONFIG_X86_PSR */
-
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/arch/x86/include/asm/mem_sharing.h b/xen/arch/x86/include/asm/mem_sharing.h
index 040962f690..3c67acfa09 100644
--- a/xen/arch/x86/include/asm/mem_sharing.h
+++ b/xen/arch/x86/include/asm/mem_sharing.h
@@ -9,10 +9,12 @@
 #ifndef __MEM_SHARING_H__
 #define __MEM_SHARING_H__
 
-#include <public/domctl.h>
-#include <public/memory.h>
+struct xen_domctl_mem_sharing_op;
 
 #ifdef CONFIG_MEM_SHARING
+#include <xen/sched.h>
+
+struct xen_mem_sharing_op;
 
 #define mem_sharing_enabled(d) ((d)->arch.hvm.mem_sharing.enabled)
 
@@ -92,8 +94,6 @@ int mem_sharing_fork_reset(struct domain *d, bool reset_state,
 int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
                               bool allow_sleep);
 int mem_sharing_memop(XEN_GUEST_HANDLE_PARAM(xen_mem_sharing_op_t) arg);
-int mem_sharing_domctl(struct domain *d,
-                       struct xen_domctl_mem_sharing_op *mec);
 
 /*
  * Scans the p2m and relinquishes any shared pages, destroying
@@ -103,6 +103,7 @@ int mem_sharing_domctl(struct domain *d,
 int relinquish_shared_pages(struct domain *d);
 
 #else
+struct domain;
 
 #define mem_sharing_enabled(d) false
 
@@ -147,4 +148,7 @@ static inline int mem_sharing_fork_reset(struct domain *d, bool reset_state,
 
 #endif
 
+int mem_sharing_domctl(struct domain *d,
+                       struct xen_domctl_mem_sharing_op *mec);
+
 #endif /* __MEM_SHARING_H__ */
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 9016e88411..ef6b02ff0b 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -806,12 +806,8 @@ static inline void p2m_pt_init(struct p2m_domain *p2m) {}
 void *map_domain_gfn(struct p2m_domain *p2m, gfn_t gfn, mfn_t *mfn,
                      p2m_query_t q, uint32_t *pfec);
 
-#if P2M_AUDIT
-extern void audit_p2m(struct domain *d,
-                      uint64_t *orphans,
-                      uint64_t *m2p_bad,
-                      uint64_t *p2m_bad);
-#endif /* P2M_AUDIT */
+void audit_p2m(struct domain *d, uint64_t *orphans,
+               uint64_t *m2p_bad, uint64_t *p2m_bad);
 
 /* Printouts */
 #define P2M_PRINTK(f, a...)                                \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 12:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 12:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228918.1534983 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWEI-0000hy-A0; Thu, 12 Feb 2026 12:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228918.1534983; Thu, 12 Feb 2026 12: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 1vqWEI-0000hq-7H; Thu, 12 Feb 2026 12:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1228918;
 Thu, 12 Feb 2026 12: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 1vqWEG-0000hh-Ef
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 12: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 1vqWEG-005Bf3-1M
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWEG-004lF9-1G
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 12: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=Rx6w3S/Srm2XWXbVzO4as/yePYO5YkljVdOPjZ0F3vQ=; b=jAlsS0NA+ruzi0vzzDj+HdYkRp
	qrihCMoYy/JMXc3QIVr+PgJ2nYqPqAytOAunhDcksNdfh3yDAtlGraF+ZDg+2vJNVnTM7d6TA8dMp
	Pgn2idNrwpw24y0PVx0kFN8acw23/TgPmmGgL9pOI+x6ETyRxFJetNjKdKc4kw1ShvcM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] EFI: Fix relocating ESRT for dom0
Message-Id: <E1vqWEG-004lF9-1G@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 12:55:32 +0000

commit 3ea44aa78c8170ca8010a89d24717d6f6ccfe564
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Thu Feb 12 11:35:05 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 11:35:05 2026 +0100

    EFI: Fix relocating ESRT for dom0
    
    Fix calculating the table size - it consists of a header + entries, not
    just entries.
    This bug caused the last entry to have garbage in its final fields,
    including LowestSupportedFwVersion and CapsuleFlags, which (usually)
    made fwupd able to detect firmware update availability, but refuse
    actually installing it.
    
    Fixes: dc7da0874ba4 ("EFI: preserve the System Resource Table for dom0")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/common/efi/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index 8adba7bd4d..967094994d 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -675,7 +675,8 @@ static size_t __init get_esrt_size(const EFI_MEMORY_DESCRIPTOR *desc)
     if ( esrt_ptr->FwResourceCount > available_len / sizeof(esrt_ptr->Entries[0]) )
         return 0;
 
-    return esrt_ptr->FwResourceCount * sizeof(esrt_ptr->Entries[0]);
+    return offsetof(EFI_SYSTEM_RESOURCE_TABLE,
+                    Entries[esrt_ptr->FwResourceCount]);
 }
 
 static EFI_GUID __initdata esrt_guid = EFI_SYSTEM_RESOURCE_TABLE_GUID;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228935.1534998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWTI-0003Zz-Io; Thu, 12 Feb 2026 13:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228935.1534998; Thu, 12 Feb 2026 13:11: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 1vqWTI-0003Zq-G9; Thu, 12 Feb 2026 13:11:04 +0000
Received: by outflank-mailman (input) for mailman id 1228935;
 Thu, 12 Feb 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 1vqWTG-0003Ze-KO
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqWTG-005Byz-16
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWTG-004mIo-0x
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=/xfOHgGXZjXeG4FATaLdkxE29hTayIpBA0r7yZdnKlU=; b=KaPfGCRNGCwwVMixYCubCEAbit
	kZV3CBpbbdWxuN4L33ATqKBp2B3G1UoywtGb5N63P2LZb6SEKgjGoDI2DQuyCui0AFoUBaHip1Ae+
	4FPy5LvAc/2/SVKWz8bGwyH1AQUagadqU2vHMgr7R8lVZzpu/sq0W5gkHWJwwF416qI8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.21] SUPPORT.md: extend "lifetime"
Message-Id: <E1vqWTG-004mIo-0x@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:02 +0000

commit afaf4e7b503ad3e79602b39064e58d6488d10f3d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:58:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:58:40 2026 +0100

    SUPPORT.md: extend "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 3099225c77..4ba562eaf0 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -11,8 +11,8 @@ for the definitions of the support status levels etc.
 
     Xen-Version: 4.21
     Initial-Release: 2025-11-19
-    Supported-Until: 2027-05-19
-    Security-Support-Until: 2028-11-19
+    Supported-Until: 2028-11-19
+    Security-Support-Until: 2030-11-19
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.21_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228938.1535001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWTS-0003bv-KA; Thu, 12 Feb 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 1228938.1535001; Thu, 12 Feb 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 1vqWTS-0003bo-HT; Thu, 12 Feb 2026 13:11:14 +0000
Received: by outflank-mailman (input) for mailman id 1228938;
 Thu, 12 Feb 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 1vqWTQ-0003bb-O5
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqWTQ-005BzA-2J
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWTQ-004mK0-1p
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=Pv/7O6o5PZ+V0zvsjC/drwy+BLQcWoyPgb7s4NmlNEQ=; b=AVKyD9e6rqeT14GS6tcnrdp9ua
	56KkXivJr4zNf+zbWjICKSf0frB3JxBmL1PqfuhXFyfg/r/7+Qd5tmS6oYdjIwWmz/3MM9d4G6fOt
	b9aO9KTl4YOAOVdVPPGbTllGz8RN3pcnIGujQxB7FVnrxTeNq0uH/VPYxrKWoyEDvD4I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.20] SUPPORT.md: extend "lifetime"
Message-Id: <E1vqWTQ-004mK0-1p@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:12 +0000

commit 61ff35323e9ae5330cb92acceba3fdc649aec99f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:58:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:58:50 2026 +0100

    SUPPORT.md: extend "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 559aa812ad..67be5a5783 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -11,8 +11,8 @@ for the definitions of the support status levels etc.
 
     Xen-Version: 4.20
     Initial-Release: 2025-03-05
-    Supported-Until: 2026-09-05
-    Security-Support-Until: 2028-03-05
+    Supported-Until: 2028-03-05
+    Security-Support-Until: 2030-03-05
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.20_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228939.1535006 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWTc-0003eB-Lj; Thu, 12 Feb 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 1228939.1535006; Thu, 12 Feb 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 1vqWTc-0003e3-J0; Thu, 12 Feb 2026 13:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1228939;
 Thu, 12 Feb 2026 13:11: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 1vqWTb-0003dw-01
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:11: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 1vqWTa-005Bzf-37
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWTa-004mLj-30
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=myh+q0vJqh3z2nCRPXQfbZXzNCkCwhD2e+DiU3V8W1o=; b=rDQMMOp2iVwN++sL7tiAILff0I
	mln3RCfUzMAaAXXoevbv6nx05GfHaVAu9Xf1LYX8APtR052EMDV1+LInS6utJiW0sKAc0esQMtyIi
	jUNoNav5VZRsZcmdULHrhM+LWWIXZzBy8GItK/30gpJ2rUmgKYAwJ+21DxFCxr1Bl50o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.19] SUPPORT.md: extend security support "lifetime"
Message-Id: <E1vqWTa-004mLj-30@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:22 +0000

commit bd3a5c42c7f4ce62e573f425a3829a4c2caa2d19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:01 2026 +0100

    SUPPORT.md: extend security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index ba6052477b..baee1d17fb 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.19
     Initial-Release: 2024-07-29
     Supported-Until: 2026-01-29
-    Security-Support-Until: 2027-07-29
+    Security-Support-Until: 2029-07-29
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.19_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228940.1535011 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWTl-0003gw-Ob; Thu, 12 Feb 2026 13:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228940.1535011; Thu, 12 Feb 2026 13: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 1vqWTl-0003go-Lm; Thu, 12 Feb 2026 13:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1228940;
 Thu, 12 Feb 2026 13:11: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 1vqWTl-0003gi-8Z
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:11: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 1vqWTl-005Bzt-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWTl-004mMT-0c
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11: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=VYa3cHpZXST3PHGcfkItCxhcrkmGrq+ofdcsRrIr9tY=; b=ldD1L0XE11lp/DE1GWaO5CZ+rE
	/hYXNe7dKKy/iydAH2DHJXE+idq+aO5KtK2w+MxH3L+Sm2hgr1gJ4XQ4Zjdr/nP3E0pYVxs1dihyz
	Y7UQd582gyFIu/8TL+1d6MHme2BrtnojqhtOoPFMNkTDWJcOnESqbQx8iG/8v72IFzas=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.18] SUPPORT.md: extend security support "lifetime"
Message-Id: <E1vqWTl-004mMT-0c@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:33 +0000

commit ec8251e53edb9559832ade56095dd2ccf436bfbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:14 2026 +0100

    SUPPORT.md: extend security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 24157088d2..27209cab7d 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.18
     Initial-Release: 2023-11-16
     Supported-Until: 2025-05-16
-    Security-Support-Until: 2026-11-16
+    Security-Support-Until: 2028-11-16
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.18_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228942.1535015 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWTw-0003jB-QE; Thu, 12 Feb 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 1228942.1535015; Thu, 12 Feb 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 1vqWTw-0003j3-NF; Thu, 12 Feb 2026 13:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1228942;
 Thu, 12 Feb 2026 13:11: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 1vqWTv-0003iw-Lz
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:11: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 1vqWTv-005Bzx-26
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWTv-004mNt-1z
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11: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=x5yKaurk/LEqZQxWa1tU6VT1elhlV0J49EgTySEcXIY=; b=5O9gaJe3TdnkFW0Ar5HZ44TB52
	QvO3o9kerfZ8cLqfF9DRtesbs3FqLim8C7JmwTphEwpRogN5fvbtXxl2fDBFgD9KUWMYpziAJnpnl
	GDhERwOOM935otleuxp61mtsecL4wsZ0TUxa8RqGbgolqfY4zTVQdPH0x3SWYe9QiqlU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] SUPPORT.md: revive for extended security support "lifetime"
Message-Id: <E1vqWTv-004mNt-1z@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:43 +0000

commit 8f29c76bd4cdda00843db2e5f339a59ec43873cf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:23 2026 +0100

    SUPPORT.md: revive for extended security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index f039d12352..a55910fcce 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.17
     Initial-Release: 2022-12-12
     Supported-Until: 2024-06-12
-    Security-Support-Until: 2025-12-12
+    Security-Support-Until: 2027-12-12
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.17_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228943.1535019 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWU6-0003lf-Rg; Thu, 12 Feb 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 1228943.1535019; Thu, 12 Feb 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 1vqWU6-0003lX-OZ; Thu, 12 Feb 2026 13:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1228943;
 Thu, 12 Feb 2026 13:11: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 1vqWU5-0003lQ-OU
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:11: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 1vqWU5-005C03-2L
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWU5-004mOk-2G
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:11: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=T1iVw7IPdfvA7EJ3aZu3ysWXoMhgvQCaPB2FoUSLeoA=; b=5M4OB0cu4F1SVciQU+DhNOGl0u
	YQIlX/A9YddlHxb5pGbP2JeRqkyw1Tcfv3T3dGvHa1lx3H16429WyOPKFtEwUnvUdmp2bgD2DGxr5
	IxLyE9HgfJKyd5acoCcvrdB0Lr8zlU/WfkhewaRnbtlL0ZvvFjq8CX8BuiwmdUc+yVNw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] cirrus-ci: bump FreeBSD version
Message-Id: <E1vqWU5-004mOk-2G@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:11:53 +0000

commit 87567b069071754797f57814150d11937caade46
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Feb 12 14:00:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:00:52 2026 +0100

    cirrus-ci: bump FreeBSD version
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 331f94d0bbd11b93d12c762300039c9b36e561c5
    master date: 2025-10-07 15:13:16 +0100
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index eb46227892..04247d8b60 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,5 +23,5 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-2
+    image_family: freebsd-14-3
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228944.1535022 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWUG-0003nj-Si; Thu, 12 Feb 2026 13:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228944.1535022; Thu, 12 Feb 2026 13:12: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 1vqWUG-0003nb-Q7; Thu, 12 Feb 2026 13:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1228944;
 Thu, 12 Feb 2026 13:12: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 1vqWUF-0003nU-Rp
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:12: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 1vqWUF-005C0L-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:12:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWUF-004mQJ-2X
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:12: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=E/A8nTcs3tC9DoZt8MtoqoeDgV9U82VmZOUV1+zsjXI=; b=crCK0KRCc21aPUfhwDRnJsDZRZ
	JjVuwlsEEQDo9ITCvL8ugtEjR0eTyxL7l1x+zF6NWaxW/bSGBtyuiyu6uFANyYpkBwAd7RAsnWPT1
	DjSPr7GUpi1V30ZCjVN4QDMZVFKvNmwE/FObwMvOOzLOQrmPuWaUmbKRJ7LQ/oHtUdCE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging-4.17] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vqWUF-004mQJ-2X@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:12:03 +0000

commit a2bca552d7eb42b19c152e0dbbccb3d15788508d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 14:01:22 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:01:22 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 24 ++++++++++++++++--------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e54a507b54..d528e1491f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1996,15 +1996,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 static inline void trace_shadow_gen(u32 event, guest_va_t va)
 {
     if ( tb_init_done )
@@ -2093,11 +2093,14 @@ static inline void trace_shadow_emulate_other(u32 event,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+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));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2119,8 +2122,13 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
     if ( tb_init_done )
     {
         struct __packed {
-            /* for PAE, guest_l1e may be 64 while guest_va may be 32;
-               so put it first for alignment sake. */
+            /*
+             * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
+             * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
+             */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
@@ -2130,7 +2138,7 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
         event = TRC_SHADOW_EMULATE | ((GUEST_PAGING_LEVELS-2)<<8);
 
         d.gl1e = gl1e;
-        d.write_val.l1 = this_cpu(trace_emulate_write_val);
+        d.write_val = this_cpu(trace_emulate_write_val);
         d.va = va;
 #if GUEST_PAGING_LEVELS == 3
         d.emulation_count = this_cpu(trace_extra_emulation_count);
@@ -2705,7 +2713,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 91f798c5aa..8a39ed979d 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -131,14 +131,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1228945.1535026 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqWUQ-0003pl-U5; Thu, 12 Feb 2026 13:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1228945.1535026; Thu, 12 Feb 2026 13:12: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 1vqWUQ-0003pd-RS; Thu, 12 Feb 2026 13:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1228945;
 Thu, 12 Feb 2026 13:12: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 1vqWUP-0003pV-UK
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13:12: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 1vqWUP-005C0g-2v
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqWUP-004mQt-2p
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:12: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=Cm92y4FD1j+T2oNZDFQKgXfTpsiYzVWnKcVeA/ZPtxo=; b=tSRJyj5/O3X2yS3kqDdQ/dXWl0
	cKozHAOrI6Uodoe9JF86/Hq9sXvLayXryeLQ8kfieZ8mvRcMFtdOpkr0o0fGy7oQpkP/fwHRH6oQA
	/wSCsnFDSVB0RaCPxXW02XoyGtUIjN26iC1/4C9b+WWXYsxqLEsVhsC1H/6XfljmUFN0=;
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: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vqWUP-004mQt-2p@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:12:13 +0000

commit 36e6dcb9940bf643763fdf495a2c73ebb9ac6a07
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Feb 12 14:01:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:01:47 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a7bf828578..884ebe2eb5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2069,33 +2069,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 13:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 13:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229011.1535050 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqX9r-0001UT-CH; Thu, 12 Feb 2026 13:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229011.1535050; Thu, 12 Feb 2026 13: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 1vqX9r-0001UL-9c; Thu, 12 Feb 2026 13:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1229011;
 Thu, 12 Feb 2026 13: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 1vqX9q-0001UF-AR
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 13: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 1vqX9q-005CqU-0i
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqX9q-004pg2-0W
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 13: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=ys+lDIJLxaxkh6aN8FDLsLJ9zb/jgcS4xvlNfHKxcXs=; b=FWIPXWIDnlYEqtIeCvxBURRzEV
	s2chGnidfRcGFgx1jiojYJKyvFyouexe7oWKnGpzlHXf27O7FBw6VKs49mZCGiLuKi8MZDDWDlbm0
	whKmeBpu1OsDsciLSSXv0vnmUhAYA5ejnzI8QIClJf3KMATwQLH1qS11rrOcDpT92tpo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.21] SUPPORT.md: extend "lifetime"
Message-Id: <E1vqX9q-004pg2-0W@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 13:55:02 +0000

commit afaf4e7b503ad3e79602b39064e58d6488d10f3d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:58:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:58:40 2026 +0100

    SUPPORT.md: extend "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 3099225c77..4ba562eaf0 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -11,8 +11,8 @@ for the definitions of the support status levels etc.
 
     Xen-Version: 4.21
     Initial-Release: 2025-11-19
-    Supported-Until: 2027-05-19
-    Security-Support-Until: 2028-11-19
+    Supported-Until: 2028-11-19
+    Security-Support-Until: 2030-11-19
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.21_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.21


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 14:00:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 14:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229018.1535055 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqXEh-0002CS-Ou; Thu, 12 Feb 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 1229018.1535055; Thu, 12 Feb 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 1vqXEh-0002C3-Li; Thu, 12 Feb 2026 14:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1229018;
 Thu, 12 Feb 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 1vqXEg-0001wa-Bo
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqXEf-005CwJ-1e
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqXEf-004q0T-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14: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=miqQi6ncG6Nj1ucbl5xBY34+D+jLtuOfy6DPkTUR9yk=; b=nHIyAwOgN0me0lJ4nIWwTfzbPs
	cyp/FsAW7HCwMhJg/W7q687vVdrHOz1/xzw9JuRA5xdNcSk4hayunovezgHuN2O+y8oHy8fE5iirf
	HqdBV3vgGvRzOLTd8SHAdhR2EfAuilIqxr4dBAdb0IkCFjkSc+fXB6ZqxQYAi6Iizb/4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] SUPPORT.md: revive for extended security support "lifetime"
Message-Id: <E1vqXEf-004q0T-1V@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 14:00:01 +0000

commit 8f29c76bd4cdda00843db2e5f339a59ec43873cf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:23 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:23 2026 +0100

    SUPPORT.md: revive for extended security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index f039d12352..a55910fcce 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.17
     Initial-Release: 2022-12-12
     Supported-Until: 2024-06-12
-    Security-Support-Until: 2025-12-12
+    Security-Support-Until: 2027-12-12
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.17_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 14:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 14:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229020.1535060 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqXEq-0002gW-QP; Thu, 12 Feb 2026 14:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229020.1535060; Thu, 12 Feb 2026 14: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 1vqXEq-0002gO-N2; Thu, 12 Feb 2026 14:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1229020;
 Thu, 12 Feb 2026 14:00: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 1vqXEp-0002g6-Ld
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 14: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 1vqXEp-005D2S-1w
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqXEp-004q23-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14: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=M/Mh/d6bKg0S7v5P2HDqdXK+eEJZFZu7dZu0wX86k08=; b=1pxaDIhhYKqeEBdimy9XtSOc4n
	m3PIIJrgFnvxkbbYD7K7mIiv/itA/cooaQW7ZzA6mnMxcKcWr2eJIAs7aZxgS/bUnD1HIB+cTVa51
	dOWv8vl+gVThlmUqZTyWefA/qOU/TpfrDlN06StkwkA77zNgx03oHacesaiZQ5B/oAts=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] cirrus-ci: bump FreeBSD version
Message-Id: <E1vqXEp-004q23-1o@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 14:00:11 +0000

commit 87567b069071754797f57814150d11937caade46
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Feb 12 14:00:52 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:00:52 2026 +0100

    cirrus-ci: bump FreeBSD version
    
    Update to latest 14.3.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 331f94d0bbd11b93d12c762300039c9b36e561c5
    master date: 2025-10-07 15:13:16 +0100
---
 .cirrus.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index eb46227892..04247d8b60 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -23,5 +23,5 @@ task:
 task:
   name: 'FreeBSD 14'
   freebsd_instance:
-    image_family: freebsd-14-2
+    image_family: freebsd-14-3
   << : *FREEBSD_TEMPLATE
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 14:00:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 14:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229022.1535062 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqXF0-0002jL-SC; Thu, 12 Feb 2026 14:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229022.1535062; Thu, 12 Feb 2026 14: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 1vqXF0-0002jD-PZ; Thu, 12 Feb 2026 14:00:22 +0000
Received: by outflank-mailman (input) for mailman id 1229022;
 Thu, 12 Feb 2026 14:00: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 1vqXEz-0002j4-O9
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 14:00: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 1vqXEz-005D2o-2I
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00:21 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqXEz-004q2j-28
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00: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=hPz1Nzd2KCcEqLYO/hs8MEeyRfYlN4C7IMPPtVlZNWo=; b=14op4y8JvOyDNLUqQC50KeLLPT
	/+ucX0O7gTC/N6P9o7FVsreOuwLngOeBpD1Pn5gQt35iD+BidprhTcENBPz72EloD3Ax/ttZqMQFP
	QlfLBfIy3aeYHYUvKXeB3pUZbRce8NshXH/DKenhcxsNYxA9vOivBKaYfcP4uNpqFTlQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.17] x86/shadow: don't overrun trace_emul_write_val
Message-Id: <E1vqXEz-004q2j-28@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 14:00:21 +0000

commit a2bca552d7eb42b19c152e0dbbccb3d15788508d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 14:01:22 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:01:22 2026 +0100

    x86/shadow: don't overrun trace_emul_write_val
    
    Guests can do wider-than-PTE-size writes on page tables. The tracing
    helper variable, however, only offers space for a single PTE (and it is
    being switched to the more correct type right here). Therefore bound
    incoming write sizes to the amount of space available.
    
    To not leave dead code (which is a Misra concern), drop the now unused
    guest_pa_t as well.
    
    Also move and adjust GUEST_PTE_SIZE: Derive it rather than using hard-
    coded numbers, and put it in the sole source file where it's actually
    needed. This then also addresses a Misra rule 20.9 ("All identifiers
    used in the controlling expression of #if or #elif preprocessing
    directives shall be #define'd before evaluation") violation:
    GUEST_PAGING_LEVELS is #define'd only in multi.c.
    
    This is XSA-477 / CVE-2025-58150.
    
    Fixes: 9a86ac1aa3d2 ("xentrace 5/7: Additional tracing for the shadow code")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: a6626b613a843c6d4c3c453e45f84046f2d10302
    master date: 2026-01-27 13:55:01 +0100
---
 xen/arch/x86/mm/shadow/multi.c   | 24 ++++++++++++++++--------
 xen/arch/x86/mm/shadow/private.h |  8 --------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e54a507b54..d528e1491f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -1996,15 +1996,15 @@ static void sh_prefetch(struct vcpu *v, walk_t *gw,
 
 #if GUEST_PAGING_LEVELS == 4
 typedef u64 guest_va_t;
-typedef u64 guest_pa_t;
 #elif GUEST_PAGING_LEVELS == 3
 typedef u32 guest_va_t;
-typedef u64 guest_pa_t;
 #else
 typedef u32 guest_va_t;
-typedef u32 guest_pa_t;
 #endif
 
+/* Size (in bytes) of a guest PTE */
+#define GUEST_PTE_SIZE sizeof(guest_l1e_t)
+
 static inline void trace_shadow_gen(u32 event, guest_va_t va)
 {
     if ( tb_init_done )
@@ -2093,11 +2093,14 @@ static inline void trace_shadow_emulate_other(u32 event,
 static DEFINE_PER_CPU(guest_va_t,trace_emulate_initial_va);
 static DEFINE_PER_CPU(int,trace_extra_emulation_count);
 #endif
-static DEFINE_PER_CPU(guest_pa_t,trace_emulate_write_val);
+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));
+
 #if GUEST_PAGING_LEVELS == 3
     if ( vaddr == this_cpu(trace_emulate_initial_va) )
         memcpy(&this_cpu(trace_emulate_write_val), src, bytes);
@@ -2119,8 +2122,13 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
     if ( tb_init_done )
     {
         struct __packed {
-            /* for PAE, guest_l1e may be 64 while guest_va may be 32;
-               so put it first for alignment sake. */
+            /*
+             * For GUEST_PAGING_LEVELS=3 (PAE paging), guest_l1e is 64 while
+             * guest_va is 32.  Put it first to avoid padding.
+             *
+             * Note: .write_val is an arbitrary set of written bytes, possibly
+             * misaligned and possibly spanning the next gl1e.
+             */
             guest_l1e_t gl1e, write_val;
             guest_va_t va;
             uint32_t flags:29, emulation_count:3;
@@ -2130,7 +2138,7 @@ static inline void trace_shadow_emulate(guest_l1e_t gl1e, unsigned long va)
         event = TRC_SHADOW_EMULATE | ((GUEST_PAGING_LEVELS-2)<<8);
 
         d.gl1e = gl1e;
-        d.write_val.l1 = this_cpu(trace_emulate_write_val);
+        d.write_val = this_cpu(trace_emulate_write_val);
         d.va = va;
 #if GUEST_PAGING_LEVELS == 3
         d.emulation_count = this_cpu(trace_extra_emulation_count);
@@ -2705,7 +2713,7 @@ static int cf_check sh_page_fault(
     paging_unlock(d);
     put_gfn(d, gfn_x(gfn));
 
-    this_cpu(trace_emulate_write_val) = 0;
+    this_cpu(trace_emulate_write_val) = (guest_l1e_t){};
 
 #if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  early_emulation:
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 91f798c5aa..8a39ed979d 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -131,14 +131,6 @@ enum {
     TRCE_SFLAG_OOS_FIXUP_EVICT,
 };
 
-
-/* Size (in bytes) of a guest PTE */
-#if GUEST_PAGING_LEVELS >= 3
-# define GUEST_PTE_SIZE 8
-#else
-# define GUEST_PTE_SIZE 4
-#endif
-
 /******************************************************************************
  * Auditing routines
  */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 14:00:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 14:00:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229024.1535066 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqXFB-0002lt-Te; Thu, 12 Feb 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 1229024.1535066; Thu, 12 Feb 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 1vqXFB-0002ll-R1; Thu, 12 Feb 2026 14:00:33 +0000
Received: by outflank-mailman (input) for mailman id 1229024;
 Thu, 12 Feb 2026 14:00: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 1vqXF9-0002le-S0
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 14:00: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 1vqXF9-005D2s-2e
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00:31 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqXF9-004q3H-2T
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 14:00: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=cCFlmX/WRZjk53di9P/5nbcYOCRZGrwyWsoXwHAH374=; b=6Vrv6I492AYlMCxkKoPG16ldzX
	8hHDbbkFfnhQ3g5uK/ZoUwDceL1KvSOAQ0dU2FMitVUjaP1ex74u2pmSSsDT0MnurMz3+yWfuw0kP
	pMzBvD0yShWR8r2EIp7tPFmPDAEQ7jEibSU7ikvSHnL5fr8KPZrpwJn1SjMJXTPNpA7I=;
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: Fix incomplete IBPB flushing during context switch
Message-Id: <E1vqXF9-004q3H-2T@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 14:00:31 +0000

commit 36e6dcb9940bf643763fdf495a2c73ebb9ac6a07
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Feb 12 14:01:47 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 14:01:47 2026 +0100

    x86/spec-ctrl: Fix incomplete IBPB flushing during context switch
    
    The previous logic attempted to skip an IBPB in the case of vCPU returning to
    a CPU on which it was the previous vCPU to run.  While safe for Xen's
    isolation between vCPUs, this prevents the guest kernel correctly isolation
    between tasks.  Consider:
    
     1) vCPU runs on CPU A, running task 1.
     2) vCPU moves to CPU B, idle gets scheduled on A.  Xen skips IBPB.
     3) On CPU B, guest kernel switches from task 1 to 2, issuing IBPB.
     4) vCPU moves back to CPU A.  Xen skips IBPB again.
    
    Now, task 2 is running on CPU A with task 1's training still in the BTB.
    
    Do the flush unconditionally when switching to a vCPU different than the
    idle one.  Note there's no need to explicitly gate the IBPB to next domain
    != idle, as the context where the IBPB is issued is subject to that
    condition already unless the pCPU is going offline, at which point we don't
    really care to issue an extra IBPB.
    
    Also add a comment with the reasoning why the IBPB needs to be in
    context_switch() rather than __context_switch().
    
    This is XSA-479 / CVE-2026-23553.
    
    Fixes: a2ed643ed783 ("x86/ctxt: Issue a speculation barrier between vcpu contexts")
    Reported-by: David Kaplan <david.kaplan@amd.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 7beadd61197a959d5fa9d310fdeb7db3148f0c0d
    master date: 2026-01-27 13:55:27 +0100
---
 xen/arch/x86/domain.c | 36 +++++++++---------------------------
 1 file changed, 9 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index a7bf828578..884ebe2eb5 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -2069,33 +2069,15 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
 
         ctxt_switch_levelling(next);
 
-        if ( opt_ibpb_ctxt_switch && !is_idle_domain(nextd) )
-        {
-            static DEFINE_PER_CPU(unsigned int, last);
-            unsigned int *last_id = &this_cpu(last);
-
-            /*
-             * Squash the domid and vcpu id together for comparison
-             * efficiency.  We could in principle stash and compare the struct
-             * vcpu pointer, but this risks a false alias if a domain has died
-             * and the same 4k page gets reused for a new vcpu.
-             */
-            unsigned int next_id = (((unsigned int)nextd->domain_id << 16) |
-                                    (uint16_t)next->vcpu_id);
-            BUILD_BUG_ON(MAX_VIRT_CPUS > 0xffff);
-
-            /*
-             * When scheduling from a vcpu, to idle, and back to the same vcpu
-             * (which might be common in a lightly loaded system, or when
-             * using vcpu pinning), there is no need to issue IBPB, as we are
-             * returning to the same security context.
-             */
-            if ( *last_id != next_id )
-            {
-                spec_ctrl_new_guest_context();
-                *last_id = next_id;
-            }
-        }
+        /*
+         * Issue an IBPB when scheduling a different vCPU if required.
+         *
+         * IBPB clears the RSB/RAS/RAP, but that's fine as we leave this
+         * function via reset_stack_and_call_ind() rather than via a RET
+         * instruction.
+         */
+        if ( opt_ibpb_ctxt_switch )
+            spec_ctrl_new_guest_context();
 
         /* Update the top-of-stack block with the new speculation settings. */
         info->scf =
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.17


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 15:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 15:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229368.1535331 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqYrL-00047r-Uu; Thu, 12 Feb 2026 15:44:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229368.1535331; Thu, 12 Feb 2026 15: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 1vqYrL-00047i-Qo; Thu, 12 Feb 2026 15:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1229368;
 Thu, 12 Feb 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 1vqYrJ-00047Z-Rv
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 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 1vqYrJ-005FE8-2g
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 15:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqYrJ-004wjj-2Y
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 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=4VwNP1y9eGpbaE/9W/q6IS7EHIIjz1DTJqSMP7hcNsg=; b=EwQUiC2k8ENR4v5hdnoOmSaNDY
	+7jDXRDY3i4ppyjAqlH8+LeGCcjLPZ3ttQPZau74Jh/yuZRNZcS+73NJqeJs1f4GBbYIPiuM4ee37
	c+ewcoTrjaFZPDvP6JSguwCTdkx5IqoPovy/dQ9Uj9QPfOtjruKj7HwLu1SEx0IdDDkc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.20] SUPPORT.md: extend "lifetime"
Message-Id: <E1vqYrJ-004wjj-2Y@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 15:44:01 +0000

commit 61ff35323e9ae5330cb92acceba3fdc649aec99f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:58:50 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:58:50 2026 +0100

    SUPPORT.md: extend "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 559aa812ad..67be5a5783 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -11,8 +11,8 @@ for the definitions of the support status levels etc.
 
     Xen-Version: 4.20
     Initial-Release: 2025-03-05
-    Supported-Until: 2026-09-05
-    Security-Support-Until: 2028-03-05
+    Supported-Until: 2028-03-05
+    Security-Support-Until: 2030-03-05
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.20_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.20


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 15:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 15:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229369.1535333 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqYrV-0004A1-V5; Thu, 12 Feb 2026 15:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229369.1535333; Thu, 12 Feb 2026 15: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 1vqYrV-00049t-SO; Thu, 12 Feb 2026 15:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1229369;
 Thu, 12 Feb 2026 15: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 1vqYrU-00049Z-3f
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 15: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 1vqYrU-005FEG-0F
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 15:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqYrU-004wlE-09
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 15: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=ya0kgAovb0IB94n9AXNbolTQYi+c5iZJ0jZrMe+W5eI=; b=XCHHAVCo0S6LwyIi6xHtybx+c7
	b1Fk5c0ZBaOq/WA98perPm+FRchS2Ajah89fQUWNp2xC+PVuWppjXFE85OjuXYSHk3+fB6ruuo6LB
	KmsQZ76XkqtNZHFfps5qx19u5gIurOnJ7U6U1i9ATHytFVB6/rGE4k2QUSsXBWuGg3zE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.19] SUPPORT.md: extend security support "lifetime"
Message-Id: <E1vqYrU-004wlE-09@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 15:44:12 +0000

commit bd3a5c42c7f4ce62e573f425a3829a4c2caa2d19
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:01 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:01 2026 +0100

    SUPPORT.md: extend security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index ba6052477b..baee1d17fb 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.19
     Initial-Release: 2024-07-29
     Supported-Until: 2026-01-29
-    Security-Support-Until: 2027-07-29
+    Security-Support-Until: 2029-07-29
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.19_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 15:55:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 15:55:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229398.1535367 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqZ1z-0007LA-MK; Thu, 12 Feb 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 1229398.1535367; Thu, 12 Feb 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 1vqZ1z-0007L2-Jo; Thu, 12 Feb 2026 15:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1229398;
 Thu, 12 Feb 2026 15: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 1vqZ1y-0007Kw-4C
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 15: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 1vqZ1y-005FSJ-0B
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 15:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqZ1y-004xLj-03
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 15: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=Rhl+442mqA9J1987Pqi8DhsQsaV6I+g+LIdNf+nGp6w=; b=gR9XQB6TPJAm/gLpPRgGnogaaN
	pUoWwY6x7D1rgGjmJ3Wv+GYlpnNI6B0GpOpPhIJQ4fGFbLP2Bhc2eOqDJKskFX99zTxs19KpzPv+z
	3rpluQs/RR6zLBw1hezmZWVlktX/1Tsw2hekEGEIEygyAoaOD9Sk2YgV7GdU2vCJ5fXk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen stable-4.18] SUPPORT.md: extend security support "lifetime"
Message-Id: <E1vqZ1y-004xLj-03@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 15:55:02 +0000

commit ec8251e53edb9559832ade56095dd2ccf436bfbc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 12 13:59:14 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 12 13:59:14 2026 +0100

    SUPPORT.md: extend security support "lifetime"
    
    As per
    https://lists.xen.org/archives/html/xen-devel/2026-02/msg00630.html.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 SUPPORT.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/SUPPORT.md b/SUPPORT.md
index 24157088d2..27209cab7d 100644
--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -12,7 +12,7 @@ for the definitions of the support status levels etc.
     Xen-Version: 4.18
     Initial-Release: 2023-11-16
     Supported-Until: 2025-05-16
-    Security-Support-Until: 2026-11-16
+    Security-Support-Until: 2028-11-16
 
 Release Notes
 : <a href="https://wiki.xenproject.org/wiki/Xen_Project_4.18_Release_Notes">RN</a>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 19:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 19:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229876.1535602 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqcmF-0008GU-6g; Thu, 12 Feb 2026 19:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229876.1535602; Thu, 12 Feb 2026 19: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 1vqcmF-0008GL-46; Thu, 12 Feb 2026 19:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1229876;
 Thu, 12 Feb 2026 19: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 1vqcmE-0008GF-G1
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 19: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 1vqcmE-005L4g-1T
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqcmE-005IyF-1A
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19: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=vL3PegH1zCiBPh0XubspotLinx+jZwETm2/EPkq3jD8=; b=aJTJBUJfNo7JPVygFmornBzSWJ
	ZBpy+HqRmrHVGw8dGR9/vdJIvhmrQ4c73fOZeuanffEyQJ5COS3YJvRkUmNyGcOkVWNjo5VBhJprW
	2+ljVh5m07suYxK/WJOySBJ9f6PnXLtr3SU92zvSKNnIItyt6EpWB98iO9UMLpcIDfqY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/x86: always consider '/' as a division in assembly
Message-Id: <E1vqcmE-005IyF-1A@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 19:55:02 +0000

commit 6ccdd6cb46029c024482635870c23c7ff7723434
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Feb 10 16:06:08 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:21:46 2026 +0100

    xen/x86: always consider '/' as a division in assembly
    
    On x86 GNU assembler will consider '/' as the start of comment marker for
    some ELF targets.  This is incorrect with Xen's usage, which does use '/'
    in assembly files as a mathematical operator.
    
    The behavior of the assembler can be altered by passing the --divide
    option; unconditionally pass this option when available to force the
    expected behavior.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 0203138a81..2e06ae2582 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -123,3 +123,8 @@ endif
 
 # Set up the assembler include path properly for older toolchains.
 CFLAGS += -Wa,-I$(objtree)/include -Wa,-I$(srctree)/include
+
+# The GNU assembler will interpret '/' as a comment start marker instead of a
+# divide for some ELF targets.  Pass --divide when when available to signal '/'
+# is always used as an operator in assembly.
+$(call cc-option-add,CFLAGS,CC,-Wa$$(comma)--divide)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 19:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 19:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229877.1535606 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqcmP-0008I5-84; Thu, 12 Feb 2026 19:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229877.1535606; Thu, 12 Feb 2026 19: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 1vqcmP-0008Hx-5R; Thu, 12 Feb 2026 19:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1229877;
 Thu, 12 Feb 2026 19: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 1vqcmO-0008Hr-Id
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 19: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 1vqcmO-005L4o-1k
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqcmO-005Iyo-1d
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19: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=Bl+/CdUl7AGkyCL4w46eRjlnNrHCz9Ri/n6eThjfmDM=; b=nDAm0kAM4wEc9uwBQB976qKa3O
	EmeXPra9RGg/Ac5atTLYl30on+Dm60Q4B0RIYKqkBAPw68Ff3f6934LoSUxFYiqn3fRPGpim2FlV9
	e3QiEPLVqNW/K/OoWemiFCpH2rabA92jiMNpiRNB+V0D70r5EQGQmNhmVgREaYdiNkpk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/tools: remove usages of `stat -c` in check-endbr.sh
Message-Id: <E1vqcmO-005Iyo-1d@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 19:55:12 +0000

commit 1348cb4f046af922c1f23d6a0124645d4d765d10
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:02:16 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:11 2026 +0100

    xen/tools: remove usages of `stat -c` in check-endbr.sh
    
    The `-c` option to stat is not POSIX compatible, and hence prevents the
    check-endbr.sh script from running reliably.
    
    The first instance of `stat -c` can be removed by fetching the section size
    from the output of objdump itself, which the script already parses to get
    the VMA values.
    
    The other two instances can be replaced by counting the lines in the
    respective files.  Those files contain list of addresses, so the size in
    bytes is not strictly needed, we can count the number of lines instead.
    
    Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/tools/check-endbr.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index bf153a570d..aaaa9ebe6b 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -92,14 +92,13 @@ ${OBJDUMP} -j .text $1 -d -w | grep '	endbr64 *$' | cut -f 1 -d ':' > $VALID &
 #    check nevertheless.
 #
 eval $(${OBJDUMP} -j .text $1 -h |
-    $AWK '$2 == ".text" {printf "vma_hi=%s\nvma_lo=%s\n", substr($4, 1, 9), substr($4, 10, 16)}')
+    $AWK '$2 == ".text" {printf "bin_sz=%s\nvma_hi=%s\nvma_lo=%s\n", "0x" $3, substr($4, 1, 9), substr($4, 10, 16)}')
 
-${OBJCOPY} -j .text $1 -O binary $TEXT_BIN
-
-bin_sz=$(stat -c '%s' $TEXT_BIN)
-[ "$bin_sz" -ge $(((1 << 28) - $vma_lo)) ] &&
+[ "$(($bin_sz))" -ge $(((1 << 28) - $vma_lo)) ] &&
     { echo "$MSG_PFX Error: .text offsets must not exceed 256M" >&2; exit 1; }
 
+${OBJCOPY} -j .text $1 -O binary $TEXT_BIN
+
 # instruction:    hex:           oct:
 # endbr64         f3 0f 1e fa    363 017 036 372
 # endbr32         f3 0f 1e fb    363 017 036 373
@@ -116,8 +115,8 @@ fi | $AWK -F':' '{printf "%s%07x\n", "'$vma_hi'", int('$((0x$vma_lo))') + $1}' >
 wait
 
 # Sanity check $VALID and $ALL, in case the string parsing bitrots
-val_sz=$(stat -c '%s' $VALID)
-all_sz=$(stat -c '%s' $ALL)
+val_sz=$(wc -l < $VALID)
+all_sz=$(wc -l < $ALL)
 [ "$val_sz" -eq 0 ]         && { echo "$MSG_PFX Error: Empty valid-addrs" >&2; exit 1; }
 [ "$all_sz" -eq 0 ]         && { echo "$MSG_PFX Error: Empty all-addrs" >&2; exit 1; }
 [ "$all_sz" -lt "$val_sz" ] && { echo "$MSG_PFX Error: More valid-addrs than all-addrs" >&2; exit 1; }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 19:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 19:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229878.1535611 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqcma-0008L8-Ax; Thu, 12 Feb 2026 19:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229878.1535611; Thu, 12 Feb 2026 19: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 1vqcma-0008L0-7y; Thu, 12 Feb 2026 19:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1229878;
 Thu, 12 Feb 2026 19: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 1vqcmY-0008Ks-Nf
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 19: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 1vqcmY-005L5F-2D
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqcmY-005IzD-1v
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19: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=CY/0OJuyExyi1JpF5CKk3RcHhulUAluwvxaQU2KniMM=; b=2g1em9jwcpO7NvBFsPH8ogLyKx
	rWJZpq+EDI/e9ZxFpiwf/fl+o2g2cZ8N1q0/iS8Hw9PQ7O+GvC86KXlg/ZO3qq/WDn/h5mfy+mUZ8
	FpFDrAJ93jqb9iNe9K+uVXzCrNTajANwK/lPsg4+x7UEza4l23YFMlWq2BLJpsYVD1jM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/tools: fix grep reporting 'illegal byte sequence' in check-endbr.sh
Message-Id: <E1vqcmY-005IzD-1v@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 19:55:22 +0000

commit 57cf001b8c9970842cb709ddad5c0e4c376a177d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:04:52 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:38 2026 +0100

    xen/tools: fix grep reporting 'illegal byte sequence' in check-endbr.sh
    
    On macOS the default encoding is UTF-8.  The binary encoding used by the
    grep matching pattern is not valid when processed as UTF-8.  Switch the
    local to C just for the grep invocation to use the binary match pattern
    correctly.
    
    Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/tools/check-endbr.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index aaaa9ebe6b..9346fe95c7 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -107,8 +107,9 @@ if $perl_re
 then
     LC_ALL=C grep -aobP '\xf3\x0f\x1e(\xfa|\xfb)|\x66\x0f\x1f\x01' $TEXT_BIN
 else
-    grep -aob -e "$(printf '\363\17\36\372')" -e "$(printf '\363\17\36\373')" \
-         -e "$(printf '\146\17\37\1')" $TEXT_BIN
+    LC_ALL=C grep -aob -e "$(printf '\363\17\36\372')" \
+                       -e "$(printf '\363\17\36\373')" \
+                       -e "$(printf '\146\17\37\1')" $TEXT_BIN
 fi | $AWK -F':' '{printf "%s%07x\n", "'$vma_hi'", int('$((0x$vma_lo))') + $1}' > $ALL
 
 # Wait for $VALID to become complete
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 19:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 19:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229879.1535614 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqcmk-0008ND-By; Thu, 12 Feb 2026 19:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229879.1535614; Thu, 12 Feb 2026 19: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 1vqcmk-0008N5-9I; Thu, 12 Feb 2026 19:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1229879;
 Thu, 12 Feb 2026 19: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 1vqcmi-0008Mw-Pt
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 19: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 1vqcmi-005L5L-2V
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqcmi-005J01-2O
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19: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=VjoWjQnH1KXCpPPNsx8OaFHSxSJWafnBWKKShzo92Jo=; b=jDbgNxUEhlv5EMyqAM4CJpU7nd
	Lq280B8Q9engag5LXk/mMsOW0CZk0n+cobzCYeHmrrT4yfnVsFV4mjv4oQCxNIIH/k/OMlu1JWaxK
	9Y04sT8uL7clvPsq407/kxNUljZEJn+6RZ9gvr+WAyUnky58aUtMdcSi+9U8pS9c/mYA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: add x86 and arm64 macOS hypervisor builds
Message-Id: <E1vqcmi-005J01-2O@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 19:55:32 +0000

commit 7ad6037fa1d96a89bfd1db6606aec21e6948fd82
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:13:28 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:44 2026 +0100

    cirrus-ci: add x86 and arm64 macOS hypervisor builds
    
    Introduce two new build that run on macOS Cirrus-CI instances.  Those build
    the hypervisor using the elf cross-toolchain from Homebrew for both x86 and
    arm64.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7bbb4f1c5c..b9608e71cc 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,3 +1,5 @@
+## FreeBSD Build Jobs
+
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_versions: &FREEBSD_VERSIONS
   env:
@@ -122,7 +124,41 @@ task:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
 
-# Test jobs
+## macOS Build Jobs
+
+task:
+  name: 'macOS: hypervisor build'
+
+  env:
+    matrix:
+      ARCH: x86_64
+      ARCH: aarch64
+
+  alias: macos-$ARCH
+  macos_instance:
+    image: ghcr.io/cirruslabs/macos-runner:sonoma
+
+  environment:
+    CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
+
+  install_script:
+    - brew install $ARCH-elf-gcc $ARCH-elf-binutils
+
+  build_script:
+    - make -j`sysctl -n hw.ncpu`
+           XEN_TARGET_ARCH=`echo $ARCH | sed -e s/aarch64/arm64/`
+           CROSS_COMPILE=$ARCH-elf- HOSTCC=clang -C xen
+
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
+## Test Jobs
 
 task:
   name: 'FreeBSD: XTF selftest'
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 12 19:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Feb 2026 19:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1229880.1535619 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqcmu-0008Pa-Dd; Thu, 12 Feb 2026 19:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1229880.1535619; Thu, 12 Feb 2026 19: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 1vqcmu-0008PT-AZ; Thu, 12 Feb 2026 19:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1229880;
 Thu, 12 Feb 2026 19: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 1vqcms-0008PL-Su
 for xen-changelog@lists.xenproject.org; Thu, 12 Feb 2026 19: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 1vqcms-005L5R-2l
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqcms-005J0o-2f
 for xen-changelog@lists.xenproject.org;
 Thu, 12 Feb 2026 19: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=sN4xOE3A8tWa66vS4ApyjcKW6TGI6fT6iafCUWqsENA=; b=y+z88vRDzT69mIRKIuSvKg5zzm
	XcHy99rAA14HWJrmpfR3Dmcis5qsRC9QgubCw2K+Pd7d3iFW9DBYKk3LYA+OsJHns4la+GoY1/DoQ
	ctf06WkKrFV0jlzsc2P/0ow83z4VUQwrxv85FlVHoAVj/3VbfdtJOfxHkVULzjS3Zeyo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] cirrus-ci: add x86 XTF self-tests for macOS build
Message-Id: <E1vqcms-005J0o-2f@xenbits.xenproject.org>
Date: Thu, 12 Feb 2026 19:55:42 +0000

commit 1f4f85b64d393be1aa8dc8170201f4fbfe9c7222
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:25:17 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:54 2026 +0100

    cirrus-ci: add x86 XTF self-tests for macOS build
    
    Like we do for the FreeBSD builds, introduce some basic smoke testing of
    the built binary using the XTF selftest image.
    
    Note this is only done for the x86 build, there's no ARM support in XTF
    yet.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index b9608e71cc..839c25149c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -161,18 +161,19 @@ task:
 ## Test Jobs
 
 task:
-  name: 'FreeBSD: XTF selftest'
+  name: 'XTF selftest'
 
   << : *FREEBSD_ENV_PRODUCTION
 
   env:
     matrix:
-      FREEBSD_BUILD: $FREEBSD_LEGACY
-      FREEBSD_BUILD: $FREEBSD_PRODUCTION
-      FREEBSD_BUILD: $FREEBSD_CURRENT
+      BUILD: freebsd_full_$FREEBSD_LEGACY
+      BUILD: freebsd_full_$FREEBSD_PRODUCTION
+      BUILD: freebsd_full_$FREEBSD_CURRENT
+      BUILD: macos-x86_64
 
   depends_on:
-    - freebsd_full_$FREEBSD_BUILD
+    - $BUILD
     - xtf
 
   install_script: pkg install -y qemu-nox11 expect
@@ -187,7 +188,7 @@ task:
 
   fetch_script:
     - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/xtf/xtf.zip
-    - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/freebsd_full_$FREEBSD_BUILD/xen.zip
+    - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/$BUILD/xen.zip
     - unzip xtf.zip
     - unzip xen.zip
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 12:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 12:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1230821.1536232 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsBO-0004Gr-Oq; Fri, 13 Feb 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 1230821.1536232; Fri, 13 Feb 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 1vqsBO-0004Gh-MD; Fri, 13 Feb 2026 12:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1230821;
 Fri, 13 Feb 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 1vqsBO-0004Gb-03
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 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 1vqsBN-006rpD-2y
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqsBN-006OpW-2q
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 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=LitH/uW5ET8wJJFwnHdrWjs9WHqMQ1gSyKCQSdNGWKk=; b=ydbLpDHUiG378a1E05xihuHOa4
	wUGvs0U7kzfu4nPgk/nBYiMaUDcFiM4IfDD05RfIM6w0IgCiJ4psu+3nFonWn1vzkfR1DXpHSs2Zi
	fYxklMXivPw951shR9R7tQbbhn9ZEqhvezB18153UYzMuNdHdM9bS+gBTWl78uogepb8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: always consider '/' as a division in assembly
Message-Id: <E1vqsBN-006OpW-2q@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 12:22:01 +0000

commit 6ccdd6cb46029c024482635870c23c7ff7723434
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Tue Feb 10 16:06:08 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:21:46 2026 +0100

    xen/x86: always consider '/' as a division in assembly
    
    On x86 GNU assembler will consider '/' as the start of comment marker for
    some ELF targets.  This is incorrect with Xen's usage, which does use '/'
    in assembly files as a mathematical operator.
    
    The behavior of the assembler can be altered by passing the --divide
    option; unconditionally pass this option when available to force the
    expected behavior.
    
    Reported-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/arch.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 0203138a81..2e06ae2582 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -123,3 +123,8 @@ endif
 
 # Set up the assembler include path properly for older toolchains.
 CFLAGS += -Wa,-I$(objtree)/include -Wa,-I$(srctree)/include
+
+# The GNU assembler will interpret '/' as a comment start marker instead of a
+# divide for some ELF targets.  Pass --divide when when available to signal '/'
+# is always used as an operator in assembly.
+$(call cc-option-add,CFLAGS,CC,-Wa$$(comma)--divide)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 12:22:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 12:22:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1230822.1536236 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsBY-0004Ik-QN; Fri, 13 Feb 2026 12:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1230822.1536236; Fri, 13 Feb 2026 12: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 1vqsBY-0004Ic-NZ; Fri, 13 Feb 2026 12:22:12 +0000
Received: by outflank-mailman (input) for mailman id 1230822;
 Fri, 13 Feb 2026 12: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 1vqsBY-0004IU-1C
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 12: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 1vqsBY-006rpI-01
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqsBX-006OqE-38
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12: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=KlN8pdIJ0lTbLglcLRDE9cScMWE0Hr8fA0A1uyXwKTE=; b=iKZiiziYyEHgqZMAjRePLJuPRt
	CYnmM3TRTfchOOMSvDSmvmm2d1qChtuNzRDUZSiJik1jVWG/jaYuI8ro5p7wtOe1B1xxOmiAx0mHn
	qyLqxZEtzlgLA+W3eGRmOXj/i6VIDBVWRwn3aMoFf6yQGpZclpjBozQyTFCsnKdJh2vQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/tools: remove usages of `stat -c` in check-endbr.sh
Message-Id: <E1vqsBX-006OqE-38@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 12:22:11 +0000

commit 1348cb4f046af922c1f23d6a0124645d4d765d10
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:02:16 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:11 2026 +0100

    xen/tools: remove usages of `stat -c` in check-endbr.sh
    
    The `-c` option to stat is not POSIX compatible, and hence prevents the
    check-endbr.sh script from running reliably.
    
    The first instance of `stat -c` can be removed by fetching the section size
    from the output of objdump itself, which the script already parses to get
    the VMA values.
    
    The other two instances can be replaced by counting the lines in the
    respective files.  Those files contain list of addresses, so the size in
    bytes is not strictly needed, we can count the number of lines instead.
    
    Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/tools/check-endbr.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index bf153a570d..aaaa9ebe6b 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -92,14 +92,13 @@ ${OBJDUMP} -j .text $1 -d -w | grep '	endbr64 *$' | cut -f 1 -d ':' > $VALID &
 #    check nevertheless.
 #
 eval $(${OBJDUMP} -j .text $1 -h |
-    $AWK '$2 == ".text" {printf "vma_hi=%s\nvma_lo=%s\n", substr($4, 1, 9), substr($4, 10, 16)}')
+    $AWK '$2 == ".text" {printf "bin_sz=%s\nvma_hi=%s\nvma_lo=%s\n", "0x" $3, substr($4, 1, 9), substr($4, 10, 16)}')
 
-${OBJCOPY} -j .text $1 -O binary $TEXT_BIN
-
-bin_sz=$(stat -c '%s' $TEXT_BIN)
-[ "$bin_sz" -ge $(((1 << 28) - $vma_lo)) ] &&
+[ "$(($bin_sz))" -ge $(((1 << 28) - $vma_lo)) ] &&
     { echo "$MSG_PFX Error: .text offsets must not exceed 256M" >&2; exit 1; }
 
+${OBJCOPY} -j .text $1 -O binary $TEXT_BIN
+
 # instruction:    hex:           oct:
 # endbr64         f3 0f 1e fa    363 017 036 372
 # endbr32         f3 0f 1e fb    363 017 036 373
@@ -116,8 +115,8 @@ fi | $AWK -F':' '{printf "%s%07x\n", "'$vma_hi'", int('$((0x$vma_lo))') + $1}' >
 wait
 
 # Sanity check $VALID and $ALL, in case the string parsing bitrots
-val_sz=$(stat -c '%s' $VALID)
-all_sz=$(stat -c '%s' $ALL)
+val_sz=$(wc -l < $VALID)
+all_sz=$(wc -l < $ALL)
 [ "$val_sz" -eq 0 ]         && { echo "$MSG_PFX Error: Empty valid-addrs" >&2; exit 1; }
 [ "$all_sz" -eq 0 ]         && { echo "$MSG_PFX Error: Empty all-addrs" >&2; exit 1; }
 [ "$all_sz" -lt "$val_sz" ] && { echo "$MSG_PFX Error: More valid-addrs than all-addrs" >&2; exit 1; }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 12:22:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 12:22:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1230823.1536240 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsBi-0004LP-Rc; Fri, 13 Feb 2026 12:22:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1230823.1536240; Fri, 13 Feb 2026 12: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 1vqsBi-0004LH-Oz; Fri, 13 Feb 2026 12:22:22 +0000
Received: by outflank-mailman (input) for mailman id 1230823;
 Fri, 13 Feb 2026 12: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 1vqsBi-0004LB-5h
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 12: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 1vqsBi-006rpO-0T
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12:22:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqsBi-006Oqj-0B
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12: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=d0AL1GFbbAjAQvlWKdSRkU8OeetYJbK9xqzVkSGvfTw=; b=Xc5st+XLGzYVsKbmAwB689rFqj
	F8jq350AAbAQ1uCWOJw+9K7UVuPotKiMPpI7gqVw7l0efcZW9d3A6NP3ew4dVrkKXt5/+EnU6+bTQ
	W5zH9H8SaoQL89KtuYzknLkE8ccA930jAvC1k9W4VcVM8wiKPNLFv8zdT8t5IMIp5i8E=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/tools: fix grep reporting 'illegal byte sequence' in check-endbr.sh
Message-Id: <E1vqsBi-006Oqj-0B@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 12:22:22 +0000

commit 57cf001b8c9970842cb709ddad5c0e4c376a177d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:04:52 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:38 2026 +0100

    xen/tools: fix grep reporting 'illegal byte sequence' in check-endbr.sh
    
    On macOS the default encoding is UTF-8.  The binary encoding used by the
    grep matching pattern is not valid when processed as UTF-8.  Switch the
    local to C just for the grep invocation to use the binary match pattern
    correctly.
    
    Suggested-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/tools/check-endbr.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/tools/check-endbr.sh b/xen/tools/check-endbr.sh
index aaaa9ebe6b..9346fe95c7 100755
--- a/xen/tools/check-endbr.sh
+++ b/xen/tools/check-endbr.sh
@@ -107,8 +107,9 @@ if $perl_re
 then
     LC_ALL=C grep -aobP '\xf3\x0f\x1e(\xfa|\xfb)|\x66\x0f\x1f\x01' $TEXT_BIN
 else
-    grep -aob -e "$(printf '\363\17\36\372')" -e "$(printf '\363\17\36\373')" \
-         -e "$(printf '\146\17\37\1')" $TEXT_BIN
+    LC_ALL=C grep -aob -e "$(printf '\363\17\36\372')" \
+                       -e "$(printf '\363\17\36\373')" \
+                       -e "$(printf '\146\17\37\1')" $TEXT_BIN
 fi | $AWK -F':' '{printf "%s%07x\n", "'$vma_hi'", int('$((0x$vma_lo))') + $1}' > $ALL
 
 # Wait for $VALID to become complete
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 12:22:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 12:22:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1230824.1536244 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsBs-0004NU-TJ; Fri, 13 Feb 2026 12:22:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1230824.1536244; Fri, 13 Feb 2026 12: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 1vqsBs-0004NM-QL; Fri, 13 Feb 2026 12:22:32 +0000
Received: by outflank-mailman (input) for mailman id 1230824;
 Fri, 13 Feb 2026 12: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 1vqsBs-0004NE-8U
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 12: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 1vqsBs-006rpU-0k
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12:22:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqsBs-006OrO-0d
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12: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=lHsYH0HPhP6dEeo3j9Le9hmOXHktIQtXfR3JPGBZBDM=; b=4gy1ljfPjCT8gtuoqNDAxETp1j
	nqwkCkHTrtW83i3yKX/tIotUASuD3RtiWfAkDeoY6Hr6zFyormLA6Kg7UQxyWRi+Ie2bz74w+U1Qz
	0ZfvV/pGIdCubp91dytLrjhhjNOHtrVqX7GEdXIfvAZ/sTzPjrwTXBPwx6gtMvD/oMJk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: add x86 and arm64 macOS hypervisor builds
Message-Id: <E1vqsBs-006OrO-0d@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 12:22:32 +0000

commit 7ad6037fa1d96a89bfd1db6606aec21e6948fd82
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:13:28 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:44 2026 +0100

    cirrus-ci: add x86 and arm64 macOS hypervisor builds
    
    Introduce two new build that run on macOS Cirrus-CI instances.  Those build
    the hypervisor using the elf cross-toolchain from Homebrew for both x86 and
    arm64.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index 7bbb4f1c5c..b9608e71cc 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,3 +1,5 @@
+## FreeBSD Build Jobs
+
 # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
 freebsd_versions: &FREEBSD_VERSIONS
   env:
@@ -122,7 +124,41 @@ task:
     path: xtf/tests/selftest/test-*-selftest
     type: application/octet-stream
 
-# Test jobs
+## macOS Build Jobs
+
+task:
+  name: 'macOS: hypervisor build'
+
+  env:
+    matrix:
+      ARCH: x86_64
+      ARCH: aarch64
+
+  alias: macos-$ARCH
+  macos_instance:
+    image: ghcr.io/cirruslabs/macos-runner:sonoma
+
+  environment:
+    CIRRUS_CLONE_DEPTH: 1
+    CIRRUS_LOG_TIMESTAMP: true
+
+  install_script:
+    - brew install $ARCH-elf-gcc $ARCH-elf-binutils
+
+  build_script:
+    - make -j`sysctl -n hw.ncpu`
+           XEN_TARGET_ARCH=`echo $ARCH | sed -e s/aarch64/arm64/`
+           CROSS_COMPILE=$ARCH-elf- HOSTCC=clang -C xen
+
+  xen_artifacts:
+    path: xen/xen
+    type: application/octet-stream
+
+  debug_artifacts:
+    path: xen/xen-syms
+    type: application/octet-stream
+
+## Test Jobs
 
 task:
   name: 'FreeBSD: XTF selftest'
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 12:22:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 12:22:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1230825.1536248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsC2-0004Pc-UT; Fri, 13 Feb 2026 12:22:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1230825.1536248; Fri, 13 Feb 2026 12:22:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqsC2-0004PU-Rs; Fri, 13 Feb 2026 12:22:42 +0000
Received: by outflank-mailman (input) for mailman id 1230825;
 Fri, 13 Feb 2026 12: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 1vqsC2-0004PN-Di
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 12: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 1vqsC2-006rpu-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12:22:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqsC2-006Ork-0v
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 12: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=2Y+QCSqKsHIJR87YASmvNX5zYYRaw7E8oYb1rN+kIQ8=; b=0+HBEBtWnkaPN2+Oydx1i822KP
	mqc1mJxacZ+U3Qz/wwsbl3Ff8vu4hmJtWHEjo/kM5cnGJhxbhPgdUxgLA+GiMIndKCBTPnvXaGKGk
	CWSU7/rjIUS4xq6WTjfwiZH1B8u5s/hjaIsNby9r7cXZcVwcfZIpqYjEjsFhN++y/dRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] cirrus-ci: add x86 XTF self-tests for macOS build
Message-Id: <E1vqsC2-006Ork-0v@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 12:22:42 +0000

commit 1f4f85b64d393be1aa8dc8170201f4fbfe9c7222
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Wed Feb 11 09:25:17 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Thu Feb 12 19:22:54 2026 +0100

    cirrus-ci: add x86 XTF self-tests for macOS build
    
    Like we do for the FreeBSD builds, introduce some basic smoke testing of
    the built binary using the XTF selftest image.
    
    Note this is only done for the x86 build, there's no ARM support in XTF
    yet.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 .cirrus.yml | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/.cirrus.yml b/.cirrus.yml
index b9608e71cc..839c25149c 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -161,18 +161,19 @@ task:
 ## Test Jobs
 
 task:
-  name: 'FreeBSD: XTF selftest'
+  name: 'XTF selftest'
 
   << : *FREEBSD_ENV_PRODUCTION
 
   env:
     matrix:
-      FREEBSD_BUILD: $FREEBSD_LEGACY
-      FREEBSD_BUILD: $FREEBSD_PRODUCTION
-      FREEBSD_BUILD: $FREEBSD_CURRENT
+      BUILD: freebsd_full_$FREEBSD_LEGACY
+      BUILD: freebsd_full_$FREEBSD_PRODUCTION
+      BUILD: freebsd_full_$FREEBSD_CURRENT
+      BUILD: macos-x86_64
 
   depends_on:
-    - freebsd_full_$FREEBSD_BUILD
+    - $BUILD
     - xtf
 
   install_script: pkg install -y qemu-nox11 expect
@@ -187,7 +188,7 @@ task:
 
   fetch_script:
     - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/xtf/xtf.zip
-    - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/freebsd_full_$FREEBSD_BUILD/xen.zip
+    - fetch https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/$BUILD/xen.zip
     - unzip xtf.zip
     - unzip xen.zip
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 17:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 17:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1231519.1536682 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqwh4-0006pe-Et; Fri, 13 Feb 2026 17:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1231519.1536682; Fri, 13 Feb 2026 17: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 1vqwh4-0006pW-CA; Fri, 13 Feb 2026 17:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1231519;
 Fri, 13 Feb 2026 17: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 1vqwh3-0006pQ-LW
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 17: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 1vqwh3-006xsa-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 17:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqwh3-006p2c-1b
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 17: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=7gjFZK/ZWpm3XUa/QG88yjS8s5bqdcNV6UL+/SB/3Wg=; b=K1SPmhkg9wL3Eco1kdNT3IPKMy
	W+HSBXvgUOxCVN8ITQqt/ntjAPTYOhvDRWaUGDHYqDHx1DUPkmckipguQzYGY+vcH8LT7nOR9lPsQ
	fCIoP8Vxro1dM5NjG0pPGK+RcEwuKFNw19lFHrhNyoMmwwnGi5MrTC8QLdmn9xrZuCC4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/x86: fix usage of [[:blank:]] with BSD grep
Message-Id: <E1vqwh3-006p2c-1b@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 17:11:01 +0000

commit c13335b5c1292e90436746ec04ed0553b688160b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 13 14:19:01 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 13 16:42:34 2026 +0100

    xen/x86: fix usage of [[:blank:]] with BSD grep
    
    BSD grep only recognizes [[:blank:]] as a valid expression when using
    extended (modern) regular expressions.  Pass -E to the grep call used in
    efi-nr-fixups.
    
    Additionally, the return from `wc -l` is space padded on BSD, and hence
    the content of efi-nr-fixups is "       2", not plain "2".  Strip the
    spaces in the Makefile using $(strip ...).
    
    Fixes: 1be65ec4c8bc ('x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/arch.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 2e06ae2582..37fe65bc13 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -100,7 +100,7 @@ endif
 ifeq ($(XEN_BUILD_PE),y)
 
 # Check if the linker produces fixups in PE by default
-efi-nr-fixups := $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l)
+efi-nr-fixups := $(strip $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep -E '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l))
 
 ifeq ($(efi-nr-fixups),2)
 MKRELOC := :
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 17:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 17:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1231520.1536686 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqwhF-0006rZ-GG; Fri, 13 Feb 2026 17:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1231520.1536686; Fri, 13 Feb 2026 17: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 1vqwhF-0006rQ-Dd; Fri, 13 Feb 2026 17:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1231520;
 Fri, 13 Feb 2026 17: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 1vqwhD-0006rB-Oy
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 17: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 1vqwhD-006xsz-2C
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 17:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqwhD-006p3Z-25
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 17: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=mvLeU/BocKzlrbP0obGKd3JkWAcqVjLQ6Hu9Ln+lvNQ=; b=wfPHU4feN5b5uTjAM3XJIWRLi3
	KzO9E5x73TPDvgZs8ovLhBltZUQxJNKuBt2/srfVc7EKHWSBMPch0E17b0pasHUFV2xKob0Qf2F/9
	5yjk5m0Y9FxVqx5Zvp9jiKkq4IW2RY6xuAmhaZoaAR0JjHGU186pBMsYiLELV0zc/ZR8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: add non-executable stack note uniformly
Message-Id: <E1vqwhD-006p3Z-25@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 17:11:11 +0000

commit 3dfd77003c28ff3f6bfbf76a75d40a41ccecb33f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 13 14:39:17 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 13 16:42:42 2026 +0100

    xen: add non-executable stack note uniformly
    
    Currently the -Wa,--noexecstack parameter is only passed to the compiler
    when building assembly files, as the assembler doesn't add such note for
    stack attributes.
    
    However, the default addition of the .note.GNU-stack section is dependent
    on the ELF target used.  Adjust the passing of -Wa,--noexecstack so it's
    added to CFLAGS instead of AFLAGS, and hence such section is also added to
    object files generated from .c sources.  This fixes the complains from the
    linker about missing .note.GNU-stack section when building x86-64 Xen on
    Darwin platforms.
    
    Note we could instead pass `-z noexecstack` to the linker, but that however
    would mask any possible errors or unintended mismatches from previous
    steps.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index a054315fa4..a2b442e76d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -413,7 +413,7 @@ ifneq ($(CONFIG_CC_IS_CLANG),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--noexecstack)
+$(call cc-option-add,CFLAGS,CC,-Wa$$(comma)--noexecstack)
 
 LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 18:11:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 18:11:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1231624.1536699 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqxd9-0007Wh-3K; Fri, 13 Feb 2026 18:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1231624.1536699; Fri, 13 Feb 2026 18: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 1vqxd9-0007Wa-0l; Fri, 13 Feb 2026 18:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1231624;
 Fri, 13 Feb 2026 18: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 1vqxd7-0007WU-Mo
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 18: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 1vqxd7-006zHn-1e
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 18:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqxd7-006sfg-1B
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 18: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=xLKbkEKGY3FY1ddTQkJLbCCZ5MJNclypwUEiU2/6dq8=; b=uYqC78hlQOf8ugBps01A3sJsvD
	EY6KSTg5A/Q3fXa/IQS+tev2pucvAT530aaagyPjTArEXXyTFZm+Rn26gIj1C9KhMSbQunu3K4OG/
	aFEdvA/WUkRmPL+q2jyWFM19jZFOJWnKJOPccaareN5pQbOEoxu2foRFKzQ4LB3ifJRE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/x86: fix usage of [[:blank:]] with BSD grep
Message-Id: <E1vqxd7-006sfg-1B@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 18:11:01 +0000

commit c13335b5c1292e90436746ec04ed0553b688160b
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 13 14:19:01 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 13 16:42:34 2026 +0100

    xen/x86: fix usage of [[:blank:]] with BSD grep
    
    BSD grep only recognizes [[:blank:]] as a valid expression when using
    extended (modern) regular expressions.  Pass -E to the grep call used in
    efi-nr-fixups.
    
    Additionally, the return from `wc -l` is space padded on BSD, and hence
    the content of efi-nr-fixups is "       2", not plain "2".  Strip the
    spaces in the Makefile using $(strip ...).
    
    Fixes: 1be65ec4c8bc ('x86/EFI: avoid use of GNU ld's --disable-reloc-section when possible')
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/arch.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 2e06ae2582..37fe65bc13 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -100,7 +100,7 @@ endif
 ifeq ($(XEN_BUILD_PE),y)
 
 # Check if the linker produces fixups in PE by default
-efi-nr-fixups := $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l)
+efi-nr-fixups := $(strip $(shell LC_ALL=C $(OBJDUMP) -p $(efi-check).efi | grep -E '^[[:blank:]]*reloc[[:blank:]]*[0-9][[:blank:]].*DIR64$$' | wc -l))
 
 ifeq ($(efi-nr-fixups),2)
 MKRELOC := :
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 13 18:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 13 Feb 2026 18:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1231625.1536705 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vqxdI-0007Ym-6h; Fri, 13 Feb 2026 18:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1231625.1536705; Fri, 13 Feb 2026 18: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 1vqxdI-0007Yd-3b; Fri, 13 Feb 2026 18:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1231625;
 Fri, 13 Feb 2026 18: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 1vqxdH-0007YT-KC
 for xen-changelog@lists.xenproject.org; Fri, 13 Feb 2026 18: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 1vqxdH-006zHx-1v
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 18:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vqxdH-006sgH-1o
 for xen-changelog@lists.xenproject.org;
 Fri, 13 Feb 2026 18: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=JGF5OtTIUc30GM28Fuiyy15JePWiTmSQs/ah8ejyExM=; b=JseHfqE3B1utAqHTsrFzsTR0h/
	hygi34iu8QvazH7N4mJ7nb3p8FQ5UNvolxy1Igq1rFAbQostyEd6d2R0bC1VvGYxNkRWG4oND35vw
	cbBlDuPgnhIDb8cNSrmqGbtdL5K4waArPQX5DqRz7k8YGdKdnP11RaDcoEoXwrBrHOCY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: add non-executable stack note uniformly
Message-Id: <E1vqxdH-006sgH-1o@xenbits.xenproject.org>
Date: Fri, 13 Feb 2026 18:11:11 +0000

commit 3dfd77003c28ff3f6bfbf76a75d40a41ccecb33f
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Fri Feb 13 14:39:17 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Fri Feb 13 16:42:42 2026 +0100

    xen: add non-executable stack note uniformly
    
    Currently the -Wa,--noexecstack parameter is only passed to the compiler
    when building assembly files, as the assembler doesn't add such note for
    stack attributes.
    
    However, the default addition of the .note.GNU-stack section is dependent
    on the ELF target used.  Adjust the passing of -Wa,--noexecstack so it's
    added to CFLAGS instead of AFLAGS, and hence such section is also added to
    object files generated from .c sources.  This fixes the complains from the
    linker about missing .note.GNU-stack section when building x86-64 Xen on
    Darwin platforms.
    
    Note we could instead pass `-z noexecstack` to the linker, but that however
    would mask any possible errors or unintended mismatches from previous
    steps.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index a054315fa4..a2b442e76d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -413,7 +413,7 @@ ifneq ($(CONFIG_CC_IS_CLANG),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--noexecstack)
+$(call cc-option-add,CFLAGS,CC,-Wa$$(comma)--noexecstack)
 
 LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232176.1536998 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4Bc-0004qB-1m; Sat, 14 Feb 2026 01:11:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232176.1536998; Sat, 14 Feb 2026 01:11: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 1vr4Bb-0004q2-VH; Sat, 14 Feb 2026 01:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1232176;
 Sat, 14 Feb 2026 01: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 1vr4Ba-0004pw-6l
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4Ba-008IXr-07
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4Ba-007GTS-00
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=ceUBwdSbwvBz6S5i/tFEj2vuSe3k1wA7fYIA+MBMOVw=; b=bKa7vyGYatbAx9J8846P2Y6CQq
	9qPgR9v0hC2xB2fh5UUWvu3f6Piu7F1AF9yS1ndPVLFXMfsd4yg1rUV88Lu0IvEe2+vo/C2+8XVRY
	gFVpRLF9LZ1ctz9GEeVHTFgePt3XSAJHwWyCYQhIhKK5h+ZX7Bnt61XyhAdeOqB1YEeQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Strip vcpu_switch_to_aarch64_mode() from PPC and RISC-V stubs
Message-Id: <E1vr4Ba-007GTS-00@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:02 +0000

commit 2cc63f3b8be6c43f1778119947a78ec2967ba16e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 10 16:33:20 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen: Strip vcpu_switch_to_aarch64_mode() from PPC and RISC-V stubs
    
    This is absolutely too much copy&paste from ARM.  All other stubs look
    somewhat reasonable.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/ppc/stubs.c   | 5 -----
 xen/arch/riscv/stubs.c | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index f7f6e7ed97..a333f06119 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -162,11 +162,6 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-void vcpu_switch_to_aarch64_mode(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index acbfde79b5..d071c8b86d 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -126,11 +126,6 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-void vcpu_switch_to_aarch64_mode(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232177.1537001 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4Bl-0004rh-2z; Sat, 14 Feb 2026 01:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232177.1537001; Sat, 14 Feb 2026 01: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 1vr4Bl-0004rZ-0L; Sat, 14 Feb 2026 01:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1232177;
 Sat, 14 Feb 2026 01: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 1vr4Bk-0004rL-5O
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4Bk-008IXy-0P
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4Bk-007GTw-0J
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=wLWHFNsUI8dMVFGRFELdXW+wVM70yWG0ucnToy0nOcg=; b=xw4ttHvxwOsaXjMvmpopOpK/7A
	hurisHo9OqyjZCWBXH/qmcppzqMiYwjMr6+2HHe8V7uU4osqK9DeIkFRAwGs8BTWJdvMj79+BOXFZ
	nWfJfwg4Qsx+ZsbSADoXSkuYUuGMj4IUxyem1jaw+dJzWO8/eg4w9wilPojsFjwcCols=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/bitmap: Drop unused headers
Message-Id: <E1vr4Bk-007GTw-0J@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:12 +0000

commit 9ad2c6572660611c0b9066bfd83851a272f351a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 31 18:05:18 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen/bitmap: Drop unused headers
    
    Nothing in bitmap.h uses lib.h.  Reduce to just macros.h and string.h.  Drop
    types.h while at it, as it comes in through bitops.h
    
    cpumask.h and nodemask.h only include kernel.h to get container_of().  Move it
    into macros.h where it belongs, cleaning it up as it goes.
    
    acpi/numa.c was picking up printk() transitively through bitmap.h so include
    lib.h directly.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/acpi/numa.c    |  1 +
 xen/include/xen/bitmap.h   |  4 ++--
 xen/include/xen/cpumask.h  |  1 -
 xen/include/xen/kernel.h   | 12 ------------
 xen/include/xen/macros.h   | 13 +++++++++++++
 xen/include/xen/nodemask.h |  1 -
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 77945f8744..5f161c32fb 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -22,6 +22,7 @@
  *
  */
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/acpi.h>
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index c69398a127..561b5da6af 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -3,9 +3,9 @@
 
 #ifndef __ASSEMBLER__
 
-#include <xen/lib.h>
-#include <xen/types.h>
 #include <xen/bitops.h>
+#include <xen/macros.h>
+#include <xen/string.h>
 
 /*
  * bitmaps provide bit arrays that consume one or more unsigned
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index f3a53d90e0..89d03e7ce1 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -57,7 +57,6 @@
 
 #include <xen/bitmap.h>
 #include <xen/bug.h>
-#include <xen/kernel.h>
 #include <xen/random.h>
 
 typedef struct cpumask{ DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index c5b6cc9777..378f21c247 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -8,18 +8,6 @@
 #include <xen/macros.h>
 #include <xen/types.h>
 
-/**
- * container_of - cast a member of a structure out to the containing structure
- *
- * @ptr:	the pointer to the member.
- * @type:	the type of the container struct this is embedded in.
- * @member:	the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({                      \
-        typeof_field(type, member) *__mptr = (ptr);             \
-        (type *)( (char *)__mptr - offsetof(type,member) );})
-
 /**
  * __struct_group() - Create a mirrored named and anonyomous struct
  *
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 714a644f4e..acd451b335 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -96,6 +96,19 @@
 
 #define endof_field(type, member) (offsetof(type, member) + sizeof_field(type, member))
 
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ *
+ * @ptr:	the pointer to the member.
+ * @type:	the type of the container struct this is embedded in.
+ * @member:	the name of the member within the struct.
+ */
+#define container_of(ptr, type, member)                         \
+    ({                                                          \
+        typeof_field(type, member) *__mptr = (ptr);             \
+        (type *)((void *)__mptr - offsetof(type, member));      \
+    })
+
 /* Cast an arbitrary integer to a pointer. */
 #define _p(x) ((void *)(unsigned long)(x))
 
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index c9b18c47aa..b4718cb3bb 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -53,7 +53,6 @@
  * for_each_online_node(node)		for-loop node over node_online_map
  */
 
-#include <xen/kernel.h>
 #include <xen/bitmap.h>
 #include <xen/numa.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232178.1537005 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4Bv-0004uC-4N; Sat, 14 Feb 2026 01:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232178.1537005; Sat, 14 Feb 2026 01: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 1vr4Bv-0004u4-1j; Sat, 14 Feb 2026 01:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1232178;
 Sat, 14 Feb 2026 01: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 1vr4Bu-0004tu-8t
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4Bu-008IY3-0m
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4Bu-007GVS-0Z
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=sD8u/P2qoLlM5k3YqMYXhc4dG/QYtWxQbkNtGAgDOKQ=; b=enAVeBlYvXfJDjBkNHrZie7qww
	fY45NuQEW2ZKA5/90RSppWazw5L6JA5E3moq0MepVq8/fGvbnjBdsFV9+TzoCerak7qUprl85qHzh
	PW8H1nuzHmHIBYaMK+E8rq7vxJiIOlVMog5ejvX0ZJMGc27QthlzVC3WxWiGGlkd+g7g=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xtf: fix argo test parameters
Message-Id: <E1vr4Bu-007GVS-0Z@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:22 +0000

commit f7173bff9d3e1fef15987d65ba67d2fbed6eee64
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Feb 12 15:15:06 2026 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xtf: fix argo test parameters
    
    The mac-permissive= option is currently ignored because Argo configuration
    parameters are comma-separated.
    
    Fix the missing comma in the XTF test arguments.
    
    Fixes: 150c6ef45922 ("CI: add argo x86 XTF test")
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/include/xtf-runner | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner
index 43ff2d4d88..d1ef888465 100644
--- a/automation/scripts/include/xtf-runner
+++ b/automation/scripts/include/xtf-runner
@@ -69,7 +69,7 @@ function xtf_build_cmdline()
     local xtf_name=$2
     declare -a cmdline=()
     declare -A per_test_args=(
-        [argo]="argo=1 mac-permissive=1"
+        [argo]="argo=1,mac-permissive=1"
     )
 
     cmdline+=("${XEN_CMDLINE}")
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232179.1537010 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4C5-0004wD-5h; Sat, 14 Feb 2026 01:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232179.1537010; Sat, 14 Feb 2026 01: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 1vr4C5-0004w7-33; Sat, 14 Feb 2026 01:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1232179;
 Sat, 14 Feb 2026 01: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 1vr4C4-0004w1-Df
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4C4-008IYB-1D
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4C4-007GWW-0w
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=gouX3LfS+QByX1ruSRv5Q9QKToDR5a7EBV9nLAm5yzU=; b=Q+AoFRpaw5zIEjiR6FfMvLtYpE
	mssBkbO1mxDlgq6FZpIHAdCnxjgVxI68iiBChmCEIDEjH+u5Tn5aESqVs9oJg0zdqAT/q3jXsLC9f
	YoRov3BlnkvvdWvjDZtThxw3TYyXtOVWidoFxwgDQRF4YYCz++8jtGA3ptfxeEqFiCi8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/traps: Alter switch_stack_and_jump() for FRED mode
Message-Id: <E1vr4C4-007GWW-0w@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:32 +0000

commit 40fbf971771a5c7c973818edbd0be7b50f0eb364
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 26 18:48:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    x86/traps: Alter switch_stack_and_jump() for FRED mode
    
    FRED and IDT differ by a Supervisor Token on the base of the shadow stack.
    This means that switch_stack_and_jump() needs to discard one extra word when
    FRED is active.
    
    Fix a typo in the parameter name, which should be shstk_base.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/current.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index c1eb27b1c4..62817e8476 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -154,7 +154,9 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
     "rdsspd %[ssp];"                                            \
     "cmp $1, %[ssp];"                                           \
     "je .L_shstk_done.%=;" /* CET not active?  Skip. */         \
-    "mov $%c[skstk_base], %[val];"                              \
+    ALTERNATIVE("mov $%c[shstk_base], %[val];",                 \
+                "mov $%c[shstk_base] + 8, %[val];",             \
+                X86_FEATURE_XEN_FRED)                           \
     "and $%c[stack_mask], %[ssp];"                              \
     "sub %[ssp], %[val];"                                       \
     "shr $3, %[val];"                                           \
@@ -188,7 +190,7 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
               [ssp] "=&r" (tmp)                                         \
             : [stk] "r" (guest_cpu_user_regs()),                        \
               [fun] constr (fn),                                        \
-              [skstk_base] "i"                                          \
+              [shstk_base] "i"                                          \
               ((PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8),               \
               [stack_mask] "i" (STACK_SIZE - 1),                        \
               _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__,                \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232180.1537014 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4CF-0004yJ-7E; Sat, 14 Feb 2026 01:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232180.1537014; Sat, 14 Feb 2026 01: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 1vr4CF-0004yB-4T; Sat, 14 Feb 2026 01:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1232180;
 Sat, 14 Feb 2026 01: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 1vr4CE-0004y3-Fx
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4CE-008IYF-1U
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4CE-007GWy-1O
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=RbxT3nho3S7FeB25TqVyvoUuBmN6jG2Yg4SbuHSNG2c=; b=tCRkNDkmHyEmnlQTHZhnCl2JQS
	6mwhagd3PxjXMqHBQyn6kC2zDXpNCRhg63t/9ciSh0SOfGMXlq7RqSh37E/Kfn2fvuIh5wZorUvzB
	5sZ9uT8HouG9HV3aTUHHQyQFFLFliNslE+AulC27c1KtIsZZcWn9o16yV1IQ6VItfgNA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/fsgsbase: Make SHADOW_GS accesses safe under FRED
Message-Id: <E1vr4CE-007GWy-1O@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:42 +0000

commit 3ff1030ea7d40e62edfe09b44dbdba44def5072a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 18 15:44:44 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    x86/fsgsbase: Make SHADOW_GS accesses safe under FRED
    
    Under FRED, the SWAPGS instruction is disallowed.  Therefore we must use the
    MSR path instead.
    
    read_registers() is in the show_registers() path, so this change allows Xen to
    render it's current state without suffering #UD (and recursing until the stack
    guard page is hit).
    
    All hardware with FRED is expected to have some kind of non-serialising access
    to these registers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/fsgsbase.h | 8 ++++++--
 xen/arch/x86/traps.c                | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/fsgsbase.h b/xen/arch/x86/include/asm/fsgsbase.h
index 24862a6bfe..5faa3a3243 100644
--- a/xen/arch/x86/include/asm/fsgsbase.h
+++ b/xen/arch/x86/include/asm/fsgsbase.h
@@ -79,7 +79,9 @@ static inline unsigned long read_gs_base(void)
 
 static inline unsigned long read_gs_shadow(void)
 {
-    if ( read_cr4() & X86_CR4_FSGSBASE )
+    unsigned long cr4 = read_cr4();
+
+    if ( !(cr4 & X86_CR4_FRED) && (cr4 & X86_CR4_FSGSBASE) )
         return __rdgs_shadow();
     else
         return rdmsr(MSR_SHADOW_GS_BASE);
@@ -103,7 +105,9 @@ static inline void write_gs_base(unsigned long base)
 
 static inline void write_gs_shadow(unsigned long base)
 {
-    if ( read_cr4() & X86_CR4_FSGSBASE )
+    unsigned long cr4 = read_cr4();
+
+    if ( !(cr4 & X86_CR4_FRED) && (cr4 & X86_CR4_FSGSBASE) )
         __wrgs_shadow(base);
     else
         wrmsrns(MSR_SHADOW_GS_BASE, base);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f621b99a5f..3c01c5eb53 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -123,7 +123,7 @@ static void read_registers(struct extra_state *state)
      * invalidate the read_cr4() address calculation (really cpu_info->cr4
      * under the hood), forcing the cr4 check to be re-evaluated every time.
      */
-    if ( state->cr4 & X86_CR4_FSGSBASE )
+    if ( !(state->cr4 & X86_CR4_FRED) && (state->cr4 & X86_CR4_FSGSBASE) )
     {
         state->fsb = __rdfsbase();
         state->gsb = __rdgsbase();
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 14 01:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 14 Feb 2026 01:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1232181.1537020 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vr4CP-00050L-9I; Sat, 14 Feb 2026 01:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1232181.1537020; Sat, 14 Feb 2026 01:11: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 1vr4CP-00050B-5r; Sat, 14 Feb 2026 01:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1232181;
 Sat, 14 Feb 2026 01: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 1vr4CO-000505-Ir
 for xen-changelog@lists.xenproject.org; Sat, 14 Feb 2026 01: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 1vr4CO-008IYe-1n
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vr4CO-007GXK-1g
 for xen-changelog@lists.xenproject.org;
 Sat, 14 Feb 2026 01: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=2YrT2nM8TtOKLDGMlketSL+lLDtHJApXBcwZrDO+XUE=; b=OmCwaMLQhperwIpFtB6vTIGgCR
	21JcPCiYIYrJRB2sZz605S14dpCmB1c1TZIOUwjo5Q1GtQdl9fuhg/r7RxCrEVAzMdYFskVVxUbJ0
	En4WGr0JfkgGOLHDvSDIBPBday0SxlbxJvtFaifdAIgEe3DxS6OsdON3Tx8SBNjxTinE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Put wait.c behind CONFIG_VM_EVENT
Message-Id: <E1vr4CO-007GXK-1g@xenbits.xenproject.org>
Date: Sat, 14 Feb 2026 01:11:52 +0000

commit b8f7b62e02c0201fba9915dbe0ec445878eb1864
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Feb 13 17:56:35 2026 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen: Put wait.c behind CONFIG_VM_EVENT
    
    wait.c is only used by vm_event.c, so build it when CONFIG_VM_EVENT is
    selected.
    
    Provide stubs of functions called from common code.  entry.S needs an
    ifdef to hide the symbol from the assembly.
    
    Also conditionalize .waitqueue_vcpu in struct vcpu to save space.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/entry.S |  2 ++
 xen/common/Makefile         |  2 +-
 xen/include/xen/sched.h     |  2 ++
 xen/include/xen/wait.h      | 11 +++++++++--
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index ca446c6ff0..8b83082413 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -664,7 +664,9 @@ FUNC(continue_pv_domain)
         ALTERNATIVE "", "mov $2, %eax; incsspd %eax", X86_FEATURE_XEN_SHSTK
 #endif
 
+#ifdef CONFIG_VM_EVENT
         call  check_wakeup_from_wait
+#endif
 ret_from_intr:
         GET_CURRENT(bx)
         testb $3, UREGS_cs(%rsp)
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 4fc0c15088..dac8b711cd 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -61,7 +61,7 @@ obj-y += virtual_region.o
 obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
-obj-y += wait.o
+obj-$(CONFIG_VM_EVENT) += wait.o
 obj-bin-y += warning.init.o
 obj-y += xmalloc_tlsf.o
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1268632344..40a35fc15c 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -293,7 +293,9 @@ struct vcpu
     /* Multicall information. */
     struct mc_state  mc_state;
 
+#ifdef CONFIG_VM_EVENT
     struct waitqueue_vcpu *waitqueue_vcpu;
+#endif
 
     struct evtchn_fifo_vcpu *evtchn_fifo;
 
diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h
index 1c68bc564b..e3510431ac 100644
--- a/xen/include/xen/wait.h
+++ b/xen/include/xen/wait.h
@@ -49,11 +49,18 @@ do {                                            \
 } while (0)
 
 /* Private functions. */
-int init_waitqueue_vcpu(struct vcpu *v);
-void destroy_waitqueue_vcpu(struct vcpu *v);
 void prepare_to_wait(struct waitqueue_head *wq);
 void wait(void);
 void finish_wait(struct waitqueue_head *wq);
+
+#ifdef CONFIG_VM_EVENT
+int init_waitqueue_vcpu(struct vcpu *v);
+void destroy_waitqueue_vcpu(struct vcpu *v);
 void check_wakeup_from_wait(void);
+#else
+static inline int init_waitqueue_vcpu(struct vcpu *v) { return 0; }
+static inline void destroy_waitqueue_vcpu(struct vcpu *v) {}
+static inline void check_wakeup_from_wait(void) {}
+#endif
 
 #endif /* __XEN_WAIT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233896.1537252 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrvZH-0004Kw-GB; Mon, 16 Feb 2026 10:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233896.1537252; Mon, 16 Feb 2026 10: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 1vrvZH-0004Ko-Dd; Mon, 16 Feb 2026 10:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1233896;
 Mon, 16 Feb 2026 10: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 1vrvZG-0004Kg-7Y
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrvZG-00BqR1-0X
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrvZG-00AGb5-0M
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=gGgyiqniFeX4x1e7tSI84vJNGiaV9WLDmR9sPqbVTeA=; b=CELlfXr9MY/6BAZBQcbm8Y/hyJ
	4j7hR3hvaXjqhi3vZbOwx3MCRoOxY9fLeckSBBs2Y/aRwKNzn9N1lp/hC/lSSf81CrdkzIsxDsn6e
	u9UcIYKo2D4I4LlGaO3nG+uuOBj8RS8WT67gl4js27bMbuLw5q1XEWP8kc+WJX+zGzbw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Strip vcpu_switch_to_aarch64_mode() from PPC and RISC-V stubs
Message-Id: <E1vrvZG-00AGb5-0M@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:02 +0000

commit 2cc63f3b8be6c43f1778119947a78ec2967ba16e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 10 16:33:20 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen: Strip vcpu_switch_to_aarch64_mode() from PPC and RISC-V stubs
    
    This is absolutely too much copy&paste from ARM.  All other stubs look
    somewhat reasonable.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/ppc/stubs.c   | 5 -----
 xen/arch/riscv/stubs.c | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/xen/arch/ppc/stubs.c b/xen/arch/ppc/stubs.c
index f7f6e7ed97..a333f06119 100644
--- a/xen/arch/ppc/stubs.c
+++ b/xen/arch/ppc/stubs.c
@@ -162,11 +162,6 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-void vcpu_switch_to_aarch64_mode(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index acbfde79b5..d071c8b86d 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -126,11 +126,6 @@ void arch_vcpu_destroy(struct vcpu *v)
     BUG_ON("unimplemented");
 }
 
-void vcpu_switch_to_aarch64_mode(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233897.1537257 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrvZR-0004Mr-Hu; Mon, 16 Feb 2026 10:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233897.1537257; Mon, 16 Feb 2026 10: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 1vrvZR-0004Mj-Ey; Mon, 16 Feb 2026 10:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1233897;
 Mon, 16 Feb 2026 10: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 1vrvZQ-0004MX-B7
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrvZQ-00BqR8-0t
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrvZQ-00AGd2-0j
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=sMfL+rmkCc43ER7C+IAvyaziay52F2CTNsm3lErQP/I=; b=NEvE7DZ2vGwTmSvsgJn6zmJTQ/
	6PpeAg1odo+DOS1quS/8/P2Y0Xq59ChjFHV421djr90dtkVR2veL2AMGMPPrULSvskHFYzWIIHLTp
	dqM0bNVGSFSjkPmiUSm75DrVYUIje6TxO1to+J+ugDghep2wHB95iA8VyO2y8Q9voGiA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/bitmap: Drop unused headers
Message-Id: <E1vrvZQ-00AGd2-0j@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:12 +0000

commit 9ad2c6572660611c0b9066bfd83851a272f351a0
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jan 31 18:05:18 2024 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen/bitmap: Drop unused headers
    
    Nothing in bitmap.h uses lib.h.  Reduce to just macros.h and string.h.  Drop
    types.h while at it, as it comes in through bitops.h
    
    cpumask.h and nodemask.h only include kernel.h to get container_of().  Move it
    into macros.h where it belongs, cleaning it up as it goes.
    
    acpi/numa.c was picking up printk() transitively through bitmap.h so include
    lib.h directly.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Julien Grall <jgrall@amazon.com>
---
 xen/drivers/acpi/numa.c    |  1 +
 xen/include/xen/bitmap.h   |  4 ++--
 xen/include/xen/cpumask.h  |  1 -
 xen/include/xen/kernel.h   | 12 ------------
 xen/include/xen/macros.h   | 13 +++++++++++++
 xen/include/xen/nodemask.h |  1 -
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c
index 77945f8744..5f161c32fb 100644
--- a/xen/drivers/acpi/numa.c
+++ b/xen/drivers/acpi/numa.c
@@ -22,6 +22,7 @@
  *
  */
 #include <xen/init.h>
+#include <xen/lib.h>
 #include <xen/types.h>
 #include <xen/errno.h>
 #include <xen/acpi.h>
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index c69398a127..561b5da6af 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -3,9 +3,9 @@
 
 #ifndef __ASSEMBLER__
 
-#include <xen/lib.h>
-#include <xen/types.h>
 #include <xen/bitops.h>
+#include <xen/macros.h>
+#include <xen/string.h>
 
 /*
  * bitmaps provide bit arrays that consume one or more unsigned
diff --git a/xen/include/xen/cpumask.h b/xen/include/xen/cpumask.h
index f3a53d90e0..89d03e7ce1 100644
--- a/xen/include/xen/cpumask.h
+++ b/xen/include/xen/cpumask.h
@@ -57,7 +57,6 @@
 
 #include <xen/bitmap.h>
 #include <xen/bug.h>
-#include <xen/kernel.h>
 #include <xen/random.h>
 
 typedef struct cpumask{ DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
diff --git a/xen/include/xen/kernel.h b/xen/include/xen/kernel.h
index c5b6cc9777..378f21c247 100644
--- a/xen/include/xen/kernel.h
+++ b/xen/include/xen/kernel.h
@@ -8,18 +8,6 @@
 #include <xen/macros.h>
 #include <xen/types.h>
 
-/**
- * container_of - cast a member of a structure out to the containing structure
- *
- * @ptr:	the pointer to the member.
- * @type:	the type of the container struct this is embedded in.
- * @member:	the name of the member within the struct.
- *
- */
-#define container_of(ptr, type, member) ({                      \
-        typeof_field(type, member) *__mptr = (ptr);             \
-        (type *)( (char *)__mptr - offsetof(type,member) );})
-
 /**
  * __struct_group() - Create a mirrored named and anonyomous struct
  *
diff --git a/xen/include/xen/macros.h b/xen/include/xen/macros.h
index 714a644f4e..acd451b335 100644
--- a/xen/include/xen/macros.h
+++ b/xen/include/xen/macros.h
@@ -96,6 +96,19 @@
 
 #define endof_field(type, member) (offsetof(type, member) + sizeof_field(type, member))
 
+/**
+ * container_of - cast a member of a structure out to the containing structure
+ *
+ * @ptr:	the pointer to the member.
+ * @type:	the type of the container struct this is embedded in.
+ * @member:	the name of the member within the struct.
+ */
+#define container_of(ptr, type, member)                         \
+    ({                                                          \
+        typeof_field(type, member) *__mptr = (ptr);             \
+        (type *)((void *)__mptr - offsetof(type, member));      \
+    })
+
 /* Cast an arbitrary integer to a pointer. */
 #define _p(x) ((void *)(unsigned long)(x))
 
diff --git a/xen/include/xen/nodemask.h b/xen/include/xen/nodemask.h
index c9b18c47aa..b4718cb3bb 100644
--- a/xen/include/xen/nodemask.h
+++ b/xen/include/xen/nodemask.h
@@ -53,7 +53,6 @@
  * for_each_online_node(node)		for-loop node over node_online_map
  */
 
-#include <xen/kernel.h>
 #include <xen/bitmap.h>
 #include <xen/numa.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233898.1537260 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrvZb-0004PJ-J2; Mon, 16 Feb 2026 10:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233898.1537260; Mon, 16 Feb 2026 10: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 1vrvZb-0004PB-GI; Mon, 16 Feb 2026 10:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1233898;
 Mon, 16 Feb 2026 10: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 1vrvZa-0004P4-Cc
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrvZa-00BqRF-19
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrvZa-00AGeL-13
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=pwA1L2F0q+jOUQaZsmm/U9t+ENgdosG+qDJ/1vUfTL4=; b=66xyp0N7RByqL9E+Sx+PeRR9Wy
	r6NkTs/WuTRLJC6NqEXPznL/f6Db4hW0ub+z2xkRXw56P7u76oZJf7aI5YRy1ie0qkFIzIY5Cnnva
	iOmQjIGnYrwsF2+geKVdRrDMJv3I+w/tfL4fvEdv/TkIj5XhMTe7i16i14RTIBTmg2DY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xtf: fix argo test parameters
Message-Id: <E1vrvZa-00AGeL-13@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:22 +0000

commit f7173bff9d3e1fef15987d65ba67d2fbed6eee64
Author:     Denis Mukhin <dmukhin@ford.com>
AuthorDate: Thu Feb 12 15:15:06 2026 -0800
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xtf: fix argo test parameters
    
    The mac-permissive= option is currently ignored because Argo configuration
    parameters are comma-separated.
    
    Fix the missing comma in the XTF test arguments.
    
    Fixes: 150c6ef45922 ("CI: add argo x86 XTF test")
    Signed-off-by: Denis Mukhin <dmukhin@ford.com>
    Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/include/xtf-runner | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/include/xtf-runner b/automation/scripts/include/xtf-runner
index 43ff2d4d88..d1ef888465 100644
--- a/automation/scripts/include/xtf-runner
+++ b/automation/scripts/include/xtf-runner
@@ -69,7 +69,7 @@ function xtf_build_cmdline()
     local xtf_name=$2
     declare -a cmdline=()
     declare -A per_test_args=(
-        [argo]="argo=1 mac-permissive=1"
+        [argo]="argo=1,mac-permissive=1"
     )
 
     cmdline+=("${XEN_CMDLINE}")
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233899.1537264 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrvZl-0004Rl-KQ; Mon, 16 Feb 2026 10:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233899.1537264; Mon, 16 Feb 2026 10: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 1vrvZl-0004Rd-Hg; Mon, 16 Feb 2026 10:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1233899;
 Mon, 16 Feb 2026 10: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 1vrvZk-0004RV-FQ
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrvZk-00BqRf-1Q
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrvZk-00AGeq-1K
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=y2q8JYegjWcjZWePO/F3bQaPFh92P8Ey3DQt9rxe4EM=; b=GEFMiIRzCEierezJep0UJvfv6I
	EkG08o+fZ07vvciYQZEfruG4rgKt1PXM8qOpSFSiazvRwiBQUibpjo43k1C6oR540JO9o5eCQw7O8
	kvZfkhCL6aoyHxCisBdv4MRQX8TNBfKHcE95TC2xfT7Jdfqm0POS2KZtGli67dhjtAbg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/traps: Alter switch_stack_and_jump() for FRED mode
Message-Id: <E1vrvZk-00AGeq-1K@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:32 +0000

commit 40fbf971771a5c7c973818edbd0be7b50f0eb364
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon May 26 18:48:26 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    x86/traps: Alter switch_stack_and_jump() for FRED mode
    
    FRED and IDT differ by a Supervisor Token on the base of the shadow stack.
    This means that switch_stack_and_jump() needs to discard one extra word when
    FRED is active.
    
    Fix a typo in the parameter name, which should be shstk_base.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/current.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
index c1eb27b1c4..62817e8476 100644
--- a/xen/arch/x86/include/asm/current.h
+++ b/xen/arch/x86/include/asm/current.h
@@ -154,7 +154,9 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
     "rdsspd %[ssp];"                                            \
     "cmp $1, %[ssp];"                                           \
     "je .L_shstk_done.%=;" /* CET not active?  Skip. */         \
-    "mov $%c[skstk_base], %[val];"                              \
+    ALTERNATIVE("mov $%c[shstk_base], %[val];",                 \
+                "mov $%c[shstk_base] + 8, %[val];",             \
+                X86_FEATURE_XEN_FRED)                           \
     "and $%c[stack_mask], %[ssp];"                              \
     "sub %[ssp], %[val];"                                       \
     "shr $3, %[val];"                                           \
@@ -188,7 +190,7 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
               [ssp] "=&r" (tmp)                                         \
             : [stk] "r" (guest_cpu_user_regs()),                        \
               [fun] constr (fn),                                        \
-              [skstk_base] "i"                                          \
+              [shstk_base] "i"                                          \
               ((PRIMARY_SHSTK_SLOT + 1) * PAGE_SIZE - 8),               \
               [stack_mask] "i" (STACK_SIZE - 1),                        \
               _ASM_BUGFRAME_INFO(BUGFRAME_bug, __LINE__,                \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233900.1537268 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrvZv-0004U2-Le; Mon, 16 Feb 2026 10:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233900.1537268; Mon, 16 Feb 2026 10: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 1vrvZv-0004Tu-J4; Mon, 16 Feb 2026 10:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1233900;
 Mon, 16 Feb 2026 10: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 1vrvZu-0004To-I3
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrvZu-00BqRj-1i
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrvZu-00AGfI-1b
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=uo4tUojwdXkx+UIzWlN8IqDxHg53vciaJQYm+NpDYOs=; b=TS1p4r1hdPjUaENNAlzvuFU+Ss
	s6OtCYtsugW08TXHr/Xcp0jQ8uAbR+TOPSsGvTPuAXqh9a6hVFglJaR/VgomWyp49I3QM2/K30HqI
	XeWUMbzFthUDfO05Z1w9tEfH60/jOlGoAJ81lyaaV/G8IrfAwFpwyR85hXwWI8lcqVD0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/fsgsbase: Make SHADOW_GS accesses safe under FRED
Message-Id: <E1vrvZu-00AGfI-1b@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:42 +0000

commit 3ff1030ea7d40e62edfe09b44dbdba44def5072a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Aug 18 15:44:44 2025 +0100
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    x86/fsgsbase: Make SHADOW_GS accesses safe under FRED
    
    Under FRED, the SWAPGS instruction is disallowed.  Therefore we must use the
    MSR path instead.
    
    read_registers() is in the show_registers() path, so this change allows Xen to
    render it's current state without suffering #UD (and recursing until the stack
    guard page is hit).
    
    All hardware with FRED is expected to have some kind of non-serialising access
    to these registers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/fsgsbase.h | 8 ++++++--
 xen/arch/x86/traps.c                | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/fsgsbase.h b/xen/arch/x86/include/asm/fsgsbase.h
index 24862a6bfe..5faa3a3243 100644
--- a/xen/arch/x86/include/asm/fsgsbase.h
+++ b/xen/arch/x86/include/asm/fsgsbase.h
@@ -79,7 +79,9 @@ static inline unsigned long read_gs_base(void)
 
 static inline unsigned long read_gs_shadow(void)
 {
-    if ( read_cr4() & X86_CR4_FSGSBASE )
+    unsigned long cr4 = read_cr4();
+
+    if ( !(cr4 & X86_CR4_FRED) && (cr4 & X86_CR4_FSGSBASE) )
         return __rdgs_shadow();
     else
         return rdmsr(MSR_SHADOW_GS_BASE);
@@ -103,7 +105,9 @@ static inline void write_gs_base(unsigned long base)
 
 static inline void write_gs_shadow(unsigned long base)
 {
-    if ( read_cr4() & X86_CR4_FSGSBASE )
+    unsigned long cr4 = read_cr4();
+
+    if ( !(cr4 & X86_CR4_FRED) && (cr4 & X86_CR4_FSGSBASE) )
         __wrgs_shadow(base);
     else
         wrmsrns(MSR_SHADOW_GS_BASE, base);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index f621b99a5f..3c01c5eb53 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -123,7 +123,7 @@ static void read_registers(struct extra_state *state)
      * invalidate the read_cr4() address calculation (really cpu_info->cr4
      * under the hood), forcing the cr4 check to be re-evaluated every time.
      */
-    if ( state->cr4 & X86_CR4_FSGSBASE )
+    if ( !(state->cr4 & X86_CR4_FRED) && (state->cr4 & X86_CR4_FSGSBASE) )
     {
         state->fsb = __rdfsbase();
         state->gsb = __rdgsbase();
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 16 10:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Feb 2026 10:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1233901.1537272 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vrva6-0004WK-N5; Mon, 16 Feb 2026 10:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1233901.1537272; Mon, 16 Feb 2026 10: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 1vrva6-0004WC-KP; Mon, 16 Feb 2026 10:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1233901;
 Mon, 16 Feb 2026 10: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 1vrva4-0004W4-L7
 for xen-changelog@lists.xenproject.org; Mon, 16 Feb 2026 10: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 1vrva4-00BqRn-21
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vrva4-00AGfl-1u
 for xen-changelog@lists.xenproject.org;
 Mon, 16 Feb 2026 10: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=AcCf1ehkz8SK54dDHKgQyS4kwV/g3FIUOLIR2VF/NAM=; b=PL7UF0vW6qwopAY+KZ+Z05vO8q
	O9dDGT5YF2Mtcsx3tMW8LtLWqUFozno7Kf9N5nMTBRnWY0Zu9lHbMRfXxQiejw4lspcHSHjdmNYWh
	lbrt8FB6IMhwxiFGepciTOnymlBZ7VicQ+YfEPg2Y8xjl3/rhRAE3WKRQ3dFHrVGTi/o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Put wait.c behind CONFIG_VM_EVENT
Message-Id: <E1vrva4-00AGfl-1u@xenbits.xenproject.org>
Date: Mon, 16 Feb 2026 10:11:52 +0000

commit b8f7b62e02c0201fba9915dbe0ec445878eb1864
Author:     Jason Andryuk <jason.andryuk@amd.com>
AuthorDate: Fri Feb 13 17:56:35 2026 -0500
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Sat Feb 14 01:01:33 2026 +0000

    xen: Put wait.c behind CONFIG_VM_EVENT
    
    wait.c is only used by vm_event.c, so build it when CONFIG_VM_EVENT is
    selected.
    
    Provide stubs of functions called from common code.  entry.S needs an
    ifdef to hide the symbol from the assembly.
    
    Also conditionalize .waitqueue_vcpu in struct vcpu to save space.
    
    Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/x86_64/entry.S |  2 ++
 xen/common/Makefile         |  2 +-
 xen/include/xen/sched.h     |  2 ++
 xen/include/xen/wait.h      | 11 +++++++++--
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index ca446c6ff0..8b83082413 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -664,7 +664,9 @@ FUNC(continue_pv_domain)
         ALTERNATIVE "", "mov $2, %eax; incsspd %eax", X86_FEATURE_XEN_SHSTK
 #endif
 
+#ifdef CONFIG_VM_EVENT
         call  check_wakeup_from_wait
+#endif
 ret_from_intr:
         GET_CURRENT(bx)
         testb $3, UREGS_cs(%rsp)
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 4fc0c15088..dac8b711cd 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -61,7 +61,7 @@ obj-y += virtual_region.o
 obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
-obj-y += wait.o
+obj-$(CONFIG_VM_EVENT) += wait.o
 obj-bin-y += warning.init.o
 obj-y += xmalloc_tlsf.o
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1268632344..40a35fc15c 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -293,7 +293,9 @@ struct vcpu
     /* Multicall information. */
     struct mc_state  mc_state;
 
+#ifdef CONFIG_VM_EVENT
     struct waitqueue_vcpu *waitqueue_vcpu;
+#endif
 
     struct evtchn_fifo_vcpu *evtchn_fifo;
 
diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h
index 1c68bc564b..e3510431ac 100644
--- a/xen/include/xen/wait.h
+++ b/xen/include/xen/wait.h
@@ -49,11 +49,18 @@ do {                                            \
 } while (0)
 
 /* Private functions. */
-int init_waitqueue_vcpu(struct vcpu *v);
-void destroy_waitqueue_vcpu(struct vcpu *v);
 void prepare_to_wait(struct waitqueue_head *wq);
 void wait(void);
 void finish_wait(struct waitqueue_head *wq);
+
+#ifdef CONFIG_VM_EVENT
+int init_waitqueue_vcpu(struct vcpu *v);
+void destroy_waitqueue_vcpu(struct vcpu *v);
 void check_wakeup_from_wait(void);
+#else
+static inline int init_waitqueue_vcpu(struct vcpu *v) { return 0; }
+static inline void destroy_waitqueue_vcpu(struct vcpu *v) {}
+static inline void check_wakeup_from_wait(void) {}
+#endif
 
 #endif /* __XEN_WAIT_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 09:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 09:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1234700.1537848 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsHS3-0005IQ-8U; Tue, 17 Feb 2026 09:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1234700.1537848; Tue, 17 Feb 2026 09: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 1vsHS3-0005II-5n; Tue, 17 Feb 2026 09:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1234700;
 Tue, 17 Feb 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 1vsHS1-0005IC-UX
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 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 1vsHS1-00DXZ8-2k
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 09:33:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsHS1-00BZpp-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 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=OwUarjml8BY8NbBtazDj0/fivbhMaDI5MtuS+zf4Y20=; b=pKklG+L66o5v0VaBljD+N2I3T3
	Yn3R9jk+QsahH957i4Cs6+Ivu94SNW4uoa9MEnzHaRMnoAjjqAAPEAmeQli7qff8+nX9ctVqpF5bQ
	FpgONoorM6pnNMAJFKV7LyvPXinJFnoqRBUUyvNnliORXujDR69/WxD1ggq7j+a8BVUE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] VT-d: fix off-by-one when handling extra RMRR ranges
Message-Id: <E1vsHS1-00BZpp-2a@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 09:33:01 +0000

commit d41501fcf62457c3df779abda6718c64da8635ae
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Feb 13 04:17:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 17 08:59:34 2026 +0100

    VT-d: fix off-by-one when handling extra RMRR ranges
    
    add_one_user_rmrr() operates on inclusive [start,end] range, which means
    the end page needs to be calculated as (start + page_count - 1).
    This off-by-one error resulted in one extra pages being mapped in IOMMU
    context, but not marked as reserved in the memory map. This in turns
    confused PVH dom0 code, resulting in the following crash:
    
        (XEN) [    3.934848] d0: GFN 0x5475c (0x5475c,5,3) -> (0x46a0f4,0,7) not permitted (0x20)
        (XEN) [    3.969657] domain_crash called from arch/x86/mm/p2m.c:695
        (XEN) [    3.972568] Domain 0 reported crashed by domain 32767 on cpu#0:
        (XEN) [    3.975527] Hardware Dom0 crashed: rebooting machine in 5 seconds.
        (XEN) [    8.986353] Resetting with ACPI MEMORY or I/O RESET_REG.
    
    I checked other parts of this API and it was the only error like this.
    Other places:
     - iommu_get_extra_reserved_device_memory() -> reserve_e820_ram() - this
       function expects exclusive range, so the code is correct
     - add_one_extra_ivmd() - this operates on start address and memory
       length
    
    Fixes: 2d9b3699136d ("IOMMU/VT-d: wire common device reserved memory API")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/dmar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 91c22b8330..2a756831a6 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -1065,7 +1065,8 @@ static int __init add_user_rmrr(void)
 static int __init cf_check add_one_extra_rmrr(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctxt)
 {
     u32 sbdf_array[] = { id };
-    return add_one_user_rmrr(start, start+nr, 1, sbdf_array);
+
+    return add_one_user_rmrr(start, start + nr - 1, 1, sbdf_array);
 }
 
 static int __init add_extra_rmrr(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 11:22:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 11:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1234863.1537971 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsJ9W-00082q-Au; Tue, 17 Feb 2026 11:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1234863.1537971; Tue, 17 Feb 2026 11: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 1vsJ9W-00082i-8I; Tue, 17 Feb 2026 11:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1234863;
 Tue, 17 Feb 2026 11: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 1vsJ9V-00082c-De
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 2026 11: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 1vsJ9V-00DZm1-17
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 11:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsJ9V-00BgPx-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 11: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=tt75Ag4SImfpWjjOUPBP9BMEUBsZ65y9YHqEPlNg1t8=; b=mE2d30gSZHtc8C1uN/mR6HbiAM
	a2t2LhruBkB769Hmi6Mf0PKoXDj+OFPgl26NACwpIv+1YMMD7xeD1kLkWWEIXLlW6hhr2/stbvoZJ
	OIqSmS3Lf/l8En/rV/zimE8YpDyszJWJM6yk07UA22Wa+jtf9ZKI7MTLZ3h7rCEKYBEI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] VT-d: fix off-by-one when handling extra RMRR ranges
Message-Id: <E1vsJ9V-00BgPx-0o@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 11:22:01 +0000

commit d41501fcf62457c3df779abda6718c64da8635ae
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Fri Feb 13 04:17:48 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 17 08:59:34 2026 +0100

    VT-d: fix off-by-one when handling extra RMRR ranges
    
    add_one_user_rmrr() operates on inclusive [start,end] range, which means
    the end page needs to be calculated as (start + page_count - 1).
    This off-by-one error resulted in one extra pages being mapped in IOMMU
    context, but not marked as reserved in the memory map. This in turns
    confused PVH dom0 code, resulting in the following crash:
    
        (XEN) [    3.934848] d0: GFN 0x5475c (0x5475c,5,3) -> (0x46a0f4,0,7) not permitted (0x20)
        (XEN) [    3.969657] domain_crash called from arch/x86/mm/p2m.c:695
        (XEN) [    3.972568] Domain 0 reported crashed by domain 32767 on cpu#0:
        (XEN) [    3.975527] Hardware Dom0 crashed: rebooting machine in 5 seconds.
        (XEN) [    8.986353] Resetting with ACPI MEMORY or I/O RESET_REG.
    
    I checked other parts of this API and it was the only error like this.
    Other places:
     - iommu_get_extra_reserved_device_memory() -> reserve_e820_ram() - this
       function expects exclusive range, so the code is correct
     - add_one_extra_ivmd() - this operates on start address and memory
       length
    
    Fixes: 2d9b3699136d ("IOMMU/VT-d: wire common device reserved memory API")
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/passthrough/vtd/dmar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 91c22b8330..2a756831a6 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -1065,7 +1065,8 @@ static int __init add_user_rmrr(void)
 static int __init cf_check add_one_extra_rmrr(xen_pfn_t start, xen_ulong_t nr, u32 id, void *ctxt)
 {
     u32 sbdf_array[] = { id };
-    return add_one_user_rmrr(start, start+nr, 1, sbdf_array);
+
+    return add_one_user_rmrr(start, start + nr - 1, 1, sbdf_array);
 }
 
 static int __init add_extra_rmrr(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 13:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 13:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235007.1538065 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsKr0-00012y-QU; Tue, 17 Feb 2026 13:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235007.1538065; Tue, 17 Feb 2026 13: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 1vsKr0-00012q-Nz; Tue, 17 Feb 2026 13:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1235007;
 Tue, 17 Feb 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 1vsKr0-00012k-84
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 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 1vsKr0-00DbrN-0c
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsKr0-00BnJI-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 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=vgtgzcU+ADLLxZeNH+4KTW6VsZLVVqOVqGURzviv/hU=; b=fJCtsyk3Bhnc9d/BRRwKGjrYWs
	L2EN737Cn+dajh7lQOKKu3Pza5YTBIeXDwA7/fN/Zp2gm0mo+aN0GjV0UgMXk0N5pOTYRsrT8vhFr
	hM3MqtkEmybt476sPvAkkf7JMYKElMbkRJS1Pdpy7EHqi1CxYBz1akLnY1l6ffleacns=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] symbols: don't over-align data
Message-Id: <E1vsKr0-00BnJI-0G@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 13:11:02 +0000

commit 9f4d363241985a908d1b582af6beefe08af45bb1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 17 11:45:22 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 17 11:45:22 2026 +0100

    symbols: don't over-align data
    
    Arrays of .byte or .short don't really need aligning better than 1 or 2
    bytes respectively. Arrays of .long also don't need aligning to 8 bytes
    (which would have happened when BITS_PER_LONG is 64 and SYMBOLS_ORIGIN is
    not defined).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 7afe301d3c..3c6f13de38 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -260,7 +260,7 @@ static void read_map(FILE *in)
 	}
 }
 
-static void output_label(const char *label, bool keep)
+static void output_label(const char *label, const char *align, bool keep)
 {
 	static bool pending;
 
@@ -274,10 +274,10 @@ static void output_label(const char *label, bool keep)
 		return;
 
 	if (symbol_prefix_char) {
-		printf("DATA(%c%s, ALGN)\n", symbol_prefix_char, label);
+		printf("DATA(%c%s, %s)\n", symbol_prefix_char, label, align);
 		printf("#define CURRENT %c%s\n", symbol_prefix_char, label);
 	} else {
-		printf("DATA(%s, ALGN)\n", label);
+		printf("DATA(%s, %s)\n", label, align);
 		printf("#define CURRENT %s\n", label);
 	}
 }
@@ -360,9 +360,9 @@ static void write_src(void)
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
 	printf("#define SYMBOLS_ORIGIN 0\n");
-	output_label("symbols_addresses", false);
+	output_label("symbols_addresses", "ALGN", false);
 	printf("#else\n");
-	output_label("symbols_offsets", true);
+	output_label("symbols_offsets", "ALGN", true);
 	printf("#endif\n");
 	for (i = 0, ends = 0; i < table_cnt; i++) {
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n", table[i].addr);
@@ -387,14 +387,14 @@ static void write_src(void)
 		       table[i].addr + table[i].size);
 	}
 
-	output_label("symbols_num_addrs", false);
+	output_label("symbols_num_addrs", "4", false);
 	printf("\t.long\t%d\n", table_cnt + ends);
 
 	/* table of offset markers, that give the offset in the compressed stream
 	 * every 256 symbols */
 	markers = malloc(sizeof(*markers) * ((table_cnt + ends + 255) >> 8));
 
-	output_label("symbols_names", false);
+	output_label("symbols_names", "1", false);
 	for (i = 0, off = 0, ends = 0; i < table_cnt; i++) {
 		if (((i + ends) & 0xFF) == 0)
 			markers[(i + ends) >> 8] = off;
@@ -419,11 +419,11 @@ static void write_src(void)
 		++off;
 	}
 
-	output_label("symbols_markers", false);
+	output_label("symbols_markers", "4", false);
 	for (i = 0; i < ((table_cnt + ends + 255) >> 8); i++)
 		printf("\t.long\t%d\n", markers[i]);
 
-	output_label("symbols_token_table", false);
+	output_label("symbols_token_table", "1", false);
 	off = 0;
 	for (i = 0; i < 256; i++) {
 		best_idx[i] = off;
@@ -432,12 +432,12 @@ static void write_src(void)
 		off += strlen(buf) + 1;
 	}
 
-	output_label("symbols_token_index", false);
+	output_label("symbols_token_index", "2", false);
 	for (i = 0; i < 256; i++)
 		printf("\t.short\t%d\n", best_idx[i]);
 
 	if (sort_by_name) {
-		output_label("symbols_num_names", false);
+		output_label("symbols_num_names", "4", false);
 		printf("\t.long\t%d\n", table_cnt);
 
 		/* Sorted by original symbol names and type. */
@@ -446,12 +446,12 @@ static void write_src(void)
 		/* A fixed sized array with two entries: offset in the
 		 * compressed stream (for symbol name), and offset in
 		 * symbols_addresses (or symbols_offset). */
-		output_label("symbols_sorted_offsets", false);
+		output_label("symbols_sorted_offsets", "4", false);
 		for (i = 0; i < table_cnt; i++)
 			printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
 	}
 
-	output_label(NULL, false);
+	output_label(NULL, NULL, false);
 	free(markers);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 13:11:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 13:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235008.1538070 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsKrA-00014k-S0; Tue, 17 Feb 2026 13:11:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235008.1538070; Tue, 17 Feb 2026 13: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 1vsKrA-00014c-PM; Tue, 17 Feb 2026 13:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1235008;
 Tue, 17 Feb 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 1vsKrA-00014W-BB
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 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 1vsKrA-00DbrU-11
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsKrA-00BnKC-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 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=KgtJxndakQenL9F1O38AVH1jXhTj3ObEYLFgdS9zmI0=; b=6DFzOJr+beaDzXh8NQxS0TNUIN
	ebHx0R9HY3H3glWqxtGdLPH4l8TFC+sl2Ned+ewu/3sk3+0PWTENfphduft6zCfw5YSwd09E+DC9Y
	PuyXe4jMtnKVl+QT4X4gx/XbBwrkkLjYaGpDzLwjhT4FRZu1Tcdr0r4Q9izWbO0Ja7Ek=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/xenstored: fix live update
Message-Id: <E1vsKrA-00BnKC-0o@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 13:11:12 +0000

commit ebf99a162718c4d858d0c997b9dcf1a502c7256e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Feb 17 11:46:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 17 11:46:29 2026 +0100

    tools/xenstored: fix live update
    
    Commit e5b0a940557 ("tools/xenstored: Auto-introduce domains") broke
    xenstored live update, as init_domains() will be skipped when live
    update is detected to have happened. This will leave priv_domid and
    store_domid set as invalid.
    
    Fix that by calling init_domains() in live update case, too. In case
    of live update skip introducing any found domains, as this will be done
    when reading the live update state.
    
    Fixes: e5b0a940557 ("tools/xenstored: Auto-introduce domains")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c   |  3 ++-
 tools/xenstored/domain.c | 20 +++++++++++++-------
 tools/xenstored/domain.h |  2 +-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 64c478a801..d509736c32 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2763,7 +2763,7 @@ int main(int argc, char *argv[])
 	/* Listen to hypervisor. */
 	if (!live_update) {
 		domain_init(-1);
-		init_domains();
+		init_domains(false);
 	}
 
 	/* redirect to /dev/null now we're ready to accept connections */
@@ -3109,6 +3109,7 @@ void read_state_global(const void *ctx, const void *state)
 	set_socket_fd(glb->socket_fd);
 
 	domain_init(glb->evtchn_fd);
+	init_domains(true);
 }
 
 static void add_buffered_data(struct buffered_data *bdata,
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 10ac1c1a8f..e453b3061f 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1344,7 +1344,7 @@ static bool init_domain(unsigned int domid)
 
 	return true;
 }
-void init_domains(void)
+void init_domains(bool live_update)
 {
 	unsigned int *domids = NULL;
 	unsigned int nr_domids = 0;
@@ -1356,12 +1356,15 @@ void init_domains(void)
 
 	while (!xenmanage_poll_changed_domain(xm_handle, &domid, &state, &caps,
 					      &unique_id)) {
-		nr_domids++;
-		domids = talloc_realloc(NULL, domids, unsigned int, nr_domids);
-		if (!domids)
-			barf_perror("Failed to reallocate domids");
-
-		domids[nr_domids - 1] = domid;
+		if (!live_update) {
+			nr_domids++;
+			domids = talloc_realloc(NULL, domids,
+						unsigned int, nr_domids);
+			if (!domids)
+				barf_perror("Failed to reallocate domids");
+
+			domids[nr_domids - 1] = domid;
+		}
 
 		if (caps & XENMANAGE_GETDOMSTATE_CAP_CONTROL) {
 			/*
@@ -1397,6 +1400,9 @@ void init_domains(void)
 	snprintf(store_domain_path, sizeof(store_domain_path),
 		 "/local/domain/%u", store_domid);
 
+	if (live_update)
+		return;
+
 	/*
 	 * Privileged domid must be first to setup structures for firing the
 	 * special watches.
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index 3b1fce74cf..28186ccac0 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -92,7 +92,7 @@ int do_set_feature(const void *ctx, struct connection *conn,
 
 void domain_early_init(void);
 void domain_init(int evtfd);
-void init_domains(void);
+void init_domains(bool live_update);
 void stubdom_init(bool live_update);
 void domain_deinit(void);
 void ignore_connection(struct connection *conn, unsigned int err);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 14:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 14:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235072.1538106 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsLxj-0002sd-Dj; Tue, 17 Feb 2026 14:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235072.1538106; Tue, 17 Feb 2026 14: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 1vsLxj-0002sR-9b; Tue, 17 Feb 2026 14:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1235072;
 Tue, 17 Feb 2026 14: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 1vsLxi-0002sL-8t
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 2026 14: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 1vsLxi-00DdGW-0d
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 14:22:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsLxi-00BrS1-0K
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 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=Dv9TuKQaQ0n3C1Ro93iZApamVvD7XCR9w0QLdfytdnA=; b=cOOr0xgp7G5pXiDNvFrneAYAlB
	zx7vhlrIx3t7gasoe9DOrwtY+xZOj3jEKXTsiPUgwnJhQEBZhpmt2Wtu9sEtOHWeDxfJ7wZU+vchz
	gJV9q4tEZUV0OEQDbjPsXJdJ3HFsFWoI157izwl7j8cja8TkuZa/sq9ZGhNUpfBPv6Xs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] symbols: don't over-align data
Message-Id: <E1vsLxi-00BrS1-0K@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 14:22:02 +0000

commit 9f4d363241985a908d1b582af6beefe08af45bb1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 17 11:45:22 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 17 11:45:22 2026 +0100

    symbols: don't over-align data
    
    Arrays of .byte or .short don't really need aligning better than 1 or 2
    bytes respectively. Arrays of .long also don't need aligning to 8 bytes
    (which would have happened when BITS_PER_LONG is 64 and SYMBOLS_ORIGIN is
    not defined).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/tools/symbols.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 7afe301d3c..3c6f13de38 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -260,7 +260,7 @@ static void read_map(FILE *in)
 	}
 }
 
-static void output_label(const char *label, bool keep)
+static void output_label(const char *label, const char *align, bool keep)
 {
 	static bool pending;
 
@@ -274,10 +274,10 @@ static void output_label(const char *label, bool keep)
 		return;
 
 	if (symbol_prefix_char) {
-		printf("DATA(%c%s, ALGN)\n", symbol_prefix_char, label);
+		printf("DATA(%c%s, %s)\n", symbol_prefix_char, label, align);
 		printf("#define CURRENT %c%s\n", symbol_prefix_char, label);
 	} else {
-		printf("DATA(%s, ALGN)\n", label);
+		printf("DATA(%s, %s)\n", label, align);
 		printf("#define CURRENT %s\n", label);
 	}
 }
@@ -360,9 +360,9 @@ static void write_src(void)
 
 	printf("#ifndef SYMBOLS_ORIGIN\n");
 	printf("#define SYMBOLS_ORIGIN 0\n");
-	output_label("symbols_addresses", false);
+	output_label("symbols_addresses", "ALGN", false);
 	printf("#else\n");
-	output_label("symbols_offsets", true);
+	output_label("symbols_offsets", "ALGN", true);
 	printf("#endif\n");
 	for (i = 0, ends = 0; i < table_cnt; i++) {
 		printf("\tPTR\t%#llx - SYMBOLS_ORIGIN\n", table[i].addr);
@@ -387,14 +387,14 @@ static void write_src(void)
 		       table[i].addr + table[i].size);
 	}
 
-	output_label("symbols_num_addrs", false);
+	output_label("symbols_num_addrs", "4", false);
 	printf("\t.long\t%d\n", table_cnt + ends);
 
 	/* table of offset markers, that give the offset in the compressed stream
 	 * every 256 symbols */
 	markers = malloc(sizeof(*markers) * ((table_cnt + ends + 255) >> 8));
 
-	output_label("symbols_names", false);
+	output_label("symbols_names", "1", false);
 	for (i = 0, off = 0, ends = 0; i < table_cnt; i++) {
 		if (((i + ends) & 0xFF) == 0)
 			markers[(i + ends) >> 8] = off;
@@ -419,11 +419,11 @@ static void write_src(void)
 		++off;
 	}
 
-	output_label("symbols_markers", false);
+	output_label("symbols_markers", "4", false);
 	for (i = 0; i < ((table_cnt + ends + 255) >> 8); i++)
 		printf("\t.long\t%d\n", markers[i]);
 
-	output_label("symbols_token_table", false);
+	output_label("symbols_token_table", "1", false);
 	off = 0;
 	for (i = 0; i < 256; i++) {
 		best_idx[i] = off;
@@ -432,12 +432,12 @@ static void write_src(void)
 		off += strlen(buf) + 1;
 	}
 
-	output_label("symbols_token_index", false);
+	output_label("symbols_token_index", "2", false);
 	for (i = 0; i < 256; i++)
 		printf("\t.short\t%d\n", best_idx[i]);
 
 	if (sort_by_name) {
-		output_label("symbols_num_names", false);
+		output_label("symbols_num_names", "4", false);
 		printf("\t.long\t%d\n", table_cnt);
 
 		/* Sorted by original symbol names and type. */
@@ -446,12 +446,12 @@ static void write_src(void)
 		/* A fixed sized array with two entries: offset in the
 		 * compressed stream (for symbol name), and offset in
 		 * symbols_addresses (or symbols_offset). */
-		output_label("symbols_sorted_offsets", false);
+		output_label("symbols_sorted_offsets", "4", false);
 		for (i = 0; i < table_cnt; i++)
 			printf("\t.long %u, %u\n", table[i].stream_offset, table[i].addr_idx);
 	}
 
-	output_label(NULL, false);
+	output_label(NULL, NULL, false);
 	free(markers);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 17 14:22:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 17 Feb 2026 14:22:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235073.1538108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsLxu-0002uQ-Dk; Tue, 17 Feb 2026 14:22:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235073.1538108; Tue, 17 Feb 2026 14: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 1vsLxu-0002uI-B4; Tue, 17 Feb 2026 14:22:14 +0000
Received: by outflank-mailman (input) for mailman id 1235073;
 Tue, 17 Feb 2026 14: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 1vsLxs-0002u4-CX
 for xen-changelog@lists.xenproject.org; Tue, 17 Feb 2026 14: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 1vsLxs-00DdGb-19
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 14:22:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsLxs-00BrSq-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 17 Feb 2026 14: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=Lq/uyU1doMr5+BsckrmPYZAqouL2KrKI7TNQwzoP2rU=; b=T40UWn9q+foxcv2N6Xd+MbGHkY
	1AMFwSlh3cEYUFbXWDEBQZRt7z9gUR4s22BcTdUh3Cp1jdvDNb0A+G66smTpoWT5OIgYk46bDvGmy
	q93jscgptjV6WqZsu1J8DXWuDMmSl+5RgDQm1TwB5DVRgUsNVMgrzOtqg50Eet36ZXQk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/xenstored: fix live update
Message-Id: <E1vsLxs-00BrSq-0p@xenbits.xenproject.org>
Date: Tue, 17 Feb 2026 14:22:12 +0000

commit ebf99a162718c4d858d0c997b9dcf1a502c7256e
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Feb 17 11:46:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 17 11:46:29 2026 +0100

    tools/xenstored: fix live update
    
    Commit e5b0a940557 ("tools/xenstored: Auto-introduce domains") broke
    xenstored live update, as init_domains() will be skipped when live
    update is detected to have happened. This will leave priv_domid and
    store_domid set as invalid.
    
    Fix that by calling init_domains() in live update case, too. In case
    of live update skip introducing any found domains, as this will be done
    when reading the live update state.
    
    Fixes: e5b0a940557 ("tools/xenstored: Auto-introduce domains")
    Signed-off-by: Juergen Gross <jgross@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 tools/xenstored/core.c   |  3 ++-
 tools/xenstored/domain.c | 20 +++++++++++++-------
 tools/xenstored/domain.h |  2 +-
 3 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/tools/xenstored/core.c b/tools/xenstored/core.c
index 64c478a801..d509736c32 100644
--- a/tools/xenstored/core.c
+++ b/tools/xenstored/core.c
@@ -2763,7 +2763,7 @@ int main(int argc, char *argv[])
 	/* Listen to hypervisor. */
 	if (!live_update) {
 		domain_init(-1);
-		init_domains();
+		init_domains(false);
 	}
 
 	/* redirect to /dev/null now we're ready to accept connections */
@@ -3109,6 +3109,7 @@ void read_state_global(const void *ctx, const void *state)
 	set_socket_fd(glb->socket_fd);
 
 	domain_init(glb->evtchn_fd);
+	init_domains(true);
 }
 
 static void add_buffered_data(struct buffered_data *bdata,
diff --git a/tools/xenstored/domain.c b/tools/xenstored/domain.c
index 10ac1c1a8f..e453b3061f 100644
--- a/tools/xenstored/domain.c
+++ b/tools/xenstored/domain.c
@@ -1344,7 +1344,7 @@ static bool init_domain(unsigned int domid)
 
 	return true;
 }
-void init_domains(void)
+void init_domains(bool live_update)
 {
 	unsigned int *domids = NULL;
 	unsigned int nr_domids = 0;
@@ -1356,12 +1356,15 @@ void init_domains(void)
 
 	while (!xenmanage_poll_changed_domain(xm_handle, &domid, &state, &caps,
 					      &unique_id)) {
-		nr_domids++;
-		domids = talloc_realloc(NULL, domids, unsigned int, nr_domids);
-		if (!domids)
-			barf_perror("Failed to reallocate domids");
-
-		domids[nr_domids - 1] = domid;
+		if (!live_update) {
+			nr_domids++;
+			domids = talloc_realloc(NULL, domids,
+						unsigned int, nr_domids);
+			if (!domids)
+				barf_perror("Failed to reallocate domids");
+
+			domids[nr_domids - 1] = domid;
+		}
 
 		if (caps & XENMANAGE_GETDOMSTATE_CAP_CONTROL) {
 			/*
@@ -1397,6 +1400,9 @@ void init_domains(void)
 	snprintf(store_domain_path, sizeof(store_domain_path),
 		 "/local/domain/%u", store_domid);
 
+	if (live_update)
+		return;
+
 	/*
 	 * Privileged domid must be first to setup structures for firing the
 	 * special watches.
diff --git a/tools/xenstored/domain.h b/tools/xenstored/domain.h
index 3b1fce74cf..28186ccac0 100644
--- a/tools/xenstored/domain.h
+++ b/tools/xenstored/domain.h
@@ -92,7 +92,7 @@ int do_set_feature(const void *ctx, struct connection *conn,
 
 void domain_early_init(void);
 void domain_init(int evtfd);
-void init_domains(void);
+void init_domains(bool live_update);
 void stubdom_init(bool live_update);
 void domain_deinit(void);
 void ignore_connection(struct connection *conn, unsigned int err);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 10:33:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 10:33:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235420.1538396 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vserf-0004JG-R4; Wed, 18 Feb 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 1235420.1538396; Wed, 18 Feb 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 1vserf-0004J8-NS; Wed, 18 Feb 2026 10:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1235420;
 Wed, 18 Feb 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 1vsere-0004Im-Ce
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsere-00FEJo-0t
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 10:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsere-00D6fD-0j
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=ROVTjj9O/ITYoi99fhpohrbwigByrows927UDh+pMOI=; b=NC3EoRSqCRyLorsS6zra+ryWYa
	/qwOYkhCLJYXjoEfPzK39RMCXuZ1kANUW4okBjE48bJhcGlaNZy2r32PEpj40LoTjcGgaRBIJv4Bt
	mTgHNubvhRGMVYziHxkRGCb/4k3fw9SBn2YKeQw13u0mluyr49SytKAPcr9jGmx/pn9I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: implement arch_vcpu_{create,destroy}()
Message-Id: <E1vsere-00D6fD-0j@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 10:33:02 +0000

commit ad535118f0f1e5cb4b1dfb2580efcfe728717194
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 18 10:16:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:16:34 2026 +0100

    xen/riscv: implement arch_vcpu_{create,destroy}()
    
    Introduce architecture-specific functions to create and destroy VCPUs.
    Note that arch_vcpu_create() currently returns -EOPNOTSUPP, as the virtual
    timer and interrupt controller are not yet implemented.
    
    Add callee-saved registers to struct arch_vcpu which are  used to preserve
    Xen’s own execution context when switching between vCPU stacks.
    It is going to be used in the following way (pseudocode):
      context_switch(prev_vcpu, next_vcpu):
        ...
    
        /* Switch from previous stack to the next stack. */
        __context_switch(prev_vcpu, next_vcpu);
    
        ...
        schedule_tail(prev_vcpu):
            Save and restore vCPU's CSRs.
    The Xen-saved context allows __context_switch() to switch execution
    from the previous vCPU’s stack to the next vCPU’s stack and later resume
    execution on the original stack when switching back.
    
    During vCPU creation, the Xen-saved context is going to be initialized
    with:
      - SP pointing to the newly allocated vCPU stack.
      - RA pointing to a helper that performs final vCPU setup before
        transferring control to the guest.
    
    As part of this change, add continue_new_vcpu(), which will be used after
    the first context_switch() of a new vCPU. Since this functionality is not
    yet implemented, continue_new_vcpu() is currently provided as a stub.
    The prev argument is going to be set by RISC-V ABI (prev will be stored in
    a0) when __context_swtich() will be introduced and called from
    context_switch().
    
    Update the STACK_SIZE definition.
    
    Introduce struct cpu_info to store per-vCPU state that lives at the top
    of the vCPU's stack.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile              |  1 +
 xen/arch/riscv/domain.c              | 58 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/config.h  |  2 +-
 xen/arch/riscv/include/asm/current.h |  6 ++++
 xen/arch/riscv/include/asm/domain.h  | 24 +++++++++++++++
 xen/arch/riscv/stubs.c               | 10 -------
 6 files changed, 90 insertions(+), 11 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 1eb9ab090b..caa1aac5b2 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,5 +1,6 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
+obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += imsic.o
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
new file mode 100644
index 0000000000..b60320b90d
--- /dev/null
+++ b/xen/arch/riscv/domain.c
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
+#include <xen/vmap.h>
+
+static void continue_new_vcpu(struct vcpu *prev)
+{
+    BUG_ON("unimplemented\n");
+}
+
+int arch_vcpu_create(struct vcpu *v)
+{
+    int rc;
+    void *stack = vzalloc(STACK_SIZE);
+
+    if ( !stack )
+        return -ENOMEM;
+
+    v->arch.cpu_info = stack + STACK_SIZE - sizeof(*v->arch.cpu_info);
+
+    v->arch.xen_saved_context.sp = (register_t)v->arch.cpu_info;
+    v->arch.xen_saved_context.ra = (register_t)continue_new_vcpu;
+
+    /* Idle VCPUs don't need the rest of this setup */
+    if ( is_idle_vcpu(v) )
+        return 0;
+
+    /*
+     * As the vtimer and interrupt controller (IC) are not yet implemented,
+     * return an error.
+     *
+     * TODO: Drop this once the vtimer and IC are implemented.
+     */
+    rc = -EOPNOTSUPP;
+    goto fail;
+
+    return rc;
+
+ fail:
+    arch_vcpu_destroy(v);
+    return rc;
+}
+
+void arch_vcpu_destroy(struct vcpu *v)
+{
+    vfree((void *)&v->arch.cpu_info[1] - STACK_SIZE);
+}
+
+static void __init __maybe_unused build_assertions(void)
+{
+    /*
+     * Enforce the requirement documented in struct cpu_info that
+     * guest_cpu_user_regs must be the first field.
+     */
+    BUILD_BUG_ON(offsetof(struct cpu_info, guest_cpu_user_regs));
+}
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 1e08d3bf78..0613de008b 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -143,7 +143,7 @@
 
 #define SMP_CACHE_BYTES (1 << 6)
 
-#define STACK_SIZE PAGE_SIZE
+#define STACK_SIZE (PAGE_SIZE << 3)
 
 #define IDENT_AREA_SIZE 64
 
diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/asm/current.h
index 0c3ea70c2e..58c9f1506b 100644
--- a/xen/arch/riscv/include/asm/current.h
+++ b/xen/arch/riscv/include/asm/current.h
@@ -21,6 +21,12 @@ struct pcpu_info {
 /* tp points to one of these */
 extern struct pcpu_info pcpu_info[NR_CPUS];
 
+/* Per-VCPU state that lives at the top of the stack */
+struct cpu_info {
+    /* This should be the first member. */
+    struct cpu_user_regs guest_cpu_user_regs;
+};
+
 #define set_processor_id(id)    do { \
     tp->processor_id = (id);         \
 } while (0)
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 316e7c6c84..f78f145258 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -24,6 +24,30 @@ struct arch_vcpu_io {
 
 struct arch_vcpu {
     struct vcpu_vmid vmid;
+
+    /*
+     * Callee saved registers for Xen's state used to switch from
+     * prev's stack to the next's stack during context switch.
+     */
+    struct
+    {
+        register_t s0;
+        register_t s1;
+        register_t s2;
+        register_t s3;
+        register_t s4;
+        register_t s5;
+        register_t s6;
+        register_t s7;
+        register_t s8;
+        register_t s9;
+        register_t s10;
+        register_t s11;
+        register_t sp;
+        register_t ra;
+    } xen_saved_context;
+
+    struct cpu_info *cpu_info;
 };
 
 struct paging_domain {
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index d071c8b86d..daadff0138 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -116,16 +116,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-int arch_vcpu_create(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
-void arch_vcpu_destroy(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 10:33:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 10:33:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235421.1538398 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vserp-0004LO-TA; Wed, 18 Feb 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 1235421.1538398; Wed, 18 Feb 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 1vserp-0004LG-QX; Wed, 18 Feb 2026 10:33:13 +0000
Received: by outflank-mailman (input) for mailman id 1235421;
 Wed, 18 Feb 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 1vsero-0004L0-Cu
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsero-00FEJt-1B
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 10:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsero-00D6ic-14
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=Fxdpni+h1S0nlcQg2JOmETIoKqxTToighyuZZ5g2ntQ=; b=vx1TznTClpu43xuU19Xqlqx+GX
	jnGKTtYVMRdrVoN82uQgDkKlUyLGeK/Ctc00XqRUo2Bb8epXXjVV0TCk+bLkxdHSvF9/qnhDeMcAU
	Z0FnKfizXbmyoi4i6ERFd85YZ1j46BOqjcuGriG7F6D1l3+THsO7sGz4XBJe7etGSg+c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: build setup code as .init
Message-Id: <E1vsero-00D6ic-14@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 10:33:12 +0000

commit 8ca1a1d5e6386926e8ff7a86ca1b422f9005caf7
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 18 10:17:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:17:06 2026 +0100

    xen/riscv: build setup code as .init
    
    At the moment, all code and data in setup.c are marked with __init or
    __initdata, which is intended to remain this way. Leverage this by using
    setup.init.o instead of setup.o in Makefile.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index caa1aac5b2..bc47e83b26 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -12,7 +12,7 @@ obj-y += paging.o
 obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
-obj-y += setup.o
+obj-y += setup.init.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 10:33:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 10:33:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235422.1538402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vserz-0004Nl-Uf; Wed, 18 Feb 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 1235422.1538402; Wed, 18 Feb 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 1vserz-0004Nd-SA; Wed, 18 Feb 2026 10:33:23 +0000
Received: by outflank-mailman (input) for mailman id 1235422;
 Wed, 18 Feb 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 1vsery-0004NT-G8
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsery-00FEMd-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 10:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsery-00D6jM-1M
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=Akwzbrb7M+z79EmbbYIf+ttoKJaOX0XkgUhqJ7yHPXA=; b=kzOh/cb6crNoLZqTkhci4SEkNr
	2WCKudhSckg7lEc1D0mymMuyrVguD6i9qD4MHKOijEhYZP+DQtk6365/QMyQv5RN/YDibzPEeO89e
	J0UoUbE6MPAKkDg1GpMLW2OLDDO1r34N98g2bhskGWcfbv1EMTfJ6KZ1l6IV0sQGZxBM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] Arm: tighten translate_get_page()
Message-Id: <E1vsery-00D6jM-1M@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 10:33:22 +0000

commit af6fc34e201c519a910aa4d34570ac3d7b13ec9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 18 10:17:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:17:39 2026 +0100

    Arm: tighten translate_get_page()
    
    Permitting writes when the P2M type says "read-only" can't be correct.
    
    Fixes: 1661158723a ("xen/arm: Extend copy_to_guest to support copying from/to guest physical address")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/guestcopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 497e785ec4..fdb06422b8 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -44,7 +44,7 @@ static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
     if ( !page )
         return NULL;
 
-    if ( !p2m_is_ram(p2mt) )
+    if ( write ? p2mt != p2m_ram_rw : !p2m_is_ram(p2mt) )
     {
         put_page(page);
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 10:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 10:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235423.1538407 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsesA-0004Pq-03; Wed, 18 Feb 2026 10:33:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235423.1538407; Wed, 18 Feb 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 1vses9-0004Pi-TW; Wed, 18 Feb 2026 10:33:33 +0000
Received: by outflank-mailman (input) for mailman id 1235423;
 Wed, 18 Feb 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 1vses8-0004Pa-Iw
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vses8-00FEMh-1n
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 10:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vses8-00D6kT-1g
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=4169fc3Cq436H2yO/HT9ce53zQ5PgLDKVdSrBIVdipo=; b=tB376TkAoTL7oz9BDRih7AUqRb
	bmxCIJOr+/vrC9q/mhCVmK9stTK8u58UyaLkzcWPTGQVFiqLndm/1tt9ypUE7jAYT3nycuTQn0H3q
	Q3VxtpdR5qGyZ60bj3v0HUMhCSIA414Y2EE4yLoXU3l1OAJC3Y0jVAK3mS1CFF50eTEA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] domain: skip more stuff for idle's vCPU-s in vcpu_create()
Message-Id: <E1vses8-00D6kT-1g@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 10:33:32 +0000

commit bada5850036bd284685fe2b60a156fa3cd579b94
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 18 10:18:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:18:53 2026 +0100

    domain: skip more stuff for idle's vCPU-s in vcpu_create()
    
    Nothing hypercall-related needs setting up there. Nor do we need to
    check whether the idle domain is shutting down - it never will.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/domain.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index de6fdf5923..2e46207d2d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,12 +475,6 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     v->vcpu_id = vcpu_id;
     v->dirty_cpu = VCPU_CPU_CLEAN;
 
-    rwlock_init(&v->virq_lock);
-
-    tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
-
-    grant_table_init_vcpu(v);
-
     if ( is_idle_domain(d) )
     {
         v->runstate.state = RUNSTATE_running;
@@ -488,6 +482,12 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     }
     else
     {
+        rwlock_init(&v->virq_lock);
+
+        tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
+
+        grant_table_init_vcpu(v);
+
         v->runstate.state = RUNSTATE_offline;
         v->runstate.state_entry_time = NOW();
         set_bit(_VPF_down, &v->pause_flags);
@@ -516,7 +516,8 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     }
 
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
-    vcpu_check_shutdown(v);
+    if ( !is_idle_domain(d) )
+        vcpu_check_shutdown(v);
 
     return v;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 11:44:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 11:44:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235504.1538470 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsfyN-00077v-2R; Wed, 18 Feb 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 1235504.1538470; Wed, 18 Feb 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 1vsfyM-00077n-W5; Wed, 18 Feb 2026 11:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1235504;
 Wed, 18 Feb 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 1vsfyL-00077h-SU
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsfyL-00FFen-2b
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsfyL-00DAll-2Q
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=K9ySJ6ZUtG+Ap+gmexjjq2P7DpYt+hon69TteLQ4SQI=; b=VEVmphuQYrnVyiuBZGPFFM8Vtg
	JvZ/iD61uABPfenhXDx9hhWoM7tK2MKKbQ6uwRZZq19s+7WF9tHywWAFE3WhQDgdUToCcV4gKN4cC
	CFOCqLemO9kHSq0YY7PNIglSEkRbP1lHF/3KEwV1r/SSFPPboCAFJTFsoEjfFoZeJNKk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: implement arch_vcpu_{create,destroy}()
Message-Id: <E1vsfyL-00DAll-2Q@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 11:44:01 +0000

commit ad535118f0f1e5cb4b1dfb2580efcfe728717194
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 18 10:16:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:16:34 2026 +0100

    xen/riscv: implement arch_vcpu_{create,destroy}()
    
    Introduce architecture-specific functions to create and destroy VCPUs.
    Note that arch_vcpu_create() currently returns -EOPNOTSUPP, as the virtual
    timer and interrupt controller are not yet implemented.
    
    Add callee-saved registers to struct arch_vcpu which are  used to preserve
    Xen’s own execution context when switching between vCPU stacks.
    It is going to be used in the following way (pseudocode):
      context_switch(prev_vcpu, next_vcpu):
        ...
    
        /* Switch from previous stack to the next stack. */
        __context_switch(prev_vcpu, next_vcpu);
    
        ...
        schedule_tail(prev_vcpu):
            Save and restore vCPU's CSRs.
    The Xen-saved context allows __context_switch() to switch execution
    from the previous vCPU’s stack to the next vCPU’s stack and later resume
    execution on the original stack when switching back.
    
    During vCPU creation, the Xen-saved context is going to be initialized
    with:
      - SP pointing to the newly allocated vCPU stack.
      - RA pointing to a helper that performs final vCPU setup before
        transferring control to the guest.
    
    As part of this change, add continue_new_vcpu(), which will be used after
    the first context_switch() of a new vCPU. Since this functionality is not
    yet implemented, continue_new_vcpu() is currently provided as a stub.
    The prev argument is going to be set by RISC-V ABI (prev will be stored in
    a0) when __context_swtich() will be introduced and called from
    context_switch().
    
    Update the STACK_SIZE definition.
    
    Introduce struct cpu_info to store per-vCPU state that lives at the top
    of the vCPU's stack.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile              |  1 +
 xen/arch/riscv/domain.c              | 58 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/config.h  |  2 +-
 xen/arch/riscv/include/asm/current.h |  6 ++++
 xen/arch/riscv/include/asm/domain.h  | 24 +++++++++++++++
 xen/arch/riscv/stubs.c               | 10 -------
 6 files changed, 90 insertions(+), 11 deletions(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 1eb9ab090b..caa1aac5b2 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,5 +1,6 @@
 obj-y += aplic.o
 obj-y += cpufeature.o
+obj-y += domain.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += imsic.o
diff --git a/xen/arch/riscv/domain.c b/xen/arch/riscv/domain.c
new file mode 100644
index 0000000000..b60320b90d
--- /dev/null
+++ b/xen/arch/riscv/domain.c
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
+#include <xen/vmap.h>
+
+static void continue_new_vcpu(struct vcpu *prev)
+{
+    BUG_ON("unimplemented\n");
+}
+
+int arch_vcpu_create(struct vcpu *v)
+{
+    int rc;
+    void *stack = vzalloc(STACK_SIZE);
+
+    if ( !stack )
+        return -ENOMEM;
+
+    v->arch.cpu_info = stack + STACK_SIZE - sizeof(*v->arch.cpu_info);
+
+    v->arch.xen_saved_context.sp = (register_t)v->arch.cpu_info;
+    v->arch.xen_saved_context.ra = (register_t)continue_new_vcpu;
+
+    /* Idle VCPUs don't need the rest of this setup */
+    if ( is_idle_vcpu(v) )
+        return 0;
+
+    /*
+     * As the vtimer and interrupt controller (IC) are not yet implemented,
+     * return an error.
+     *
+     * TODO: Drop this once the vtimer and IC are implemented.
+     */
+    rc = -EOPNOTSUPP;
+    goto fail;
+
+    return rc;
+
+ fail:
+    arch_vcpu_destroy(v);
+    return rc;
+}
+
+void arch_vcpu_destroy(struct vcpu *v)
+{
+    vfree((void *)&v->arch.cpu_info[1] - STACK_SIZE);
+}
+
+static void __init __maybe_unused build_assertions(void)
+{
+    /*
+     * Enforce the requirement documented in struct cpu_info that
+     * guest_cpu_user_regs must be the first field.
+     */
+    BUILD_BUG_ON(offsetof(struct cpu_info, guest_cpu_user_regs));
+}
diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 1e08d3bf78..0613de008b 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -143,7 +143,7 @@
 
 #define SMP_CACHE_BYTES (1 << 6)
 
-#define STACK_SIZE PAGE_SIZE
+#define STACK_SIZE (PAGE_SIZE << 3)
 
 #define IDENT_AREA_SIZE 64
 
diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/asm/current.h
index 0c3ea70c2e..58c9f1506b 100644
--- a/xen/arch/riscv/include/asm/current.h
+++ b/xen/arch/riscv/include/asm/current.h
@@ -21,6 +21,12 @@ struct pcpu_info {
 /* tp points to one of these */
 extern struct pcpu_info pcpu_info[NR_CPUS];
 
+/* Per-VCPU state that lives at the top of the stack */
+struct cpu_info {
+    /* This should be the first member. */
+    struct cpu_user_regs guest_cpu_user_regs;
+};
+
 #define set_processor_id(id)    do { \
     tp->processor_id = (id);         \
 } while (0)
diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index 316e7c6c84..f78f145258 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -24,6 +24,30 @@ struct arch_vcpu_io {
 
 struct arch_vcpu {
     struct vcpu_vmid vmid;
+
+    /*
+     * Callee saved registers for Xen's state used to switch from
+     * prev's stack to the next's stack during context switch.
+     */
+    struct
+    {
+        register_t s0;
+        register_t s1;
+        register_t s2;
+        register_t s3;
+        register_t s4;
+        register_t s5;
+        register_t s6;
+        register_t s7;
+        register_t s8;
+        register_t s9;
+        register_t s10;
+        register_t s11;
+        register_t sp;
+        register_t ra;
+    } xen_saved_context;
+
+    struct cpu_info *cpu_info;
 };
 
 struct paging_domain {
diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c
index d071c8b86d..daadff0138 100644
--- a/xen/arch/riscv/stubs.c
+++ b/xen/arch/riscv/stubs.c
@@ -116,16 +116,6 @@ void dump_pageframe_info(struct domain *d)
     BUG_ON("unimplemented");
 }
 
-int arch_vcpu_create(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
-void arch_vcpu_destroy(struct vcpu *v)
-{
-    BUG_ON("unimplemented");
-}
-
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     BUG_ON("unimplemented");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235505.1538474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsfyX-0007A6-3r; Wed, 18 Feb 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 1235505.1538474; Wed, 18 Feb 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 1vsfyX-00079y-1B; Wed, 18 Feb 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1235505;
 Wed, 18 Feb 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 1vsfyV-00079m-UX
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsfyV-00FFer-2x
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 11:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsfyV-00DAn4-2l
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=8Y6jfc9d1zXftl7ZIV0myqGLHGxddBpH+5UvTb2x2BE=; b=0Poc2BgLjpREpgP2OaeR8EUSEf
	/7C1OGscBgmPhHwf9cXiMQ369XKIkW+jzwWshFnLtcyOr9DsKZugJQJhtpAb4Adldc6NA3Rt3XCsW
	PBXUwgAM8SpCB/BVyk8hfJQB1KW31Gw1nD2lIfOYLFtUymESGEw5XlnwWGxR898pJ9Nw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: build setup code as .init
Message-Id: <E1vsfyV-00DAn4-2l@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 11:44:11 +0000

commit 8ca1a1d5e6386926e8ff7a86ca1b422f9005caf7
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Wed Feb 18 10:17:06 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:17:06 2026 +0100

    xen/riscv: build setup code as .init
    
    At the moment, all code and data in setup.c are marked with __init or
    __initdata, which is intended to remain this way. Leverage this by using
    setup.init.o instead of setup.o in Makefile.
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index caa1aac5b2..bc47e83b26 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -12,7 +12,7 @@ obj-y += paging.o
 obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
-obj-y += setup.o
+obj-y += setup.init.o
 obj-y += shutdown.o
 obj-y += smp.o
 obj-y += smpboot.o
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 11:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 11:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235506.1538479 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsfyh-0007Dx-52; Wed, 18 Feb 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 1235506.1538479; Wed, 18 Feb 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 1vsfyh-0007Dp-2W; Wed, 18 Feb 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1235506;
 Wed, 18 Feb 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 1vsfyg-0007Dh-1d
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsfyg-00FFfF-01
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsfyf-00DAoM-38
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 11: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=KvVrK46dIwAmL1C4fFu5qnWoKnK5gYgFZNy1pxNVoak=; b=1yr33I26EohRLftW5BKqrbozlO
	+8IgKT7o4DrNQOllfDchNADc2go4kf/1RO09gix/XZOOV1h7TiM7IGunzdDSiVpg01fD93JJddflu
	jBCXa2SS8yLZtIkkdviJVbT9Vsr+I9KsSnSZatg3B2nskwre5VrM8t3o56N/KcVSLliM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] Arm: tighten translate_get_page()
Message-Id: <E1vsfyf-00DAoM-38@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 11:44:21 +0000

commit af6fc34e201c519a910aa4d34570ac3d7b13ec9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 18 10:17:39 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:17:39 2026 +0100

    Arm: tighten translate_get_page()
    
    Permitting writes when the P2M type says "read-only" can't be correct.
    
    Fixes: 1661158723a ("xen/arm: Extend copy_to_guest to support copying from/to guest physical address")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/guestcopy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index 497e785ec4..fdb06422b8 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -44,7 +44,7 @@ static struct page_info *translate_get_page(copy_info_t info, uint64_t addr,
     if ( !page )
         return NULL;
 
-    if ( !p2m_is_ram(p2mt) )
+    if ( write ? p2mt != p2m_ram_rw : !p2m_is_ram(p2mt) )
     {
         put_page(page);
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 11:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 11:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235507.1538483 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vsfys-0007G1-6T; Wed, 18 Feb 2026 11:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235507.1538483; Wed, 18 Feb 2026 11: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 1vsfys-0007Fr-3o; Wed, 18 Feb 2026 11:44:34 +0000
Received: by outflank-mailman (input) for mailman id 1235507;
 Wed, 18 Feb 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 1vsfyq-0007Fi-4a
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vsfyq-00FFfJ-0J
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vsfyq-00DApW-0C
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=1AO2tpHRxjYFhczOl60xaDqeaAIofXW3bW84kx9AUik=; b=tbY30VrnadAncX+ar1sBm5mULT
	2Cx3ZS2sk7+ezbMcT8UYFDkmQJUMK9g3OmhmawWWBlfozH9wF31ud7UyWqAs3lXnw0ireyvI51Lm7
	FG8J/JuT+wXhcpfNafh1hwSs19Ayx/TnOxMALqWrF/Urg5WTbSpSebtNFdHmM4b9RUk8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] domain: skip more stuff for idle's vCPU-s in vcpu_create()
Message-Id: <E1vsfyq-00DApW-0C@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 11:44:32 +0000

commit bada5850036bd284685fe2b60a156fa3cd579b94
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 18 10:18:53 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 18 10:18:53 2026 +0100

    domain: skip more stuff for idle's vCPU-s in vcpu_create()
    
    Nothing hypercall-related needs setting up there. Nor do we need to
    check whether the idle domain is shutting down - it never will.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/common/domain.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index de6fdf5923..2e46207d2d 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -475,12 +475,6 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     v->vcpu_id = vcpu_id;
     v->dirty_cpu = VCPU_CPU_CLEAN;
 
-    rwlock_init(&v->virq_lock);
-
-    tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
-
-    grant_table_init_vcpu(v);
-
     if ( is_idle_domain(d) )
     {
         v->runstate.state = RUNSTATE_running;
@@ -488,6 +482,12 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     }
     else
     {
+        rwlock_init(&v->virq_lock);
+
+        tasklet_init(&v->continue_hypercall_tasklet, NULL, NULL);
+
+        grant_table_init_vcpu(v);
+
         v->runstate.state = RUNSTATE_offline;
         v->runstate.state_entry_time = NOW();
         set_bit(_VPF_down, &v->pause_flags);
@@ -516,7 +516,8 @@ struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id)
     }
 
     /* Must be called after making new vcpu visible to for_each_vcpu(). */
-    vcpu_check_shutdown(v);
+    if ( !is_idle_domain(d) )
+        vcpu_check_shutdown(v);
 
     return v;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 16:22:10 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 16:22:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235852.1538693 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vskJO-0000W1-Tw; Wed, 18 Feb 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 1235852.1538693; Wed, 18 Feb 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 1vskJO-0000Vu-RE; Wed, 18 Feb 2026 16:22:02 +0000
Received: by outflank-mailman (input) for mailman id 1235852;
 Wed, 18 Feb 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 1vskJN-0000Vo-Fy
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 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 1vskJN-00FLsN-1L
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 16:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vskJN-00DSVU-1A
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 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=hF4UYR0N/JfQ9616443j0fh5CuTcaWS7wXMQQSRAmWw=; b=kLYvROp+NyrFnBQNlGr+HJehRY
	StHcab7PcmHufFoCypF89V4rdmHas6oNA32ndpf5ffqeyDXKzRzTyNAMF92yFXdX5vLhQTLEK2mwG
	lgaJtEWAygHVCyiRP2MST4m4+C7jwT5WU1sYwrSyLb9qu5PhstnBRuo4WiYc4KE1YkNk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] CI: Extend eclair-*-allcode to enable as much as possible
Message-Id: <E1vskJN-00DSVU-1A@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 16:22:01 +0000

commit 52e801093b6d9f72944328925588b227d7114f8e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 12:13:13 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 18 16:12:43 2026 +0000

    CI: Extend eclair-*-allcode to enable as much as possible
    
    On x86, this is basically everything.
    
    For ARM, CONFIG_MPU and CONFIG_MMU are mutually exclusive (with
    CONFIG_STATIC_MEMORY in the mix), as well as CONFIG_NEW_VGIC being mutually
    exclusive with the other VGIC infrastructure.
    
    No functional change, but a lot of new Eclair reports (non-blocking).
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 automation/gitlab-ci/analyze.yaml | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index b3395e2da7..4e9af9d602 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -44,6 +44,23 @@ eclair-x86_64-allcode:
     LOGFILE: "eclair-x86_64.log"
     VARIANT: "X86_64"
     RULESET: "monitored"
+    EXTRA_XEN_CONFIG: |
+      CONFIG_ARGO=y
+      CONFIG_DEBUG_LOCK_PROFILE=y
+      CONFIG_DEBUG_TRACE=y
+      CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP=y
+      CONFIG_EXPERT=y
+      CONFIG_HYPERV_GUEST=y
+      CONFIG_LATE_HWDOM=y
+      CONFIG_MEM_PAGING=y
+      CONFIG_MEM_SHARING=y
+      CONFIG_PERF_ARRAYS=y
+      CONFIG_PERF_COUNTERS=y
+      CONFIG_PV32=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_XEN_GUEST=y
+      CONFIG_XHCI=y
+      CONFIG_XSM=y
   allow_failure: true
 
 eclair-x86_64-testing:
@@ -105,6 +122,33 @@ eclair-ARM64-allcode:
     LOGFILE: "eclair-ARM64.log"
     VARIANT: "ARM64"
     RULESET: "monitored"
+    EXTRA_XEN_CONFIG: |
+      CONFIG_ACPI=y
+      CONFIG_ARGO=y
+      CONFIG_ARM64_SVE=y
+      CONFIG_ARM_SMMU_V3=y
+      CONFIG_BOOT_TIME_CPUPOOLS=y
+      CONFIG_DEBUG_LOCK_PROFILE=y
+      CONFIG_DEBUG_TRACE=y
+      CONFIG_DEVICE_TREE_DEBUG=y
+      CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP=y
+      CONFIG_EXPERT=y
+      CONFIG_FFA=y
+      CONFIG_FFA_VM_TO_VM=y
+      CONFIG_GICV3_ESPI=y
+      CONFIG_HAS_ITS=y
+      CONFIG_IOREQ_SERVER=y
+      CONFIG_IPMMU_VMSA=y
+      CONFIG_LIVEPATCH=y
+      CONFIG_LLC_COLORING=y
+      CONFIG_OPTEE=y
+      CONFIG_OVERLAY_DTB=y
+      CONFIG_PCI_PASSTHROUGH=y
+      CONFIG_PERF_ARRAYS=y
+      CONFIG_PERF_COUNTERS=y
+      CONFIG_STACK_PROTECTOR=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_VM_EVENT=y
   allow_failure: true
 
 eclair-ARM64-testing:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 18 17:22:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Feb 2026 17:22:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1235891.1538727 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vslFT-0000jp-K8; Wed, 18 Feb 2026 17:22:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1235891.1538727; Wed, 18 Feb 2026 17: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 1vslFT-0000jh-Hf; Wed, 18 Feb 2026 17:22:03 +0000
Received: by outflank-mailman (input) for mailman id 1235891;
 Wed, 18 Feb 2026 17: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 1vslFR-0000jb-Tp
 for xen-changelog@lists.xenproject.org; Wed, 18 Feb 2026 17: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 1vslFR-00FN5J-2o
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 17:22:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vslFR-00Dd38-2h
 for xen-changelog@lists.xenproject.org;
 Wed, 18 Feb 2026 17: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=vCbcINhX8m4xZLClTUYGnvUXdPxoTbyNUqACDOuboRg=; b=2CZUGimCDxdH/2flKV1asqsvCt
	KTRnDsXQyjK48JCAfawOe/3jReF5s1UeYMyCVLqhw5Srcp4N4qNThX1JAZiemJd/Ee7qacGLkH7o6
	rDElEpFS8FEH4OBvWa+zNgC3WwYYnRaJcZJ4crvKAUIBlc2ztdlX9TuKsYqS8tbKkXYc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] CI: Extend eclair-*-allcode to enable as much as possible
Message-Id: <E1vslFR-00Dd38-2h@xenbits.xenproject.org>
Date: Wed, 18 Feb 2026 17:22:01 +0000

commit 52e801093b6d9f72944328925588b227d7114f8e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 12:13:13 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 18 16:12:43 2026 +0000

    CI: Extend eclair-*-allcode to enable as much as possible
    
    On x86, this is basically everything.
    
    For ARM, CONFIG_MPU and CONFIG_MMU are mutually exclusive (with
    CONFIG_STATIC_MEMORY in the mix), as well as CONFIG_NEW_VGIC being mutually
    exclusive with the other VGIC infrastructure.
    
    No functional change, but a lot of new Eclair reports (non-blocking).
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 automation/gitlab-ci/analyze.yaml | 44 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/automation/gitlab-ci/analyze.yaml b/automation/gitlab-ci/analyze.yaml
index b3395e2da7..4e9af9d602 100644
--- a/automation/gitlab-ci/analyze.yaml
+++ b/automation/gitlab-ci/analyze.yaml
@@ -44,6 +44,23 @@ eclair-x86_64-allcode:
     LOGFILE: "eclair-x86_64.log"
     VARIANT: "X86_64"
     RULESET: "monitored"
+    EXTRA_XEN_CONFIG: |
+      CONFIG_ARGO=y
+      CONFIG_DEBUG_LOCK_PROFILE=y
+      CONFIG_DEBUG_TRACE=y
+      CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP=y
+      CONFIG_EXPERT=y
+      CONFIG_HYPERV_GUEST=y
+      CONFIG_LATE_HWDOM=y
+      CONFIG_MEM_PAGING=y
+      CONFIG_MEM_SHARING=y
+      CONFIG_PERF_ARRAYS=y
+      CONFIG_PERF_COUNTERS=y
+      CONFIG_PV32=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_XEN_GUEST=y
+      CONFIG_XHCI=y
+      CONFIG_XSM=y
   allow_failure: true
 
 eclair-x86_64-testing:
@@ -105,6 +122,33 @@ eclair-ARM64-allcode:
     LOGFILE: "eclair-ARM64.log"
     VARIANT: "ARM64"
     RULESET: "monitored"
+    EXTRA_XEN_CONFIG: |
+      CONFIG_ACPI=y
+      CONFIG_ARGO=y
+      CONFIG_ARM64_SVE=y
+      CONFIG_ARM_SMMU_V3=y
+      CONFIG_BOOT_TIME_CPUPOOLS=y
+      CONFIG_DEBUG_LOCK_PROFILE=y
+      CONFIG_DEBUG_TRACE=y
+      CONFIG_DEVICE_TREE_DEBUG=y
+      CONFIG_EFI_SET_VIRTUAL_ADDRESS_MAP=y
+      CONFIG_EXPERT=y
+      CONFIG_FFA=y
+      CONFIG_FFA_VM_TO_VM=y
+      CONFIG_GICV3_ESPI=y
+      CONFIG_HAS_ITS=y
+      CONFIG_IOREQ_SERVER=y
+      CONFIG_IPMMU_VMSA=y
+      CONFIG_LIVEPATCH=y
+      CONFIG_LLC_COLORING=y
+      CONFIG_OPTEE=y
+      CONFIG_OVERLAY_DTB=y
+      CONFIG_PCI_PASSTHROUGH=y
+      CONFIG_PERF_ARRAYS=y
+      CONFIG_PERF_COUNTERS=y
+      CONFIG_STACK_PROTECTOR=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_VM_EVENT=y
   allow_failure: true
 
 eclair-ARM64-testing:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Fri Feb 20 11:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Feb 2026 11:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1237037.1539515 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vtOPW-0002Lr-92; Fri, 20 Feb 2026 11:11:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1237037.1539515; Fri, 20 Feb 2026 11: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 1vtOPW-0002Lj-6P; Fri, 20 Feb 2026 11:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1237037;
 Fri, 20 Feb 2026 11: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 1vtOPV-0002Ld-H4
 for xen-changelog@lists.xenproject.org; Fri, 20 Feb 2026 11: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 1vtOPV-0011kc-1U
 for xen-changelog@lists.xenproject.org;
 Fri, 20 Feb 2026 11:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vtOPV-00GAiD-1H
 for xen-changelog@lists.xenproject.org;
 Fri, 20 Feb 2026 11: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=/K60xnz9VAmBwhLpW9zyesZpfSG8zBt5U7avpG4/Vss=; b=H/aErguavEJwTyXpg6X6gq9V+C
	13F6N7ijx8V2NiS08JfoTTfV72I1hibE0VGKCBQZ8eq+1/etusaCWnMmXmtUOaIkF+UtEUS7Gvsxm
	suOptDcY5Hq82rY0v7CsRbIJOCiCl/ovrk3UHHHJsdavkmqjVWCX0E5i+7e12+3QHWRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu/intel: Limit the non-architectural constant_tsc model checks
Message-Id: <E1vtOPV-00GAiD-1H@xenbits.xenproject.org>
Date: Fri, 20 Feb 2026 11:11:01 +0000

commit 0acaba1257651e531ea79be789d0671d9c56b169
Author:     Sohil Mehta <sohil.mehta@intel.com>
AuthorDate: Wed Feb 19 18:41:31 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Feb 20 10:37:42 2026 +0000

    x86/cpu/intel: Limit the non-architectural constant_tsc model checks
    
    X86_FEATURE_CONSTANT_TSC is a Linux-defined, synthesized feature flag.
    It is used across several vendors. Intel CPUs will set the feature when
    the architectural CPUID.80000007.EDX[1] bit is set. There are also some
    Intel CPUs that have the X86_FEATURE_CONSTANT_TSC behavior but don't
    enumerate it with the architectural bit.  Those currently have a model
    range check.
    
    Today, virtually all of the CPUs that have the CPUID bit *also* match
    the "model >= 0x0e" check. This is confusing. Instead of an open-ended
    check, pick some models (INTEL_IVYBRIDGE and P4_WILLAMETTE) as the end
    of goofy CPUs that should enumerate the bit but don't.  These models are
    relatively arbitrary but conservative pick for this.
    
    This makes it obvious that later CPUs (like Family 18+) no longer need
    to synthesize X86_FEATURE_CONSTANT_TSC.
    
    Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250219184133.816753-14-sohil.mehta@intel.com
    Link: https://git.kernel.org/tip/fadb6f569b10bf668677add876ed50586931b8f3
    [Port to Xen]
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/intel.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 584588e406..18b3c79dc9 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -637,14 +637,13 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	/* Work around errata */
 	Intel_errata_workarounds(c);
 
-	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
-		(c->x86 == 0x6 && c->x86_model >= 0x0e))
-		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	if (cpu_has(c, X86_FEATURE_ITSC)) {
 		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
-	}
+	} else if ((c->vfm >= INTEL_P4_PRESCOTT && c->vfm <= INTEL_P4_CEDARMILL) ||
+	           (c->vfm >= INTEL_CORE_YONAH && c->vfm <= INTEL_IVYBRIDGE))
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Sat Feb 21 17:33:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Feb 2026 17:33:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1238051.1540049 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vtqql-0002Pe-9x; Sat, 21 Feb 2026 17:33:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1238051.1540049; Sat, 21 Feb 2026 17: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 1vtqql-0002PW-7E; Sat, 21 Feb 2026 17:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1238051;
 Sat, 21 Feb 2026 17: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 1vtqqk-0002PQ-9l
 for xen-changelog@lists.xenproject.org; Sat, 21 Feb 2026 17: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 1vtqqk-002qPl-0k
 for xen-changelog@lists.xenproject.org;
 Sat, 21 Feb 2026 17:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vtqqk-000P5c-0a
 for xen-changelog@lists.xenproject.org;
 Sat, 21 Feb 2026 17: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=IUzfu0G9bBMtPHDXKHf/2Vnv6sS2ytrsBfW9wwg2DZE=; b=EUK0rrtZQM30+agSiadSbxw/bR
	VYuh79tg+MAKFHvIwgzrfMYIVCkcx7eddFHV1t8aQmge5qwFXcMWvpAAVW7cIKl9oBv4bSxummi7g
	VOvhLw5Zz7oJyIz8XPinsKARWlt38Cu0SZcBUbWFfp7rIReIclUpkFUXxyeVf3ljpX8A=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu/intel: Limit the non-architectural constant_tsc model checks
Message-Id: <E1vtqqk-000P5c-0a@xenbits.xenproject.org>
Date: Sat, 21 Feb 2026 17:33:02 +0000

commit 0acaba1257651e531ea79be789d0671d9c56b169
Author:     Sohil Mehta <sohil.mehta@intel.com>
AuthorDate: Wed Feb 19 18:41:31 2025 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Fri Feb 20 10:37:42 2026 +0000

    x86/cpu/intel: Limit the non-architectural constant_tsc model checks
    
    X86_FEATURE_CONSTANT_TSC is a Linux-defined, synthesized feature flag.
    It is used across several vendors. Intel CPUs will set the feature when
    the architectural CPUID.80000007.EDX[1] bit is set. There are also some
    Intel CPUs that have the X86_FEATURE_CONSTANT_TSC behavior but don't
    enumerate it with the architectural bit.  Those currently have a model
    range check.
    
    Today, virtually all of the CPUs that have the CPUID bit *also* match
    the "model >= 0x0e" check. This is confusing. Instead of an open-ended
    check, pick some models (INTEL_IVYBRIDGE and P4_WILLAMETTE) as the end
    of goofy CPUs that should enumerate the bit but don't.  These models are
    relatively arbitrary but conservative pick for this.
    
    This makes it obvious that later CPUs (like Family 18+) no longer need
    to synthesize X86_FEATURE_CONSTANT_TSC.
    
    Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>
    Link: https://lore.kernel.org/r/20250219184133.816753-14-sohil.mehta@intel.com
    Link: https://git.kernel.org/tip/fadb6f569b10bf668677add876ed50586931b8f3
    [Port to Xen]
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/intel.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 584588e406..18b3c79dc9 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -637,14 +637,13 @@ static void cf_check init_intel(struct cpuinfo_x86 *c)
 	/* Work around errata */
 	Intel_errata_workarounds(c);
 
-	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
-		(c->x86 == 0x6 && c->x86_model >= 0x0e))
-		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 	if (cpu_has(c, X86_FEATURE_ITSC)) {
 		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
 		__set_bit(X86_FEATURE_TSC_RELIABLE, c->x86_capability);
-	}
+	} else if ((c->vfm >= INTEL_P4_PRESCOTT && c->vfm <= INTEL_P4_CEDARMILL) ||
+	           (c->vfm >= INTEL_CORE_YONAH && c->vfm <= INTEL_IVYBRIDGE))
+		__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 
 	if ((opt_cpu_info && !(c->apicid & (c->x86_num_siblings - 1))) ||
 	    c == &boot_cpu_data )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239020.1540402 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUM7-0003Rn-T6; Mon, 23 Feb 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 1239020.1540402; Mon, 23 Feb 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 1vuUM7-0003Rf-Qf; Mon, 23 Feb 2026 11:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1239020;
 Mon, 23 Feb 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 1vuUM6-0003RZ-1f
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUM5-0068Tc-30
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUM5-002oxr-2n
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=NR0oiTa7xbxB6skWCyS6jnpRUrvlexsZ7Ht9TpyfFf8=; b=nsoAygRgMjuPhCTtgtdh/AoEJr
	IjfpsqUeFvSslbnDwNcD65YFUtcdB5/95XhdULgNmjQ6TGsYmLODGIgkoPK2jKdW/ZG95AimRxsjw
	l+odk8y1iz2PSVXA+LU7DgqF9BW2Jz8Q/mwmr0gNlw2AYcjnTYVnTN5mjQgQW8af01XE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: reduce explicit log-dirty recording for HVM
Message-Id: <E1vuUM5-002oxr-2n@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:01 +0000

commit ff78502db07d0c18aa7e1db6b03b59432229d0d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:37:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:37:13 2026 +0100

    x86/shadow: reduce explicit log-dirty recording for HVM
    
    validate_guest_pt_write(), by calling sh_validate_guest_entry(), already
    guarantees the needed update of log-dirty information. Move the
    operation into the sole code path needing it (when SHOPT_SKIP_VERIFY is
    enabled), making clear that only one such call is needed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index bfc81b680a..7b3b58119c 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -665,6 +665,7 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
     {
         /* Writes with this alignment constraint can't possibly cross pages. */
         ASSERT(!mfn_valid(sh_ctxt->mfn[1]));
+        paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
     }
     else
 #endif /* SHADOW_OPTIMIZATIONS & SHOPT_SKIP_VERIFY */
@@ -682,12 +683,10 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
             validate_guest_pt_write(v, sh_ctxt->mfn[1], addr + b1, b2);
     }
 
-    paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
     put_page(mfn_to_page(sh_ctxt->mfn[0]));
 
     if ( unlikely(mfn_valid(sh_ctxt->mfn[1])) )
     {
-        paging_mark_dirty(v->domain, sh_ctxt->mfn[1]);
         put_page(mfn_to_page(sh_ctxt->mfn[1]));
         vunmap((void *)((unsigned long)addr & PAGE_MASK));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239021.1540407 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUMH-0003TR-Ut; Mon, 23 Feb 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 1239021.1540407; Mon, 23 Feb 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 1vuUMH-0003TH-S4; Mon, 23 Feb 2026 11:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1239021;
 Mon, 23 Feb 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 1vuUMG-0003Sy-2v
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUMG-0068Tg-08
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUMF-002ozr-3C
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=S5u786snkuCMnTsLtkJNyFmKRPT0RltVA/Bfxi9VApg=; b=jKuOxMRoy3itbkXvYcjYz3hQV4
	9O7HN8GXWodvKbyQpdVafFm+YrTEwiF8v7X9H6Pth5ButvZiFrS1XiX667oCWsdCoXcM/vdbxhowa
	IhOA9JF+tU7b8+CNVVYJGmlHsEpYeWnZ9Hhvjj1M997lxAhJWRcy+N8ZhMaEaaoIzGZk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: call sh_update_cr3() directly from sh_page_fault()
Message-Id: <E1vuUMF-002ozr-3C@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:11 +0000

commit 5d45c8202d4e2a87beefd4f71db2e35134e204c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:37:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:37:49 2026 +0100

    x86/shadow: call sh_update_cr3() directly from sh_page_fault()
    
    There's no need for an indirect call here, as the mode is invariant
    throughout the entire paging-locked region. All it takes to avoid it is
    to have a forward declaration of sh_update_cr3() in place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 3bbaceec12..e13cc602b9 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -79,6 +79,8 @@ const char *const fetch_type_names[] = {
 # define for_each_shadow_table(v, i) for ( (i) = 0; (i) < 1; ++(i) )
 #endif
 
+static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush);
+
 /* Helper to perform a local TLB flush. */
 static void sh_flush_local(const struct domain *d)
 {
@@ -2478,7 +2480,7 @@ static int cf_check sh_page_fault(
          * In any case, in the PAE case, the ASSERT is not true; it can
          * happen because of actions the guest is taking. */
 #if GUEST_PAGING_LEVELS == 3
-        v->arch.paging.mode->update_cr3(v, false);
+        sh_update_cr3(v, false);
 #else
         ASSERT(d->is_shutting_down);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239022.1540411 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUMR-0003Xn-WE; Mon, 23 Feb 2026 11:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239022.1540411; Mon, 23 Feb 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 1vuUMR-0003Xf-TW; Mon, 23 Feb 2026 11:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1239022;
 Mon, 23 Feb 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 1vuUMQ-0003XU-5e
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUMQ-0068Tm-0R
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUMQ-002p1L-0K
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=uG+uLx/X2cwwxkh5mNj0Fs/xbLiYFI9KiFk8Th9KGFU=; b=c+60n2QC95qpvvTXIWD3fntTBu
	lUXCGSA/wFZNnG95CcW/OawJLvVoXiuywL7AiE4ZoqAZ0qi7VIPZCFdhrXpBq3aI4F02/urSHkrJp
	eHaumjMJDKy6gkavinlKlwXo2IMMInCZ+vqwSfL3H6r1CqCEgtjIPg9O6Yn6Ou+VaWb0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: don't generate bogus "domain dying" trace entry from sh_page_fault()
Message-Id: <E1vuUMQ-002p1L-0K@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:22 +0000

commit cbfed8361b679676193f4dfe366fe39992566c51
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:38:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:38:07 2026 +0100

    x86/shadow: don't generate bogus "domain dying" trace entry from sh_page_fault()
    
    When in 3-level guest mode we help a guest to stay alive, we also
    shouldn't emit a trace entry to the contrary. Move the invocation up
    into the respective #ifdef, noting that while this moves it into the
    locked region, emitting trace records with the paging lock held is okay
    (as done elsewhere as well), just needlessly increasing lock holding
    time a little.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e13cc602b9..b63046fd4f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2483,10 +2483,10 @@ static int cf_check sh_page_fault(
         sh_update_cr3(v, false);
 #else
         ASSERT(d->is_shutting_down);
+        sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
 #endif
         paging_unlock(d);
         put_gfn(d, gfn_x(gfn));
-        sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
         return 0;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239023.1540415 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUMc-0003Zw-1p; Mon, 23 Feb 2026 11:44:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239023.1540415; Mon, 23 Feb 2026 11: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 1vuUMb-0003Zo-Uz; Mon, 23 Feb 2026 11:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1239023;
 Mon, 23 Feb 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 1vuUMa-0003Zf-8i
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUMa-0068Ty-0l
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUMa-002p2c-0e
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=FE+HI6okofH4fmXN1H2hm7YNp8GVlr0RONm80a0uWts=; b=zWCsM83jKsWbtV0GywgWStGlyu
	uzQM6VZPRFvm6q5SK3HEXIswSVIE7o6WcGfcDSFv/upt77e4MgqXPypjgEowo+cvT/YUrcXc+kVMC
	cd/5gBGWiAFFO26YdmpDKgwabod8Yb2ksuHY+9TJKFPNysXjgz9l4x4Tq8HTG/QTh0ic=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: use lighter-weight mode checks
Message-Id: <E1vuUMa-002p2c-0e@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:32 +0000

commit 20f7edd97cb86e9ae4c7e4aed541e368bb00d5ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:38:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:38:48 2026 +0100

    x86/shadow: use lighter-weight mode checks
    
    shadow_mode_...(), with the exception of shadow_mode_enabled(), are
    shorthands for shadow_mode_enabled() && paging_mode_...(). While
    potentially useful outside of shadow-internal functions, when we already
    know that we're dealing with a domain in shadow mode, the "paging"
    checks are sufficient and cheaper. While the "shadow" ones commonly
    translate to a MOV/AND/CMP/Jcc sequence, the "paging" ones typically
    resolve to just TEST+Jcc.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c  | 10 +++++-----
 xen/arch/x86/mm/shadow/multi.c   | 36 ++++++++++++++++++------------------
 xen/arch/x86/mm/shadow/private.h |  6 +++---
 xen/arch/x86/mm/shadow/set.c     |  6 +++---
 xen/arch/x86/mm/shadow/types.h   |  2 +-
 5 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 96986ee255..6d44d9ad1d 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1276,7 +1276,7 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
      * In guest refcounting, we trust Xen to already be restricting
      * all the writes to the guest page tables, so we do not need to
      * do more. */
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         return 0;
 
     /* Early exit if it's already a pagetable, or otherwise not writeable */
@@ -1508,7 +1508,7 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
          *   guest pages with an extra reference taken by
          *   prepare_ring_for_helper().
          */
-        if ( !(shadow_mode_external(d)
+        if ( !(paging_mode_external(d)
                && (page->count_info & PGC_count_mask) <= 3
                && ((page->u.inuse.type_info & PGT_count_mask)
                    == (is_special_page(page) ||
@@ -1806,8 +1806,8 @@ static void sh_update_paging_modes(struct vcpu *v)
     {
         const struct paging_mode *old_mode = v->arch.paging.mode;
 
-        ASSERT(shadow_mode_translate(d));
-        ASSERT(shadow_mode_external(d));
+        ASSERT(paging_mode_translate(d));
+        ASSERT(paging_mode_external(d));
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
         /* Need to resync all our pages now, because if a page goes out
@@ -2211,7 +2211,7 @@ void shadow_vcpu_teardown(struct vcpu *v)
 
     sh_detach_old_tables(v);
 #ifdef CONFIG_HVM
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         mfn_t mfn = pagetable_get_mfn(v->arch.hvm.monitor_table);
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b63046fd4f..ade4b2dbe3 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -519,7 +519,7 @@ _sh_propagate(struct vcpu *v,
                || (level == 1
                    && page_get_owner(mfn_to_page(target_mfn)) == dom_io);
     if ( mmio_mfn
-         && !(level == 1 && (!shadow_mode_refcounts(d)
+         && !(level == 1 && (!paging_mode_refcounts(d)
                              || p2mt == p2m_mmio_direct)) )
     {
         ASSERT((ft == ft_prefetch));
@@ -536,7 +536,7 @@ _sh_propagate(struct vcpu *v,
                        _PAGE_RW | _PAGE_PRESENT);
     if ( guest_nx_enabled(v) )
         pass_thru_flags |= _PAGE_NX_BIT;
-    if ( level == 1 && !shadow_mode_refcounts(d) && mmio_mfn )
+    if ( level == 1 && !paging_mode_refcounts(d) && mmio_mfn )
         pass_thru_flags |= PAGE_CACHE_ATTRS;
     sflags = gflags & pass_thru_flags;
 
@@ -656,7 +656,7 @@ _sh_propagate(struct vcpu *v,
      * (We handle log-dirty entirely inside the shadow code, without using the
      * p2m_ram_logdirty p2m type: only HAP uses that.)
      */
-    if ( level == 1 && unlikely(shadow_mode_log_dirty(d)) && !mmio_mfn )
+    if ( level == 1 && unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
     {
         if ( ft & FETCH_TYPE_WRITE )
             paging_mark_dirty(d, target_mfn);
@@ -812,7 +812,7 @@ do {                                                                    \
 #define FOREACH_PRESENT_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)    \
 do {                                                                      \
     int _i, _j;                                                           \
-    ASSERT(shadow_mode_external(_dom));                                   \
+    ASSERT(paging_mode_external(_dom));                                   \
     ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);      \
     for ( _j = 0; _j < 4; _j++ )                                          \
     {                                                                     \
@@ -838,7 +838,7 @@ do {                                                                      \
 do {                                                                       \
     int _i;                                                                \
     shadow_l2e_t *_sp = map_domain_page((_sl2mfn));                        \
-    ASSERT(shadow_mode_external(_dom));                                    \
+    ASSERT(paging_mode_external(_dom));                                    \
     ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow);      \
     for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i++ )                 \
     {                                                                      \
@@ -859,7 +859,7 @@ do {                                                                        \
     unsigned int _i, _end = 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 !shadow_mode_external */ &&    \
+    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 )                                         \
@@ -901,7 +901,7 @@ do {                                                                    \
 #define FOREACH_PRESENT_L4E(_sl4mfn, _sl4e, _gl4p, _done, _dom, _code)  \
 do {                                                                    \
     shadow_l4e_t *_sp = map_domain_page((_sl4mfn));                     \
-    int _xen = !shadow_mode_external(_dom);                             \
+    int _xen = !paging_mode_external(_dom);                             \
     int _i;                                                             \
     ASSERT(mfn_to_page(_sl4mfn)->u.sh.type == SH_type_l4_64_shadow);\
     for ( _i = 0; _i < SHADOW_L4_PAGETABLE_ENTRIES; _i++ )              \
@@ -970,7 +970,7 @@ sh_make_shadow(struct vcpu *v, mfn_t gmfn, u32 shadow_type)
 #endif
 
     // Create the Xen mappings...
-    if ( !shadow_mode_external(d) )
+    if ( !paging_mode_external(d) )
     {
         switch (shadow_type)
         {
@@ -1372,7 +1372,7 @@ void sh_destroy_l1_shadow(struct domain *d, mfn_t smfn)
         shadow_demote(d, gmfn, t);
     }
 
-    if ( shadow_mode_refcounts(d) )
+    if ( paging_mode_refcounts(d) )
     {
         /* Decrement refcounts of all the old entries */
         mfn_t sl1mfn = smfn;
@@ -1469,7 +1469,7 @@ static int cf_check validate_gl4e(
     l4e_propagate_from_guest(v, new_gl4e, sl3mfn, &new_sl4e, ft_prefetch);
 
     // check for updates to xen reserved slots
-    if ( !shadow_mode_external(d) )
+    if ( !paging_mode_external(d) )
     {
         int shadow_index = (((unsigned long)sl4p & ~PAGE_MASK) /
                             sizeof(shadow_l4e_t));
@@ -2390,7 +2390,7 @@ static int cf_check sh_page_fault(
      * present entry) we'd get back right here immediately afterwards, thus
      * preventing the guest from making further forward progress.
      */
-    if ( shadow_mode_refcounts(d) &&
+    if ( paging_mode_refcounts(d) &&
          !p2m_is_mmio(p2mt) &&
          (!p2m_is_any_ram(p2mt) || !mfn_valid(gmfn)) )
     {
@@ -2614,7 +2614,7 @@ static int cf_check sh_page_fault(
     return EXCRET_fault_fixed;
 
  emulate:
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         goto not_a_shadow_fault;
 
 #ifdef CONFIG_HVM
@@ -3063,7 +3063,7 @@ sh_update_linear_entries(struct vcpu *v)
      */
 
     /* Don't try to update the monitor table if it doesn't exist */
-    if ( !shadow_mode_external(d) ||
+    if ( !paging_mode_external(d) ||
          pagetable_get_pfn(v->arch.hvm.monitor_table) == 0 )
         return;
 
@@ -3214,7 +3214,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     /* Double-check that the HVM code has sent us a sane guest_table */
     if ( is_hvm_domain(d) )
     {
-        ASSERT(shadow_mode_external(d));
+        ASSERT(paging_mode_external(d));
         if ( hvm_paging_enabled(v) )
             ASSERT(pagetable_get_pfn(v->arch.guest_table));
         else
@@ -3239,7 +3239,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
      * table.  We cache the current state of that table and shadow that,
      * until the next CR3 write makes us refresh our cache.
      */
-    ASSERT(shadow_mode_external(d));
+    ASSERT(paging_mode_external(d));
 
     /*
      * Find where in the page the l3 table is, but ignore the low 2 bits of
@@ -3271,7 +3271,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
         ASSERT(d->is_dying || d->is_shutting_down);
         return old_entry;
     }
-    if ( !shadow_mode_external(d) && !is_pv_32bit_domain(d) )
+    if ( !paging_mode_external(d) && !is_pv_32bit_domain(d) )
     {
         mfn_t smfn = pagetable_get_mfn(v->arch.paging.shadow.shadow_table[0]);
 
@@ -3371,7 +3371,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ///
     /// v->arch.cr3
     ///
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         make_cr3(v, pagetable_get_mfn(v->arch.hvm.monitor_table));
     }
@@ -3388,7 +3388,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ///
     /// v->arch.hvm.hw_cr[3]
     ///
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         ASSERT(is_hvm_domain(d));
 #if SHADOW_PAGING_LEVELS == 3
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 6420ec4645..8c8e29a021 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -399,7 +399,7 @@ static inline int sh_remove_write_access(struct domain *d, mfn_t gmfn,
                                          unsigned int level,
                                          unsigned long fault_addr)
 {
-    ASSERT(!shadow_mode_refcounts(d));
+    ASSERT(!paging_mode_refcounts(d));
     return 0;
 }
 #endif
@@ -523,8 +523,8 @@ sh_mfn_is_a_page_table(mfn_t gmfn)
 
     page = mfn_to_page(gmfn);
     owner = page_get_owner(page);
-    if ( owner && shadow_mode_refcounts(owner)
-         && (page->count_info & PGC_shadowed_pt) )
+    if ( owner && paging_mode_refcounts(owner) &&
+         (page->count_info & PGC_shadowed_pt) )
         return 1;
 
     type_info = page->u.inuse.type_info & PGT_type_mask;
diff --git a/xen/arch/x86/mm/shadow/set.c b/xen/arch/x86/mm/shadow/set.c
index 8b670b6bb5..8f9690f0df 100644
--- a/xen/arch/x86/mm/shadow/set.c
+++ b/xen/arch/x86/mm/shadow/set.c
@@ -81,7 +81,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
     struct domain *owner = NULL;
 
     ASSERT(!sh_l1e_is_magic(sl1e));
-    ASSERT(shadow_mode_refcounts(d));
+    ASSERT(paging_mode_refcounts(d));
 
     if ( mfn_valid(mfn) )
     {
@@ -342,7 +342,7 @@ int shadow_set_l1e(struct domain *d, shadow_l1e_t *sl1e,
          !sh_l1e_is_magic(new_sl1e) )
     {
         /* About to install a new reference */
-        if ( shadow_mode_refcounts(d) )
+        if ( paging_mode_refcounts(d) )
         {
 #define PAGE_FLIPPABLE (_PAGE_RW | _PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
             int rc;
@@ -375,7 +375,7 @@ int shadow_set_l1e(struct domain *d, shadow_l1e_t *sl1e,
 
     old_sl1f = shadow_l1e_get_flags(old_sl1e);
     if ( (old_sl1f & _PAGE_PRESENT) && !sh_l1e_is_magic(old_sl1e) &&
-         shadow_mode_refcounts(d) )
+         paging_mode_refcounts(d) )
     {
         /*
          * We lost a reference to an old mfn.
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d700d8d64c..09e443d1b6 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -262,7 +262,7 @@ int shadow_set_l4e(struct domain *d, shadow_l4e_t *sl4e,
 static void inline
 shadow_put_page_from_l1e(shadow_l1e_t sl1e, struct domain *d)
 {
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         return;
 
     put_page_from_l1e(sl1e, d);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239024.1540419 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUMm-0003c2-3A; Mon, 23 Feb 2026 11:44:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239024.1540419; Mon, 23 Feb 2026 11: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 1vuUMm-0003bu-0G; Mon, 23 Feb 2026 11:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1239024;
 Mon, 23 Feb 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 1vuUMk-0003bj-EI
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUMk-0068U6-1I
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUMk-002p3g-0w
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=IFiFKtrpDoVjA7xjgXTsfupWKCyq3tp+7xtuQlEpi8g=; b=Aad+rFJW7fYgMEIP9OKCOvw/G1
	PaD+Pb9zi1kWhhnLjT/9DACS/kPmPN3H10zNQl9W8VJhZOB6e04MiEbElvElvAOrzscneCI58Mdri
	hB3tqmUVUCi+RBJv7/qvl9ZOq4gAcn9hGaZ1LU722MJlTJf6vIyZICGtP4AR9Dq90gOM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/MCE: restore CPU vendor reporting to the outside world
Message-Id: <E1vuUMk-002p3g-0w@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:42 +0000

commit a94c5fd8290a55461c599b8baad309df0d929f1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:39:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:39:58 2026 +0100

    x86/MCE: restore CPU vendor reporting to the outside world
    
    The records reported used to contain Linux enumerators. We first broke
    that connection when purging unused ones, and then again when switching to
    the bit mask forms.
    
    Fixes: 408413051144 ("x86/cpu: Drop unused X86_VENDOR_* values")
    Fixes: 0cd074144cbb ("x86/cpu: Renumber X86_VENDOR_* to form a bitmap")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/mcheck/mce.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 9277781bff..9a91807cfb 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -858,6 +858,22 @@ void *x86_mcinfo_reserve(struct mc_info *mi,
     return mic_index;
 }
 
+/* Linux values need using when reporting CPU vendors to the outside. */
+static unsigned int xen2linux_vendor(unsigned int vendor)
+{
+    switch ( vendor )
+    {
+    case X86_VENDOR_INTEL:    return 0;
+    case X86_VENDOR_AMD:      return 2;
+    case X86_VENDOR_CENTAUR:  return 5;
+    case X86_VENDOR_HYGON:    return 9;
+    case X86_VENDOR_SHANGHAI: return 10; /* X86_VENDOR_ZHAOXIN */
+    default: break;
+    }
+
+    return 0xff; /* X86_VENDOR_UNKNOWN */
+}
+
 static void x86_mcinfo_apei_save(
     struct mcinfo_global *mc_global, struct mcinfo_bank *mc_bank)
 {
@@ -866,7 +882,7 @@ static void x86_mcinfo_apei_save(
     memset(&m, 0, sizeof(struct mce));
 
     m.cpu = mc_global->mc_coreid;
-    m.cpuvendor = boot_cpu_data.x86_vendor;
+    m.cpuvendor = xen2linux_vendor(boot_cpu_data.x86_vendor);
     m.cpuid = cpuid_eax(1);
     m.socketid = mc_global->mc_socketid;
     m.apicid = mc_global->mc_apicid;
@@ -968,7 +984,7 @@ static void cf_check __maybe_unused do_mc_get_cpu_info(void *v)
                         &xcp->mc_ncores_active, &xcp->mc_nthreads);
     xcp->mc_cpuid_level = c->cpuid_level;
     xcp->mc_family = c->x86;
-    xcp->mc_vendor = c->x86_vendor;
+    xcp->mc_vendor = xen2linux_vendor(c->x86_vendor);
     xcp->mc_model = c->x86_model;
     xcp->mc_step = c->x86_mask;
     xcp->mc_cache_size = c->x86_cache_size;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239025.1540423 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUMw-0003ei-5c; Mon, 23 Feb 2026 11:44:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239025.1540423; Mon, 23 Feb 2026 11: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 1vuUMw-0003ea-2w; Mon, 23 Feb 2026 11:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1239025;
 Mon, 23 Feb 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 1vuUMu-0003eS-Id
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUMu-0068UE-1m
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:44:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUMu-002p4e-1T
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=ayjp3DDbmna6LLWmHIfXkbP1u9nUglcXwMahKFAaGvI=; b=sZVDPthPqy+8+FQ2kz89w65u1Q
	JuJ2dgFL9xLVhXIAjY7jBJTKSiRh5ibPXgcGXQu++/AjBkFHiGRBDhncRFSDktemnJgfZMyBW0NGw
	vehmbIww+i2pLeD4kwDdOP3qApVNqHJ3fA8XJTEqzDGdhiHklgDqomgdXWJmN6U+LDO8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: don't use #if in macro invocations
Message-Id: <E1vuUMu-002p4e-1T@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:44:52 +0000

commit e2d4157fb5945d8f9e2ad76304b8493c8b6d1111
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:41:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:41:07 2026 +0100

    x86/shadow: don't use #if in macro invocations
    
    As per the standard this is UB, i.e. we're building on a defacto extension
    in the compilers we use. Misra C:2012 rule 20.6 disallows this altogether,
    though. Use helper always-inline functions instead.
    
    In sh_audit_l1_table(), along with reducing the scope of "gfn", which now
    isn't used anymore by the if() side of the conditional, also reduce the
    scope of two other adjacent variables.
    
    For audit_magic() note that both which parameters are needed and what
    their types are is attributed to AUDIT_FAIL() accessing variables which
    aren't passed as arguments to it.
    
    No functional change intended. Of course codegen does change with this,
    first and foremost in register allocation.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/shadow/multi.c | 101 +++++++++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index ade4b2dbe3..b1cb9aad1f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -397,7 +397,7 @@ static inline mfn_t cf_check sh_next_page(mfn_t smfn)
     shadow_set_l2e(d, sl2e, new_sl2e, sl2mfn, SH_type_fl1_shadow, sh_next_page)
 
 static inline u32
-guest_index(void *ptr)
+guest_index(const void *ptr)
 {
     return (u32)((unsigned long)ptr & ~PAGE_MASK) / sizeof(guest_l1e_t);
 }
@@ -3551,16 +3551,25 @@ static int cf_check sh_guess_wrmap(
 }
 #endif
 
+/* Remember the last shadow that we shot a writeable mapping in */
+static always_inline void store_last_writeable_pte_smfn(
+    const struct domain *d, mfn_t sl1mfn)
+{
+#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
+    struct vcpu *curr = current;
+
+    if ( curr->domain == d )
+        curr->arch.paging.shadow.last_writeable_pte_smfn = mfn_x(sl1mfn);
+#endif
+}
+
 int cf_check sh_rm_write_access_from_l1(
     struct domain *d, mfn_t sl1mfn, mfn_t readonly_mfn)
 /* Excises all writeable mappings to readonly_mfn from this l1 shadow table */
 {
     shadow_l1e_t *sl1e;
     int done = 0;
-#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
-    struct vcpu *curr = current;
     mfn_t base_sl1mfn = sl1mfn; /* Because sl1mfn changes in the foreach */
-#endif
 
     FOREACH_PRESENT_L1E(sl1mfn, sl1e, NULL, done,
     {
@@ -3570,11 +3579,9 @@ int cf_check sh_rm_write_access_from_l1(
             shadow_l1e_t ro_sl1e = shadow_l1e_remove_flags(*sl1e, _PAGE_RW);
 
             shadow_set_l1e(d, sl1e, ro_sl1e, p2m_ram_rw, sl1mfn);
-#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
-            /* Remember the last shadow that we shot a writeable mapping in */
-            if ( curr->domain == d )
-                curr->arch.paging.shadow.last_writeable_pte_smfn = mfn_x(base_sl1mfn);
-#endif
+
+            store_last_writeable_pte_smfn(d, base_sl1mfn);
+
             if ( (mfn_to_page(readonly_mfn)->u.inuse.type_info
                   & PGT_count_mask) == 0 )
                 /* This breaks us cleanly out of the FOREACH macro */
@@ -3884,12 +3891,36 @@ static const char *sh_audit_flags(const struct domain *d, int level,
     return NULL;
 }
 
+static always_inline bool audit_magic(
+    const guest_l1e_t *gl1e, mfn_t gl1mfn,
+    const shadow_l1e_t *sl1e, mfn_t sl1mfn)
+{
+    bool done = false;
+
+#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH
+    if ( !sh_l1e_is_gnp(*sl1e) )
+    {
+        gfn_t gfn = sh_l1e_mmio_get_gfn(*sl1e);
+
+        ASSERT(sh_l1e_is_mmio(*sl1e));
+
+        if ( !gfn_eq(gfn, guest_l1e_get_gfn(*gl1e)) )
+            AUDIT_FAIL(1,
+                       "shadow MMIO gfn is %" SH_PRI_gfn " but guest gfn is %" SH_PRI_gfn,
+                       gfn_x(gfn), gfn_x(guest_l1e_get_gfn(*gl1e)));
+    }
+    else if ( guest_l1e_get_flags(*gl1e) & _PAGE_PRESENT )
+        AUDIT_FAIL(1, "shadow is GNP magic but guest is present");
+#endif
+
+    return done;
+}
+
 int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 {
     guest_l1e_t *gl1e, *gp;
     shadow_l1e_t *sl1e;
-    mfn_t mfn, gmfn, gl1mfn;
-    gfn_t gfn;
+    mfn_t gl1mfn;
     p2m_type_t p2mt;
     const char *s;
     int done = 0;
@@ -3908,28 +3939,10 @@ int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 #endif
 
     gl1e = gp = map_domain_page(gl1mfn);
-    FOREACH_PRESENT_L1E(sl1mfn, sl1e, &gl1e, done, {
-
+    FOREACH_PRESENT_L1E(sl1mfn, sl1e, &gl1e, done,
+    {
         if ( sh_l1e_is_magic(*sl1e) )
-        {
-#if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
-            if ( sh_l1e_is_gnp(*sl1e) )
-            {
-                if ( guest_l1e_get_flags(*gl1e) & _PAGE_PRESENT )
-                    AUDIT_FAIL(1, "shadow is GNP magic but guest is present");
-            }
-            else
-            {
-                ASSERT(sh_l1e_is_mmio(*sl1e));
-                gfn = sh_l1e_mmio_get_gfn(*sl1e);
-                if ( gfn_x(gfn) != gfn_x(guest_l1e_get_gfn(*gl1e)) )
-                    AUDIT_FAIL(1, "shadow MMIO gfn is %" SH_PRI_gfn
-                               " but guest gfn is %" SH_PRI_gfn,
-                               gfn_x(gfn),
-                               gfn_x(guest_l1e_get_gfn(*gl1e)));
-            }
-#endif
-        }
+            done = audit_magic(gl1e, gl1mfn, sl1e, sl1mfn);
         else
         {
             s = sh_audit_flags(d, 1, guest_l1e_get_flags(*gl1e),
@@ -3938,9 +3951,10 @@ int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 
             if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_MFNS )
             {
-                gfn = guest_l1e_get_gfn(*gl1e);
-                mfn = shadow_l1e_get_mfn(*sl1e);
-                gmfn = get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt);
+                gfn_t gfn = guest_l1e_get_gfn(*gl1e);
+                mfn_t mfn = shadow_l1e_get_mfn(*sl1e);
+                mfn_t gmfn = get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt);
+
                 if ( !p2m_is_grant(p2mt) && !mfn_eq(gmfn, mfn) )
                     AUDIT_FAIL(1, "bad translation: gfn %" SH_PRI_gfn
                                " --> %" PRI_mfn " != mfn %" PRI_mfn,
@@ -4029,6 +4043,17 @@ int cf_check sh_audit_l2_table(struct domain *d, mfn_t sl2mfn, mfn_t x)
 }
 
 #if GUEST_PAGING_LEVELS >= 4
+static always_inline unsigned int type_from_gl3e(
+    const struct domain *d, const guest_l3e_t *gl3e)
+{
+#ifdef CONFIG_PV32
+    if ( guest_index(gl3e) == 3 && is_pv_32bit_domain(d) )
+        return SH_type_l2h_shadow;
+#endif
+
+    return SH_type_l2_shadow;
+}
+
 int cf_check sh_audit_l3_table(struct domain *d, mfn_t sl3mfn, mfn_t x)
 {
     guest_l3e_t *gl3e, *gp;
@@ -4058,14 +4083,10 @@ int cf_check sh_audit_l3_table(struct domain *d, mfn_t sl3mfn, mfn_t x)
 
         if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_MFNS )
         {
-            unsigned int t = SH_type_l2_shadow;
+            unsigned int t = type_from_gl3e(d, gl3e);
 
             gfn = guest_l3e_get_gfn(*gl3e);
             mfn = shadow_l3e_get_mfn(*sl3e);
-#ifdef CONFIG_PV32
-            if ( guest_index(gl3e) == 3 && is_pv_32bit_domain(d) )
-                t = SH_type_l2h_shadow;
-#endif
             gmfn = get_shadow_status(
                        d, get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt), t);
             if ( !mfn_eq(gmfn, mfn) )
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239026.1540427 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUN6-0003gk-6x; Mon, 23 Feb 2026 11:45:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239026.1540427; Mon, 23 Feb 2026 11: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 1vuUN6-0003gc-4L; Mon, 23 Feb 2026 11:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1239026;
 Mon, 23 Feb 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 1vuUN4-0003gU-Lb
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUN4-0068V5-24
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:45:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUN4-002p67-1w
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=vts7qocK/fBxqYQJd1Oz1I+r2TGoBJ+VmUhGJU0Qv7c=; b=A0t393FG3206PdnXiGqVbdxtHA
	7s5EWNLPJ18gRvq22UMaV9pVwffW88qohVjBAE6DG6yu+l2OGxfsAfvgtlL/s1xTvIW5YyxuCtkem
	H+wI/GrQ9YxnkkocDdSa1elpVJvzzfmLSsmhVSi+AS4CTVTK2OzO1WLiFADZlz4P/wwg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/svm: Add Enumerations for the SVM virtual NMI
Message-Id: <E1vuUN4-002p67-1w@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:45:02 +0000

commit 0294292b4ca6d90e18cb66912d18b88576dd2733
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Mon Feb 23 08:41:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:41:32 2026 +0100

    x86/svm: Add Enumerations for the SVM virtual NMI
    
    Introduce the cpuid bit for the SVM vNMI feature support for the x86\AMD
    platforms. The feature support is indicated by the CPUID
    Fn8000_000A_EDX[25] = 1.
    
    Add defines for the three SVM's Virtual NMI (vNMI) managements bits in the
    VMCB structure's vintr_t:
    
    vintr_t(11) - Virtual NMI is pending.
    vintr_t(12) - Virtual NMI is masked.
    vintr_t(26) - Enable NMI virtualization.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/vmcb.h        | 8 ++++++--
 xen/arch/x86/include/asm/hvm/svm.h | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 69f6047394..13ccfd3ff9 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -336,13 +336,17 @@ typedef union
         u64 tpr:          8;
         u64 irq:          1;
         u64 vgif:         1;
-        u64 rsvd0:        6;
+        u64 :             1;
+        u64 vnmi_pending: 1;
+        u64 vnmi_blocking:1;
+        u64 :             3;
         u64 prio:         4;
         u64 ign_tpr:      1;
         u64 rsvd1:        3;
         u64 intr_masking: 1;
         u64 vgif_enable:  1;
-        u64 rsvd2:        6;
+        u64 vnmi_enable:  1;
+        u64 :             5;
         u64 vector:       8;
         u64 rsvd3:       24;
     } fields;
diff --git a/xen/arch/x86/include/asm/hvm/svm.h b/xen/arch/x86/include/asm/hvm/svm.h
index 15f0268be7..a35a61273b 100644
--- a/xen/arch/x86/include/asm/hvm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm.h
@@ -37,6 +37,7 @@ extern u32 svm_feature_flags;
 #define SVM_FEATURE_VGIF          16 /* Virtual GIF */
 #define SVM_FEATURE_SSS           19 /* NPT Supervisor Shadow Stacks */
 #define SVM_FEATURE_SPEC_CTRL     20 /* MSR_SPEC_CTRL virtualisation */
+#define SVM_FEATURE_VNMI          25 /* Virtual NMI */
 #define SVM_FEATURE_BUS_LOCK      29 /* Bus Lock Threshold */
 
 static inline bool cpu_has_svm_feature(unsigned int feat)
@@ -57,6 +58,7 @@ static inline bool cpu_has_svm_feature(unsigned int feat)
 #define cpu_has_svm_vloadsave cpu_has_svm_feature(SVM_FEATURE_VLOADSAVE)
 #define cpu_has_svm_sss       cpu_has_svm_feature(SVM_FEATURE_SSS)
 #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL)
+#define cpu_has_svm_vnmi      cpu_has_svm_feature(SVM_FEATURE_VNMI)
 #define cpu_has_svm_bus_lock  cpu_has_svm_feature(SVM_FEATURE_BUS_LOCK)
 
 #define MSR_INTERCEPT_NONE    0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239027.1540431 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUNG-0003iq-8M; Mon, 23 Feb 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 1239027.1540431; Mon, 23 Feb 2026 11: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 1vuUNG-0003ii-5i; Mon, 23 Feb 2026 11:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1239027;
 Mon, 23 Feb 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 1vuUNE-0003iZ-OP
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUNE-0068VF-2L
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:45:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUNE-002p6v-2F
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=x+BgAQANePW2fw1gucq7BPx3Hy5KdZKG2+0eHV39QD0=; b=lseRGXqj/AsMruaTYTA/PDaL2q
	xWutDjJr4hxUKopsn8KdHjUcLEftAR053SvIP6Tqd9xCal19L7WcIJSAcfy3LgWRwAx5qvFA0xZIN
	YSNOUEvcPJGtfwcvsafqa9y5gid5/NdGjCL6RC/4+1/m0FzTS5BJke4Ae6UAF16Tq/cI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] common/domctl: xsm update for get_domain_state access
Message-Id: <E1vuUNE-002p6v-2F@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:45:12 +0000

commit 0c79dde780217935a5c320300e381fc797f5fa19
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Mon Feb 23 08:42:15 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:42:15 2026 +0100

    common/domctl: xsm update for get_domain_state access
    
    When using XSM Flask, passing DOMID_INVALID will result in a NULL pointer
    reference from the passing of NULL as the target domain to
    xsm_get_domain_state(). Simply not invoking xsm_get_domain_state() when the
    target domain is NULL opens the opportunity to circumvent the XSM
    get_domain_state access check. This is due to the fact that the call to
    xsm_domctl() for get_domain_state op is a no-op check, deferring to
    xsm_get_domain_state().
    
    Modify the helper get_domain_state() to ensure the requesting domain has
    get_domain_state access for the target domain, whether the target domain is
    explicitly set or implicitly determined with a domain state search. In the case
    of access not being allowed for a domain found during an implicit search, the
    search will continue to the next domain whose state has changed.
    
    Fixes: 3ad3df1bd0aa ("xen: add new domctl get_domain_state")
    Reported-by: Chris Rogers <rogersc@ainfosec.com>
    Reported-by: Dmytro Firsov <dmytro_firsov@epam.com>
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c | 37 ++++++++++++++++++++++---------------
 xen/common/domctl.c |  7 ++-----
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2e46207d2d..e06174fca7 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -210,7 +210,7 @@ static void set_domain_state_info(struct xen_domctl_get_domain_state *info,
 int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
                      domid_t *domid)
 {
-    unsigned int dom;
+    unsigned int dom = -1;
     int rc = -ENOENT;
     struct domain *hdl;
 
@@ -219,6 +219,10 @@ int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
 
     if ( d )
     {
+        rc = xsm_get_domain_state(XSM_XS_PRIV, d);
+        if ( rc )
+            return rc;
+
         set_domain_state_info(info, d);
 
         return 0;
@@ -238,28 +242,31 @@ int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
 
     while ( dom_state_changed )
     {
-        dom = find_first_bit(dom_state_changed, DOMID_MASK + 1);
+        dom = find_next_bit(dom_state_changed, DOMID_MASK + 1, dom + 1);
         if ( dom >= DOMID_FIRST_RESERVED )
             break;
-        if ( test_and_clear_bit(dom, dom_state_changed) )
-        {
-            *domid = dom;
-
-            d = rcu_lock_domain_by_id(dom);
 
+        d = rcu_lock_domain_by_id(dom);
+        if ( (d && xsm_get_domain_state(XSM_XS_PRIV, d)) ||
+             !test_and_clear_bit(dom, dom_state_changed) )
+        {
             if ( d )
-            {
-                set_domain_state_info(info, d);
-
                 rcu_unlock_domain(d);
-            }
-            else
-                memset(info, 0, sizeof(*info));
+            continue;
+        }
 
-            rc = 0;
+        *domid = dom;
 
-            break;
+        if ( d )
+        {
+            set_domain_state_info(info, d);
+            rcu_unlock_domain(d);
         }
+        else
+            memset(info, 0, sizeof(*info));
+
+        rc = 0;
+        break;
     }
 
  out:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 29a7726d32..93738931c5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -860,12 +860,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         break;
 
     case XEN_DOMCTL_get_domain_state:
-        ret = xsm_get_domain_state(XSM_XS_PRIV, d);
-        if ( ret )
-            break;
-
-        copyback = 1;
         ret = get_domain_state(&op->u.get_domain_state, d, &op->domain);
+        if ( !ret )
+            copyback = true;
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239028.1540434 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUNQ-0003lG-9W; Mon, 23 Feb 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 1239028.1540434; Mon, 23 Feb 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 1vuUNQ-0003l8-72; Mon, 23 Feb 2026 11:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1239028;
 Mon, 23 Feb 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 1vuUNO-0003l1-RY
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUNO-0068VR-2f
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:45:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUNO-002p81-2V
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=srtANdr+fPF+ESO3KA83kGQ5AMoijaaeLhXCT/WB9WI=; b=OPZaWyicD/sajEei/1cgk2a880
	qMKpOhXIkkmbDWOTQ+A1of9bKrJmBl4KvBMfa3dUrp8msLcIRd2b+r+8r6xh793ayhxJHN2uhC1/O
	gjH/Pqyn4Wdzzi0yXkrutyVSCfZFaktVPAg4yw8xCmfKhFfc8WmrRfrRUN4CyQROKhJw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/bitops: adjust partial first word handling in __find_next{,_zero}_bit()
Message-Id: <E1vuUNO-002p81-2V@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:45:22 +0000

commit 0e6f9fbb8a7724e6cb73733a68a60b64f841ea61
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:43:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:43:29 2026 +0100

    x86/bitops: adjust partial first word handling in __find_next{,_zero}_bit()
    
    There's no need to subtract "bit" in what is passed to __scanbit(), as the
    other bits are zero anyway after the shift (in __find_next_bit()) or can
    be made so (in __find_next_zero_bit()) by flipping negation and shift. (We
    actually leverage the same facts in find_next{,_zero}_bit() as well.) This
    way in __scanbit() the TZCNT alternative can be engaged.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/bitops.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/bitops.c b/xen/arch/x86/bitops.c
index 720ab32362..22cfb6d8ec 100644
--- a/xen/arch/x86/bitops.c
+++ b/xen/arch/x86/bitops.c
@@ -35,8 +35,8 @@ unsigned int __find_next_bit(
     if ( bit != 0 )
     {
         /* Look for a bit in the first word. */
-        set = __scanbit(*p >> bit, BITS_PER_LONG - bit);
-        if ( set < (BITS_PER_LONG - bit) )
+        set = __scanbit(*p >> bit, BITS_PER_LONG);
+        if ( set < BITS_PER_LONG )
             return (offset + set);
         offset += BITS_PER_LONG - bit;
         p++;
@@ -85,8 +85,8 @@ unsigned int __find_next_zero_bit(
     if ( bit != 0 )
     {
         /* Look for zero in the first word. */
-        set = __scanbit(~(*p >> bit), BITS_PER_LONG - bit);
-        if ( set < (BITS_PER_LONG - bit) )
+        set = __scanbit(~*p >> bit, BITS_PER_LONG);
+        if ( set < BITS_PER_LONG )
             return (offset + set);
         offset += BITS_PER_LONG - bit;
         p++;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 11:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 11:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239029.1540440 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuUNa-0003nQ-BR; Mon, 23 Feb 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 1239029.1540440; Mon, 23 Feb 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 1vuUNa-0003nH-8P; Mon, 23 Feb 2026 11:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1239029;
 Mon, 23 Feb 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 1vuUNY-0003n9-U4
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuUNY-0068VX-2v
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 11:45:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuUNY-002p9S-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=QbmxV1S4wLwjyt1auJZVNQkcQKoIh+ti/jc656pjrkk=; b=VZ+dTHaay2KC2TJj68tChwQx6o
	DoHtdJ7Da6CKLPidi7xEXHTw6Pl1iVUB2d0VqSzx4Y1Foeqvp3Fo47kKbf8f0w6byEMKN5OMM423N
	yjXx2GFrum/V//pVlaRBqySyEBq/T62qxKGmNI1FZip9+xgN2nlToJAsXgYiGtcdZFnU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/bitops: drop redundant casts from find_next{,_zero}_bit()
Message-Id: <E1vuUNY-002p9S-2p@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 11:45:32 +0000

commit 5eb84d6c992cf4e81936872c441b649057947442
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:43:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:43:46 2026 +0100

    x86/bitops: drop redundant casts from find_next{,_zero}_bit()
    
    It's not clear why they were put in place - a__ is of the very type
    already.
    
    No change in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/bitops.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index b17d67e8ca..69ffed510c 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -343,7 +343,7 @@ static always_inline unsigned int __scanbit(unsigned long val, unsigned int max)
     if ( o__ >= s__ )                                                       \
         r__ = s__;                                                          \
     else if ( __builtin_constant_p(size) && s__ <= BITS_PER_LONG )          \
-        r__ = o__ + __scanbit(*(const unsigned long *)(a__) >> o__, s__);   \
+        r__ = o__ + __scanbit(*a__ >> o__, s__);                            \
     else if ( __builtin_constant_p(off) && !o__ )                           \
         r__ = __find_first_bit(a__, s__);                                   \
     else                                                                    \
@@ -375,7 +375,7 @@ static always_inline unsigned int __scanbit(unsigned long val, unsigned int max)
     if ( o__ >= s__ )                                                       \
         r__ = s__;                                                          \
     else if ( __builtin_constant_p(size) && s__ <= BITS_PER_LONG )          \
-        r__ = o__ + __scanbit(~*(const unsigned long *)(a__) >> o__, s__);  \
+        r__ = o__ + __scanbit(~*a__ >> o__, s__);                           \
     else if ( __builtin_constant_p(off) && !o__ )                           \
         r__ = __find_first_zero_bit(a__, s__);                              \
     else                                                                    \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239055.1540463 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW3c-0000mx-25; Mon, 23 Feb 2026 13:33:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239055.1540463; Mon, 23 Feb 2026 13: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 1vuW3b-0000mp-Vg; Mon, 23 Feb 2026 13:33:03 +0000
Received: by outflank-mailman (input) for mailman id 1239055;
 Mon, 23 Feb 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 1vuW3a-0000mj-7x
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW3a-006Ats-0V
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW3a-002v6f-0O
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=UY3NgVsG3jSMkXx9fF607Hh9X2WUID2Jj6hfJ57eLYs=; b=PtMRZmdvNn5QSlRnQooAiktaJe
	rgmyi6r4vUKdcVRTDbD2tl4CBCeqLDPAEXvN4e8O7xxGdgwRszj16K+S6VI+TS8AZwqN2NKxPN406
	YvApkedsZRo0Jiqo/26kdZDE+HGhiYJopvvJlNoWQNN5OS6MEJ4TUrolBJMLTysDoM0w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: reduce explicit log-dirty recording for HVM
Message-Id: <E1vuW3a-002v6f-0O@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:02 +0000

commit ff78502db07d0c18aa7e1db6b03b59432229d0d0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:37:13 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:37:13 2026 +0100

    x86/shadow: reduce explicit log-dirty recording for HVM
    
    validate_guest_pt_write(), by calling sh_validate_guest_entry(), already
    guarantees the needed update of log-dirty information. Move the
    operation into the sole code path needing it (when SHOPT_SKIP_VERIFY is
    enabled), making clear that only one such call is needed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index bfc81b680a..7b3b58119c 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -665,6 +665,7 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
     {
         /* Writes with this alignment constraint can't possibly cross pages. */
         ASSERT(!mfn_valid(sh_ctxt->mfn[1]));
+        paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
     }
     else
 #endif /* SHADOW_OPTIMIZATIONS & SHOPT_SKIP_VERIFY */
@@ -682,12 +683,10 @@ static void sh_emulate_unmap_dest(struct vcpu *v, void *addr,
             validate_guest_pt_write(v, sh_ctxt->mfn[1], addr + b1, b2);
     }
 
-    paging_mark_dirty(v->domain, sh_ctxt->mfn[0]);
     put_page(mfn_to_page(sh_ctxt->mfn[0]));
 
     if ( unlikely(mfn_valid(sh_ctxt->mfn[1])) )
     {
-        paging_mark_dirty(v->domain, sh_ctxt->mfn[1]);
         put_page(mfn_to_page(sh_ctxt->mfn[1]));
         vunmap((void *)((unsigned long)addr & PAGE_MASK));
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239056.1540467 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW3m-0000on-3K; Mon, 23 Feb 2026 13:33:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239056.1540467; Mon, 23 Feb 2026 13:33: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 1vuW3m-0000of-0m; Mon, 23 Feb 2026 13:33:14 +0000
Received: by outflank-mailman (input) for mailman id 1239056;
 Mon, 23 Feb 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 1vuW3k-0000oM-9A
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW3k-006Au0-0o
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW3k-002v9i-0h
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=44rzbfuKL8lYoNBVLBQ956jLHSYSVyKvTsw0Pq0tdUM=; b=gnSdocc9W1uuPxKeRxQYV7zbp0
	9B/U6O+Q2iTvi0Qm4Ey9drabhXhAnsxLSoWO3SGxvd7URle/ZM4eiNOFYEInk7sN5KCmMAp217Myl
	15vqOKsev+3lzgfM+7Xxa1ToeLYZFjRMUW7jgkDeQR1E8cFmGRapY7aueZ/1K+vQnaoE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: call sh_update_cr3() directly from sh_page_fault()
Message-Id: <E1vuW3k-002v9i-0h@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:12 +0000

commit 5d45c8202d4e2a87beefd4f71db2e35134e204c9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:37:49 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:37:49 2026 +0100

    x86/shadow: call sh_update_cr3() directly from sh_page_fault()
    
    There's no need for an indirect call here, as the mode is invariant
    throughout the entire paging-locked region. All it takes to avoid it is
    to have a forward declaration of sh_update_cr3() in place.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 3bbaceec12..e13cc602b9 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -79,6 +79,8 @@ const char *const fetch_type_names[] = {
 # define for_each_shadow_table(v, i) for ( (i) = 0; (i) < 1; ++(i) )
 #endif
 
+static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush);
+
 /* Helper to perform a local TLB flush. */
 static void sh_flush_local(const struct domain *d)
 {
@@ -2478,7 +2480,7 @@ static int cf_check sh_page_fault(
          * In any case, in the PAE case, the ASSERT is not true; it can
          * happen because of actions the guest is taking. */
 #if GUEST_PAGING_LEVELS == 3
-        v->arch.paging.mode->update_cr3(v, false);
+        sh_update_cr3(v, false);
 #else
         ASSERT(d->is_shutting_down);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239057.1540471 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW3w-0000rM-4l; Mon, 23 Feb 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 1239057.1540471; Mon, 23 Feb 2026 13:33: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 1vuW3w-0000rC-27; Mon, 23 Feb 2026 13:33:24 +0000
Received: by outflank-mailman (input) for mailman id 1239057;
 Mon, 23 Feb 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 1vuW3u-0000ql-E2
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW3u-006AwT-18
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW3u-002vAG-10
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=dwZ540+VrNzSAChDLYA5K97AaU8xOUUEz14ADAQRuR0=; b=tqTaWp1FwJRvCXP4tusJQCyJqg
	gZvkhBWYHGdnC+rUZddkXKqRDnzQLkFdZ7YdkplpWQrH+k5vYdZmW7aY+dtd5tO8Wwdw4RvonFSr1
	JOTF2XZQ5bK7P7J7S+PkZK44XoCPUgBNIzU91c0UZffrihQRbrFrLcNe6y/KekLvcS94=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: don't generate bogus "domain dying" trace entry from sh_page_fault()
Message-Id: <E1vuW3u-002vAG-10@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:22 +0000

commit cbfed8361b679676193f4dfe366fe39992566c51
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:38:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:38:07 2026 +0100

    x86/shadow: don't generate bogus "domain dying" trace entry from sh_page_fault()
    
    When in 3-level guest mode we help a guest to stay alive, we also
    shouldn't emit a trace entry to the contrary. Move the invocation up
    into the respective #ifdef, noting that while this moves it into the
    locked region, emitting trace records with the paging lock held is okay
    (as done elsewhere as well), just needlessly increasing lock holding
    time a little.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index e13cc602b9..b63046fd4f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -2483,10 +2483,10 @@ static int cf_check sh_page_fault(
         sh_update_cr3(v, false);
 #else
         ASSERT(d->is_shutting_down);
+        sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
 #endif
         paging_unlock(d);
         put_gfn(d, gfn_x(gfn));
-        sh_trace_va(TRC_SHADOW_DOMF_DYING, va);
         return 0;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239058.1540474 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW46-0000tU-62; Mon, 23 Feb 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 1239058.1540474; Mon, 23 Feb 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 1vuW46-0000tM-3U; Mon, 23 Feb 2026 13:33:34 +0000
Received: by outflank-mailman (input) for mailman id 1239058;
 Mon, 23 Feb 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 1vuW44-0000tF-FT
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW44-006Awb-1R
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW44-002vAw-1K
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=IvHVqmaQECfTfP8TKUizdKuAjyQaWc4zrjzq66sea44=; b=Ab++5eDhwR8wVHATntwZ+lsI2J
	P9qB/ndjjoCpAsRn+sQ55dKvyhSE4TEiSGORAqFQ3L0YiGHlH0/dDVbeSNsMDHa/F+vTpdPPvSehp
	u+C/SJhJingcLe4LHXw1pLNbL1qYsb0+tJpAbxM3Fa9jygJg6Aggwj4NU2DnUGq/Bmy0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: use lighter-weight mode checks
Message-Id: <E1vuW44-002vAw-1K@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:32 +0000

commit 20f7edd97cb86e9ae4c7e4aed541e368bb00d5ba
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:38:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:38:48 2026 +0100

    x86/shadow: use lighter-weight mode checks
    
    shadow_mode_...(), with the exception of shadow_mode_enabled(), are
    shorthands for shadow_mode_enabled() && paging_mode_...(). While
    potentially useful outside of shadow-internal functions, when we already
    know that we're dealing with a domain in shadow mode, the "paging"
    checks are sufficient and cheaper. While the "shadow" ones commonly
    translate to a MOV/AND/CMP/Jcc sequence, the "paging" ones typically
    resolve to just TEST+Jcc.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c  | 10 +++++-----
 xen/arch/x86/mm/shadow/multi.c   | 36 ++++++++++++++++++------------------
 xen/arch/x86/mm/shadow/private.h |  6 +++---
 xen/arch/x86/mm/shadow/set.c     |  6 +++---
 xen/arch/x86/mm/shadow/types.h   |  2 +-
 5 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 96986ee255..6d44d9ad1d 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1276,7 +1276,7 @@ int sh_remove_write_access(struct domain *d, mfn_t gmfn,
      * In guest refcounting, we trust Xen to already be restricting
      * all the writes to the guest page tables, so we do not need to
      * do more. */
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         return 0;
 
     /* Early exit if it's already a pagetable, or otherwise not writeable */
@@ -1508,7 +1508,7 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
          *   guest pages with an extra reference taken by
          *   prepare_ring_for_helper().
          */
-        if ( !(shadow_mode_external(d)
+        if ( !(paging_mode_external(d)
                && (page->count_info & PGC_count_mask) <= 3
                && ((page->u.inuse.type_info & PGT_count_mask)
                    == (is_special_page(page) ||
@@ -1806,8 +1806,8 @@ static void sh_update_paging_modes(struct vcpu *v)
     {
         const struct paging_mode *old_mode = v->arch.paging.mode;
 
-        ASSERT(shadow_mode_translate(d));
-        ASSERT(shadow_mode_external(d));
+        ASSERT(paging_mode_translate(d));
+        ASSERT(paging_mode_external(d));
 
 #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC)
         /* Need to resync all our pages now, because if a page goes out
@@ -2211,7 +2211,7 @@ void shadow_vcpu_teardown(struct vcpu *v)
 
     sh_detach_old_tables(v);
 #ifdef CONFIG_HVM
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         mfn_t mfn = pagetable_get_mfn(v->arch.hvm.monitor_table);
 
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b63046fd4f..ade4b2dbe3 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -519,7 +519,7 @@ _sh_propagate(struct vcpu *v,
                || (level == 1
                    && page_get_owner(mfn_to_page(target_mfn)) == dom_io);
     if ( mmio_mfn
-         && !(level == 1 && (!shadow_mode_refcounts(d)
+         && !(level == 1 && (!paging_mode_refcounts(d)
                              || p2mt == p2m_mmio_direct)) )
     {
         ASSERT((ft == ft_prefetch));
@@ -536,7 +536,7 @@ _sh_propagate(struct vcpu *v,
                        _PAGE_RW | _PAGE_PRESENT);
     if ( guest_nx_enabled(v) )
         pass_thru_flags |= _PAGE_NX_BIT;
-    if ( level == 1 && !shadow_mode_refcounts(d) && mmio_mfn )
+    if ( level == 1 && !paging_mode_refcounts(d) && mmio_mfn )
         pass_thru_flags |= PAGE_CACHE_ATTRS;
     sflags = gflags & pass_thru_flags;
 
@@ -656,7 +656,7 @@ _sh_propagate(struct vcpu *v,
      * (We handle log-dirty entirely inside the shadow code, without using the
      * p2m_ram_logdirty p2m type: only HAP uses that.)
      */
-    if ( level == 1 && unlikely(shadow_mode_log_dirty(d)) && !mmio_mfn )
+    if ( level == 1 && unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
     {
         if ( ft & FETCH_TYPE_WRITE )
             paging_mark_dirty(d, target_mfn);
@@ -812,7 +812,7 @@ do {                                                                    \
 #define FOREACH_PRESENT_L2E(_sl2mfn, _sl2e, _gl2p, _done, _dom, _code)    \
 do {                                                                      \
     int _i, _j;                                                           \
-    ASSERT(shadow_mode_external(_dom));                                   \
+    ASSERT(paging_mode_external(_dom));                                   \
     ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_32_shadow);      \
     for ( _j = 0; _j < 4; _j++ )                                          \
     {                                                                     \
@@ -838,7 +838,7 @@ do {                                                                      \
 do {                                                                       \
     int _i;                                                                \
     shadow_l2e_t *_sp = map_domain_page((_sl2mfn));                        \
-    ASSERT(shadow_mode_external(_dom));                                    \
+    ASSERT(paging_mode_external(_dom));                                    \
     ASSERT(mfn_to_page(_sl2mfn)->u.sh.type == SH_type_l2_pae_shadow);      \
     for ( _i = 0; _i < SHADOW_L2_PAGETABLE_ENTRIES; _i++ )                 \
     {                                                                      \
@@ -859,7 +859,7 @@ do {                                                                        \
     unsigned int _i, _end = 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 !shadow_mode_external */ &&    \
+    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 )                                         \
@@ -901,7 +901,7 @@ do {                                                                    \
 #define FOREACH_PRESENT_L4E(_sl4mfn, _sl4e, _gl4p, _done, _dom, _code)  \
 do {                                                                    \
     shadow_l4e_t *_sp = map_domain_page((_sl4mfn));                     \
-    int _xen = !shadow_mode_external(_dom);                             \
+    int _xen = !paging_mode_external(_dom);                             \
     int _i;                                                             \
     ASSERT(mfn_to_page(_sl4mfn)->u.sh.type == SH_type_l4_64_shadow);\
     for ( _i = 0; _i < SHADOW_L4_PAGETABLE_ENTRIES; _i++ )              \
@@ -970,7 +970,7 @@ sh_make_shadow(struct vcpu *v, mfn_t gmfn, u32 shadow_type)
 #endif
 
     // Create the Xen mappings...
-    if ( !shadow_mode_external(d) )
+    if ( !paging_mode_external(d) )
     {
         switch (shadow_type)
         {
@@ -1372,7 +1372,7 @@ void sh_destroy_l1_shadow(struct domain *d, mfn_t smfn)
         shadow_demote(d, gmfn, t);
     }
 
-    if ( shadow_mode_refcounts(d) )
+    if ( paging_mode_refcounts(d) )
     {
         /* Decrement refcounts of all the old entries */
         mfn_t sl1mfn = smfn;
@@ -1469,7 +1469,7 @@ static int cf_check validate_gl4e(
     l4e_propagate_from_guest(v, new_gl4e, sl3mfn, &new_sl4e, ft_prefetch);
 
     // check for updates to xen reserved slots
-    if ( !shadow_mode_external(d) )
+    if ( !paging_mode_external(d) )
     {
         int shadow_index = (((unsigned long)sl4p & ~PAGE_MASK) /
                             sizeof(shadow_l4e_t));
@@ -2390,7 +2390,7 @@ static int cf_check sh_page_fault(
      * present entry) we'd get back right here immediately afterwards, thus
      * preventing the guest from making further forward progress.
      */
-    if ( shadow_mode_refcounts(d) &&
+    if ( paging_mode_refcounts(d) &&
          !p2m_is_mmio(p2mt) &&
          (!p2m_is_any_ram(p2mt) || !mfn_valid(gmfn)) )
     {
@@ -2614,7 +2614,7 @@ static int cf_check sh_page_fault(
     return EXCRET_fault_fixed;
 
  emulate:
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         goto not_a_shadow_fault;
 
 #ifdef CONFIG_HVM
@@ -3063,7 +3063,7 @@ sh_update_linear_entries(struct vcpu *v)
      */
 
     /* Don't try to update the monitor table if it doesn't exist */
-    if ( !shadow_mode_external(d) ||
+    if ( !paging_mode_external(d) ||
          pagetable_get_pfn(v->arch.hvm.monitor_table) == 0 )
         return;
 
@@ -3214,7 +3214,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     /* Double-check that the HVM code has sent us a sane guest_table */
     if ( is_hvm_domain(d) )
     {
-        ASSERT(shadow_mode_external(d));
+        ASSERT(paging_mode_external(d));
         if ( hvm_paging_enabled(v) )
             ASSERT(pagetable_get_pfn(v->arch.guest_table));
         else
@@ -3239,7 +3239,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
      * table.  We cache the current state of that table and shadow that,
      * until the next CR3 write makes us refresh our cache.
      */
-    ASSERT(shadow_mode_external(d));
+    ASSERT(paging_mode_external(d));
 
     /*
      * Find where in the page the l3 table is, but ignore the low 2 bits of
@@ -3271,7 +3271,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
         ASSERT(d->is_dying || d->is_shutting_down);
         return old_entry;
     }
-    if ( !shadow_mode_external(d) && !is_pv_32bit_domain(d) )
+    if ( !paging_mode_external(d) && !is_pv_32bit_domain(d) )
     {
         mfn_t smfn = pagetable_get_mfn(v->arch.paging.shadow.shadow_table[0]);
 
@@ -3371,7 +3371,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ///
     /// v->arch.cr3
     ///
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         make_cr3(v, pagetable_get_mfn(v->arch.hvm.monitor_table));
     }
@@ -3388,7 +3388,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
     ///
     /// v->arch.hvm.hw_cr[3]
     ///
-    if ( shadow_mode_external(d) )
+    if ( paging_mode_external(d) )
     {
         ASSERT(is_hvm_domain(d));
 #if SHADOW_PAGING_LEVELS == 3
diff --git a/xen/arch/x86/mm/shadow/private.h b/xen/arch/x86/mm/shadow/private.h
index 6420ec4645..8c8e29a021 100644
--- a/xen/arch/x86/mm/shadow/private.h
+++ b/xen/arch/x86/mm/shadow/private.h
@@ -399,7 +399,7 @@ static inline int sh_remove_write_access(struct domain *d, mfn_t gmfn,
                                          unsigned int level,
                                          unsigned long fault_addr)
 {
-    ASSERT(!shadow_mode_refcounts(d));
+    ASSERT(!paging_mode_refcounts(d));
     return 0;
 }
 #endif
@@ -523,8 +523,8 @@ sh_mfn_is_a_page_table(mfn_t gmfn)
 
     page = mfn_to_page(gmfn);
     owner = page_get_owner(page);
-    if ( owner && shadow_mode_refcounts(owner)
-         && (page->count_info & PGC_shadowed_pt) )
+    if ( owner && paging_mode_refcounts(owner) &&
+         (page->count_info & PGC_shadowed_pt) )
         return 1;
 
     type_info = page->u.inuse.type_info & PGT_type_mask;
diff --git a/xen/arch/x86/mm/shadow/set.c b/xen/arch/x86/mm/shadow/set.c
index 8b670b6bb5..8f9690f0df 100644
--- a/xen/arch/x86/mm/shadow/set.c
+++ b/xen/arch/x86/mm/shadow/set.c
@@ -81,7 +81,7 @@ shadow_get_page_from_l1e(shadow_l1e_t sl1e, struct domain *d, p2m_type_t type)
     struct domain *owner = NULL;
 
     ASSERT(!sh_l1e_is_magic(sl1e));
-    ASSERT(shadow_mode_refcounts(d));
+    ASSERT(paging_mode_refcounts(d));
 
     if ( mfn_valid(mfn) )
     {
@@ -342,7 +342,7 @@ int shadow_set_l1e(struct domain *d, shadow_l1e_t *sl1e,
          !sh_l1e_is_magic(new_sl1e) )
     {
         /* About to install a new reference */
-        if ( shadow_mode_refcounts(d) )
+        if ( paging_mode_refcounts(d) )
         {
 #define PAGE_FLIPPABLE (_PAGE_RW | _PAGE_PWT | _PAGE_PCD | _PAGE_PAT)
             int rc;
@@ -375,7 +375,7 @@ int shadow_set_l1e(struct domain *d, shadow_l1e_t *sl1e,
 
     old_sl1f = shadow_l1e_get_flags(old_sl1e);
     if ( (old_sl1f & _PAGE_PRESENT) && !sh_l1e_is_magic(old_sl1e) &&
-         shadow_mode_refcounts(d) )
+         paging_mode_refcounts(d) )
     {
         /*
          * We lost a reference to an old mfn.
diff --git a/xen/arch/x86/mm/shadow/types.h b/xen/arch/x86/mm/shadow/types.h
index d700d8d64c..09e443d1b6 100644
--- a/xen/arch/x86/mm/shadow/types.h
+++ b/xen/arch/x86/mm/shadow/types.h
@@ -262,7 +262,7 @@ int shadow_set_l4e(struct domain *d, shadow_l4e_t *sl4e,
 static void inline
 shadow_put_page_from_l1e(shadow_l1e_t sl1e, struct domain *d)
 {
-    if ( !shadow_mode_refcounts(d) )
+    if ( !paging_mode_refcounts(d) )
         return;
 
     put_page_from_l1e(sl1e, d);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239059.1540478 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW4G-0000vV-7i; Mon, 23 Feb 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 1239059.1540478; Mon, 23 Feb 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 1vuW4G-0000vN-4w; Mon, 23 Feb 2026 13:33:44 +0000
Received: by outflank-mailman (input) for mailman id 1239059;
 Mon, 23 Feb 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 1vuW4E-0000vF-Hs
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW4E-006Awf-1h
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW4E-002vBt-1b
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=MCZTLhCOOv7qSVJtkVXCYnYCgctxAcjvmxTThHxwoag=; b=69ldp6F12FBXk/eIcvnLOIAskS
	0xzPCDcdwptt5zgLQUbQU1iDc1XPSKUttLUpWq0+PmmMvc8UqwceBVk/Xsl1vWgrYvY6Dkuqop77F
	ytIpZuUTTXTe+DgFtuxq9OZzA2jNz+WR+9BwaRZHvsH2szUzxmWBvVHjr88QcteO9WTA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/MCE: restore CPU vendor reporting to the outside world
Message-Id: <E1vuW4E-002vBt-1b@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:42 +0000

commit a94c5fd8290a55461c599b8baad309df0d929f1f
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:39:58 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:39:58 2026 +0100

    x86/MCE: restore CPU vendor reporting to the outside world
    
    The records reported used to contain Linux enumerators. We first broke
    that connection when purging unused ones, and then again when switching to
    the bit mask forms.
    
    Fixes: 408413051144 ("x86/cpu: Drop unused X86_VENDOR_* values")
    Fixes: 0cd074144cbb ("x86/cpu: Renumber X86_VENDOR_* to form a bitmap")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---
 xen/arch/x86/cpu/mcheck/mce.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 9277781bff..9a91807cfb 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -858,6 +858,22 @@ void *x86_mcinfo_reserve(struct mc_info *mi,
     return mic_index;
 }
 
+/* Linux values need using when reporting CPU vendors to the outside. */
+static unsigned int xen2linux_vendor(unsigned int vendor)
+{
+    switch ( vendor )
+    {
+    case X86_VENDOR_INTEL:    return 0;
+    case X86_VENDOR_AMD:      return 2;
+    case X86_VENDOR_CENTAUR:  return 5;
+    case X86_VENDOR_HYGON:    return 9;
+    case X86_VENDOR_SHANGHAI: return 10; /* X86_VENDOR_ZHAOXIN */
+    default: break;
+    }
+
+    return 0xff; /* X86_VENDOR_UNKNOWN */
+}
+
 static void x86_mcinfo_apei_save(
     struct mcinfo_global *mc_global, struct mcinfo_bank *mc_bank)
 {
@@ -866,7 +882,7 @@ static void x86_mcinfo_apei_save(
     memset(&m, 0, sizeof(struct mce));
 
     m.cpu = mc_global->mc_coreid;
-    m.cpuvendor = boot_cpu_data.x86_vendor;
+    m.cpuvendor = xen2linux_vendor(boot_cpu_data.x86_vendor);
     m.cpuid = cpuid_eax(1);
     m.socketid = mc_global->mc_socketid;
     m.apicid = mc_global->mc_apicid;
@@ -968,7 +984,7 @@ static void cf_check __maybe_unused do_mc_get_cpu_info(void *v)
                         &xcp->mc_ncores_active, &xcp->mc_nthreads);
     xcp->mc_cpuid_level = c->cpuid_level;
     xcp->mc_family = c->x86;
-    xcp->mc_vendor = c->x86_vendor;
+    xcp->mc_vendor = xen2linux_vendor(c->x86_vendor);
     xcp->mc_model = c->x86_model;
     xcp->mc_step = c->x86_mask;
     xcp->mc_cache_size = c->x86_cache_size;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:33:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:33:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239060.1540483 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW4Q-0000y9-Aa; Mon, 23 Feb 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 1239060.1540483; Mon, 23 Feb 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 1vuW4Q-0000y1-7y; Mon, 23 Feb 2026 13:33:54 +0000
Received: by outflank-mailman (input) for mailman id 1239060;
 Mon, 23 Feb 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 1vuW4O-0000xt-Kp
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW4O-006Awn-1z
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:33:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW4O-002vCR-1t
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=PVX6F9rOBfXUr74eooPcgTfd37N6WVDirBOi5eJ29/A=; b=2wCq8jtPsGr4oGesN2xO0AGnFm
	ve3Hs0McFQL+zEg2OznctTpjHGFg/rk0LBfUblLf4S8f0wjc0BFmoNvE2dnit/tcFImW8x1Cbjp4t
	6jsBcyoJDVDJls55g8bs/WytWbn5J1dl5BbP5/c+wqJiNaZzJdJ4RN2Z2zJERIpqHu68=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: don't use #if in macro invocations
Message-Id: <E1vuW4O-002vCR-1t@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:33:52 +0000

commit e2d4157fb5945d8f9e2ad76304b8493c8b6d1111
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:41:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:41:07 2026 +0100

    x86/shadow: don't use #if in macro invocations
    
    As per the standard this is UB, i.e. we're building on a defacto extension
    in the compilers we use. Misra C:2012 rule 20.6 disallows this altogether,
    though. Use helper always-inline functions instead.
    
    In sh_audit_l1_table(), along with reducing the scope of "gfn", which now
    isn't used anymore by the if() side of the conditional, also reduce the
    scope of two other adjacent variables.
    
    For audit_magic() note that both which parameters are needed and what
    their types are is attributed to AUDIT_FAIL() accessing variables which
    aren't passed as arguments to it.
    
    No functional change intended. Of course codegen does change with this,
    first and foremost in register allocation.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/mm/shadow/multi.c | 101 +++++++++++++++++++++++++----------------
 1 file changed, 61 insertions(+), 40 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index ade4b2dbe3..b1cb9aad1f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -397,7 +397,7 @@ static inline mfn_t cf_check sh_next_page(mfn_t smfn)
     shadow_set_l2e(d, sl2e, new_sl2e, sl2mfn, SH_type_fl1_shadow, sh_next_page)
 
 static inline u32
-guest_index(void *ptr)
+guest_index(const void *ptr)
 {
     return (u32)((unsigned long)ptr & ~PAGE_MASK) / sizeof(guest_l1e_t);
 }
@@ -3551,16 +3551,25 @@ static int cf_check sh_guess_wrmap(
 }
 #endif
 
+/* Remember the last shadow that we shot a writeable mapping in */
+static always_inline void store_last_writeable_pte_smfn(
+    const struct domain *d, mfn_t sl1mfn)
+{
+#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
+    struct vcpu *curr = current;
+
+    if ( curr->domain == d )
+        curr->arch.paging.shadow.last_writeable_pte_smfn = mfn_x(sl1mfn);
+#endif
+}
+
 int cf_check sh_rm_write_access_from_l1(
     struct domain *d, mfn_t sl1mfn, mfn_t readonly_mfn)
 /* Excises all writeable mappings to readonly_mfn from this l1 shadow table */
 {
     shadow_l1e_t *sl1e;
     int done = 0;
-#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
-    struct vcpu *curr = current;
     mfn_t base_sl1mfn = sl1mfn; /* Because sl1mfn changes in the foreach */
-#endif
 
     FOREACH_PRESENT_L1E(sl1mfn, sl1e, NULL, done,
     {
@@ -3570,11 +3579,9 @@ int cf_check sh_rm_write_access_from_l1(
             shadow_l1e_t ro_sl1e = shadow_l1e_remove_flags(*sl1e, _PAGE_RW);
 
             shadow_set_l1e(d, sl1e, ro_sl1e, p2m_ram_rw, sl1mfn);
-#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
-            /* Remember the last shadow that we shot a writeable mapping in */
-            if ( curr->domain == d )
-                curr->arch.paging.shadow.last_writeable_pte_smfn = mfn_x(base_sl1mfn);
-#endif
+
+            store_last_writeable_pte_smfn(d, base_sl1mfn);
+
             if ( (mfn_to_page(readonly_mfn)->u.inuse.type_info
                   & PGT_count_mask) == 0 )
                 /* This breaks us cleanly out of the FOREACH macro */
@@ -3884,12 +3891,36 @@ static const char *sh_audit_flags(const struct domain *d, int level,
     return NULL;
 }
 
+static always_inline bool audit_magic(
+    const guest_l1e_t *gl1e, mfn_t gl1mfn,
+    const shadow_l1e_t *sl1e, mfn_t sl1mfn)
+{
+    bool done = false;
+
+#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH
+    if ( !sh_l1e_is_gnp(*sl1e) )
+    {
+        gfn_t gfn = sh_l1e_mmio_get_gfn(*sl1e);
+
+        ASSERT(sh_l1e_is_mmio(*sl1e));
+
+        if ( !gfn_eq(gfn, guest_l1e_get_gfn(*gl1e)) )
+            AUDIT_FAIL(1,
+                       "shadow MMIO gfn is %" SH_PRI_gfn " but guest gfn is %" SH_PRI_gfn,
+                       gfn_x(gfn), gfn_x(guest_l1e_get_gfn(*gl1e)));
+    }
+    else if ( guest_l1e_get_flags(*gl1e) & _PAGE_PRESENT )
+        AUDIT_FAIL(1, "shadow is GNP magic but guest is present");
+#endif
+
+    return done;
+}
+
 int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 {
     guest_l1e_t *gl1e, *gp;
     shadow_l1e_t *sl1e;
-    mfn_t mfn, gmfn, gl1mfn;
-    gfn_t gfn;
+    mfn_t gl1mfn;
     p2m_type_t p2mt;
     const char *s;
     int done = 0;
@@ -3908,28 +3939,10 @@ int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 #endif
 
     gl1e = gp = map_domain_page(gl1mfn);
-    FOREACH_PRESENT_L1E(sl1mfn, sl1e, &gl1e, done, {
-
+    FOREACH_PRESENT_L1E(sl1mfn, sl1e, &gl1e, done,
+    {
         if ( sh_l1e_is_magic(*sl1e) )
-        {
-#if (SHADOW_OPTIMIZATIONS & SHOPT_FAST_FAULT_PATH)
-            if ( sh_l1e_is_gnp(*sl1e) )
-            {
-                if ( guest_l1e_get_flags(*gl1e) & _PAGE_PRESENT )
-                    AUDIT_FAIL(1, "shadow is GNP magic but guest is present");
-            }
-            else
-            {
-                ASSERT(sh_l1e_is_mmio(*sl1e));
-                gfn = sh_l1e_mmio_get_gfn(*sl1e);
-                if ( gfn_x(gfn) != gfn_x(guest_l1e_get_gfn(*gl1e)) )
-                    AUDIT_FAIL(1, "shadow MMIO gfn is %" SH_PRI_gfn
-                               " but guest gfn is %" SH_PRI_gfn,
-                               gfn_x(gfn),
-                               gfn_x(guest_l1e_get_gfn(*gl1e)));
-            }
-#endif
-        }
+            done = audit_magic(gl1e, gl1mfn, sl1e, sl1mfn);
         else
         {
             s = sh_audit_flags(d, 1, guest_l1e_get_flags(*gl1e),
@@ -3938,9 +3951,10 @@ int cf_check sh_audit_l1_table(struct domain *d, mfn_t sl1mfn, mfn_t x)
 
             if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_MFNS )
             {
-                gfn = guest_l1e_get_gfn(*gl1e);
-                mfn = shadow_l1e_get_mfn(*sl1e);
-                gmfn = get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt);
+                gfn_t gfn = guest_l1e_get_gfn(*gl1e);
+                mfn_t mfn = shadow_l1e_get_mfn(*sl1e);
+                mfn_t gmfn = get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt);
+
                 if ( !p2m_is_grant(p2mt) && !mfn_eq(gmfn, mfn) )
                     AUDIT_FAIL(1, "bad translation: gfn %" SH_PRI_gfn
                                " --> %" PRI_mfn " != mfn %" PRI_mfn,
@@ -4029,6 +4043,17 @@ int cf_check sh_audit_l2_table(struct domain *d, mfn_t sl2mfn, mfn_t x)
 }
 
 #if GUEST_PAGING_LEVELS >= 4
+static always_inline unsigned int type_from_gl3e(
+    const struct domain *d, const guest_l3e_t *gl3e)
+{
+#ifdef CONFIG_PV32
+    if ( guest_index(gl3e) == 3 && is_pv_32bit_domain(d) )
+        return SH_type_l2h_shadow;
+#endif
+
+    return SH_type_l2_shadow;
+}
+
 int cf_check sh_audit_l3_table(struct domain *d, mfn_t sl3mfn, mfn_t x)
 {
     guest_l3e_t *gl3e, *gp;
@@ -4058,14 +4083,10 @@ int cf_check sh_audit_l3_table(struct domain *d, mfn_t sl3mfn, mfn_t x)
 
         if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_MFNS )
         {
-            unsigned int t = SH_type_l2_shadow;
+            unsigned int t = type_from_gl3e(d, gl3e);
 
             gfn = guest_l3e_get_gfn(*gl3e);
             mfn = shadow_l3e_get_mfn(*sl3e);
-#ifdef CONFIG_PV32
-            if ( guest_index(gl3e) == 3 && is_pv_32bit_domain(d) )
-                t = SH_type_l2h_shadow;
-#endif
             gmfn = get_shadow_status(
                        d, get_gfn_query_unlocked(d, gfn_x(gfn), &p2mt), t);
             if ( !mfn_eq(gmfn, mfn) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:34:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:34:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239061.1540487 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW4a-00010N-C4; Mon, 23 Feb 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 1239061.1540487; Mon, 23 Feb 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 1vuW4a-00010F-9J; Mon, 23 Feb 2026 13:34:04 +0000
Received: by outflank-mailman (input) for mailman id 1239061;
 Mon, 23 Feb 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 1vuW4Y-000105-PK
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW4Y-006AxQ-2Q
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:34:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW4Y-002vDN-2A
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=3DBfRNvYGxBzsCOx+UxyEXhMgiB9cjxgAXfdxT53G8s=; b=PtSAREAGZrwdGJc+tt4LwqRmZO
	fviK/8C5elJpMKzrGScOY7KyAA6TNM7o/gy4HYarAXnsXvY8D5rFAQ5PAu/yChZlCXXy/4+tdxj7P
	rnTlkE7I/Ng0bwxq2ZatNYaoO8n0sncluN4Rip2yHtaMdyiDP3xcnux2g5is1cB5ncoE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/svm: Add Enumerations for the SVM virtual NMI
Message-Id: <E1vuW4Y-002vDN-2A@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:34:02 +0000

commit 0294292b4ca6d90e18cb66912d18b88576dd2733
Author:     Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
AuthorDate: Mon Feb 23 08:41:32 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:41:32 2026 +0100

    x86/svm: Add Enumerations for the SVM virtual NMI
    
    Introduce the cpuid bit for the SVM vNMI feature support for the x86\AMD
    platforms. The feature support is indicated by the CPUID
    Fn8000_000A_EDX[25] = 1.
    
    Add defines for the three SVM's Virtual NMI (vNMI) managements bits in the
    VMCB structure's vintr_t:
    
    vintr_t(11) - Virtual NMI is pending.
    vintr_t(12) - Virtual NMI is masked.
    vintr_t(26) - Enable NMI virtualization.
    
    Signed-off-by: Abdelkareem Abdelsaamad <abdelkareem.abdelsaamad@citrix.com>
    Reviewed-by: Teddy Astie <teddy.astie@vates.tech>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/svm/vmcb.h        | 8 ++++++--
 xen/arch/x86/include/asm/hvm/svm.h | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index 69f6047394..13ccfd3ff9 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -336,13 +336,17 @@ typedef union
         u64 tpr:          8;
         u64 irq:          1;
         u64 vgif:         1;
-        u64 rsvd0:        6;
+        u64 :             1;
+        u64 vnmi_pending: 1;
+        u64 vnmi_blocking:1;
+        u64 :             3;
         u64 prio:         4;
         u64 ign_tpr:      1;
         u64 rsvd1:        3;
         u64 intr_masking: 1;
         u64 vgif_enable:  1;
-        u64 rsvd2:        6;
+        u64 vnmi_enable:  1;
+        u64 :             5;
         u64 vector:       8;
         u64 rsvd3:       24;
     } fields;
diff --git a/xen/arch/x86/include/asm/hvm/svm.h b/xen/arch/x86/include/asm/hvm/svm.h
index 15f0268be7..a35a61273b 100644
--- a/xen/arch/x86/include/asm/hvm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm.h
@@ -37,6 +37,7 @@ extern u32 svm_feature_flags;
 #define SVM_FEATURE_VGIF          16 /* Virtual GIF */
 #define SVM_FEATURE_SSS           19 /* NPT Supervisor Shadow Stacks */
 #define SVM_FEATURE_SPEC_CTRL     20 /* MSR_SPEC_CTRL virtualisation */
+#define SVM_FEATURE_VNMI          25 /* Virtual NMI */
 #define SVM_FEATURE_BUS_LOCK      29 /* Bus Lock Threshold */
 
 static inline bool cpu_has_svm_feature(unsigned int feat)
@@ -57,6 +58,7 @@ static inline bool cpu_has_svm_feature(unsigned int feat)
 #define cpu_has_svm_vloadsave cpu_has_svm_feature(SVM_FEATURE_VLOADSAVE)
 #define cpu_has_svm_sss       cpu_has_svm_feature(SVM_FEATURE_SSS)
 #define cpu_has_svm_spec_ctrl cpu_has_svm_feature(SVM_FEATURE_SPEC_CTRL)
+#define cpu_has_svm_vnmi      cpu_has_svm_feature(SVM_FEATURE_VNMI)
 #define cpu_has_svm_bus_lock  cpu_has_svm_feature(SVM_FEATURE_BUS_LOCK)
 
 #define MSR_INTERCEPT_NONE    0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:34:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239062.1540492 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW4k-00012U-Di; Mon, 23 Feb 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 1239062.1540492; Mon, 23 Feb 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 1vuW4k-00012M-As; Mon, 23 Feb 2026 13:34:14 +0000
Received: by outflank-mailman (input) for mailman id 1239062;
 Mon, 23 Feb 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 1vuW4i-00012C-TJ
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW4i-006AxU-2p
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:34:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW4i-002vDo-2b
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=mZm0WZPwX2YEKgdZMjFejX4CqbrgeSJgsp0jPTQjLj0=; b=BvCaEl5dzLqQBLxUR6FeiG4m5B
	8sB/5C4o5WJmg7e3A7gylJ3pUoW97OBwmMK+3usUI0vdqjH5a1DYNgGIuE0Hz0UNvc3XHc+JPIzaF
	clL/Uz3MH17OQMSBjKTt+6ulaugN0MuKnAFNlZ34/hOr+oYHHZLSlI0k4iVY2G9aVqjg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] common/domctl: xsm update for get_domain_state access
Message-Id: <E1vuW4i-002vDo-2b@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:34:12 +0000

commit 0c79dde780217935a5c320300e381fc797f5fa19
Author:     Daniel P. Smith <dpsmith@apertussolutions.com>
AuthorDate: Mon Feb 23 08:42:15 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:42:15 2026 +0100

    common/domctl: xsm update for get_domain_state access
    
    When using XSM Flask, passing DOMID_INVALID will result in a NULL pointer
    reference from the passing of NULL as the target domain to
    xsm_get_domain_state(). Simply not invoking xsm_get_domain_state() when the
    target domain is NULL opens the opportunity to circumvent the XSM
    get_domain_state access check. This is due to the fact that the call to
    xsm_domctl() for get_domain_state op is a no-op check, deferring to
    xsm_get_domain_state().
    
    Modify the helper get_domain_state() to ensure the requesting domain has
    get_domain_state access for the target domain, whether the target domain is
    explicitly set or implicitly determined with a domain state search. In the case
    of access not being allowed for a domain found during an implicit search, the
    search will continue to the next domain whose state has changed.
    
    Fixes: 3ad3df1bd0aa ("xen: add new domctl get_domain_state")
    Reported-by: Chris Rogers <rogersc@ainfosec.com>
    Reported-by: Dmytro Firsov <dmytro_firsov@epam.com>
    Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c | 37 ++++++++++++++++++++++---------------
 xen/common/domctl.c |  7 ++-----
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 2e46207d2d..e06174fca7 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -210,7 +210,7 @@ static void set_domain_state_info(struct xen_domctl_get_domain_state *info,
 int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
                      domid_t *domid)
 {
-    unsigned int dom;
+    unsigned int dom = -1;
     int rc = -ENOENT;
     struct domain *hdl;
 
@@ -219,6 +219,10 @@ int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
 
     if ( d )
     {
+        rc = xsm_get_domain_state(XSM_XS_PRIV, d);
+        if ( rc )
+            return rc;
+
         set_domain_state_info(info, d);
 
         return 0;
@@ -238,28 +242,31 @@ int get_domain_state(struct xen_domctl_get_domain_state *info, struct domain *d,
 
     while ( dom_state_changed )
     {
-        dom = find_first_bit(dom_state_changed, DOMID_MASK + 1);
+        dom = find_next_bit(dom_state_changed, DOMID_MASK + 1, dom + 1);
         if ( dom >= DOMID_FIRST_RESERVED )
             break;
-        if ( test_and_clear_bit(dom, dom_state_changed) )
-        {
-            *domid = dom;
-
-            d = rcu_lock_domain_by_id(dom);
 
+        d = rcu_lock_domain_by_id(dom);
+        if ( (d && xsm_get_domain_state(XSM_XS_PRIV, d)) ||
+             !test_and_clear_bit(dom, dom_state_changed) )
+        {
             if ( d )
-            {
-                set_domain_state_info(info, d);
-
                 rcu_unlock_domain(d);
-            }
-            else
-                memset(info, 0, sizeof(*info));
+            continue;
+        }
 
-            rc = 0;
+        *domid = dom;
 
-            break;
+        if ( d )
+        {
+            set_domain_state_info(info, d);
+            rcu_unlock_domain(d);
         }
+        else
+            memset(info, 0, sizeof(*info));
+
+        rc = 0;
+        break;
     }
 
  out:
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 29a7726d32..93738931c5 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -860,12 +860,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         break;
 
     case XEN_DOMCTL_get_domain_state:
-        ret = xsm_get_domain_state(XSM_XS_PRIV, d);
-        if ( ret )
-            break;
-
-        copyback = 1;
         ret = get_domain_state(&op->u.get_domain_state, d, &op->domain);
+        if ( !ret )
+            copyback = true;
         break;
 
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:34:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239063.1540494 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW4t-00016l-Er; Mon, 23 Feb 2026 13:34:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239063.1540494; Mon, 23 Feb 2026 13:34: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 1vuW4t-00016d-CI; Mon, 23 Feb 2026 13:34:23 +0000
Received: by outflank-mailman (input) for mailman id 1239063;
 Mon, 23 Feb 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 1vuW4s-00016F-W0
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 2026 13:34: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 1vuW4s-006AxY-36
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:34:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW4s-002vEJ-30
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=KNqF2B7V2XP5MOh0bNaeOBrS3qMuWnsWfVkboDFzD74=; b=f76xTgqRLrpr3xyDbUp4L5q8Bg
	PZiwnCx8Rapwk1//jUCv9iQW4Lf90PFzOuzMOCLQ8lOCBVxFt90K9rlu98y2ssb62kBBrXXHVzfzZ
	xOQ33uOAG9ZDfV0YD2XSD2h82VvRBKB1fKkfSulu4CJ7ioywVh8Ot2PUVPfVtI7HqhmE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/bitops: adjust partial first word handling in __find_next{,_zero}_bit()
Message-Id: <E1vuW4s-002vEJ-30@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:34:22 +0000

commit 0e6f9fbb8a7724e6cb73733a68a60b64f841ea61
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:43:29 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:43:29 2026 +0100

    x86/bitops: adjust partial first word handling in __find_next{,_zero}_bit()
    
    There's no need to subtract "bit" in what is passed to __scanbit(), as the
    other bits are zero anyway after the shift (in __find_next_bit()) or can
    be made so (in __find_next_zero_bit()) by flipping negation and shift. (We
    actually leverage the same facts in find_next{,_zero}_bit() as well.) This
    way in __scanbit() the TZCNT alternative can be engaged.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/bitops.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/bitops.c b/xen/arch/x86/bitops.c
index 720ab32362..22cfb6d8ec 100644
--- a/xen/arch/x86/bitops.c
+++ b/xen/arch/x86/bitops.c
@@ -35,8 +35,8 @@ unsigned int __find_next_bit(
     if ( bit != 0 )
     {
         /* Look for a bit in the first word. */
-        set = __scanbit(*p >> bit, BITS_PER_LONG - bit);
-        if ( set < (BITS_PER_LONG - bit) )
+        set = __scanbit(*p >> bit, BITS_PER_LONG);
+        if ( set < BITS_PER_LONG )
             return (offset + set);
         offset += BITS_PER_LONG - bit;
         p++;
@@ -85,8 +85,8 @@ unsigned int __find_next_zero_bit(
     if ( bit != 0 )
     {
         /* Look for zero in the first word. */
-        set = __scanbit(~(*p >> bit), BITS_PER_LONG - bit);
-        if ( set < (BITS_PER_LONG - bit) )
+        set = __scanbit(~*p >> bit, BITS_PER_LONG);
+        if ( set < BITS_PER_LONG )
             return (offset + set);
         offset += BITS_PER_LONG - bit;
         p++;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Mon Feb 23 13:34:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 23 Feb 2026 13:34:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239064.1540499 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuW53-00018v-GO; Mon, 23 Feb 2026 13:34:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239064.1540499; Mon, 23 Feb 2026 13:34: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 1vuW53-00018m-Dg; Mon, 23 Feb 2026 13:34:33 +0000
Received: by outflank-mailman (input) for mailman id 1239064;
 Mon, 23 Feb 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 1vuW53-00018f-2M
 for xen-changelog@lists.xenproject.org; Mon, 23 Feb 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 1vuW53-006Axe-08
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 2026 13:34:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuW53-002vF4-03
 for xen-changelog@lists.xenproject.org;
 Mon, 23 Feb 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=jNNUxdvIzFOWg+vA36V0OuXcYS9JwxBV3ZzTYI+Oziw=; b=ntUY9GCceUW3Xp+PRPB/uueBw4
	IoSVeiOF8I0WkyS0lmBhquDUhe1BJTqla+4qlkyJIjmhp/Iyr05zm/NmYcvy8YdWDGDuqH9mKl9Rf
	e4UtRZc9Q8KiFhCOZ8MhEf6nAeyc/2o4MDeHbpYgR8NObZLlNFr98gpDtz8KQFRlq4T0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/bitops: drop redundant casts from find_next{,_zero}_bit()
Message-Id: <E1vuW53-002vF4-03@xenbits.xenproject.org>
Date: Mon, 23 Feb 2026 13:34:33 +0000

commit 5eb84d6c992cf4e81936872c441b649057947442
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Feb 23 08:43:46 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Feb 23 08:43:46 2026 +0100

    x86/bitops: drop redundant casts from find_next{,_zero}_bit()
    
    It's not clear why they were put in place - a__ is of the very type
    already.
    
    No change in generated code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/include/asm/bitops.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index b17d67e8ca..69ffed510c 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -343,7 +343,7 @@ static always_inline unsigned int __scanbit(unsigned long val, unsigned int max)
     if ( o__ >= s__ )                                                       \
         r__ = s__;                                                          \
     else if ( __builtin_constant_p(size) && s__ <= BITS_PER_LONG )          \
-        r__ = o__ + __scanbit(*(const unsigned long *)(a__) >> o__, s__);   \
+        r__ = o__ + __scanbit(*a__ >> o__, s__);                            \
     else if ( __builtin_constant_p(off) && !o__ )                           \
         r__ = __find_first_bit(a__, s__);                                   \
     else                                                                    \
@@ -375,7 +375,7 @@ static always_inline unsigned int __scanbit(unsigned long val, unsigned int max)
     if ( o__ >= s__ )                                                       \
         r__ = s__;                                                          \
     else if ( __builtin_constant_p(size) && s__ <= BITS_PER_LONG )          \
-        r__ = o__ + __scanbit(~*(const unsigned long *)(a__) >> o__, s__);  \
+        r__ = o__ + __scanbit(~*a__ >> o__, s__);                           \
     else if ( __builtin_constant_p(off) && !o__ )                           \
         r__ = __find_first_zero_bit(a__, s__);                              \
     else                                                                    \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 08:44:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 08:44:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239530.1540925 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuo1T-0008Dy-2y; Tue, 24 Feb 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 1239530.1540925; Tue, 24 Feb 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 1vuo1T-0008Dq-0H; Tue, 24 Feb 2026 08:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1239530;
 Tue, 24 Feb 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 1vuo1R-0008Dk-T7
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vuo1R-007lCh-2b
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 08:44:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuo1R-0041E9-2R
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=nygYE2BJyorrFpkBkCuXvrV+wkCsWJ7IgSNHn7mKUw4=; b=dtOmUxF9uLGvYXzLKg0KmphmA5
	fAvwiNIkAgbiM91spdQUcn7b2kvSBW0H8LRhz1FDCNHbdTohz3Tr1x67t0sBryVtRvYYuoc3kOd+a
	8IhDcNXe+6d2ahQ7wdkEzETmRmQ63CSntUBYugaXOZlB/h5DwUEwpL+5yQDRHVfab+fU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/p2m: clarify foreign map handling in p2m_entry_modify()
Message-Id: <E1vuo1R-0041E9-2R@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 08:44:01 +0000

commit ac607edc2e261e1bd5b2907a62c55f8e5ba8bc9d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Feb 19 18:26:19 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 24 09:34:29 2026 +0100

    x86/p2m: clarify foreign map handling in p2m_entry_modify()
    
    Introduce an extra check and comment to ensure the outer caller has
    possibly taken an extra reference on the foreign page that's about to be
    removed from the p2m.  Otherwise the put_page() in p2m_entry_modify() won't
    be safe to do ahead of the entry being removed form the p2m and any cached
    states purged.
    
    While there also replace the error codes for unreachable paths to use
    EILSEQ.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/p2m.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index ef6b02ff0b..1ceb248b9d 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -1066,7 +1066,7 @@ static inline int p2m_entry_modify(struct p2m_domain *p2m, p2m_type_t nt,
         if ( !mfn_valid(nfn) || p2m != p2m_get_hostp2m(p2m->domain) )
         {
             ASSERT_UNREACHABLE();
-            return -EINVAL;
+            return -EILSEQ;
         }
 
         if ( !page_get_owner_and_reference(mfn_to_page(nfn)) )
@@ -1088,14 +1088,26 @@ static inline int p2m_entry_modify(struct p2m_domain *p2m, p2m_type_t nt,
         break;
 
     case p2m_map_foreign:
-        if ( !mfn_valid(ofn) || p2m != p2m_get_hostp2m(p2m->domain) )
+    {
+        struct page_info *pg = mfn_valid(ofn) ? mfn_to_page(ofn) : NULL;
+        unsigned long ci = pg ? ACCESS_ONCE(pg->count_info) : 0;
+
+        if ( !pg || p2m != p2m_get_hostp2m(p2m->domain) ||
+             /*
+              * Rely on the caller also holding a reference to the page, so
+              * that the put_page() below doesn't cause the page to be
+              * freed, as it still has to be removed from the p2m.
+              */
+             (ci & PGC_count_mask) <= (ci & PGC_allocated ? 2 : 1) ||
+             !p2m->nr_foreign )
         {
             ASSERT_UNREACHABLE();
-            return -EINVAL;
+            return -EILSEQ;
         }
-        put_page(mfn_to_page(ofn));
+        put_page(pg);
         p2m->nr_foreign--;
         break;
+    }
 
     default:
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 08:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 08:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239531.1540929 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuo1d-0008Fx-5M; Tue, 24 Feb 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 1239531.1540929; Tue, 24 Feb 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 1vuo1d-0008Fp-2t; Tue, 24 Feb 2026 08:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1239531;
 Tue, 24 Feb 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 1vuo1b-0008Fd-UV
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vuo1b-007lCw-2w
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 08:44:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuo1b-0041Fd-2m
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=dEhM9ltm1JkdFWxt6U8Yy172WWET9FryAw5ffSAEMpM=; b=QKvmqphwUZ2w0kj6QMTEy4vzNb
	akBKJjguvHscqZ5nm4QoatrVDd26Dai5nR4ITikp1CmpnjHpTyid8pV9Ngpi3Y6BEGdZyVBZnmq4A
	yOQR3LlXtGtA40vxr9wJ/MbojH2WqstXOdmv4abnk+bsTuG/V7vWTjFiUDafha5cwEZk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] vpci/msix: fix typo
Message-Id: <E1vuo1b-0041Fd-2m@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 08:44:11 +0000

commit de963f81efaf19c1899fa06eecdc585f3d6d4a96
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Feb 23 22:05:15 2026 -0500
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 24 09:34:29 2026 +0100

    vpci/msix: fix typo
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 516282205a..eaf8fae970 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -795,7 +795,7 @@ static int cf_check init_msix(struct pci_dev *pdev)
 
     /*
      * vPCI header initialization will have mapped the whole BAR into the
-     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * p2m, as MSI-X capability was not yet initialized.  Carve a hole for
      * the MSI-X table here, so that Xen can trap accesses.
      */
     return vpci_make_msix_hole(pdev);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239719.1541104 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupNf-0004NJ-25; Tue, 24 Feb 2026 10:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239719.1541104; Tue, 24 Feb 2026 10: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 1vupNe-0004NB-Vk; Tue, 24 Feb 2026 10:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1239719;
 Tue, 24 Feb 2026 10: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 1vupNe-0004N5-3g
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupNe-007mvp-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupNe-0046hY-02
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=Q5JnctyI0P4CTDLbFxjvOqak0PIRv5mbxt9Gq3K76HY=; b=XryCM80r5iqUH4+kFibAe9nke5
	HyHqybedGOOwYLU79lVcz8zT85GbVXLdA2xn0NqomNFaQFFw2T8g7wytXaSQKOxD2hH5/nWfMUfDa
	vvdyt6Z8wDT5T2GUaG5WBS7jXRNJKhUNTL4zxcY6N8z/HNklT/fclZRh+00kgNrRJxZ8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: sh_rm_write_access_from_sl1p() is HVM-only
Message-Id: <E1vupNe-0046hY-02@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:02 +0000

commit 259dc9c485b80cc9cead5825dd77d6a155e666cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:15:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:47 2026 +0100

    x86/shadow: sh_rm_write_access_from_sl1p() is HVM-only
    
    The function is used from (HVM-only) OOS code only - replace the
    respective #ifdef inside the function to make this more obvious. (Note
    that SHOPT_OUT_OF_SYNC won't be set when !HVM, so the #ifdef surrounding
    the function is already sufficient.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b1cb9aad1f..853682190f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3435,9 +3435,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
 int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
                                  mfn_t smfn, unsigned long off)
 {
-#ifdef CONFIG_HVM
     struct vcpu *curr = current;
-#endif
     int r;
     shadow_l1e_t *sl1p, sl1e;
     struct page_info *sp;
@@ -3445,12 +3443,10 @@ int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
     ASSERT(mfn_valid(gmfn));
     ASSERT(mfn_valid(smfn));
 
-#ifdef CONFIG_HVM
     /* Remember if we've been told that this process is being torn down */
     if ( curr->domain == d && is_hvm_domain(d) )
         curr->arch.paging.shadow.pagetable_dying
             = mfn_to_page(gmfn)->pagetable_dying;
-#endif
 
     sp = mfn_to_page(smfn);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239720.1541108 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupNp-0004P9-3Y; Tue, 24 Feb 2026 10:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239720.1541108; Tue, 24 Feb 2026 10: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 1vupNp-0004P1-0o; Tue, 24 Feb 2026 10:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1239720;
 Tue, 24 Feb 2026 10: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 1vupNo-0004Ov-6i
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupNo-007mvw-0U
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupNo-0046hv-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=cjsBkGx9vCo2/Zt35tTxKZbcdsptyQDgmtg9Hb8QYiQ=; b=mBDETQL81yTqDcmvXOOrbcuaEi
	fSqjWEkdVDiV5UQ0AVBhOFE+1fxQrU5GD3CgUZSt1c3MoW2KJai56A5y2gol80+YEc2VRpEmX9Eot
	18kNlVBEMXhePWbbdfT2drgeHKt87XYidTD0/kQZDnoTlNapTUMTyR9DcIimEqbsAbRs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: drop is_hvm_...() where easily possible
Message-Id: <E1vupNo-0046hv-0O@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:12 +0000

commit 227b86fee0c96eabe742d904e47f368b52cd09e6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:15:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:47 2026 +0100

    x86/shadow: drop is_hvm_...() where easily possible
    
    These emulation related functions are involved in HVM handling only, and
    in some cases they even invoke such checks after having already done
    things which are valid for HVM domains only. OOS active also implies HVM.
    In sh_remove_all_mappings() one of the two checks is redundant with an
    earlier paging_mode_external() one (the other, however, needs to stay).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c |  2 +-
 xen/arch/x86/mm/shadow/hvm.c    | 20 +-------------------
 xen/arch/x86/mm/shadow/multi.c  |  2 +-
 xen/arch/x86/mm/shadow/oos.c    |  1 -
 4 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 6d44d9ad1d..c89ab8e063 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1512,7 +1512,7 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
                && (page->count_info & PGC_count_mask) <= 3
                && ((page->u.inuse.type_info & PGT_count_mask)
                    == (is_special_page(page) ||
-                       (is_hvm_domain(d) && is_ioreq_server_page(d, page))))) )
+                       is_ioreq_server_page(d, page)))) )
             printk(XENLOG_G_ERR "can't find all mappings of mfn %"PRI_mfn
                    " (gfn %"PRI_gfn"): c=%lx t=%lx s=%d i=%d\n",
                    mfn_x(gmfn), gfn_x(gfn),
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 7b3b58119c..a7db8addc0 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -192,10 +192,6 @@ hvm_emulate_write(enum x86_segment seg,
     if ( rc || !bytes )
         return rc;
 
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (addr & (bytes - 1)) && !is_hvm_vcpu(v)  )
-        return X86EMUL_UNHANDLEABLE;
-
     ptr = sh_emulate_map_dest(v, addr, bytes, sh_ctxt);
     if ( IS_ERR(ptr) )
         return ~PTR_ERR(ptr);
@@ -248,10 +244,6 @@ hvm_emulate_cmpxchg(enum x86_segment seg,
     if ( rc )
         return rc;
 
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (addr & (bytes - 1)) && !is_hvm_vcpu(v)  )
-        return X86EMUL_UNHANDLEABLE;
-
     ptr = sh_emulate_map_dest(v, addr, bytes, sh_ctxt);
     if ( IS_ERR(ptr) )
         return ~PTR_ERR(ptr);
@@ -466,8 +458,7 @@ static void *sh_emulate_map_dest(struct vcpu *v, unsigned long vaddr,
 
 #ifndef NDEBUG
     /* We don't emulate user-mode writes to page tables. */
-    if ( is_hvm_domain(d) ? hvm_get_cpl(v) == 3
-                          : !guest_kernel_mode(v, guest_cpu_user_regs()) )
+    if ( hvm_get_cpl(v) == 3 )
     {
         gdprintk(XENLOG_DEBUG, "User-mode write to pagetable reached "
                  "emulate_map_dest(). This should never happen!\n");
@@ -496,15 +487,6 @@ static void *sh_emulate_map_dest(struct vcpu *v, unsigned long vaddr,
         sh_ctxt->mfn[1] = INVALID_MFN;
         map = map_domain_page(sh_ctxt->mfn[0]) + (vaddr & ~PAGE_MASK);
     }
-    else if ( !is_hvm_domain(d) )
-    {
-        /*
-         * Cross-page emulated writes are only supported for HVM guests;
-         * PV guests ought to know better.
-         */
-        put_page(mfn_to_page(sh_ctxt->mfn[0]));
-        return MAPPING_UNHANDLEABLE;
-    }
     else
     {
         /* This write crosses a page boundary. Translate the second page. */
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 853682190f..593532defc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3444,7 +3444,7 @@ int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
     ASSERT(mfn_valid(smfn));
 
     /* Remember if we've been told that this process is being torn down */
-    if ( curr->domain == d && is_hvm_domain(d) )
+    if ( curr->domain == d )
         curr->arch.paging.shadow.pagetable_dying
             = mfn_to_page(gmfn)->pagetable_dying;
 
diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
index 89e8a3b722..956b5ebcba 100644
--- a/xen/arch/x86/mm/shadow/oos.c
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -577,7 +577,6 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn)
     if ( (pg->shadow_flags &
           ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)) ||
          sh_page_has_multiple_shadows(pg) ||
-         !is_hvm_vcpu(v) ||
          !v->domain->arch.paging.shadow.oos_active )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239721.1541111 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupNz-0004RO-4e; Tue, 24 Feb 2026 10:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239721.1541111; Tue, 24 Feb 2026 10: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 1vupNz-0004RG-29; Tue, 24 Feb 2026 10:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1239721;
 Tue, 24 Feb 2026 10: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 1vupNy-0004RA-97
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupNy-007mwK-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupNy-0046jm-0g
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=QFMEz8gSep0xRCOxGi1UVYmmahKGn9QA4VnczQ+cQNk=; b=ye4Np9ebzmuH2o4iwkR87HoC2k
	L52CrfrDPqm7g9rQkXqOS8D8oy/ppDD/1ZXzlDKQlm+rbnSKng/iFIVNv9Rf8bRfBnpsXru958fvi
	KwbiLi6ESfSi/7JA2/tUny+9CAf3d4WnOSMexTKkWyDLCM/rrn8KOc5T1/bxc+lpBMKg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: make monitor table create/destroy more consistent
Message-Id: <E1vupNy-0046jm-0g@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:22 +0000

commit 06dfcb7f61c05ae184cb1e2d692a14a09551e704
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:55 2026 +0100

    x86/shadow: make monitor table create/destroy more consistent
    
    While benign at present, it is still a little fragile to operate on a
    wrong "old_mode" value in sh_update_paging_modes(). This can happen when
    no monitor table was present initially - we'd create one for the new
    mode without updating old_mode. Correct this in two ways, each of which
    would be sufficient on its own: Once by adding "else" to the second of
    the involved if()s in the function, and then by setting the correct
    initial mode for HVM domains in shadow_vcpu_init().
    
    Further use the same predicate (paging_mode_external()) consistently
    when dealing with shadow mode init/update/cleanup, rather than a mix of
    is_hvm_vcpu() (init), is_hvm_domain() (update), and
    paging_mode_external() (cleanup).
    
    Finally drop a redundant is_hvm_domain() from inside the bigger if()
    (which is being converted to paging_mode_external()) in
    sh_update_paging_modes().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index c89ab8e063..126523b898 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -120,9 +120,9 @@ void shadow_vcpu_init(struct vcpu *v)
     }
 #endif
 
-    v->arch.paging.mode = is_hvm_vcpu(v) ?
-                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 3) :
-                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
+    v->arch.paging.mode = paging_mode_external(v->domain)
+                          ? &SHADOW_INTERNAL_NAME(sh_paging_mode, 2)
+                          : &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
 }
 
 #if SHADOW_AUDIT
@@ -1802,7 +1802,7 @@ static void sh_update_paging_modes(struct vcpu *v)
         sh_detach_old_tables(v);
 
 #ifdef CONFIG_HVM
-    if ( is_hvm_domain(d) )
+    if ( paging_mode_external(d) )
     {
         const struct paging_mode *old_mode = v->arch.paging.mode;
 
@@ -1855,13 +1855,12 @@ static void sh_update_paging_modes(struct vcpu *v)
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
         }
-
-        if ( v->arch.paging.mode != old_mode )
+        else if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: %pv pe=%d gl=%u "
                           "sl=%u (was g=%u s=%u)\n",
                           v,
-                          is_hvm_domain(d) ? hvm_paging_enabled(v) : 1,
+                          hvm_paging_enabled(v),
                           v->arch.paging.mode->guest_levels,
                           v->arch.paging.mode->shadow.shadow_levels,
                           old_mode ? old_mode->guest_levels : 0,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239722.1541115 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupO9-0004TR-63; Tue, 24 Feb 2026 10:11:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239722.1541115; Tue, 24 Feb 2026 10: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 1vupO9-0004TJ-3W; Tue, 24 Feb 2026 10:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1239722;
 Tue, 24 Feb 2026 10: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 1vupO8-0004TB-EV
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupO8-007mwS-18
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupO8-0046kU-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=NpE5xGKlqTIQumLeYiGXCoiFOD6V36JDv1PhNqSzKZs=; b=OTxKrAuNs055up+u+Y3oDILzF4
	TeGm1NYRK0qPBXbcEKuDwBrcqg9MfDqfPbP+xCuw0ahih1ajea9VMPU7gOhbcgffMOhRYmgBUoD88
	K/xiblbNI58QQhCOb0IjvPlzGZZxw/XqT5R8F8MEH9xHeAj+9khlO/nPdhuXTzOy86dU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: vCPU-s never have "no mode"
Message-Id: <E1vupO8-0046kU-0y@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:32 +0000

commit 88f7ce5f57d49f61941986aac158baeca5b9c381
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:56 2026 +0100

    x86/shadow: vCPU-s never have "no mode"
    
    With an initial mode installed by shadow_vcpu_init(), there's no need
    for sh_update_paging_modes() to deal with the "mode is still unset"
    case. Leave an assertion, though.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 126523b898..e07ba6d5a7 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1855,6 +1855,8 @@ static void sh_update_paging_modes(struct vcpu *v)
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
         }
+        else if ( !old_mode )
+            ASSERT_UNREACHABLE();
         else if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: %pv pe=%d gl=%u "
@@ -1863,11 +1865,10 @@ static void sh_update_paging_modes(struct vcpu *v)
                           hvm_paging_enabled(v),
                           v->arch.paging.mode->guest_levels,
                           v->arch.paging.mode->shadow.shadow_levels,
-                          old_mode ? old_mode->guest_levels : 0,
-                          old_mode ? old_mode->shadow.shadow_levels : 0);
-            if ( old_mode &&
-                 (v->arch.paging.mode->shadow.shadow_levels !=
-                  old_mode->shadow.shadow_levels) )
+                          old_mode->guest_levels,
+                          old_mode->shadow.shadow_levels);
+            if ( v->arch.paging.mode->shadow.shadow_levels !=
+                 old_mode->shadow.shadow_levels )
             {
                 /* Need to make a new monitor table for the new mode */
                 mfn_t new_mfn, old_mfn;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:43 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239723.1541119 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupOJ-0004Vn-7c; Tue, 24 Feb 2026 10:11:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239723.1541119; Tue, 24 Feb 2026 10: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 1vupOJ-0004Ve-4x; Tue, 24 Feb 2026 10:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1239723;
 Tue, 24 Feb 2026 10: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 1vupOI-0004VY-FJ
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupOI-007mwY-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupOI-0046l1-1J
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=DfjLx3DMlCymoxxrw+0k7gGHBVG26/ZMxxyCa7kynns=; b=MFXhD7+BlguWa1+39kUFiYppGX
	YbNfnr8UuW21M0AhK9313Hc1JNw1Fd4le/4HlkjJGhgQu1+QlYavkVooJyLQOAzGfpVdMVpP+svS9
	ywG/NeAzd9nmfr121kdVn6WVCUmiXvk+g2audd43txh4WHt3Rr1VdWcLgDF7Foa/dlfA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: adjust monitor table prealloc amount
Message-Id: <E1vupOI-0046l1-1J@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:42 +0000

commit fcd373dc72ca30e6cd559943c09dcd13a79d8c6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:58 2026 +0100

    x86/shadow: adjust monitor table prealloc amount
    
    While 670d6b908ff2 ('x86 shadow: Move the shadow linear mapping for
    n-on-3-on-4 shadows so') bumped the amount by one too little for the
    32-on-64 case (which luckily was dead code, and hence a bump wasn't
    necessary in the first place), 0b841314dace ('x86/shadow:
    sh_{make,destroy}_monitor_table() are "even more" HVM-only'), dropping
    the dead code, then didn't adjust the amount back. Yet even the original
    amount was too high in certain cases. Switch to pre-allocating just as
    much as is going to be needed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@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 a7db8addc0..3565c7940d 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -747,7 +747,7 @@ mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels)
     ASSERT(!pagetable_get_pfn(v->arch.hvm.monitor_table));
 
     /* Guarantee we can get the memory we need */
-    if ( !shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS) )
+    if ( !shadow_prealloc(d, SH_type_monitor_table, shadow_levels < 4 ? 3 : 1) )
         return INVALID_MFN;
 
     m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:11:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:11:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239724.1541124 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupOT-0004Xo-94; Tue, 24 Feb 2026 10:11:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239724.1541124; Tue, 24 Feb 2026 10:11: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 1vupOT-0004Xg-6J; Tue, 24 Feb 2026 10:11:53 +0000
Received: by outflank-mailman (input) for mailman id 1239724;
 Tue, 24 Feb 2026 10: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 1vupOS-0004XY-I2
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10: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 1vupOS-007mwc-1h
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupOS-0046lN-1c
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10: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=Bv5sUz7zyxempt/Duv7wAN8KNkVg1admwh0p20f7fl8=; b=bvoWSYPRlYC+kSA/aQWURW06H+
	Lje/LAAYk8jvTUBAKfncvbEyaeZUCfC/D3L1X1Gclf05RcUXwxJbcgjiHCOBF2M8Cq9SJWFkQ/A1E
	ycbg5HXhEuQQiIejdFE9rXWgBze27EYTGAe7oX4b/f7I5QJX0nlGbJBbHm0LZA2K0hKU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/riscv: add p2m context switch handling for VSATP and HGATP
Message-Id: <E1vupOS-0046lN-1c@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:11:52 +0000

commit 40e5a4ee554269c9ca5db295a78addf01ade029e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Feb 24 09:17:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:01 2026 +0100

    xen/riscv: add p2m context switch handling for VSATP and HGATP
    
    Introduce helpers to manage VS-stage and G-stage translation state during
    vCPU context switches.
    
    As VSATP and HGATP cannot be updated atomically, clear VSATP on context
    switch-out to prevent speculative VS-stage translations from being associated
    with an incorrect VMID. On context switch-in, restore HGATP and VSATP in the
    required order.
    
    Add p2m_handle_vmenter() to perform VMID management and issue TLB flushes
    only when required (e.g. on VMID reuse or generation change).
    
    This provides the necessary infrastructure for correct p2m context switching
    on RISC-V.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/domain.h |   2 +
 xen/arch/riscv/include/asm/p2m.h    |   4 ++
 xen/arch/riscv/p2m.c                | 100 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/traps.c              |   8 +++
 4 files changed, 114 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index f78f145258..5aec627a7a 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -48,6 +48,8 @@ struct arch_vcpu {
     } xen_saved_context;
 
     struct cpu_info *cpu_info;
+
+    register_t vsatp;
 };
 
 struct paging_domain {
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index f63b5dec99..60f27f9b34 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -255,6 +255,10 @@ static inline bool p2m_is_locked(const struct p2m_domain *p2m)
 struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
                                         p2m_type_t *t);
 
+void p2m_ctxt_switch_from(struct vcpu *p);
+void p2m_ctxt_switch_to(struct vcpu *n);
+void p2m_handle_vmenter(void);
+
 #endif /* ASM__RISCV__P2M_H */
 
 /*
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 0abeb374c1..89e5db606f 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1434,3 +1434,103 @@ struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
 
     return get_page(page, p2m->domain) ? page : NULL;
 }
+
+/*
+ * Must be called before restoring CSRs to avoid potential speculation using
+ * an incorrect set of page tables during updates of VSATP and HGATP.
+ */
+void p2m_ctxt_switch_from(struct vcpu *p)
+{
+    if ( is_idle_vcpu(p) )
+        return;
+
+    /*
+     * No mechanism is provided to atomically change vsatp and hgatp
+     * together. Hence, to prevent speculative execution causing one
+     * guest’s VS-stage translations to be cached under another guest’s
+     * VMID, world-switch code should zero vsatp, then swap hgatp, then
+     * finally write the new vsatp value what will be done in
+     * p2m_ctxt_switch_to().
+     * Note, that also HGATP update could happen in p2m_handle_vmenter().
+     */
+    p->arch.vsatp = csr_swap(CSR_VSATP, 0);
+
+    /*
+     * Nothing to do with HGATP as it will be update in p2m_ctxt_switch_to()
+     * or/and in p2m_handle_vmenter().
+     */
+}
+
+/*
+ * As speculation may occur at any time, an incorrect set of page tables could
+ * be used. Therefore, this function must be called only after all other guest
+ * CSRs have been restored. Otherwise, VS-stage translations could be populated
+ * using stale control state (e.g. SEPC still referring to the previous guest)
+ * while VSATP and HGATP already point to the new guest.
+ */
+void p2m_ctxt_switch_to(struct vcpu *n)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(n->domain);
+
+    if ( is_idle_vcpu(n) )
+        return;
+
+    csr_write(CSR_HGATP, construct_hgatp(p2m, n->arch.vmid.vmid));
+    /*
+     * As VMID is unique per vCPU and just re-used here thereby there is no
+     * need for G-stage TLB flush here.
+     */
+
+    csr_write(CSR_VSATP, n->arch.vsatp);
+
+    /*
+     * Since n->arch.vsatp.ASID may equal p->arch.vsatp.ASID,
+     * flush the VS-stage TLB to prevent the new guest from
+     * using stale (not belongs to it) translations.
+     * ASID equality is not the only potential issue here.
+     *
+     * TODO: This could be optimized by making the flush
+     *       conditional.
+     */
+    flush_tlb_guest_local();
+}
+
+void p2m_handle_vmenter(void)
+{
+    struct vcpu *curr = current;
+    struct p2m_domain *p2m = p2m_get_hostp2m(curr->domain);
+    struct vcpu_vmid *p_vmid = &curr->arch.vmid;
+    unsigned short old_vmid, new_vmid;
+    bool need_flush;
+
+    BUG_ON(is_idle_vcpu(curr));
+
+    old_vmid = p_vmid->vmid;
+    need_flush = vmid_handle_vmenter(p_vmid);
+    new_vmid = p_vmid->vmid;
+
+#ifdef P2M_DEBUG
+    printk("%pv: oldvmid(%d) new_vmid(%d), need_flush(%d)\n",
+           curr, old_vmid, new_vmid, need_flush);
+#endif
+
+    /*
+     * There is no need to set VSATP to 0 to stop speculation before updating
+     * HGATP, as VSATP is not modified here.
+     */
+    if ( old_vmid != new_vmid )
+        csr_write(CSR_HGATP, construct_hgatp(p2m, p_vmid->vmid));
+
+    /*
+     * There is also no need to flush G-stage TLB unconditionally as old VMID
+     * won't be reused until need_flush is set to true.
+     */
+    if ( unlikely(need_flush) )
+        local_hfence_gvma_all();
+
+    /*
+     * There is also no need to flush the VS-stage TLB: even if speculation
+     * occurs (VSATP + old HGATP were used), it will use the old VMID, which
+     * won't be reused until need_flush is set to true.
+     */
+}
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index c81a4f79a0..9fca941526 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -169,6 +169,11 @@ static void do_unexpected_trap(const struct cpu_user_regs *regs)
     die();
 }
 
+static void check_for_pcpu_work(void)
+{
+    p2m_handle_vmenter();
+}
+
 void do_trap(struct cpu_user_regs *cpu_regs)
 {
     register_t pc = cpu_regs->sepc;
@@ -222,6 +227,9 @@ void do_trap(struct cpu_user_regs *cpu_regs)
         do_unexpected_trap(cpu_regs);
         break;
     }
+
+    if ( cpu_regs->hstatus & HSTATUS_SPV )
+        check_for_pcpu_work();
 }
 
 void vcpu_show_execution_state(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:12:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:12:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239725.1541128 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupOd-0004aK-Be; Tue, 24 Feb 2026 10:12:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239725.1541128; Tue, 24 Feb 2026 10:12: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 1vupOd-0004aD-90; Tue, 24 Feb 2026 10:12:03 +0000
Received: by outflank-mailman (input) for mailman id 1239725;
 Tue, 24 Feb 2026 10:12: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 1vupOc-0004a5-Kr
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10:12: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 1vupOc-007mww-1z
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupOc-0046mG-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12: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=EN5w0+tjkox2FEed2fEeMFVBGfMsYltPbgGva0eqSiY=; b=1aOWjcCwhPWMUe2rPuaw3zEgNk
	AliFWfRxZrophPkZjkbdxihsEoTnM570loN5enJ8ajK7GBhLvcidsVQ+yFvylj2/6S1B+fH1eGJjg
	MjmKOAub2qFABCa+x6GlZSzotPyNow/v+A6BRw/Y7VuyxHJ+Xh9Zsnv02IYRIzy7/P70=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/platform: Adjust temperature sensors MSRs
Message-Id: <E1vupOc-0046mG-1s@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:12:02 +0000

commit 87669157168e83756259b27db8774d959c211776
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Feb 24 09:18:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:03 2026 +0100

    x86/platform: Adjust temperature sensors MSRs
    
    Temperature sensors MSR were previously assumed to be available when "DTS"
    CPUID bit is set. This is not really the case :
     * MSR_IA32_THERM_STATUS is gated behind ACPI CPUID bit, only DTS-related bits
    of this MSR are gated behind the DTS CPUID
     * MSR_PACKAGE_THERM_STATUS is gated behind "PTM" CPUID
    
    Also adjust the MSR_TEMPERATURE_TARGET which is not architectural, but stable
    in practice, and required to be exposed for reliably querying CPU temperature.
    
    Fixes: 615c9f3f820 ("x86/platform: Expose DTS sensors MSR")
    Reported-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c    | 19 ++++++++++++++++++-
 xen/include/xen/lib/x86/cpu-policy.h |  2 +-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index c6c5135806..cd4f0ae5e5 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -89,9 +89,26 @@ static bool msr_read_allowed(unsigned int msr)
         return cpu_has_srbds_ctrl;
 
     case MSR_IA32_THERM_STATUS:
+        return host_cpu_policy.basic.acpi;
+
+    /*
+     * This MSR is present on most Intel Core-family CPUs since Nehalem but is not an
+     * architectural MSR. No CPUID bit enumerates this MSR.
+     *
+     * This MSR exposes "temperature target" that is needed to compute the CPU
+     * temperature. The "temperature target" is a model specific value, and this MSR is
+     * the only known method of getting the one used for the CPU. On some CPU models with
+     * Intel SST-PP, the "temperature target" can vary over time.
+     *
+     * We assume all Intel CPUs with DTS may support this MSR; but reads can fail in case
+     * the platform doesn't actually support this MSR.
+     */
     case MSR_TEMPERATURE_TARGET:
+        return boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+               host_cpu_policy.basic.digital_temp_sensor;
+
     case MSR_PACKAGE_THERM_STATUS:
-        return host_cpu_policy.basic.digital_temp_sensor;
+        return host_cpu_policy.basic.pkg_therm_mgmt;
     }
 
     if ( ppin_msr && msr == ppin_msr )
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index db8d035589..d29e380359 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -132,7 +132,7 @@ struct cpu_policy
                         :1,
                         :1,
                         :1,
-                        :1,
+                        pkg_therm_mgmt:1,
                         hwp:1,
                         hwp_interrupt:1,
                         hwp_activity_window:1,
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:12:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:12:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239726.1541133 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupOn-0004cO-Dg; Tue, 24 Feb 2026 10:12:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239726.1541133; Tue, 24 Feb 2026 10:12: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 1vupOn-0004cF-Aj; Tue, 24 Feb 2026 10:12:13 +0000
Received: by outflank-mailman (input) for mailman id 1239726;
 Tue, 24 Feb 2026 10:12: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 1vupOm-0004c7-OB
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10:12: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 1vupOm-007mx1-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupOm-0046mu-2B
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12: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=FkVwvgak3NWludo2IGy819rn+SHVKAg0CL0eRr2qX+8=; b=t6Iv6yuke9r/xqQ9ld0VV5PYuo
	FyqUC103QnyKbb8VVGu08ipCevzsiZ7TifqbZ7bxlliMnlsQ0gwWqPGcZVpk9DAI1KcqRBEvBEOAs
	6XdzPXD5ScMoJPof+XUWslEsiMyJixCT5t9fkhoo9A9ucanra4k0T74CMBgOrQw4yRVA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests/x86_emulator: fix 'shifting a negative signed value is undefined'
Message-Id: <E1vupOm-0046mu-2B@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:12:12 +0000

commit 5a376999562bf43dbbbff28c2f19c634ec7f1b32
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Tue Feb 24 09:18:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:05 2026 +0100

    tools/tests/x86_emulator: fix 'shifting a negative signed value is undefined'
    
    clang-21 refuses to compile this:
    ```
    test_x86_emulator.c:1164:24: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
     1164 |     regs.r8     = (-1L << 40) + 1;
          |                    ~~~ ^
    1 error generated.
    ```
    
    The shift could also exceed the width of the type on some systems.
    I confirmed that both the old and the new code would produce the same value
    with GCC on x86-64: `0xffffff0000000001`.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 39e8056d77..ea507f9c3a 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -1161,7 +1161,7 @@ int main(int argc, char **argv)
     instr[0] = 0x4d; instr[1] = 0x0f; instr[2] = 0xbb; instr[3] = 0x03;
     regs.eflags = EFLAGS_ALWAYS_SET;
     regs.rip    = (unsigned long)&instr[0];
-    regs.r8     = (-1L << 40) + 1;
+    regs.r8     = (~0UL << 40) + 1;
     regs.r11    = (unsigned long)(res + (1L << 35));
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:12:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239727.1541136 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupOy-0004eP-EZ; Tue, 24 Feb 2026 10:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239727.1541136; Tue, 24 Feb 2026 10:12: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 1vupOy-0004eI-C2; Tue, 24 Feb 2026 10:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1239727;
 Tue, 24 Feb 2026 10:12: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 1vupOw-0004eB-Qb
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10:12: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 1vupOw-007mxL-2Z
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupOw-0046nf-2U
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12: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=n6eAPg5vxQhc1oKahhNkIFS45B7h5EojIFqAe+iWLMI=; b=L5FUCT5IYdmdxXPeCosgyhanh/
	RBbKVihzpSfBEGmxaKxqY9iPFuzBBEB6IQC2FKLwoB/l4OPWClJWeJnXnxayjOj8Qng0TEWijlGcg
	P+hLz5dS/DowCjvsRspSAqVvLR1RpfP0wM1YOk3RCchjP9sQ7cSTn7CkeattW8gsgZf4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Remove x86 prefixed names from cpuinfo for common.c
Message-Id: <E1vupOw-0046nf-2U@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:12:22 +0000

commit a42a4e3ea5733461180284666e50f5166dc775bf
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Feb 24 09:19:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:07 2026 +0100

    x86: Remove x86 prefixed names from cpuinfo for common.c
    
    struct cpuinfo_x86
      .x86        => .family
      .x86_vendor => .vendor
      .x86_model  => .model
      .x86_mask   => .stepping
    
    No functional change.
    
    This work is part of making Xen safe for Intel family 18/19.
    
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ebe2baf8b9..bfa63fcfb7 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -327,8 +327,8 @@ void __init early_cpu_init(bool verbose)
 	*(u32 *)&c->x86_vendor_id[8] = ecx;
 	*(u32 *)&c->x86_vendor_id[4] = edx;
 
-	c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-	switch (c->x86_vendor) {
+	c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+	switch (c->vendor) {
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu = intel_cpu_dev;    break;
 	case X86_VENDOR_AMD:      actual_cpu = amd_cpu_dev;      break;
@@ -345,7 +345,7 @@ void __init early_cpu_init(bool verbose)
 	}
 
 	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
-	c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+	c->family = get_cpu_family(eax, &c->model, &c->stepping);
 
 	edx &= ~cleared_caps[FEATURESET_1d];
 	ecx &= ~cleared_caps[FEATURESET_1c];
@@ -389,8 +389,8 @@ void __init early_cpu_init(bool verbose)
 		printk(XENLOG_INFO
 		       "CPU Vendor: %s, Family %u (%#x), "
 		       "Model %u (%#x), Stepping %u (raw %08x)\n",
-		       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86,
-		       c->x86, c->x86_model, c->x86_model, c->x86_mask,
+		       x86_cpuid_vendor_to_str(c->vendor), c->family,
+		       c->family, c->model, c->model, c->stepping,
 		       eax);
 
 	if (c->cpuid_level >= 7) {
@@ -432,7 +432,7 @@ void __init early_cpu_init(bool verbose)
 		paddr_bits -= (ebx >> 6) & 0x3f;
 	}
 
-	if (!(c->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
+	if (!(c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
 		park_offline_cpus = opt_mce;
 
 	initialize_cpu_data(0);
@@ -442,10 +442,10 @@ void reset_cpuinfo(struct cpuinfo_x86 *c, bool keep_basic)
 {
     if ( !keep_basic )
     {
-        c->x86_vendor = 0;
-        c->x86 = 0;
-        c->x86_model = 0;
-        c->x86_mask = 0;
+        c->vendor = 0;
+        c->family = 0;
+        c->model = 0;
+        c->stepping = 0;
         memset(&c->x86_capability, 0, sizeof(c->x86_capability));
         memset(&c->x86_vendor_id, 0, sizeof(c->x86_vendor_id));
         memset(&c->x86_model_id, 0, sizeof(c->x86_model_id));
@@ -465,18 +465,18 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	*(u32 *)&c->x86_vendor_id[8] = ecx;
 	*(u32 *)&c->x86_vendor_id[4] = edx;
 
-	c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-	if (boot_cpu_data.x86_vendor != c->x86_vendor)
+	c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+	if (boot_cpu_data.vendor != c->vendor)
 		printk(XENLOG_ERR "CPU%u vendor %u mismatch against BSP %u\n",
-		       smp_processor_id(), c->x86_vendor,
-		       boot_cpu_data.x86_vendor);
+		       smp_processor_id(), c->vendor,
+		       boot_cpu_data.vendor);
 
 	/* Initialize the standard set of capabilities */
 	/* Note that the vendor-specific code below might override */
 
 	/* Model and family information. */
 	cpuid(1, &eax, &ebx, &ecx, &edx);
-	c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+	c->family = get_cpu_family(eax, &c->model, &c->stepping);
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
@@ -605,7 +605,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	if ( !c->x86_model_id[0] ) {
 		/* Last resort... */
 		snprintf(c->x86_model_id, sizeof(c->x86_model_id),
-			"%02x/%02x", c->x86_vendor, c->x86_model);
+			"%02x/%02x", c->vendor, c->model);
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
@@ -824,16 +824,16 @@ void print_cpu_info(unsigned int cpu)
 
 	printk("CPU%u: ", cpu);
 
-	vendor = x86_cpuid_vendor_to_str(c->x86_vendor);
+	vendor = x86_cpuid_vendor_to_str(c->vendor);
 	if (strncmp(c->x86_model_id, vendor, strlen(vendor)))
 		printk("%s ", vendor);
 
 	if (!c->x86_model_id[0])
-		printk("%d86", c->x86);
+		printk("%d86", c->family);
 	else
 		printk("%s", c->x86_model_id);
 
-	printk(" stepping %02x\n", c->x86_mask);
+	printk(" stepping %02x\n", c->stepping);
 }
 
 static cpumask_t cpu_initialized;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 10:12:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 10:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239728.1541140 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vupP8-0004gR-G0; Tue, 24 Feb 2026 10:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239728.1541140; Tue, 24 Feb 2026 10:12: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 1vupP8-0004gJ-DU; Tue, 24 Feb 2026 10:12:34 +0000
Received: by outflank-mailman (input) for mailman id 1239728;
 Tue, 24 Feb 2026 10:12: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 1vupP6-0004gB-Tc
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 10:12: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 1vupP6-007mxW-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vupP6-0046oE-2l
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 10:12: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=nPEOcgWfEwRWW1qxe9Y4O0gEiG3+we2G6NfT1gyClQM=; b=Oyqj+cw1Si1GJtzgUiVW41CQ+X
	1XhGNO4yBs1qKh1O0Z980fg/797EDuIEXMl5nIdU1WdTfa5T5lh1nfMs57JZOtnTsTXW/JcPLA3N5
	07eJuyo6hXhJyt43o3+oX3B2YnKC2Y8kxiAkbH8eCXwHH79AfGyO8ayMwtPXMj+Ru3RU=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] wait: drop wake_up_{all,one}()
Message-Id: <E1vupP6-0046oE-2l@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 10:12:32 +0000

commit 88009f9edded12b65d0ff68e21fa4e96d08ca546
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:19:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:10 2026 +0100

    wait: drop wake_up_{all,one}()
    
    wake_up_one() isn't used at all, so violates Misra rule 2.1 (unreachable
    code). wake_up_all() is only used locally, yet rather than making it
    static its sole user can invoke wake_up_nr() in the intended way directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/wait.c      | 12 +-----------
 xen/include/xen/wait.h |  2 --
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 9a11dccb5d..2a12055f78 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -87,7 +87,7 @@ void init_waitqueue_head(struct waitqueue_head *wq)
 
 void destroy_waitqueue_head(struct waitqueue_head *wq)
 {
-    wake_up_all(wq);
+    wake_up_nr(wq, UINT_MAX);
 }
 
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
@@ -107,16 +107,6 @@ void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
     spin_unlock(&wq->lock);
 }
 
-void wake_up_one(struct waitqueue_head *wq)
-{
-    wake_up_nr(wq, 1);
-}
-
-void wake_up_all(struct waitqueue_head *wq)
-{
-    wake_up_nr(wq, UINT_MAX);
-}
-
 #ifdef CONFIG_X86
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h
index e3510431ac..f2cac62963 100644
--- a/xen/include/xen/wait.h
+++ b/xen/include/xen/wait.h
@@ -31,8 +31,6 @@ void destroy_waitqueue_head(struct waitqueue_head *wq);
 
 /* Wake VCPU(s) waiting on specified waitqueue. */
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);
-void wake_up_one(struct waitqueue_head *wq);
-void wake_up_all(struct waitqueue_head *wq);
 
 /* Wait on specified waitqueue until @condition is true. */
 #define wait_event(wq, condition)               \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:11:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:11:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239840.1541243 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuqJj-00018u-Pq; Tue, 24 Feb 2026 11:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239840.1541243; Tue, 24 Feb 2026 11: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 1vuqJj-00018m-NG; Tue, 24 Feb 2026 11:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1239840;
 Tue, 24 Feb 2026 11: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 1vuqJi-00018g-3b
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 11: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 1vuqJi-007oCd-08
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuqJh-004AIV-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11: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=tMQ8J3eVqKrQZ9O6qMhlUpDBkvqhm89uVPihx5U0uxc=; b=2cQfd3Q2BkZjbjqrez3JhdgoNR
	pTe5hx3u3VAppia7TmfNFEfT1AN61aSbBgcujCxn1Y7Sir6Z3EkwS4G2qPXTUGEjYscOPQNb16zFx
	k86x9KsJFhm/64TaLmK835g3V61lm6/nNO24kCCMXE6vjIe05v2Z0ZYf+wPghUqYDx2Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/p2m: clarify foreign map handling in p2m_entry_modify()
Message-Id: <E1vuqJh-004AIV-3D@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:11:01 +0000

commit ac607edc2e261e1bd5b2907a62c55f8e5ba8bc9d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Thu Feb 19 18:26:19 2026 +0100
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 24 09:34:29 2026 +0100

    x86/p2m: clarify foreign map handling in p2m_entry_modify()
    
    Introduce an extra check and comment to ensure the outer caller has
    possibly taken an extra reference on the foreign page that's about to be
    removed from the p2m.  Otherwise the put_page() in p2m_entry_modify() won't
    be safe to do ahead of the entry being removed form the p2m and any cached
    states purged.
    
    While there also replace the error codes for unreachable paths to use
    EILSEQ.
    
    No functional change intended.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/p2m.h | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index ef6b02ff0b..1ceb248b9d 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -1066,7 +1066,7 @@ static inline int p2m_entry_modify(struct p2m_domain *p2m, p2m_type_t nt,
         if ( !mfn_valid(nfn) || p2m != p2m_get_hostp2m(p2m->domain) )
         {
             ASSERT_UNREACHABLE();
-            return -EINVAL;
+            return -EILSEQ;
         }
 
         if ( !page_get_owner_and_reference(mfn_to_page(nfn)) )
@@ -1088,14 +1088,26 @@ static inline int p2m_entry_modify(struct p2m_domain *p2m, p2m_type_t nt,
         break;
 
     case p2m_map_foreign:
-        if ( !mfn_valid(ofn) || p2m != p2m_get_hostp2m(p2m->domain) )
+    {
+        struct page_info *pg = mfn_valid(ofn) ? mfn_to_page(ofn) : NULL;
+        unsigned long ci = pg ? ACCESS_ONCE(pg->count_info) : 0;
+
+        if ( !pg || p2m != p2m_get_hostp2m(p2m->domain) ||
+             /*
+              * Rely on the caller also holding a reference to the page, so
+              * that the put_page() below doesn't cause the page to be
+              * freed, as it still has to be removed from the p2m.
+              */
+             (ci & PGC_count_mask) <= (ci & PGC_allocated ? 2 : 1) ||
+             !p2m->nr_foreign )
         {
             ASSERT_UNREACHABLE();
-            return -EINVAL;
+            return -EILSEQ;
         }
-        put_page(mfn_to_page(ofn));
+        put_page(pg);
         p2m->nr_foreign--;
         break;
+    }
 
     default:
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239841.1541248 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vuqJt-0001As-Re; Tue, 24 Feb 2026 11:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239841.1541248; Tue, 24 Feb 2026 11: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 1vuqJt-0001Ak-Oi; Tue, 24 Feb 2026 11:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1239841;
 Tue, 24 Feb 2026 11: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 1vuqJs-0001AW-7m
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 11: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 1vuqJs-007oCn-0f
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vuqJs-004AJ5-0I
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11: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=PPn1osuXW3LhdMV1f68whkixXLLKVs4Y+93eUZqvyO4=; b=IRG69NDGQ9CsRmENFOGL7QpSbg
	0IjXIt6TyrvBYCo8nZegKX4Fzn8EW56g7pbVs+41ctIqSLYBlMHxU0zenhT5IbSq6X2KCHCgszw1N
	iA29OldDPVycnfD3BCLcgJkOCcdoonWJ3m9xg6dyDQy/AsWRJ30xSlVg2MNPRaBU55yE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] vpci/msix: fix typo
Message-Id: <E1vuqJs-004AJ5-0I@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:11:12 +0000

commit de963f81efaf19c1899fa06eecdc585f3d6d4a96
Author:     Stewart Hildebrand <stewart.hildebrand@amd.com>
AuthorDate: Mon Feb 23 22:05:15 2026 -0500
Commit:     Roger Pau Monne <roger.pau@citrix.com>
CommitDate: Tue Feb 24 09:34:29 2026 +0100

    vpci/msix: fix typo
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/msix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 516282205a..eaf8fae970 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -795,7 +795,7 @@ static int cf_check init_msix(struct pci_dev *pdev)
 
     /*
      * vPCI header initialization will have mapped the whole BAR into the
-     * p2m, as MSI-X capability was not yet initialized.  Crave a hole for
+     * p2m, as MSI-X capability was not yet initialized.  Carve a hole for
      * the MSI-X table here, so that Xen can trap accesses.
      */
     return vpci_make_msix_hole(pdev);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239956.1541351 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur0J-0003w5-6c; Tue, 24 Feb 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 1239956.1541351; Tue, 24 Feb 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 1vur0J-0003vx-3V; Tue, 24 Feb 2026 11:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1239956;
 Tue, 24 Feb 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 1vur0I-0003vr-6w
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur0I-007p2H-0a
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur0I-004CbD-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=HjpuB5O+lEoy0+4A520ndL/dMVwtkJzoyJn5DRHWa5g=; b=2EVnuhHu/DG12/vhxk1UR4lr/k
	TtWyT9cvr1ptvUj4FP5ScJSe0S/J4g4Sp2YrbCDwpvjSzftQPNw1ZDmzK0vw4gfkTyoh+vWq4Fb0N
	i+mb2m5DuC4VLn0ihYLChYkkRDwcudV3Ez7eK+xoT4L42NO3aVT2V0CLh+CoKTE8gG1c=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: sh_rm_write_access_from_sl1p() is HVM-only
Message-Id: <E1vur0I-004CbD-0S@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:02 +0000

commit 259dc9c485b80cc9cead5825dd77d6a155e666cc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:15:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:47 2026 +0100

    x86/shadow: sh_rm_write_access_from_sl1p() is HVM-only
    
    The function is used from (HVM-only) OOS code only - replace the
    respective #ifdef inside the function to make this more obvious. (Note
    that SHOPT_OUT_OF_SYNC won't be set when !HVM, so the #ifdef surrounding
    the function is already sufficient.)
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index b1cb9aad1f..853682190f 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3435,9 +3435,7 @@ static pagetable_t cf_check sh_update_cr3(struct vcpu *v, bool noflush)
 int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
                                  mfn_t smfn, unsigned long off)
 {
-#ifdef CONFIG_HVM
     struct vcpu *curr = current;
-#endif
     int r;
     shadow_l1e_t *sl1p, sl1e;
     struct page_info *sp;
@@ -3445,12 +3443,10 @@ int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
     ASSERT(mfn_valid(gmfn));
     ASSERT(mfn_valid(smfn));
 
-#ifdef CONFIG_HVM
     /* Remember if we've been told that this process is being torn down */
     if ( curr->domain == d && is_hvm_domain(d) )
         curr->arch.paging.shadow.pagetable_dying
             = mfn_to_page(gmfn)->pagetable_dying;
-#endif
 
     sp = mfn_to_page(smfn);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239957.1541356 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur0U-0003yT-9G; Tue, 24 Feb 2026 11:55:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239957.1541356; Tue, 24 Feb 2026 11: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 1vur0U-0003yL-6s; Tue, 24 Feb 2026 11:55:14 +0000
Received: by outflank-mailman (input) for mailman id 1239957;
 Tue, 24 Feb 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 1vur0S-0003y9-AH
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur0S-007p2L-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur0S-004Cbp-0n
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=cinuELBui2xglyQmmBSggMnoiQpu1W+UQ1NPIlnn2ro=; b=VWrE4+oaM2jj/x8DmeoQCP8n1w
	n/vsomD+oitHYN6NpY38nYrMKXpOtGvSZZF7Hyc5Gvlel+zG81wzloQToExH714YokOAvrN3E4SjF
	lO5pPQAZZcBnGCuM/ZCCSu3QQphmSYPz+m9FyoCobs4iZbHV1KAMkTBvgTRh98wB5pF0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: drop is_hvm_...() where easily possible
Message-Id: <E1vur0S-004Cbp-0n@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:12 +0000

commit 227b86fee0c96eabe742d904e47f368b52cd09e6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:15:34 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:47 2026 +0100

    x86/shadow: drop is_hvm_...() where easily possible
    
    These emulation related functions are involved in HVM handling only, and
    in some cases they even invoke such checks after having already done
    things which are valid for HVM domains only. OOS active also implies HVM.
    In sh_remove_all_mappings() one of the two checks is redundant with an
    earlier paging_mode_external() one (the other, however, needs to stay).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c |  2 +-
 xen/arch/x86/mm/shadow/hvm.c    | 20 +-------------------
 xen/arch/x86/mm/shadow/multi.c  |  2 +-
 xen/arch/x86/mm/shadow/oos.c    |  1 -
 4 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 6d44d9ad1d..c89ab8e063 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1512,7 +1512,7 @@ int sh_remove_all_mappings(struct domain *d, mfn_t gmfn, gfn_t gfn)
                && (page->count_info & PGC_count_mask) <= 3
                && ((page->u.inuse.type_info & PGT_count_mask)
                    == (is_special_page(page) ||
-                       (is_hvm_domain(d) && is_ioreq_server_page(d, page))))) )
+                       is_ioreq_server_page(d, page)))) )
             printk(XENLOG_G_ERR "can't find all mappings of mfn %"PRI_mfn
                    " (gfn %"PRI_gfn"): c=%lx t=%lx s=%d i=%d\n",
                    mfn_x(gmfn), gfn_x(gfn),
diff --git a/xen/arch/x86/mm/shadow/hvm.c b/xen/arch/x86/mm/shadow/hvm.c
index 7b3b58119c..a7db8addc0 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -192,10 +192,6 @@ hvm_emulate_write(enum x86_segment seg,
     if ( rc || !bytes )
         return rc;
 
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (addr & (bytes - 1)) && !is_hvm_vcpu(v)  )
-        return X86EMUL_UNHANDLEABLE;
-
     ptr = sh_emulate_map_dest(v, addr, bytes, sh_ctxt);
     if ( IS_ERR(ptr) )
         return ~PTR_ERR(ptr);
@@ -248,10 +244,6 @@ hvm_emulate_cmpxchg(enum x86_segment seg,
     if ( rc )
         return rc;
 
-    /* Unaligned writes are only acceptable on HVM */
-    if ( (addr & (bytes - 1)) && !is_hvm_vcpu(v)  )
-        return X86EMUL_UNHANDLEABLE;
-
     ptr = sh_emulate_map_dest(v, addr, bytes, sh_ctxt);
     if ( IS_ERR(ptr) )
         return ~PTR_ERR(ptr);
@@ -466,8 +458,7 @@ static void *sh_emulate_map_dest(struct vcpu *v, unsigned long vaddr,
 
 #ifndef NDEBUG
     /* We don't emulate user-mode writes to page tables. */
-    if ( is_hvm_domain(d) ? hvm_get_cpl(v) == 3
-                          : !guest_kernel_mode(v, guest_cpu_user_regs()) )
+    if ( hvm_get_cpl(v) == 3 )
     {
         gdprintk(XENLOG_DEBUG, "User-mode write to pagetable reached "
                  "emulate_map_dest(). This should never happen!\n");
@@ -496,15 +487,6 @@ static void *sh_emulate_map_dest(struct vcpu *v, unsigned long vaddr,
         sh_ctxt->mfn[1] = INVALID_MFN;
         map = map_domain_page(sh_ctxt->mfn[0]) + (vaddr & ~PAGE_MASK);
     }
-    else if ( !is_hvm_domain(d) )
-    {
-        /*
-         * Cross-page emulated writes are only supported for HVM guests;
-         * PV guests ought to know better.
-         */
-        put_page(mfn_to_page(sh_ctxt->mfn[0]));
-        return MAPPING_UNHANDLEABLE;
-    }
     else
     {
         /* This write crosses a page boundary. Translate the second page. */
diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 853682190f..593532defc 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -3444,7 +3444,7 @@ int sh_rm_write_access_from_sl1p(struct domain *d, mfn_t gmfn,
     ASSERT(mfn_valid(smfn));
 
     /* Remember if we've been told that this process is being torn down */
-    if ( curr->domain == d && is_hvm_domain(d) )
+    if ( curr->domain == d )
         curr->arch.paging.shadow.pagetable_dying
             = mfn_to_page(gmfn)->pagetable_dying;
 
diff --git a/xen/arch/x86/mm/shadow/oos.c b/xen/arch/x86/mm/shadow/oos.c
index 89e8a3b722..956b5ebcba 100644
--- a/xen/arch/x86/mm/shadow/oos.c
+++ b/xen/arch/x86/mm/shadow/oos.c
@@ -577,7 +577,6 @@ int sh_unsync(struct vcpu *v, mfn_t gmfn)
     if ( (pg->shadow_flags &
           ((SHF_page_type_mask & ~SHF_L1_ANY) | SHF_out_of_sync)) ||
          sh_page_has_multiple_shadows(pg) ||
-         !is_hvm_vcpu(v) ||
          !v->domain->arch.paging.shadow.oos_active )
         return 0;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239958.1541362 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur0e-00040f-C1; Tue, 24 Feb 2026 11:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239958.1541362; Tue, 24 Feb 2026 11: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 1vur0e-00040X-8B; Tue, 24 Feb 2026 11:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1239958;
 Tue, 24 Feb 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 1vur0c-00040M-DH
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur0c-007p2k-1D
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur0c-004CcC-14
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=4EzM/uXOVjtXULk4WV4UETVt8mKoT67+2o7018XWY9k=; b=V2ke+fXGvZzPZ278NfFQSKNOtE
	HxJyfCo2RZLZkiW16XD66yTUARqhx/vQVZqk4xoxznHEnj3jJdz1UOD6qKTRi6N39fnBVOZbUPI4C
	30H6cnQe0iZYYErBRN67rxYIdngh2ucH0LNFzS3OyykuqybSlp9L9XU6Uyg5/D/PJwqY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: make monitor table create/destroy more consistent
Message-Id: <E1vur0c-004CcC-14@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:22 +0000

commit 06dfcb7f61c05ae184cb1e2d692a14a09551e704
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:07 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:55 2026 +0100

    x86/shadow: make monitor table create/destroy more consistent
    
    While benign at present, it is still a little fragile to operate on a
    wrong "old_mode" value in sh_update_paging_modes(). This can happen when
    no monitor table was present initially - we'd create one for the new
    mode without updating old_mode. Correct this in two ways, each of which
    would be sufficient on its own: Once by adding "else" to the second of
    the involved if()s in the function, and then by setting the correct
    initial mode for HVM domains in shadow_vcpu_init().
    
    Further use the same predicate (paging_mode_external()) consistently
    when dealing with shadow mode init/update/cleanup, rather than a mix of
    is_hvm_vcpu() (init), is_hvm_domain() (update), and
    paging_mode_external() (cleanup).
    
    Finally drop a redundant is_hvm_domain() from inside the bigger if()
    (which is being converted to paging_mode_external()) in
    sh_update_paging_modes().
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index c89ab8e063..126523b898 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -120,9 +120,9 @@ void shadow_vcpu_init(struct vcpu *v)
     }
 #endif
 
-    v->arch.paging.mode = is_hvm_vcpu(v) ?
-                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 3) :
-                          &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
+    v->arch.paging.mode = paging_mode_external(v->domain)
+                          ? &SHADOW_INTERNAL_NAME(sh_paging_mode, 2)
+                          : &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
 }
 
 #if SHADOW_AUDIT
@@ -1802,7 +1802,7 @@ static void sh_update_paging_modes(struct vcpu *v)
         sh_detach_old_tables(v);
 
 #ifdef CONFIG_HVM
-    if ( is_hvm_domain(d) )
+    if ( paging_mode_external(d) )
     {
         const struct paging_mode *old_mode = v->arch.paging.mode;
 
@@ -1855,13 +1855,12 @@ static void sh_update_paging_modes(struct vcpu *v)
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
         }
-
-        if ( v->arch.paging.mode != old_mode )
+        else if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: %pv pe=%d gl=%u "
                           "sl=%u (was g=%u s=%u)\n",
                           v,
-                          is_hvm_domain(d) ? hvm_paging_enabled(v) : 1,
+                          hvm_paging_enabled(v),
                           v->arch.paging.mode->guest_levels,
                           v->arch.paging.mode->shadow.shadow_levels,
                           old_mode ? old_mode->guest_levels : 0,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239959.1541364 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur0o-00042l-C4; Tue, 24 Feb 2026 11:55:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239959.1541364; Tue, 24 Feb 2026 11: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 1vur0o-00042e-9U; Tue, 24 Feb 2026 11:55:34 +0000
Received: by outflank-mailman (input) for mailman id 1239959;
 Tue, 24 Feb 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 1vur0m-00042V-Fw
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur0m-007p2o-1V
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur0m-004Ccl-1O
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=+f0gD0Ec9TccwEghjcXlmzLLReQsJIFjh3kNjZSEqqE=; b=ZRvqK5PoEvDyWX9yZQhB4wFr/N
	iNQMLLvvZ7Hz/9hPxH5q40dSrsa42Ufb/75Ibkh3IyPY3bYS1RsOlFu6hXJPIiB22slo6OS1Ozmgf
	UhcTyWllOhi/EjU0vkwIY4WB96HLUjeXaRVjHcVpC6pTKxUvzsxxSDZgj0AJ3a62Eftw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: vCPU-s never have "no mode"
Message-Id: <E1vur0m-004Ccl-1O@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:32 +0000

commit 88f7ce5f57d49f61941986aac158baeca5b9c381
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:27 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:56 2026 +0100

    x86/shadow: vCPU-s never have "no mode"
    
    With an initial mode installed by shadow_vcpu_init(), there's no need
    for sh_update_paging_modes() to deal with the "mode is still unset"
    case. Leave an assertion, though.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/common.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 126523b898..e07ba6d5a7 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1855,6 +1855,8 @@ static void sh_update_paging_modes(struct vcpu *v)
             make_cr3(v, mmfn);
             hvm_update_host_cr3(v);
         }
+        else if ( !old_mode )
+            ASSERT_UNREACHABLE();
         else if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: %pv pe=%d gl=%u "
@@ -1863,11 +1865,10 @@ static void sh_update_paging_modes(struct vcpu *v)
                           hvm_paging_enabled(v),
                           v->arch.paging.mode->guest_levels,
                           v->arch.paging.mode->shadow.shadow_levels,
-                          old_mode ? old_mode->guest_levels : 0,
-                          old_mode ? old_mode->shadow.shadow_levels : 0);
-            if ( old_mode &&
-                 (v->arch.paging.mode->shadow.shadow_levels !=
-                  old_mode->shadow.shadow_levels) )
+                          old_mode->guest_levels,
+                          old_mode->shadow.shadow_levels);
+            if ( v->arch.paging.mode->shadow.shadow_levels !=
+                 old_mode->shadow.shadow_levels )
             {
                 /* Need to make a new monitor table for the new mode */
                 mfn_t new_mfn, old_mfn;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239960.1541368 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur0y-000455-Dt; Tue, 24 Feb 2026 11:55:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239960.1541368; Tue, 24 Feb 2026 11: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 1vur0y-00044x-Az; Tue, 24 Feb 2026 11:55:44 +0000
Received: by outflank-mailman (input) for mailman id 1239960;
 Tue, 24 Feb 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 1vur0w-00044p-Ii
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur0w-007p2s-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur0w-004CdN-1g
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=racZZa6uiDxVbggI5RXhomyuvNovOW9LKq9NuKkeZa4=; b=HvR5J8U3O3aDCVwco4BRxCxCRH
	AwyJUATQ7ruHB8ZbGLMdU3dLithW6JBgTxnNCI0QTFxs2f4BA2h5S18h104onqfno1uX2dmrEcn+g
	l2UDwMKJD/8H71WynXnLPjFA/eVoTMoM1yLnNZOVZyIzDxinx1izBodOIfBErbU1YPdo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: adjust monitor table prealloc amount
Message-Id: <E1vur0w-004CdN-1g@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:42 +0000

commit fcd373dc72ca30e6cd559943c09dcd13a79d8c6a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:16:43 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:29:58 2026 +0100

    x86/shadow: adjust monitor table prealloc amount
    
    While 670d6b908ff2 ('x86 shadow: Move the shadow linear mapping for
    n-on-3-on-4 shadows so') bumped the amount by one too little for the
    32-on-64 case (which luckily was dead code, and hence a bump wasn't
    necessary in the first place), 0b841314dace ('x86/shadow:
    sh_{make,destroy}_monitor_table() are "even more" HVM-only'), dropping
    the dead code, then didn't adjust the amount back. Yet even the original
    amount was too high in certain cases. Switch to pre-allocating just as
    much as is going to be needed.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@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 a7db8addc0..3565c7940d 100644
--- a/xen/arch/x86/mm/shadow/hvm.c
+++ b/xen/arch/x86/mm/shadow/hvm.c
@@ -747,7 +747,7 @@ mfn_t sh_make_monitor_table(const struct vcpu *v, unsigned int shadow_levels)
     ASSERT(!pagetable_get_pfn(v->arch.hvm.monitor_table));
 
     /* Guarantee we can get the memory we need */
-    if ( !shadow_prealloc(d, SH_type_monitor_table, CONFIG_PAGING_LEVELS) )
+    if ( !shadow_prealloc(d, SH_type_monitor_table, shadow_levels < 4 ? 3 : 1) )
         return INVALID_MFN;
 
     m4mfn = shadow_alloc(d, SH_type_monitor_table, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:55:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:55:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239961.1541372 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur18-00047C-Ez; Tue, 24 Feb 2026 11:55:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239961.1541372; Tue, 24 Feb 2026 11: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 1vur18-000474-CH; Tue, 24 Feb 2026 11:55:54 +0000
Received: by outflank-mailman (input) for mailman id 1239961;
 Tue, 24 Feb 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 1vur16-00046v-M3
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur16-007p2w-26
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:55:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur16-004Cdp-1x
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=4WPLkchmuUxW6KTbdFoHA4a3VZPMoKp9fYpMngUaJ5s=; b=Q3GCRdhYY6ATg8sDIeLmVAVc2X
	kwbtugTqoXuv+g4I3ffW7PTxnv6OwQIcMVjw/0RA+OCV+rKmSXu7xnBuhz3Ksg/2rgMpWRSZJaMBN
	zimmIY0K7OgVZPCXngpWgsrQYFmbD0kxxAqsNShewlYqDaZMZeFnoA8U88ehItD464zQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/riscv: add p2m context switch handling for VSATP and HGATP
Message-Id: <E1vur16-004Cdp-1x@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:55:52 +0000

commit 40e5a4ee554269c9ca5db295a78addf01ade029e
Author:     Oleksii Kurochko <oleksii.kurochko@gmail.com>
AuthorDate: Tue Feb 24 09:17:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:01 2026 +0100

    xen/riscv: add p2m context switch handling for VSATP and HGATP
    
    Introduce helpers to manage VS-stage and G-stage translation state during
    vCPU context switches.
    
    As VSATP and HGATP cannot be updated atomically, clear VSATP on context
    switch-out to prevent speculative VS-stage translations from being associated
    with an incorrect VMID. On context switch-in, restore HGATP and VSATP in the
    required order.
    
    Add p2m_handle_vmenter() to perform VMID management and issue TLB flushes
    only when required (e.g. on VMID reuse or generation change).
    
    This provides the necessary infrastructure for correct p2m context switching
    on RISC-V.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/riscv/include/asm/domain.h |   2 +
 xen/arch/riscv/include/asm/p2m.h    |   4 ++
 xen/arch/riscv/p2m.c                | 100 ++++++++++++++++++++++++++++++++++++
 xen/arch/riscv/traps.c              |   8 +++
 4 files changed, 114 insertions(+)

diff --git a/xen/arch/riscv/include/asm/domain.h b/xen/arch/riscv/include/asm/domain.h
index f78f145258..5aec627a7a 100644
--- a/xen/arch/riscv/include/asm/domain.h
+++ b/xen/arch/riscv/include/asm/domain.h
@@ -48,6 +48,8 @@ struct arch_vcpu {
     } xen_saved_context;
 
     struct cpu_info *cpu_info;
+
+    register_t vsatp;
 };
 
 struct paging_domain {
diff --git a/xen/arch/riscv/include/asm/p2m.h b/xen/arch/riscv/include/asm/p2m.h
index f63b5dec99..60f27f9b34 100644
--- a/xen/arch/riscv/include/asm/p2m.h
+++ b/xen/arch/riscv/include/asm/p2m.h
@@ -255,6 +255,10 @@ static inline bool p2m_is_locked(const struct p2m_domain *p2m)
 struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
                                         p2m_type_t *t);
 
+void p2m_ctxt_switch_from(struct vcpu *p);
+void p2m_ctxt_switch_to(struct vcpu *n);
+void p2m_handle_vmenter(void);
+
 #endif /* ASM__RISCV__P2M_H */
 
 /*
diff --git a/xen/arch/riscv/p2m.c b/xen/arch/riscv/p2m.c
index 0abeb374c1..89e5db606f 100644
--- a/xen/arch/riscv/p2m.c
+++ b/xen/arch/riscv/p2m.c
@@ -1434,3 +1434,103 @@ struct page_info *p2m_get_page_from_gfn(struct p2m_domain *p2m, gfn_t gfn,
 
     return get_page(page, p2m->domain) ? page : NULL;
 }
+
+/*
+ * Must be called before restoring CSRs to avoid potential speculation using
+ * an incorrect set of page tables during updates of VSATP and HGATP.
+ */
+void p2m_ctxt_switch_from(struct vcpu *p)
+{
+    if ( is_idle_vcpu(p) )
+        return;
+
+    /*
+     * No mechanism is provided to atomically change vsatp and hgatp
+     * together. Hence, to prevent speculative execution causing one
+     * guest’s VS-stage translations to be cached under another guest’s
+     * VMID, world-switch code should zero vsatp, then swap hgatp, then
+     * finally write the new vsatp value what will be done in
+     * p2m_ctxt_switch_to().
+     * Note, that also HGATP update could happen in p2m_handle_vmenter().
+     */
+    p->arch.vsatp = csr_swap(CSR_VSATP, 0);
+
+    /*
+     * Nothing to do with HGATP as it will be update in p2m_ctxt_switch_to()
+     * or/and in p2m_handle_vmenter().
+     */
+}
+
+/*
+ * As speculation may occur at any time, an incorrect set of page tables could
+ * be used. Therefore, this function must be called only after all other guest
+ * CSRs have been restored. Otherwise, VS-stage translations could be populated
+ * using stale control state (e.g. SEPC still referring to the previous guest)
+ * while VSATP and HGATP already point to the new guest.
+ */
+void p2m_ctxt_switch_to(struct vcpu *n)
+{
+    struct p2m_domain *p2m = p2m_get_hostp2m(n->domain);
+
+    if ( is_idle_vcpu(n) )
+        return;
+
+    csr_write(CSR_HGATP, construct_hgatp(p2m, n->arch.vmid.vmid));
+    /*
+     * As VMID is unique per vCPU and just re-used here thereby there is no
+     * need for G-stage TLB flush here.
+     */
+
+    csr_write(CSR_VSATP, n->arch.vsatp);
+
+    /*
+     * Since n->arch.vsatp.ASID may equal p->arch.vsatp.ASID,
+     * flush the VS-stage TLB to prevent the new guest from
+     * using stale (not belongs to it) translations.
+     * ASID equality is not the only potential issue here.
+     *
+     * TODO: This could be optimized by making the flush
+     *       conditional.
+     */
+    flush_tlb_guest_local();
+}
+
+void p2m_handle_vmenter(void)
+{
+    struct vcpu *curr = current;
+    struct p2m_domain *p2m = p2m_get_hostp2m(curr->domain);
+    struct vcpu_vmid *p_vmid = &curr->arch.vmid;
+    unsigned short old_vmid, new_vmid;
+    bool need_flush;
+
+    BUG_ON(is_idle_vcpu(curr));
+
+    old_vmid = p_vmid->vmid;
+    need_flush = vmid_handle_vmenter(p_vmid);
+    new_vmid = p_vmid->vmid;
+
+#ifdef P2M_DEBUG
+    printk("%pv: oldvmid(%d) new_vmid(%d), need_flush(%d)\n",
+           curr, old_vmid, new_vmid, need_flush);
+#endif
+
+    /*
+     * There is no need to set VSATP to 0 to stop speculation before updating
+     * HGATP, as VSATP is not modified here.
+     */
+    if ( old_vmid != new_vmid )
+        csr_write(CSR_HGATP, construct_hgatp(p2m, p_vmid->vmid));
+
+    /*
+     * There is also no need to flush G-stage TLB unconditionally as old VMID
+     * won't be reused until need_flush is set to true.
+     */
+    if ( unlikely(need_flush) )
+        local_hfence_gvma_all();
+
+    /*
+     * There is also no need to flush the VS-stage TLB: even if speculation
+     * occurs (VSATP + old HGATP were used), it will use the old VMID, which
+     * won't be reused until need_flush is set to true.
+     */
+}
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index c81a4f79a0..9fca941526 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -169,6 +169,11 @@ static void do_unexpected_trap(const struct cpu_user_regs *regs)
     die();
 }
 
+static void check_for_pcpu_work(void)
+{
+    p2m_handle_vmenter();
+}
+
 void do_trap(struct cpu_user_regs *cpu_regs)
 {
     register_t pc = cpu_regs->sepc;
@@ -222,6 +227,9 @@ void do_trap(struct cpu_user_regs *cpu_regs)
         do_unexpected_trap(cpu_regs);
         break;
     }
+
+    if ( cpu_regs->hstatus & HSTATUS_SPV )
+        check_for_pcpu_work();
 }
 
 void vcpu_show_execution_state(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:56:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:56:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239962.1541376 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur1I-00049D-H0; Tue, 24 Feb 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 1239962.1541376; Tue, 24 Feb 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 1vur1I-000493-Di; Tue, 24 Feb 2026 11:56:04 +0000
Received: by outflank-mailman (input) for mailman id 1239962;
 Tue, 24 Feb 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 1vur1G-00048x-Ow
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vur1G-007p3E-2P
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur1G-004Cen-2H
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=vyrwhUYW8VY+JC8hJ9fe8MunoFNbs6arvV5IYrcdjT8=; b=4rDwMAUJsZmMPAt+q8iiKVoc89
	McV67ghKbHO7ZbWQXqhWvih7oXreofOJENiJcB0agJv7163Eg/xaRFq9VQcjbE6kKs2+Lf1EFeqQI
	/DBqmpmYPqS1la1rw68b1o9a0z09v0UPkkoIcMBVrXmNjFsA4CcgI4Ww6n9ukH+5ttUk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/platform: Adjust temperature sensors MSRs
Message-Id: <E1vur1G-004Cen-2H@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:56:02 +0000

commit 87669157168e83756259b27db8774d959c211776
Author:     Teddy Astie <teddy.astie@vates.tech>
AuthorDate: Tue Feb 24 09:18:02 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:03 2026 +0100

    x86/platform: Adjust temperature sensors MSRs
    
    Temperature sensors MSR were previously assumed to be available when "DTS"
    CPUID bit is set. This is not really the case :
     * MSR_IA32_THERM_STATUS is gated behind ACPI CPUID bit, only DTS-related bits
    of this MSR are gated behind the DTS CPUID
     * MSR_PACKAGE_THERM_STATUS is gated behind "PTM" CPUID
    
    Also adjust the MSR_TEMPERATURE_TARGET which is not architectural, but stable
    in practice, and required to be exposed for reliably querying CPU temperature.
    
    Fixes: 615c9f3f820 ("x86/platform: Expose DTS sensors MSR")
    Reported-by: Tu Dinh <ngoc-tu.dinh@vates.tech>
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/platform_hypercall.c    | 19 ++++++++++++++++++-
 xen/include/xen/lib/x86/cpu-policy.h |  2 +-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index c6c5135806..cd4f0ae5e5 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -89,9 +89,26 @@ static bool msr_read_allowed(unsigned int msr)
         return cpu_has_srbds_ctrl;
 
     case MSR_IA32_THERM_STATUS:
+        return host_cpu_policy.basic.acpi;
+
+    /*
+     * This MSR is present on most Intel Core-family CPUs since Nehalem but is not an
+     * architectural MSR. No CPUID bit enumerates this MSR.
+     *
+     * This MSR exposes "temperature target" that is needed to compute the CPU
+     * temperature. The "temperature target" is a model specific value, and this MSR is
+     * the only known method of getting the one used for the CPU. On some CPU models with
+     * Intel SST-PP, the "temperature target" can vary over time.
+     *
+     * We assume all Intel CPUs with DTS may support this MSR; but reads can fail in case
+     * the platform doesn't actually support this MSR.
+     */
     case MSR_TEMPERATURE_TARGET:
+        return boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
+               host_cpu_policy.basic.digital_temp_sensor;
+
     case MSR_PACKAGE_THERM_STATUS:
-        return host_cpu_policy.basic.digital_temp_sensor;
+        return host_cpu_policy.basic.pkg_therm_mgmt;
     }
 
     if ( ppin_msr && msr == ppin_msr )
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index db8d035589..d29e380359 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -132,7 +132,7 @@ struct cpu_policy
                         :1,
                         :1,
                         :1,
-                        :1,
+                        pkg_therm_mgmt:1,
                         hwp:1,
                         hwp_interrupt:1,
                         hwp_activity_window:1,
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:56:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239963.1541379 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur1S-0004Bn-JL; Tue, 24 Feb 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 1239963.1541379; Tue, 24 Feb 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 1vur1S-0004Bf-Go; Tue, 24 Feb 2026 11:56:14 +0000
Received: by outflank-mailman (input) for mailman id 1239963;
 Tue, 24 Feb 2026 11:56: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 1vur1Q-0004BW-Rs
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 11:56: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 1vur1Q-007p3P-2g
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur1Q-004CfV-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=oj8nyiFIMSpl3fwOvFPyE2FcmEpzFin5MsdjEtti/Zo=; b=ns2jShjOxYvlsKpYU8xBl/3its
	iGQY3VCOQ7U029LIbJ97VeZ8c71aU8p6R3w8vMq0naGB6dIrojQJrlKZH+ouRCzK7umvTtAZdE/wn
	+YnT9ISVZUF41VTnA0Ybx5q1JEFPK2VGQhYxTg+2tagsjzEE/4fYOpPyEZvqlG8LYOaM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests/x86_emulator: fix 'shifting a negative signed value is undefined'
Message-Id: <E1vur1Q-004CfV-2a@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:56:12 +0000

commit 5a376999562bf43dbbbff28c2f19c634ec7f1b32
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Tue Feb 24 09:18:40 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:05 2026 +0100

    tools/tests/x86_emulator: fix 'shifting a negative signed value is undefined'
    
    clang-21 refuses to compile this:
    ```
    test_x86_emulator.c:1164:24: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
     1164 |     regs.r8     = (-1L << 40) + 1;
          |                    ~~~ ^
    1 error generated.
    ```
    
    The shift could also exceed the width of the type on some systems.
    I confirmed that both the old and the new code would produce the same value
    with GCC on x86-64: `0xffffff0000000001`.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/tests/x86_emulator/test_x86_emulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c
index 39e8056d77..ea507f9c3a 100644
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -1161,7 +1161,7 @@ int main(int argc, char **argv)
     instr[0] = 0x4d; instr[1] = 0x0f; instr[2] = 0xbb; instr[3] = 0x03;
     regs.eflags = EFLAGS_ALWAYS_SET;
     regs.rip    = (unsigned long)&instr[0];
-    regs.r8     = (-1L << 40) + 1;
+    regs.r8     = (~0UL << 40) + 1;
     regs.r11    = (unsigned long)(res + (1L << 35));
     rc = x86_emulate(&ctxt, &emulops);
     if ( (rc != X86EMUL_OKAY) ||
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:56:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239964.1541384 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur1c-0004Ds-Kq; Tue, 24 Feb 2026 11:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239964.1541384; Tue, 24 Feb 2026 11:56: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 1vur1c-0004Dk-I9; Tue, 24 Feb 2026 11:56:24 +0000
Received: by outflank-mailman (input) for mailman id 1239964;
 Tue, 24 Feb 2026 11: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 1vur1a-0004Dc-Ue
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 11:56: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 1vur1a-007p3k-2y
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur1a-004CgB-2r
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56: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=qe0v6xLULSSHA0ukS+I1mSWHOEs5RkSNFydktW6pWEY=; b=G00qLiOMaRoDykGZoA6nHfPRNC
	/SkPMfkz9XTGl+Xoaqed3i4grwuD3XNAhVQfYBOgi8bJyMW+9hl/d5eqTJcszpyOMDuMbVeYOXiGE
	XY7f15Aa8SXZinhYr2jKWLiZe4NXrwqZWHuOGxhdAmdFs40alDseC3dneg3gx721EN/k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Remove x86 prefixed names from cpuinfo for common.c
Message-Id: <E1vur1a-004CgB-2r@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:56:22 +0000

commit a42a4e3ea5733461180284666e50f5166dc775bf
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Tue Feb 24 09:19:03 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:07 2026 +0100

    x86: Remove x86 prefixed names from cpuinfo for common.c
    
    struct cpuinfo_x86
      .x86        => .family
      .x86_vendor => .vendor
      .x86_model  => .model
      .x86_mask   => .stepping
    
    No functional change.
    
    This work is part of making Xen safe for Intel family 18/19.
    
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/common.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ebe2baf8b9..bfa63fcfb7 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -327,8 +327,8 @@ void __init early_cpu_init(bool verbose)
 	*(u32 *)&c->x86_vendor_id[8] = ecx;
 	*(u32 *)&c->x86_vendor_id[4] = edx;
 
-	c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-	switch (c->x86_vendor) {
+	c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+	switch (c->vendor) {
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu = intel_cpu_dev;    break;
 	case X86_VENDOR_AMD:      actual_cpu = amd_cpu_dev;      break;
@@ -345,7 +345,7 @@ void __init early_cpu_init(bool verbose)
 	}
 
 	cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
-	c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+	c->family = get_cpu_family(eax, &c->model, &c->stepping);
 
 	edx &= ~cleared_caps[FEATURESET_1d];
 	ecx &= ~cleared_caps[FEATURESET_1c];
@@ -389,8 +389,8 @@ void __init early_cpu_init(bool verbose)
 		printk(XENLOG_INFO
 		       "CPU Vendor: %s, Family %u (%#x), "
 		       "Model %u (%#x), Stepping %u (raw %08x)\n",
-		       x86_cpuid_vendor_to_str(c->x86_vendor), c->x86,
-		       c->x86, c->x86_model, c->x86_model, c->x86_mask,
+		       x86_cpuid_vendor_to_str(c->vendor), c->family,
+		       c->family, c->model, c->model, c->stepping,
 		       eax);
 
 	if (c->cpuid_level >= 7) {
@@ -432,7 +432,7 @@ void __init early_cpu_init(bool verbose)
 		paddr_bits -= (ebx >> 6) & 0x3f;
 	}
 
-	if (!(c->x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
+	if (!(c->vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)))
 		park_offline_cpus = opt_mce;
 
 	initialize_cpu_data(0);
@@ -442,10 +442,10 @@ void reset_cpuinfo(struct cpuinfo_x86 *c, bool keep_basic)
 {
     if ( !keep_basic )
     {
-        c->x86_vendor = 0;
-        c->x86 = 0;
-        c->x86_model = 0;
-        c->x86_mask = 0;
+        c->vendor = 0;
+        c->family = 0;
+        c->model = 0;
+        c->stepping = 0;
         memset(&c->x86_capability, 0, sizeof(c->x86_capability));
         memset(&c->x86_vendor_id, 0, sizeof(c->x86_vendor_id));
         memset(&c->x86_model_id, 0, sizeof(c->x86_model_id));
@@ -465,18 +465,18 @@ static void generic_identify(struct cpuinfo_x86 *c)
 	*(u32 *)&c->x86_vendor_id[8] = ecx;
 	*(u32 *)&c->x86_vendor_id[4] = edx;
 
-	c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
-	if (boot_cpu_data.x86_vendor != c->x86_vendor)
+	c->vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
+	if (boot_cpu_data.vendor != c->vendor)
 		printk(XENLOG_ERR "CPU%u vendor %u mismatch against BSP %u\n",
-		       smp_processor_id(), c->x86_vendor,
-		       boot_cpu_data.x86_vendor);
+		       smp_processor_id(), c->vendor,
+		       boot_cpu_data.vendor);
 
 	/* Initialize the standard set of capabilities */
 	/* Note that the vendor-specific code below might override */
 
 	/* Model and family information. */
 	cpuid(1, &eax, &ebx, &ecx, &edx);
-	c->x86 = get_cpu_family(eax, &c->x86_model, &c->x86_mask);
+	c->family = get_cpu_family(eax, &c->model, &c->stepping);
 	c->apicid = phys_pkg_id((ebx >> 24) & 0xFF, 0);
 	c->phys_proc_id = c->apicid;
 
@@ -605,7 +605,7 @@ void identify_cpu(struct cpuinfo_x86 *c)
 	if ( !c->x86_model_id[0] ) {
 		/* Last resort... */
 		snprintf(c->x86_model_id, sizeof(c->x86_model_id),
-			"%02x/%02x", c->x86_vendor, c->x86_model);
+			"%02x/%02x", c->vendor, c->model);
 	}
 
 	/* Now the feature flags better reflect actual CPU features! */
@@ -824,16 +824,16 @@ void print_cpu_info(unsigned int cpu)
 
 	printk("CPU%u: ", cpu);
 
-	vendor = x86_cpuid_vendor_to_str(c->x86_vendor);
+	vendor = x86_cpuid_vendor_to_str(c->vendor);
 	if (strncmp(c->x86_model_id, vendor, strlen(vendor)))
 		printk("%s ", vendor);
 
 	if (!c->x86_model_id[0])
-		printk("%d86", c->x86);
+		printk("%d86", c->family);
 	else
 		printk("%s", c->x86_model_id);
 
-	printk(" stepping %02x\n", c->x86_mask);
+	printk(" stepping %02x\n", c->stepping);
 }
 
 static cpumask_t cpu_initialized;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 11:56:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 11:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239965.1541388 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vur1l-0004GN-MW; Tue, 24 Feb 2026 11:56:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239965.1541388; Tue, 24 Feb 2026 11:56: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 1vur1l-0004GF-Jf; Tue, 24 Feb 2026 11:56:33 +0000
Received: by outflank-mailman (input) for mailman id 1239965;
 Tue, 24 Feb 2026 11: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 1vur1l-0004G7-17
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 11: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 1vur1l-007p3s-01
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vur1k-004Cgk-39
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 11:56: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=5aWt/B8RGwMfSFOL7fmQ6cQ8OaePZu0qE06MDdPxsdw=; b=e2xeu1kc3dmvICc70L6t3QQ2sb
	9iw7d8Zrw7BjJ+Ke96IYs+fWiFgTuTTfyZs9CFJ674l9K4xtvOdoG35QHXctzYHvZ36QMiKcVycXe
	36/gaF/Ou5i56A17X+clPjL1Ct6m4lLLvrxPTZFFl0KH6ZGkuurfEULsqLHNZ2xEcKAE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] wait: drop wake_up_{all,one}()
Message-Id: <E1vur1k-004Cgk-39@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 11:56:32 +0000

commit 88009f9edded12b65d0ff68e21fa4e96d08ca546
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Feb 24 09:19:44 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Feb 24 10:30:10 2026 +0100

    wait: drop wake_up_{all,one}()
    
    wake_up_one() isn't used at all, so violates Misra rule 2.1 (unreachable
    code). wake_up_all() is only used locally, yet rather than making it
    static its sole user can invoke wake_up_nr() in the intended way directly.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/wait.c      | 12 +-----------
 xen/include/xen/wait.h |  2 --
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/xen/common/wait.c b/xen/common/wait.c
index 9a11dccb5d..2a12055f78 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -87,7 +87,7 @@ void init_waitqueue_head(struct waitqueue_head *wq)
 
 void destroy_waitqueue_head(struct waitqueue_head *wq)
 {
-    wake_up_all(wq);
+    wake_up_nr(wq, UINT_MAX);
 }
 
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
@@ -107,16 +107,6 @@ void wake_up_nr(struct waitqueue_head *wq, unsigned int nr)
     spin_unlock(&wq->lock);
 }
 
-void wake_up_one(struct waitqueue_head *wq)
-{
-    wake_up_nr(wq, 1);
-}
-
-void wake_up_all(struct waitqueue_head *wq)
-{
-    wake_up_nr(wq, UINT_MAX);
-}
-
 #ifdef CONFIG_X86
 
 static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h
index e3510431ac..f2cac62963 100644
--- a/xen/include/xen/wait.h
+++ b/xen/include/xen/wait.h
@@ -31,8 +31,6 @@ void destroy_waitqueue_head(struct waitqueue_head *wq);
 
 /* Wake VCPU(s) waiting on specified waitqueue. */
 void wake_up_nr(struct waitqueue_head *wq, unsigned int nr);
-void wake_up_one(struct waitqueue_head *wq);
-void wake_up_all(struct waitqueue_head *wq);
 
 /* Wait on specified waitqueue until @condition is true. */
 #define wait_event(wq, condition)               \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239978.1541403 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurFn-0007Jo-2p; Tue, 24 Feb 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 1239978.1541403; Tue, 24 Feb 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 1vurFm-0007Jg-VE; Tue, 24 Feb 2026 12:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1239978;
 Tue, 24 Feb 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 1vurFm-0007Ja-B6
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vurFm-007pMv-0t
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurFm-004Dmd-0l
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=e9WvzNube1WO++8+MvCAfZNUq8WiHSfXX1gebHF0b5g=; b=Ma9rThxYFR7NEcPWreFbewVKsc
	YlQ4DjJcJEDUqwhbpFd2kf4u/5/HVtsWLxH/rprn6KF1yu5EqmX72a9eb1BPpLj4dJ+urLkN6RhRd
	yxmVfuIjCX8LzhxN6N66x0OiXuxjd+75UmUKoQOS4XcHSUwadaJnFifg2KwI7zVcxCc8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Add endpoint lookup helper
Message-Id: <E1vurFm-004Dmd-0l@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:02 +0000

commit 4ed7f66fab333f7ea22c48e9645d974e96631b28
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:25 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add endpoint lookup helper
    
    Direct messaging paths duplicate endpoint validation and RCU domain
    lookup logic across multiple call sites, which makes the checks easy to
    drift and complicates maintenance.
    
    Introduce ffa_endpoint_domain_lookup() to centralize this logic. The
    helper validates the endpoint ID (rejecting ID 0 for the hypervisor),
    performs RCU domain lookup, ensures the domain is live and has an
    initialized FF-A context with a negotiated version, and returns the
    domain locked via RCU.
    
    Switch ffa_msg_send2_vm() to use the helper, replacing its open-coded
    validation sequence. This consolidates approximately 20 lines of
    duplicated checks into a single call.
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 45 ++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/tee/ffa_msg.c     | 24 +++-------------------
 xen/arch/arm/tee/ffa_private.h |  3 +++
 3 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ed18e76080..6de2b9f8ac 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -433,6 +433,51 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     return true;
 }
 
+/*
+ * Look up a domain by its FF-A endpoint ID and validate it's ready for FF-A.
+ * Returns FFA_RET_OK on success with domain locked via RCU.
+ * Caller must call rcu_unlock_domain() when done.
+ *
+ * Validates:
+ * - endpoint_id is not 0 (the hypervisor)
+ * - domain exists and is live
+ * - domain has FF-A context initialized
+ * - domain has negotiated an FF-A version
+ */
+int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
+                                   struct ffa_ctx **ctx_out)
+{
+    struct domain *d;
+    struct ffa_ctx *ctx;
+    int err;
+
+    if ( endpoint_id == 0 )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    err = rcu_lock_live_remote_domain_by_id(endpoint_id - 1, &d);
+    if ( err )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( !d->arch.tee )
+    {
+        rcu_unlock_domain(d);
+        return FFA_RET_INVALID_PARAMETERS;
+    }
+
+    ctx = d->arch.tee;
+    if ( !ACCESS_ONCE(ctx->guest_vers) )
+    {
+        rcu_unlock_domain(d);
+        return FFA_RET_INVALID_PARAMETERS;
+    }
+
+    *d_out = d;
+    if ( ctx_out )
+        *ctx_out = ctx;
+
+    return FFA_RET_OK;
+}
+
 static int ffa_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 4e26596461..10856fddcb 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -161,30 +161,12 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     struct ffa_part_msg_rxtx_1_2 *dst_msg;
     void *rx_buf;
     size_t rx_size;
-    int err;
     int32_t ret;
 
-    if ( dst_id == 0 )
-        /* FF-A ID 0 is the hypervisor, this is not valid */
-        return FFA_RET_INVALID_PARAMETERS;
-
     /* This is also checking that dest is not src */
-    err = rcu_lock_live_remote_domain_by_id(dst_id - 1, &dst_d);
-    if ( err )
-        return FFA_RET_INVALID_PARAMETERS;
-
-    if ( dst_d->arch.tee == NULL )
-    {
-        ret = FFA_RET_INVALID_PARAMETERS;
-        goto out_unlock;
-    }
-
-    dst_ctx = dst_d->arch.tee;
-    if ( !ACCESS_ONCE(dst_ctx->guest_vers) )
-    {
-        ret = FFA_RET_INVALID_PARAMETERS;
-        goto out_unlock;
-    }
+    ret = ffa_endpoint_domain_lookup(dst_id, &dst_d, &dst_ctx);
+    if ( ret )
+        return ret;
 
     /* This also checks that destination has set a Rx buffer */
     ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 282c105f3b..cd7ecabc7e 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -437,6 +437,9 @@ int32_t ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
+int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
+                                   struct ffa_ctx **ctx_out);
+
 bool ffa_rxtx_spmc_init(void);
 void ffa_rxtx_spmc_destroy(void);
 void *ffa_rxtx_spmc_rx_acquire(void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239979.1541408 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurFx-0007Lh-4R; Tue, 24 Feb 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 1239979.1541408; Tue, 24 Feb 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 1vurFx-0007LX-0O; Tue, 24 Feb 2026 12:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1239979;
 Tue, 24 Feb 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 1vurFw-0007LR-Dc
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vurFw-007pN3-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurFw-004Dof-14
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=rjPYjJWwbT9gJ/qHF4+9o/VbgE8HDviR0LOAwOP57g8=; b=k7glyvFq1s53e0RpDNCPO04XP7
	xgnRF8s3FIi3fcEBIDLOrlG+/8q9oTLsH9PC8X1ErI9+wkOjm3CS8HNbx8sFehLH/NUw7LfUMDC8D
	V6UW1q7yGcBTnuNoG25HUp3ajtgMGO7AI5ZwB10x2kgP9D0d5mqW74KfLnd/YbrMnGrQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix MEM_SHARE NS attribute handling
Message-Id: <E1vurFw-004Dof-14@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:12 +0000

commit edf036fac2b09b131b0b3db5c1c93c17ffd1600a
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:26 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix MEM_SHARE NS attribute handling
    
    The FF-A memory attribute encoding is currently a literal value (0x2f),
    which makes reviews and validation harder. In addition, MEM_SHARE
    accepts the NS (non-secure) attribute bit even though the normal world
    must not set it according to FF-A specification.
    
    Introduce named attribute bit masks and express FFA_NORMAL_MEM_REG_ATTR
    in terms of them for clarity.
    
    Reject MEM_SHARE descriptors with the NS bit set, returning
    INVALID_PARAMETERS to match FF-A v1.1 rules that prohibit normal world
    from setting this bit.
    
    Functional impact: MEM_SHARE now rejects descriptors with NS bit set
    with the right error code, INVALID_PARAMETER.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_private.h | 17 ++++++++++++++++-
 xen/arch/arm/tee/ffa_shm.c     |  6 ++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index cd7ecabc7e..b625f1c729 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -129,11 +129,26 @@
 #define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
 #define FFA_HANDLE_INVALID              0xffffffffffffffffULL
 
+/* NS attribute was introduced in v1.1 */
+#define FFA_MEM_ATTR_NS                 BIT(6, U)
+
+#define FFA_MEM_ATTR_TYPE_DEV           (1U << 3)
+#define FFA_MEM_ATTR_TYPE_MEM           (2U << 4)
+
+#define FFA_MEM_ATTR_NC                 (1U << 2)
+#define FFA_MEM_ATTR_WB                 (3U << 2)
+
+#define FFA_MEM_ATTR_NON_SHARE          (0U)
+#define FFA_MEM_ATTR_OUT_SHARE          (2U)
+#define FFA_MEM_ATTR_INN_SHARE          (3U)
+
 /*
  * Memory attributes: Normal memory, Write-Back cacheable, Inner shareable
  * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
  */
-#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
+#define FFA_NORMAL_MEM_REG_ATTR         (FFA_MEM_ATTR_TYPE_MEM | \
+                                         FFA_MEM_ATTR_WB | \
+                                         FFA_MEM_ATTR_INN_SHARE)
 /*
  * Memory access permissions: Read-write
  * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 8282bacf85..90800e44a8 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -512,6 +512,12 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out_unlock;
 
+    if ( trans.mem_reg_attr & FFA_MEM_ATTR_NS )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
     if ( trans.mem_reg_attr != FFA_NORMAL_MEM_REG_ATTR )
     {
         ret = FFA_RET_NOT_SUPPORTED;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239980.1541410 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurG8-0007Nv-4q; Tue, 24 Feb 2026 12:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239980.1541410; Tue, 24 Feb 2026 12: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 1vurG8-0007Nn-1x; Tue, 24 Feb 2026 12:11:24 +0000
Received: by outflank-mailman (input) for mailman id 1239980;
 Tue, 24 Feb 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 1vurG6-0007Ng-GR
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vurG6-007pNX-1X
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurG6-004Dq6-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=vlttWLzZsggYPbvKY3aMv/QWSUxUl4pFgciQIajtnpM=; b=Xwzl2FNp93ttNthdiSWz07KtAZ
	sCSzKOv1IAiLsD9+08i4flAfokDlfSJ0F0fTYiTK83S3GJjJZ/fA2/mJ8G4X0Degb6GP2fo1YZ6u9
	LqdeBkHGqHBv10JrfdZE//ycGoALqQ3pfw2I0PG0L9uDzydKAVxyPl3dTUvrD4qJhlzY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Harden shm page parsing
Message-Id: <E1vurG6-004Dq6-1R@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:22 +0000

commit 01c79ad9c6f3ea39ec684bd10ad1b202f90271fc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:27 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Harden shm page parsing
    
    get_shm_pages() uses unchecked address arithmetic and does not enforce
    alignment, so malformed descriptors can cause overflow or slip through
    validation. The reclaim path also repeats handle-to-shm-mem conversion
    in multiple places, duplicating error handling.
    
    Harden page parsing and reclaim handling:
    - add ffa_safe_addr_add() and use it to detect address overflows
    - enforce alignment checks in get_shm_pages() and return FF-A errors
    - introduce ffa_secure_reclaim() and use it for MEM_RECLAIM and teardown
    - simplify ffa_mem_share() argument handling and allow max page count
    
    While there rename ffa_mem_share to ffa_spmc_share and ffa_mem_reclaim
    to ffa_spmc_reclaim to have coherent names with other parts of ffa
    implementation for SMC wrappers to the SPMC.
    
    Functional impact: invalid or misaligned memory ranges now fail earlier
    with proper error codes; behavior for valid descriptors is unchanged.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_private.h | 11 ++++++++
 xen/arch/arm/tee/ffa_shm.c     | 60 ++++++++++++++++++++----------------------
 2 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index b625f1c729..58562d8e73 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -632,4 +632,15 @@ static inline void ffa_uuid_set(struct ffa_uuid *id, uint32_t val0,
     id->val[1] = ((uint64_t)val3 << 32U) | val2;
 }
 
+/*
+ * Common overflow-safe helper to verify that adding a number of pages to an
+ * address will not wrap around.
+ */
+static inline bool ffa_safe_addr_add(uint64_t addr, uint64_t pages)
+{
+    uint64_t off = pages * FFA_PAGE_SIZE;
+
+    return (off / FFA_PAGE_SIZE) == pages && addr <= UINT64_MAX - off;
+}
+
 #endif /*__FFA_PRIVATE_H__*/
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 90800e44a8..adc7e645a1 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -96,16 +96,14 @@ struct ffa_shm_mem {
     struct page_info *pages[];
 };
 
-static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
-                             register_t addr, uint32_t pg_count,
-                             uint64_t *handle)
+static int32_t ffa_spmc_share(uint32_t tot_len, uint64_t *handle)
 {
     struct arm_smccc_1_2_regs arg = {
         .a0 = FFA_MEM_SHARE_64,
         .a1 = tot_len,
-        .a2 = frag_len,
-        .a3 = addr,
-        .a4 = pg_count,
+        .a2 = tot_len,
+        .a3 = 0,
+        .a4 = 0,
     };
     struct arm_smccc_1_2_regs resp;
 
@@ -131,12 +129,16 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
-static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
-                               uint32_t flags)
+static int32_t ffa_spmc_reclaim(struct ffa_shm_mem *shm, uint32_t flags)
 {
+    register_t handle_hi;
+    register_t handle_lo;
+
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
         return FFA_RET_NOT_SUPPORTED;
 
+    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+
     return ffa_simple_call(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, 0);
 }
 
@@ -145,7 +147,7 @@ static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
  * this function fails then the caller is still expected to call
  * put_shm_pages() as a cleanup.
  */
-static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
+static int32_t get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
                          const struct ffa_address_range *range,
                          uint32_t range_count)
 {
@@ -156,17 +158,26 @@ static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
     p2m_type_t t;
     uint64_t addr;
     uint64_t page_count;
+    uint64_t gaddr;
 
     for ( n = 0; n < range_count; n++ )
     {
         page_count = ACCESS_ONCE(range[n].page_count);
         addr = ACCESS_ONCE(range[n].address);
+
+        if ( !IS_ALIGNED(addr, FFA_PAGE_SIZE) )
+            return FFA_RET_INVALID_PARAMETERS;
+
         for ( m = 0; m < page_count; m++ )
         {
             if ( pg_idx >= shm->page_count )
                 return FFA_RET_INVALID_PARAMETERS;
 
-            gfn = gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
+            if ( !ffa_safe_addr_add(addr, m) )
+                return FFA_RET_INVALID_PARAMETERS;
+
+            gaddr = addr + m * FFA_PAGE_SIZE;
+            gfn = gaddr_to_gfn(gaddr);
             shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
 						   P2M_ALLOC);
             if ( !shm->pages[pg_idx] )
@@ -180,7 +191,7 @@ static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
 
     /* The ranges must add up */
     if ( pg_idx < shm->page_count )
-            return FFA_RET_INVALID_PARAMETERS;
+        return FFA_RET_INVALID_PARAMETERS;
 
     return FFA_RET_OK;
 }
@@ -198,15 +209,11 @@ static void put_shm_pages(struct ffa_shm_mem *shm)
 
 static bool inc_ctx_shm_count(struct domain *d, struct ffa_ctx *ctx)
 {
-    bool ret = true;
+    bool ret = false;
 
     spin_lock(&ctx->lock);
 
-    if ( ctx->shm_count >= FFA_MAX_SHM_COUNT )
-    {
-        ret = false;
-    }
-    else
+    if ( ctx->shm_count < FFA_MAX_SHM_COUNT )
     {
         /*
          * If this is the first shm added, increase the domain reference
@@ -217,6 +224,7 @@ static bool inc_ctx_shm_count(struct domain *d, struct ffa_ctx *ctx)
             get_knownalive_domain(d);
 
         ctx->shm_count++;
+        ret = true;
     }
 
     spin_unlock(&ctx->lock);
@@ -251,7 +259,7 @@ static struct ffa_shm_mem *alloc_ffa_shm_mem(struct domain *d,
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
 
-    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT )
+    if ( page_count > FFA_MAX_SHM_PAGE_COUNT )
         return NULL;
     if ( !inc_ctx_shm_count(d, ctx) )
         return NULL;
@@ -297,7 +305,6 @@ static int share_shm(struct ffa_shm_mem *shm)
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
     const unsigned int region_count = 1;
-    uint32_t frag_len;
     uint32_t tot_len;
     paddr_t last_pa;
     unsigned int n;
@@ -350,7 +357,6 @@ static int share_shm(struct ffa_shm_mem *shm)
     }
 
     addr_range = region_descr->address_range_array;
-    frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
     last_pa = page_to_maddr(shm->pages[0]);
     init_range(addr_range, last_pa);
     for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
@@ -362,12 +368,11 @@ static int share_shm(struct ffa_shm_mem *shm)
             continue;
         }
 
-        frag_len += sizeof(*addr_range);
         addr_range++;
         init_range(addr_range, pa);
     }
 
-    ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    ret = ffa_spmc_share(tot_len, &shm->handle);
 
 out:
     ffa_rxtx_spmc_tx_release();
@@ -637,8 +642,6 @@ int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
-    register_t handle_hi;
-    register_t handle_lo;
     int32_t ret;
 
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
@@ -652,8 +655,7 @@ int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
     if ( !shm )
         return FFA_RET_INVALID_PARAMETERS;
 
-    uint64_to_regpair(&handle_hi, &handle_lo, handle);
-    ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+    ret = ffa_spmc_reclaim(shm, flags);
 
     if ( ret )
     {
@@ -677,11 +679,7 @@ bool ffa_shm_domain_destroy(struct domain *d)
 
     list_for_each_entry_safe(shm, tmp, &ctx->shm_list, list)
     {
-        register_t handle_hi;
-        register_t handle_lo;
-
-        uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
-        res = ffa_mem_reclaim(handle_lo, handle_hi, 0);
+        res = ffa_spmc_reclaim(shm, 0);
         switch ( res ) {
         case FFA_RET_OK:
             printk(XENLOG_G_DEBUG "%pd: ffa: Reclaimed handle %#lx\n",
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239981.1541414 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurGI-0007Pw-6F; Tue, 24 Feb 2026 12:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239981.1541414; Tue, 24 Feb 2026 12: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 1vurGI-0007Po-3Q; Tue, 24 Feb 2026 12:11:34 +0000
Received: by outflank-mailman (input) for mailman id 1239981;
 Tue, 24 Feb 2026 12: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 1vurGG-0007Pg-JH
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12: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 1vurGG-007pNi-1p
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurGG-004Dz7-1i
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12: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=XwBE/b4Ho9JRkkWmAgmAANRB/EMKO1WFNV0jAUsgFGA=; b=BJqxnTt5EoFzzhPx+xN2kW0sfn
	QOfouK5CdW3PvS6PIxue1Tug203LAskMS+ZTBueiLTMIGBZid+zKgeExkSE0BpYPa7fM0FjcRKgV8
	lKIPnfrb5nSjIuakTFcFBWCejxuV48uldK9gxIxIryBI/GHoaQ6Ulk5tHMwKrYEpJU1Q=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors
Message-Id: <E1vurGG-004Dz7-1i@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:32 +0000

commit a90376c6adbc732f803a0ccf13cde7ffa74e2020
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:28 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors
    
    FF-A 1.2 extends the endpoint memory access descriptor (EMAD) from
    16 to 32 bytes, adding implementation-defined (IMPDEF) fields and
    reserved space. The MEM_SHARE path currently assumes the 1.1 EMAD
    size and rejects the 1.2 layout.
    
    Add FF-A 1.2 EMAD support to MEM_SHARE:
    - define ffa_mem_access_1_2 and store IMPDEF payload in ffa_shm_mem
    - emit 1.2 EMADs to the SPMC for FF-A 1.2 guests, forwarding IMPDEF
    - refactor header parsing into read_mem_transaction() for 1.0/1.1+
    - detect EMAD format by mem_access_size to allow 1.1 on 1.2 guests
    
    Export ffa_fw_version to build memory descriptors according to the
    firmware version to relay share memory requests and remove unused offset
    macros.
    
    Functional impact: MEM_SHARE supports FF-A 1.2 EMADs.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |   2 +-
 xen/arch/arm/tee/ffa_private.h |   1 +
 xen/arch/arm/tee/ffa_shm.c     | 121 +++++++++++++++++++++++++++++------------
 3 files changed, 87 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 6de2b9f8ac..23e1f40848 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -70,7 +70,7 @@
 #include "ffa_private.h"
 
 /* Negotiated FF-A version to use with the SPMC, 0 if not there or supported */
-static uint32_t __ro_after_init ffa_fw_version;
+uint32_t __ro_after_init ffa_fw_version;
 
 /* Features supported by the SPMC or secure world when present */
 DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 58562d8e73..ccef2f7631 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -436,6 +436,7 @@ struct ffa_ctx {
 };
 
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
+extern uint32_t __ro_after_init ffa_fw_version;
 
 extern struct list_head ffa_ctx_head;
 extern rwlock_t ffa_ctx_list_rwlock;
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index adc7e645a1..070babce96 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -30,6 +30,14 @@ struct ffa_mem_access {
     uint64_t reserved;
 };
 
+/* Endpoint memory access descriptor (FF-A 1.2) */
+struct ffa_mem_access_1_2 {
+    struct ffa_mem_access_perm access_perm;
+    uint32_t region_offs;
+    uint8_t impdef[16];
+    uint8_t reserved[8];
+};
+
 /* Lend, donate or share memory transaction descriptor */
 struct ffa_mem_transaction_1_0 {
     uint16_t sender_id;
@@ -55,25 +63,10 @@ struct ffa_mem_transaction_1_1 {
     uint8_t reserved[12];
 };
 
-/* Calculate offset of struct ffa_mem_access from start of buffer */
-#define MEM_ACCESS_OFFSET(access_idx) \
-    ( sizeof(struct ffa_mem_transaction_1_1) + \
-      ( access_idx ) * sizeof(struct ffa_mem_access) )
-
-/* Calculate offset of struct ffa_mem_region from start of buffer */
-#define REGION_OFFSET(access_count, region_idx) \
-    ( MEM_ACCESS_OFFSET(access_count) + \
-      ( region_idx ) * sizeof(struct ffa_mem_region) )
-
-/* Calculate offset of struct ffa_address_range from start of buffer */
-#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
-    ( REGION_OFFSET(access_count, region_count) + \
-      ( range_idx ) * sizeof(struct ffa_address_range) )
-
 /*
  * The parts needed from struct ffa_mem_transaction_1_0 or struct
  * ffa_mem_transaction_1_1, used to provide an abstraction of difference in
- * data structures between version 1.0 and 1.1. This is just an internal
+ * data structures between version 1.0 and 1.2. This is just an internal
  * interface and can be changed without changing any ABI.
  */
 struct ffa_mem_transaction_int {
@@ -92,6 +85,8 @@ struct ffa_shm_mem {
     uint16_t sender_id;
     uint16_t ep_id;     /* endpoint, the one lending */
     uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
+    /* Endpoint memory access descriptor IMPDEF value (FF-A 1.2). */
+    uint64_t impdef[2];
     unsigned int page_count;
     struct page_info *pages[];
 };
@@ -297,16 +292,20 @@ static void init_range(struct ffa_address_range *addr_range,
  * This function uses the ffa_spmc tx buffer to transmit the memory transaction
  * descriptor.
  */
-static int share_shm(struct ffa_shm_mem *shm)
+static int share_shm(struct ffa_shm_mem *shm, uint32_t ffa_vers)
 {
     const uint32_t max_frag_len = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
     struct ffa_mem_access *mem_access_array;
+    struct ffa_mem_access_1_2 *mem_access_array_1_2;
     struct ffa_mem_transaction_1_1 *descr;
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
-    const unsigned int region_count = 1;
     uint32_t tot_len;
+    uint32_t mem_access_size;
+    uint32_t mem_access_offs;
+    uint32_t region_offs;
     paddr_t last_pa;
+    uint32_t range_count;
     unsigned int n;
     paddr_t pa;
     int32_t ret;
@@ -325,16 +324,35 @@ static int share_shm(struct ffa_shm_mem *shm)
     descr->handle = shm->handle;
     descr->mem_reg_attr = FFA_NORMAL_MEM_REG_ATTR;
     descr->mem_access_count = 1;
-    descr->mem_access_size = sizeof(*mem_access_array);
-    descr->mem_access_offs = MEM_ACCESS_OFFSET(0);
+    if ( ffa_vers >= FFA_VERSION_1_2 )
+        mem_access_size = sizeof(struct ffa_mem_access_1_2);
+    else
+        mem_access_size = sizeof(struct ffa_mem_access);
+    mem_access_offs = sizeof(struct ffa_mem_transaction_1_1);
+    region_offs = mem_access_offs + mem_access_size;
+    descr->mem_access_size = mem_access_size;
+    descr->mem_access_offs = mem_access_offs;
 
-    mem_access_array = buf + descr->mem_access_offs;
-    memset(mem_access_array, 0, sizeof(*mem_access_array));
-    mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
-    mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
-    mem_access_array[0].region_offs = REGION_OFFSET(descr->mem_access_count, 0);
+    if ( ffa_vers >= FFA_VERSION_1_2 )
+    {
+        mem_access_array_1_2 = buf + mem_access_offs;
+        memset(mem_access_array_1_2, 0, sizeof(*mem_access_array_1_2));
+        mem_access_array_1_2[0].access_perm.endpoint_id = shm->ep_id;
+        mem_access_array_1_2[0].access_perm.perm = FFA_MEM_ACC_RW;
+        mem_access_array_1_2[0].region_offs = region_offs;
+        memcpy(mem_access_array_1_2[0].impdef, shm->impdef,
+               sizeof(mem_access_array_1_2[0].impdef));
+    }
+    else
+    {
+        mem_access_array = buf + mem_access_offs;
+        memset(mem_access_array, 0, sizeof(*mem_access_array));
+        mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
+        mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
+        mem_access_array[0].region_offs = region_offs;
+    }
 
-    region_descr = buf + mem_access_array[0].region_offs;
+    region_descr = buf + region_offs;
     memset(region_descr, 0, sizeof(*region_descr));
     region_descr->total_page_count = shm->page_count;
 
@@ -348,8 +366,9 @@ static int share_shm(struct ffa_shm_mem *shm)
         region_descr->address_range_count++;
     }
 
-    tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
-                                region_descr->address_range_count);
+    range_count = region_descr->address_range_count;
+    tot_len = region_offs + sizeof(*region_descr) +
+              range_count * sizeof(struct ffa_address_range);
     if ( tot_len > max_frag_len )
     {
         ret = FFA_RET_NOT_SUPPORTED;
@@ -445,6 +464,12 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
     if ( size * count + offs > blen )
         return FFA_RET_INVALID_PARAMETERS;
 
+    if ( size < sizeof(struct ffa_mem_access) )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( offs & 0xF )
+        return FFA_RET_INVALID_PARAMETERS;
+
     trans->mem_reg_attr = mem_reg_attr;
     trans->flags = flags;
     trans->mem_access_size = size;
@@ -461,7 +486,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     uint64_t addr = get_user_reg(regs, 3);
     uint32_t page_count = get_user_reg(regs, 4);
     const struct ffa_mem_region *region_descr;
-    const struct ffa_mem_access *mem_access;
+    const struct ffa_mem_access_1_2 *mem_access;
     struct ffa_mem_transaction_int trans;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
@@ -471,9 +496,12 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     register_t handle_hi = 0;
     register_t handle_lo = 0;
     int ret = FFA_RET_DENIED;
+    uint32_t ffa_vers;
     uint32_t range_count;
     uint32_t region_offs;
     uint16_t dst_id;
+    uint8_t perm;
+    uint64_t impdef[2];
 
     if ( !ffa_fw_supports_fid(FFA_MEM_SHARE_64) )
     {
@@ -512,8 +540,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( frag_len > tx_size )
         goto out_unlock;
 
-    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), tx_buf,
-                               frag_len, &trans);
+    ffa_vers = ACCESS_ONCE(ctx->guest_vers);
+    ret = read_mem_transaction(ffa_vers, tx_buf, frag_len, &trans);
     if ( ret )
         goto out_unlock;
 
@@ -542,13 +570,35 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
+    if ( trans.mem_access_size < sizeof(struct ffa_mem_access) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
     /* Check that it fits in the supplied data */
     if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
         goto out_unlock;
 
     mem_access = tx_buf + trans.mem_access_offs;
-
     dst_id = ACCESS_ONCE(mem_access->access_perm.endpoint_id);
+    perm = ACCESS_ONCE(mem_access->access_perm.perm);
+    region_offs = ACCESS_ONCE(mem_access->region_offs);
+
+    /*
+     * FF-A 1.2 introduced an extended mem_access descriptor with impdef
+     * fields, but guests can still use the 1.1 format if they don't need
+     * implementation-defined data. Detect which format is used based on
+     * the mem_access_size field rather than the negotiated FF-A version.
+     */
+    if ( trans.mem_access_size >= sizeof(struct ffa_mem_access_1_2) )
+        memcpy(impdef, mem_access->impdef, sizeof(impdef));
+    else
+    {
+        impdef[0] = 0;
+        impdef[1] = 0;
+    }
+
     if ( !FFA_ID_IS_SECURE(dst_id) )
     {
         /* we do not support sharing with VMs */
@@ -556,13 +606,11 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
-    if ( ACCESS_ONCE(mem_access->access_perm.perm) != FFA_MEM_ACC_RW )
+    if ( perm != FFA_MEM_ACC_RW )
     {
         ret = FFA_RET_NOT_SUPPORTED;
         goto out_unlock;
     }
-
-    region_offs = ACCESS_ONCE(mem_access->region_offs);
     if ( sizeof(*region_descr) + region_offs > frag_len )
     {
         ret = FFA_RET_NOT_SUPPORTED;
@@ -587,6 +635,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     }
     shm->sender_id = trans.sender_id;
     shm->ep_id = dst_id;
+    memcpy(shm->impdef, impdef, sizeof(shm->impdef));
 
     /*
      * Check that the Composite memory region descriptor fits.
@@ -602,7 +651,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
-    ret = share_shm(shm);
+    ret = share_shm(shm, ffa_fw_version);
     if ( ret )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239982.1541418 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurGS-0007So-8q; Tue, 24 Feb 2026 12:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239982.1541418; Tue, 24 Feb 2026 12: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 1vurGS-0007Sg-6A; Tue, 24 Feb 2026 12:11:44 +0000
Received: by outflank-mailman (input) for mailman id 1239982;
 Tue, 24 Feb 2026 12: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 1vurGQ-0007SY-MW
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12: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 1vurGQ-007pNq-29
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurGQ-004DzZ-20
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12: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=8bqeBnYHMRXXuZQ+SsJNoJs6PU5K3xluVRJkQdVKPPM=; b=AiN1zYzWYjtNfgFkye+yja14De
	xCemRMFUmBqE5eXWPgFb9FMj+mmW3uTzGBYK1Vb1IhwD405Vel4gs5Jazgwzv9U4IL9bfZQsJXGVL
	T2rIZy2e1oyeunVm1XD8BmMHIZuW1Yka8Vl0pxWYtPNKGzzuTjmE1YqIamBqbfJUDJPc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix PARTINFO RX release errors
Message-Id: <E1vurGQ-004DzZ-20@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:42 +0000

commit a97fe0a4c7b0ad4167cc162455a085d5112f3aea
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:29 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix PARTINFO RX release errors
    
    On PARTITION_INFO_GET error paths, Xen unconditionally called
    FFA_RX_RELEASE for the SPMC RX buffer. If the SPMC didn't grant RX
    ownership (i.e., the call failed early), this issues a spurious release
    that returns DENIED and produces warnings.
    
    Modify ffa_rxtx_spmc_rx_release() to return the release status and let
    callers choose whether to log it. Only issue FFA_RX_RELEASE after a
    successful PARTINFO SMC, while always releasing the local RX lock to
    avoid deadlocks.
    
    Update handle_partition_info_get() to only release the SPMC RX buffer
    after successful fw_ret checks, and ignore release errors during the
    error path.
    
    Functional impact: eliminates spurious FFA_RX_RELEASE calls and
    associated DENIED warnings when PARTITION_INFO_GET fails before
    obtaining SPMC RX buffer ownership.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_partinfo.c | 14 ++++++++++++--
 xen/arch/arm/tee/ffa_private.h  |  2 +-
 xen/arch/arm/tee/ffa_rxtx.c     | 14 +++++++++-----
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index bf906ed0c8..015097bd4d 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -92,9 +92,11 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
                                    uint32_t dst_size)
 {
     int32_t ret;
+    int32_t release_ret;
     uint32_t src_size, real_sp_count;
     void *src_buf;
     uint32_t count = 0;
+    bool notify_fw = false;
 
     /* We need to use the RX buffer to receive the list */
     src_buf = ffa_rxtx_spmc_rx_acquire();
@@ -104,6 +106,7 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
     ret = ffa_partition_info_get(uuid, 0, &real_sp_count, &src_size);
     if ( ret )
         goto out;
+    notify_fw = true;
 
     /* Validate the src_size we got */
     if ( src_size < sizeof(struct ffa_partition_info_1_0) ||
@@ -157,7 +160,10 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
     *sp_count = count;
 
 out:
-    ffa_rxtx_spmc_rx_release();
+    release_ret = ffa_rxtx_spmc_rx_release(notify_fw);
+    if ( release_ret )
+        gprintk(XENLOG_WARNING,
+                "ffa: Error releasing SPMC RX buffer: %d\n", release_ret);
     return ret;
 }
 
@@ -507,6 +513,7 @@ bool ffa_partinfo_init(void)
     int32_t e;
     void *spmc_rx;
     struct ffa_uuid nil_uuid = { .val = { 0ULL, 0ULL } };
+    bool notify_fw = false;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
          !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
@@ -522,6 +529,7 @@ bool ffa_partinfo_init(void)
         printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
         goto out;
     }
+    notify_fw = true;
 
     if ( count >= FFA_MAX_NUM_SP )
     {
@@ -533,7 +541,9 @@ bool ffa_partinfo_init(void)
     ret = init_subscribers(spmc_rx, count, fpi_size);
 
 out:
-    ffa_rxtx_spmc_rx_release();
+    e = ffa_rxtx_spmc_rx_release(notify_fw);
+    if ( e )
+        printk(XENLOG_WARNING "ffa: Error releasing SPMC RX buffer: %d\n", e);
     return ret;
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index ccef2f7631..1a632983c8 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -459,7 +459,7 @@ int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
 bool ffa_rxtx_spmc_init(void);
 void ffa_rxtx_spmc_destroy(void);
 void *ffa_rxtx_spmc_rx_acquire(void);
-void ffa_rxtx_spmc_rx_release(void);
+int32_t ffa_rxtx_spmc_rx_release(bool notify_fw);
 void *ffa_rxtx_spmc_tx_acquire(void);
 void ffa_rxtx_spmc_tx_release(void);
 
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 7d8bb4f4d0..50758fb57c 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -375,18 +375,22 @@ void *ffa_rxtx_spmc_rx_acquire(void)
     return NULL;
 }
 
-void ffa_rxtx_spmc_rx_release(void)
+int32_t ffa_rxtx_spmc_rx_release(bool notify_fw)
 {
     int32_t ret;
 
     ASSERT(spin_is_locked(&ffa_spmc_rx_lock));
 
-    /* Inform the SPMC that we are done with our RX buffer */
-    ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
-    if ( ret != FFA_RET_OK )
-        printk(XENLOG_DEBUG "Error releasing SPMC RX buffer: %d\n", ret);
+    if ( notify_fw )
+    {
+        /* Inform the SPMC that we are done with our RX buffer */
+        ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+    }
+    else
+        ret = FFA_RET_OK;
 
     spin_unlock(&ffa_spmc_rx_lock);
+    return ret;
 }
 
 void *ffa_rxtx_spmc_tx_acquire(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239983.1541422 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurGc-0007Us-AJ; Tue, 24 Feb 2026 12:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239983.1541422; Tue, 24 Feb 2026 12: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 1vurGc-0007Uk-7W; Tue, 24 Feb 2026 12:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1239983;
 Tue, 24 Feb 2026 12: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 1vurGa-0007Uc-RJ
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12: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 1vurGa-007pNu-2a
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurGa-004E0D-2J
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12: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=q8AYfSf9wvKRcM248+clXip5qYhfp0IJJCbiSCe/nXA=; b=lhgmemHecgFk+ld7SHmNF7Xxjk
	nhWugpKKNL0rZMFOFMv8lLNgpJDw07G/Da6qbKZFOzzVz32j9ZXLE9ZmkXRNUCkT/EbltuKmTVJMZ
	Rx68Smv6/4OTMYbiiZea4ID4rRiiTkkvP42MPfVhRbuXZdc19nosgO8PUa58ac9YIH7Y=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix RX/TX map layout and errors
Message-Id: <E1vurGa-004E0D-2J@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:11:52 +0000

commit d1b958a92ca8137a843f063eed7b8e558c125eda
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:30 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix RX/TX map layout and errors
    
    FFA_RXTX_MAP builds a descriptor for the SPMC and the composite region
    offsets must be 8-byte aligned. Xen currently uses a 12-byte header
    size, which produces misaligned RX/TX offsets. Mapping failures also
    return INVALID_PARAMETERS even when the failure is due to resource
    exhaustion, which misreports the error condition.
    
    Round the descriptor header size up to 8 bytes before placing the RX
    region and derive the TX offset from the aligned RX offset. Return
    FFA_RET_NO_MEMORY when the TX or RX buffer mapping fails before the
    error paths unwind.
    
    Functional impact: RXTX_MAP now returns NO_MEMORY on mapping failures
    and the SPMC receives an aligned RX/TX descriptor layout.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_rxtx.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 50758fb57c..eff95a7955 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -119,11 +119,17 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
     tx = __map_domain_page_global(tx_pg);
     if ( !tx )
+    {
+        ret = FFA_RET_NO_MEMORY;
         goto err_put_rx_pg;
+    }
 
     rx = __map_domain_page_global(rx_pg);
     if ( !rx )
+    {
+        ret = FFA_RET_NO_MEMORY;
         goto err_unmap_tx;
+    }
 
     /*
      * Transmit the RX/TX buffer information to the SPM if acquire is supported
@@ -136,7 +142,8 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         struct ffa_mem_region *mem_reg;
 
         /* All must fit in our TX buffer */
-        BUILD_BUG_ON(sizeof(*rxtx_desc) + sizeof(*mem_reg) * 2 +
+        BUILD_BUG_ON(ROUNDUP(sizeof(*rxtx_desc), 8) +
+                     sizeof(*mem_reg) * 2 +
                      sizeof(struct ffa_address_range) * 2 >
                      FFA_MAX_RXTX_PAGE_COUNT * FFA_PAGE_SIZE);
 
@@ -153,8 +160,8 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
          */
         rxtx_desc->sender_id = ffa_get_vm_id(d);
         rxtx_desc->reserved = 0;
-        rxtx_desc->rx_region_offs = sizeof(*rxtx_desc);
-        rxtx_desc->tx_region_offs = sizeof(*rxtx_desc) +
+        rxtx_desc->rx_region_offs = ROUNDUP(sizeof(*rxtx_desc), 8);
+        rxtx_desc->tx_region_offs = rxtx_desc->rx_region_offs +
                                     offsetof(struct ffa_mem_region,
                                              address_range_array[1]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239984.1541426 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurGm-0007Wu-Bc; Tue, 24 Feb 2026 12:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239984.1541426; Tue, 24 Feb 2026 12:12: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 1vurGm-0007Wn-8x; Tue, 24 Feb 2026 12:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1239984;
 Tue, 24 Feb 2026 12:12: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 1vurGk-0007Wg-U1
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurGk-007pOB-2u
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurGk-004E1H-2l
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=6sN+GayG6wZrBWsnG+di2ME+KUXc4Cm9rbuoxrz+x+Q=; b=aigqr2GtLGaP8KZbv4gaqhTYQO
	xUMjnliZ05B07ztelG7P+hQK1xb+HMNlYoBRZ1Q3nF4z2RPCj4lQLT28oAbxAXsEVcZB8lLYXC0Ca
	defDV9pDoOiuDwsH9MdN9f4CyqzZV5bJz6P4nbGCyFUtUNTuHQlsQREjoKVjMIhQdikM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix RXTX_UNMAP ownership race
Message-Id: <E1vurGk-004E1H-2l@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:02 +0000

commit 309e8edfe32ffd95374fd1f4ccf5104db82378be
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:31 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix RXTX_UNMAP ownership race
    
    rxtx_unmap() checks RX ownership without holding the RX/TX locks and
    only enforces the ownership rule when FFA_RX_ACQUIRE is supported. This
    allows a vCPU to acquire RX between the check and unmap, and it lets
    RXTX_UNMAP proceed while RX is owned when buffers are not forwarded to
    firmware.
    
    Hold rx_lock/tx_lock across the ownership check and unmap, and deny
    RXTX_UNMAP whenever RX is owned, independent of RX_ACQUIRE support. For
    teardown, release RX ownership under the same lock window; use
    FFA_RX_RELEASE directly because rx_lock is held, and clear the local
    flag when the firmware path is unavailable.
    
    Functional impact: RXTX_UNMAP now reliably returns DENIED while RX is
    owned, and teardown releases/clears ownership without a race.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_rxtx.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index eff95a7955..c4fc4c4934 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -220,7 +220,7 @@ err_unlock_rxtx:
     return ret;
 }
 
-static int32_t rxtx_unmap(struct domain *d)
+static int32_t rxtx_unmap(struct domain *d, bool teardown)
 {
     struct ffa_ctx *ctx = d->arch.tee;
     int32_t ret = FFA_RET_OK;
@@ -234,6 +234,32 @@ static int32_t rxtx_unmap(struct domain *d)
         goto err_unlock_rxtx;
     }
 
+    if ( !ctx->rx_is_free )
+    {
+        if ( teardown )
+        {
+            if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
+            {
+                int32_t rel_ret;
+
+                /* Can't use ffa_rx_release() while holding rx_lock. */
+                rel_ret = ffa_simple_call(FFA_RX_RELEASE, ctx->ffa_id,
+                                          0, 0, 0);
+                if ( rel_ret )
+                    gdprintk(XENLOG_DEBUG,
+                             "ffa: RX release during teardown failed: %d\n",
+                             rel_ret);
+            }
+        }
+        else
+        {
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: RXTX_UNMAP denied, RX buffer owned by VM\n");
+            ret = FFA_RET_DENIED;
+            goto err_unlock_rxtx;
+        }
+    }
+
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
         ret = ffa_rxtx_unmap(ffa_get_vm_id(d));
@@ -261,7 +287,7 @@ err_unlock_rxtx:
 
 int32_t ffa_handle_rxtx_unmap(void)
 {
-    return rxtx_unmap(current->domain);
+    return rxtx_unmap(current->domain, false);
 }
 
 int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
@@ -369,7 +395,7 @@ int32_t ffa_rxtx_domain_init(struct domain *d)
 
 void ffa_rxtx_domain_destroy(struct domain *d)
 {
-    rxtx_unmap(d);
+    rxtx_unmap(d, true /* teardown */);
 }
 
 void *ffa_rxtx_spmc_rx_acquire(void)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239985.1541430 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurGw-0007Yw-DR; Tue, 24 Feb 2026 12:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239985.1541430; Tue, 24 Feb 2026 12:12: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 1vurGw-0007Yo-AZ; Tue, 24 Feb 2026 12:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1239985;
 Tue, 24 Feb 2026 12:12: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 1vurGv-0007Yg-0y
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurGu-007pOK-3D
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurGu-004E1v-34
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=V3gne6RH2OBnIqVrU7XJ54LYT87Tf9CbVujZWvCDM4E=; b=yaKEs0q69M9+2IpXsxFJHeItPB
	dFeSS1jitfZKfREzEop/K/L23HOSG5lBZOS4I65VggqUE1VKDT7TFHKztxxGod33A4DL661kxAQro
	hRsaAogrlRKz5eht4KpiunOClu+y5OGuCzVFqp3sMDmXZrX9E875Z+E+0U5SE0RWfjCs=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix FFA_FEATURES validation
Message-Id: <E1vurGu-004E1v-34@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:12 +0000

commit 4992308e970a3a5619d5fef308c7758870bb05b1
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:32 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix FFA_FEATURES validation
    
    FFA_FEATURES advertises several ABIs unconditionally, even when firmware
    support is missing or when the ABI is physical-instance-only. This can
    mislead guests about what Xen can actually provide and violates FF-A
    calling conventions. Some SPMCs (Hafnium v2.14 or earlier) also fail to
    report FFA_RX_ACQUIRE despite supporting it.
    
    Update FFA_FEATURES validation to match spec and firmware support:
    - do no check w2-w7 input registers during FFA_FEATURES as they are
      flagged Should Be Zero by the FF-A specification or are not used by
      the calls we support.
    - reject 64-bit calling conventions from 32-bit guests with NOT_SUPPORTED
    - return NOT_SUPPORTED for physical-instance-only ABIs
    (FFA_NOTIFICATION_BITMAP_{CREATE,DESTROY}, FFA_RX_ACQUIRE)
    - advertise FFA_INTERRUPT as supported
    - gate message ABIs on firmware support:
    - FFA_MSG_SEND_DIRECT_REQ_{32,64}
    - FFA_MSG_SEND_DIRECT_REQ2 (also requires FF-A 1.2 negotiation)
    - FFA_MSG_SEND2 (or VM-to-VM enabled)
    - report MEM_SHARE_{32,64} only when FFA_MEM_SHARE_64 is supported
    - stop advertising FFA_MSG_YIELD (not implemented)
    
    Update firmware probing: drop FFA_MEM_SHARE_32 checks (deprecated) and
    add FFA_RX_ACQUIRE to the probed set. If FFA_MSG_SEND2 is reported but
    FFA_RX_ACQUIRE is not, assume RX_ACQUIRE support and warn to work
    around the Hafnium bug.
    
    Functional impact: guests now see ABI support that reflects firmware
    capabilities and Xen implementation status. When SEND2 is present but
    RX_ACQUIRE is not reported, Xen assumes RX_ACQUIRE support.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 63 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 23e1f40848..cb8cd95fda 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -91,10 +91,10 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_PARTITION_INFO_GET),
     FW_ABI(FFA_NOTIFICATION_INFO_GET_64),
     FW_ABI(FFA_NOTIFICATION_GET),
+    FW_ABI(FFA_RX_ACQUIRE),
     FW_ABI(FFA_RX_RELEASE),
     FW_ABI(FFA_RXTX_MAP_64),
     FW_ABI(FFA_RXTX_UNMAP),
-    FW_ABI(FFA_MEM_SHARE_32),
     FW_ABI(FFA_MEM_SHARE_64),
     FW_ABI(FFA_MEM_RECLAIM),
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_32),
@@ -238,21 +238,30 @@ static void handle_features(struct cpu_user_regs *regs)
     uint32_t a1 = get_user_reg(regs, 1);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    unsigned int n;
 
-    for ( n = 2; n <= 7; n++ )
+    /*
+     * FFA_FEATURES defines w2 as input properties only for specific
+     * function IDs and reserves w3-w7 as SBZ. Xen does not currently
+     * implement any feature that consumes w2, so ignore extra inputs.
+     */
+    if ( !is_64bit_domain(d) && smccc_is_conv_64(a1) )
     {
-        if ( get_user_reg(regs, n) )
-        {
-            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
-            return;
-        }
+        /* 32bit guests should only use 32bit convention calls */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        return;
     }
 
     switch ( a1 )
     {
+    case FFA_NOTIFICATION_BITMAP_CREATE:
+    case FFA_NOTIFICATION_BITMAP_DESTROY:
+    case FFA_RX_ACQUIRE:
+        /* Physical-instance-only ABIs are not exposed to VMs. */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        break;
     case FFA_ERROR:
     case FFA_VERSION:
+    case FFA_INTERRUPT:
     case FFA_SUCCESS_32:
     case FFA_SUCCESS_64:
     case FFA_FEATURES:
@@ -261,16 +270,25 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_RXTX_UNMAP:
     case FFA_MEM_RECLAIM:
     case FFA_PARTITION_INFO_GET:
+        ffa_set_regs_success(regs, 0, 0);
+        break;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
-    case FFA_MSG_SEND2:
     case FFA_RUN:
-    case FFA_INTERRUPT:
-    case FFA_MSG_YIELD:
-        ffa_set_regs_success(regs, 0, 0);
+        if ( ffa_fw_supports_fid(a1) )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        break;
+    case FFA_MSG_SEND2:
+        if ( ffa_fw_supports_fid(a1) || IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
         break;
     case FFA_MSG_SEND_DIRECT_REQ2:
-        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 &&
+             ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ2) )
         {
             ffa_set_regs_success(regs, 0, 0);
         }
@@ -281,6 +299,11 @@ static void handle_features(struct cpu_user_regs *regs)
         break;
     case FFA_MEM_SHARE_64:
     case FFA_MEM_SHARE_32:
+        if ( !ffa_fw_supports_fid(FFA_MEM_SHARE_64) )
+        {
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+            break;
+        }
         /*
          * We currently don't support dynamically allocated buffers. Report
          * that with 0 in bit[0] of w2.
@@ -688,6 +711,20 @@ static bool ffa_probe_fw(void)
                    ffa_fw_abi_needed[i].name);
     }
 
+    /*
+     * Hafnium v2.14 or earlier does not report FFA_RX_ACQUIRE in
+     * FFA_FEATURES even though it supports it.
+     */
+    if ( !ffa_fw_supports_fid(FFA_RX_ACQUIRE) &&
+         ffa_fw_supports_fid(FFA_MSG_SEND2) )
+    {
+        printk(XENLOG_WARNING
+               "ARM FF-A Firmware reports FFA_MSG_SEND2 without FFA_RX_ACQUIRE\n");
+        printk(XENLOG_WARNING
+               "ffa: assuming RX_ACQUIRE support (workaround)\n");
+        set_bit(FFA_ABI_BITNUM(FFA_RX_ACQUIRE), ffa_fw_abi_supported);
+    }
+
     if ( !ffa_rxtx_spmc_init() )
     {
         printk(XENLOG_ERR "ffa: Error during RXTX buffer init\n");
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239986.1541435 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurH6-0007b3-Gl; Tue, 24 Feb 2026 12:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239986.1541435; Tue, 24 Feb 2026 12:12: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 1vurH6-0007as-C3; Tue, 24 Feb 2026 12:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1239986;
 Tue, 24 Feb 2026 12:12: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 1vurH5-0007ak-3V
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurH5-007pOe-0G
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurH5-004E2n-0A
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=dqkK82r7Ed3mVRW8E8/XVKvynNS0FuFrahBhI2LPQtQ=; b=WyqsJwlK1uwdar1SI3W/XrwHc/
	MmA+pnd/rntbhR9cu+YAlgcz14TnZXD8GazTM8UttNrI9epkNpkoh3w4oL7G19kki9VfQ5ZyWzLla
	1D8tbnVP/xcp5/WGomcjAxqpbwobH441GU7b9HXHWTONL96zqcZGPSygHp4L4GbPeldo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Fix SEND2 SP support gating
Message-Id: <E1vurH5-004E2n-0A@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:23 +0000

commit e70117a53fe83dafad94538ef4ff50bb297b1d56
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:33 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix SEND2 SP support gating
    
    Xen only maps a VM RX/TX buffer into the SPMC when firmware supports
    FFA_RX_ACQUIRE. Without that mapping, the SPMC cannot access the VM TX
    buffer to relay FFA_MSG_SEND2 to a secure partition.
    
    Advertise FFA_MSG_SEND2 to guests only when VM-to-VM is enabled or when
    the firmware supports both FFA_MSG_SEND2 and FFA_RX_ACQUIRE, and reject
    SEND2 to a secure partition otherwise. Add comments to document the
    mapping/ownership dependency.
    
    Functional impact: SEND2 to a secure partition is reported as
    NOT_SUPPORTED when FFA_RX_ACQUIRE is absent.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c     |  8 +++++++-
 xen/arch/arm/tee/ffa_msg.c | 11 +++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index cb8cd95fda..ab02eafdb3 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -281,7 +281,13 @@ static void handle_features(struct cpu_user_regs *regs)
             ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
         break;
     case FFA_MSG_SEND2:
-        if ( ffa_fw_supports_fid(a1) || IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
+        /*
+         * Forwarding SEND2 to an SP requires the SPMC to see the VM TX buffer.
+         * We only map VM RX/TX into the SPMC when RX_ACQUIRE is supported.
+         */
+        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) ||
+             (ffa_fw_supports_fid(FFA_MSG_SEND2) &&
+              ffa_fw_supports_fid(FFA_RX_ACQUIRE)) )
             ffa_set_regs_success(regs, 0, 0);
         else
             ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 10856fddcb..928f269f6c 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -274,6 +274,17 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
             ret = FFA_RET_NOT_SUPPORTED;
             goto out;
         }
+        /*
+         * The SPMC needs access to the VM TX buffer to relay SEND2.
+         * We only map VM RX/TX into the SPMC when RX_ACQUIRE is supported.
+         */
+        if ( !ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
+        {
+            ret = FFA_RET_NOT_SUPPORTED;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 to SP requires RX_ACQUIRE\n");
+            goto out;
+        }
 
         ret = ffa_simple_call(FFA_MSG_SEND2,
                               ((uint32_t)ffa_get_vm_id(src_d)) << 16, 0, 0, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239987.1541438 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurHG-0007dY-IK; Tue, 24 Feb 2026 12:12:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239987.1541438; Tue, 24 Feb 2026 12:12: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 1vurHG-0007dQ-Fb; Tue, 24 Feb 2026 12:12:34 +0000
Received: by outflank-mailman (input) for mailman id 1239987;
 Tue, 24 Feb 2026 12:12: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 1vurHF-0007dI-6e
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurHF-007pOn-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurHF-004E3v-0S
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=utUK4hp4A4RXJcvz7/Ja5iWY7kK0SXVZySEeMeybnHc=; b=m9K/yYV3PUtpbmgCJy8osvq175
	UMBnkzgMnaKDWYwsULTRw+IQbSLd5ju+r1Hwh5QzXfE0AQVR6tqcfuPRaYthGUwtryw8ZTgvoVlWU
	FwT5mxXNpNKfDPYPHaSHRax53458m707sbpeO3i9OM1K5/GkcA8+Z/O4BuwnVuU1Cj3w=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Reduce logging noise
Message-Id: <E1vurHF-004E3v-0S@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:33 +0000

commit 9d63e7e9caa3398b0c9fc75eec2a439f205dff92
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:34 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Reduce logging noise
    
    Several FF-A paths log warnings for expected or recoverable conditions,
    leading to noisy logs during normal operation.
    
    Reduce log noise by:
    - demoting unhandled FID warnings to debug
    - ratelimiting notification and VM teardown failures
    - printing the bit-15 convention warning once per boot
    - adjusting log prefixes for hypervisor-only events
    - adding debug diagnostics for RX/TX acquire failures, with busy cases
      ratelimited
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 11 ++++++-----
 xen/arch/arm/tee/ffa_notif.c    | 11 ++++++-----
 xen/arch/arm/tee/ffa_partinfo.c | 15 ++++++++-------
 xen/arch/arm/tee/ffa_rxtx.c     | 21 +++++++++++++++++++--
 4 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ab02eafdb3..aa43ae2595 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -450,7 +450,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         break;
 
     default:
-        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
+        gdprintk(XENLOG_DEBUG, "ffa: unhandled fid 0x%x\n", fid);
         e = FFA_RET_NOT_SUPPORTED;
         break;
     }
@@ -570,7 +570,8 @@ static void ffa_domain_teardown_continue(struct ffa_ctx *ctx, bool first_time)
 
     if ( retry )
     {
-        printk(XENLOG_G_INFO "%pd: ffa: Remaining cleanup, retrying\n", ctx->teardown_d);
+        printk(XENLOG_G_DEBUG "%pd: ffa: Remaining cleanup, retrying\n",
+               ctx->teardown_d);
 
         ctx->teardown_expire = NOW() + FFA_CTX_TEARDOWN_DELAY;
 
@@ -611,7 +612,7 @@ static void ffa_teardown_timer_callback(void *arg)
     if ( ctx )
         ffa_domain_teardown_continue(ctx, false /* !first_time */);
     else
-        printk(XENLOG_G_ERR "%s: teardown list is empty\n", __func__);
+        printk(XENLOG_ERR "%s: teardown list is empty\n", __func__);
 }
 
 /* This function is supposed to undo what ffa_domain_init() has done */
@@ -673,7 +674,7 @@ static bool ffa_probe_fw(void)
 
     if ( !ffa_get_version(&vers) )
     {
-        gprintk(XENLOG_ERR, "Cannot retrieve the FFA version\n");
+        printk(XENLOG_ERR "ffa: Cannot retrieve the FFA version\n");
         goto err_no_fw;
     }
 
@@ -713,7 +714,7 @@ static bool ffa_probe_fw(void)
             set_bit(FFA_ABI_BITNUM(ffa_fw_abi_needed[i].id),
                     ffa_fw_abi_supported);
         else
-            printk(XENLOG_INFO "ARM FF-A Firmware does not support %s\n",
+            printk(XENLOG_WARNING "ARM FF-A Firmware does not support %s\n",
                    ffa_fw_abi_needed[i].name);
     }
 
diff --git a/xen/arch/arm/tee/ffa_notif.c b/xen/arch/arm/tee/ffa_notif.c
index 37b05747cd..186e726412 100644
--- a/xen/arch/arm/tee/ffa_notif.c
+++ b/xen/arch/arm/tee/ffa_notif.c
@@ -292,8 +292,9 @@ static void notif_vm_pend_intr(uint16_t vm_id)
             break;
         }
     }
-    if ( !v )
-        printk(XENLOG_ERR "ffa: can't inject NPI, all vCPUs offline\n");
+    if ( !v && printk_ratelimit() )
+        printk(XENLOG_G_DEBUG "%pd: ffa: can't inject NPI, all vCPUs offline\n",
+               d);
 
 out_unlock:
     rcu_unlock_domain(d);
@@ -316,9 +317,9 @@ static void notif_sri_action(void *unused)
         res = ffa_get_ret_code(&resp);
         if ( res )
         {
-            if ( res != FFA_RET_NO_DATA )
-                printk(XENLOG_ERR "ffa: notification info get failed: error %d\n",
-                       res);
+            if ( res != FFA_RET_NO_DATA && printk_ratelimit() )
+                printk(XENLOG_WARNING
+                       "ffa: notification info get failed: error %d\n", res);
             return;
         }
 
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 015097bd4d..fdb03dae9a 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -461,9 +461,11 @@ static bool init_subscribers(void *buf, uint16_t count, uint32_t fpi_size)
          */
         if ( !FFA_ID_IS_SECURE(fpi->id) )
         {
-            printk(XENLOG_ERR "ffa: Firmware is not using bit 15 convention for IDs !!\n"
-                              "ffa: Secure partition with id 0x%04x cannot be used\n",
-                              fpi->id);
+            printk_once(XENLOG_ERR
+                        "ffa: Firmware is not using bit 15 convention for IDs !!\n");
+            printk(XENLOG_ERR
+                   "ffa: Secure partition with id 0x%04x cannot be used\n",
+                   fpi->id);
         }
         else
         {
@@ -632,11 +634,10 @@ bool ffa_partinfo_domain_destroy(struct domain *d)
         res = ffa_direct_req_send_vm(subscr_vm_destroyed[n], ffa_get_vm_id(d),
                                      FFA_MSG_SEND_VM_DESTROYED);
 
-        if ( res )
-        {
-            printk(XENLOG_ERR "%pd: ffa: Failed to report destruction of vm_id %u to %u: res %d\n",
+        if ( res && printk_ratelimit() )
+            printk(XENLOG_WARNING
+                   "%pd: ffa: Failed to report destruction of vm_id %u to %u: res %d\n",
                    d, ffa_get_vm_id(d), subscr_vm_destroyed[n], res);
-        }
 
         /*
          * For these two error codes the hypervisor is expected to resend
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index c4fc4c4934..26a04f056f 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -4,6 +4,7 @@
  */
 
 #include <xen/const.h>
+#include <xen/lib.h>
 #include <xen/domain_page.h>
 #include <xen/mm.h>
 #include <xen/sizes.h>
@@ -82,8 +83,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
     if ( page_count > FFA_MAX_RXTX_PAGE_COUNT || !page_count )
     {
-        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
-               page_count, FFA_MAX_RXTX_PAGE_COUNT);
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
+                 page_count, FFA_MAX_RXTX_PAGE_COUNT);
         return FFA_RET_INVALID_PARAMETERS;
     }
 
@@ -299,12 +301,15 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
     if ( !ctx->page_count )
     {
         ret = FFA_RET_DENIED;
+        gdprintk(XENLOG_DEBUG, "ffa: RX acquire denied, no RX/TX mapped\n");
         goto out;
     }
 
     if ( !ctx->rx_is_free )
     {
         ret = FFA_RET_BUSY;
+        if ( printk_ratelimit() )
+            gdprintk(XENLOG_DEBUG, "ffa: RX acquire busy\n");
         goto out;
     }
 
@@ -312,7 +317,10 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
     {
         ret = ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
+        {
+            gdprintk(XENLOG_DEBUG, "ffa: RX acquire failed: %d\n", ret);
             goto out;
+        }
     }
     ctx->rx_is_free = false;
     *buf = ctx->rx;
@@ -351,13 +359,22 @@ int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size)
     int32_t ret = FFA_RET_DENIED;
 
     if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire busy\n");
         return FFA_RET_BUSY;
+    }
 
     if ( !ctx->page_count )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, no RX/TX mapped\n");
         goto err_unlock;
+    }
 
     if ( !ctx->tx )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, TX buffer missing\n");
         goto err_unlock;
+    }
 
     *buf = ctx->tx;
     *buf_size = ctx->page_count * FFA_PAGE_SIZE;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239988.1541442 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurHQ-0007fw-JZ; Tue, 24 Feb 2026 12:12:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239988.1541442; Tue, 24 Feb 2026 12:12: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 1vurHQ-0007fo-Gy; Tue, 24 Feb 2026 12:12:44 +0000
Received: by outflank-mailman (input) for mailman id 1239988;
 Tue, 24 Feb 2026 12:12: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 1vurHP-0007ff-91
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurHP-007pP1-0o
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurHP-004E55-0j
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=7KTK4q9rIT7qcUZMxf8Ccx30WXyEf5Fc4SfUNchcymo=; b=CAqXvqDFNGW4bkvWpMQfld+W6t
	DdLsebBymFKxShsagakIAfkJU3wbR5HnyJj7tH960SOtmf4k70JRuwQqrFnE3eA+gSgkrJvUyoXtZ
	AYaSDm9AZwDKb1Y1N5Fd3qwTF4BpNRZc3K+6Gwa42vu651/BL0VQj9qYVpdFmmjmwYYI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Add MEM_SHARE page diagnostics
Message-Id: <E1vurHP-004E55-0j@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:43 +0000

commit 4d39261835719362548f0da978bcf081662feabb
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:35 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add MEM_SHARE page diagnostics
    
    MEM_SHARE failures in get_shm_pages() are silent, which makes malformed
    ranges and page mapping failures hard to diagnose.
    
    Add debug logging for page validation failures:
    - descriptor validation failures (unaligned, range short/overflow)
    - per-page mapping failures (unmapped GFN, wrong p2m type)
    - address overflow detection in range walks
    
    Ratelimit temporary reclaim failures and log permanent reclaim failures
    as errors.
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_shm.c | 39 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 070babce96..3d61caaeba 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -161,32 +161,62 @@ static int32_t get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
         addr = ACCESS_ONCE(range[n].address);
 
         if ( !IS_ALIGNED(addr, FFA_PAGE_SIZE) )
+        {
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: mem share pages invalid: unaligned range %u address %#lx\n",
+                     n, (unsigned long)addr);
             return FFA_RET_INVALID_PARAMETERS;
+        }
 
         for ( m = 0; m < page_count; m++ )
         {
             if ( pg_idx >= shm->page_count )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: range overflow rg %u pg %u\n",
+                         n, m);
                 return FFA_RET_INVALID_PARAMETERS;
+            }
 
             if ( !ffa_safe_addr_add(addr, m) )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: addr overflow rg %u pg %u base %#lx\n",
+                         n, m, (unsigned long)addr);
                 return FFA_RET_INVALID_PARAMETERS;
+            }
 
             gaddr = addr + m * FFA_PAGE_SIZE;
             gfn = gaddr_to_gfn(gaddr);
             shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
 						   P2M_ALLOC);
             if ( !shm->pages[pg_idx] )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: gfn unmapped rg %u pg %u addr %#lx\n",
+                         n, m, (unsigned long)gaddr);
                 return FFA_RET_DENIED;
+            }
             /* Only normal RW RAM for now */
             if ( t != p2m_ram_rw )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: p2m type %u rg %u pg %u addr %#lx\n",
+                         t, n, m, (unsigned long)gaddr);
                 return FFA_RET_DENIED;
+            }
             pg_idx++;
         }
     }
 
     /* The ranges must add up */
     if ( pg_idx < shm->page_count )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: mem share pages invalid: range short pg %u\n",
+                 pg_idx);
         return FFA_RET_INVALID_PARAMETERS;
+    }
 
     return FFA_RET_OK;
 }
@@ -741,8 +771,10 @@ bool ffa_shm_domain_destroy(struct domain *d)
              * A temporary error that may get resolved a bit later, it's
              * worth retrying.
              */
-            printk(XENLOG_G_INFO "%pd: ffa: Failed to reclaim handle %#lx : %d\n",
-                   d, shm->handle, res);
+            if ( printk_ratelimit() )
+                printk(XENLOG_G_WARNING
+                       "%pd: ffa: Failed to reclaim handle %#lx : %d\n",
+                       d, shm->handle, res);
             break; /* We will retry later */
         default:
             /*
@@ -754,7 +786,8 @@ bool ffa_shm_domain_destroy(struct domain *d)
              * FFA_RET_NO_MEMORY might be a temporary error as it it could
              * succeed if retried later, but treat it as permanent for now.
              */
-            printk(XENLOG_G_INFO "%pd: ffa: Permanent failure to reclaim handle %#lx : %d\n",
+            printk(XENLOG_G_ERR
+                   "%pd: ffa: Permanent failure to reclaim handle %#lx : %d\n",
                    d, shm->handle, res);
 
             /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:12:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:12:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239989.1541445 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurHa-0007i1-Kw; Tue, 24 Feb 2026 12:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239989.1541445; Tue, 24 Feb 2026 12:12: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 1vurHa-0007ht-IO; Tue, 24 Feb 2026 12:12:54 +0000
Received: by outflank-mailman (input) for mailman id 1239989;
 Tue, 24 Feb 2026 12:12: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 1vurHZ-0007hl-Bo
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:12: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 1vurHZ-007pP5-15
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurHZ-004E6f-0y
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:12: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=nAbROgjjIADDmSCf6Jy7Hqdh7f9xVNom+bY1Cki2zyI=; b=CqsW+m9CDIpsLigkfDOJvqmxk6
	qEb8TS/LMXtPWxJdCKY01KmoLjdJIBIvcmGxKh+6+8Baraf9zQ8lNssxM82I/xMfp5Yf2xrdGQ8jZ
	NH+cugLgJK79/iK/Z0JZWx9PauTi4udKcQh2dgWT4Nvf4tVKpGuBvxGLP5Uo8oT6kU9o=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: ffa: Add message parameter diagnostics
Message-Id: <E1vurHZ-004E6f-0y@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:12:53 +0000

commit b5174863a465b5a8a0ba842f5f6e5f2691d42812
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:36 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add message parameter diagnostics
    
    MSG_SEND2 and direct request validation failures are silent, making it
    hard to diagnose invalid IDs, oversized messages, or unsupported
    destination types.
    
    Add debug logs for parameter validation failures:
    - invalid endpoint IDs
    - oversized messages
    - unsupported destination types
    - invalid sender/receiver combinations
    - ratelimit MSG_SEND2 busy failures to avoid log flooding
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_msg.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 928f269f6c..1eadc62870 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -4,6 +4,7 @@
  */
 
 #include <xen/const.h>
+#include <xen/lib.h>
 #include <xen/sizes.h>
 #include <xen/types.h>
 
@@ -100,6 +101,7 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     if ( !ffa_fw_supports_fid(fid) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: direct req fid %#x not supported\n", fid);
         goto out;
     }
 
@@ -108,6 +110,9 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
          (src_dst & GENMASK(15,0)) == ffa_get_vm_id(d) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: direct req invalid src/dst %#x\n",
+                 (uint32_t)src_dst);
         goto out;
     }
 
@@ -115,6 +120,9 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     if ( !FFA_ID_IS_SECURE(src_dst & GENMASK(15,0)) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: direct req to non-secure dst %#x\n",
+                 (uint32_t)(src_dst & GENMASK(15, 0)));
         goto out;
     }
 
@@ -166,7 +174,12 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* This is also checking that dest is not src */
     ret = ffa_endpoint_domain_lookup(dst_id, &dst_d, &dst_ctx);
     if ( ret )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 lookup failed: dst %#x ret %d\n",
+                 dst_id, ret);
         return ret;
+    }
 
     /* This also checks that destination has set a Rx buffer */
     ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
@@ -199,6 +212,16 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* receiver rx buffer will be released by the receiver*/
 
 out_unlock:
+    if ( ret )
+    {
+        /**
+         * Always print other errors than BUSY but ratelimit BUSY prints
+         * to prevent large number of prints when sender retries on BUSY.
+         */
+        if ( ret != FFA_RET_BUSY || printk_ratelimit() )
+            gdprintk(XENLOG_DEBUG, "ffa: msg_send2 to %#x failed: %d\n",
+                     dst_id, ret);
+    }
     rcu_unlock_domain(dst_d);
     if ( !ret )
         ffa_raise_rx_buffer_full(dst_d);
@@ -226,7 +249,11 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
     ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
     if ( ret != FFA_RET_OK )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 TX acquire failed: %d\n", ret);
         return ret;
+    }
 
     /* create a copy of the message header */
     memcpy(&src_msg, tx_buf, sizeof(src_msg));
@@ -238,6 +265,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
          dst_id == ffa_get_vm_id(src_d) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid src/dst src %#x dst %#x\n",
+                 src_id, dst_id);
         goto out;
     }
 
@@ -246,6 +276,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         if (src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_1))
         {
             ret = FFA_RET_INVALID_PARAMETERS;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 invalid msg_offset %u (v1.1)\n",
+                     src_msg.msg_offset);
             goto out;
         }
         /* Set uuid to Nil UUID for v1.1 guests */
@@ -255,6 +288,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     else if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_2) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid msg_offset %u (v1.2)\n",
+                 src_msg.msg_offset);
         goto out;
     }
 
@@ -263,6 +299,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
             src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid msg_size %u offset %u tx %zu\n",
+                 src_msg.msg_size, src_msg.msg_offset, tx_size);
         goto out;
     }
 
@@ -272,6 +311,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         if ( !ffa_fw_supports_fid(FFA_MSG_SEND2) )
         {
             ret = FFA_RET_NOT_SUPPORTED;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 to SP not supported\n");
             goto out;
         }
         /*
@@ -288,6 +329,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
         ret = ffa_simple_call(FFA_MSG_SEND2,
                               ((uint32_t)ffa_get_vm_id(src_d)) << 16, 0, 0, 0);
+        if ( ret )
+            gdprintk(XENLOG_DEBUG, "ffa: msg_send2 to SP failed: %d\n", ret);
     }
     else if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
@@ -295,7 +338,11 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         ret = ffa_msg_send2_vm(dst_id, tx_buf, &src_msg);
     }
     else
+    {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 to VM disabled (dst %#x)\n", dst_id);
+    }
 
 out:
     ffa_tx_release(src_ctx);
@@ -311,6 +358,7 @@ void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
     if ( !ffa_fw_supports_fid(fid) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: run fid %#x not supported\n", fid);
         goto out;
     }
 
@@ -322,6 +370,7 @@ void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
     if ( !FFA_ID_IS_SECURE(dst >> 16) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: run to non-secure dst %#x\n", dst);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 12:13:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 12:13:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1239990.1541450 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vurHk-0007k5-Mp; Tue, 24 Feb 2026 12:13:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1239990.1541450; Tue, 24 Feb 2026 12:13: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 1vurHk-0007jx-Jp; Tue, 24 Feb 2026 12:13:04 +0000
Received: by outflank-mailman (input) for mailman id 1239990;
 Tue, 24 Feb 2026 12:13: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 1vurHj-0007jp-EL
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 12:13: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 1vurHj-007pPN-1L
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:13:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vurHj-004E8W-1G
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 12:13: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=xgZhcWABb3yjU2+94DTuTBVBKAnrjMMtCjys0gn9qJs=; b=aLYPIja7LneWbiFTuXNTEdlQKm
	fYCkuXf0rrzi/aMRu/Tv2/p2+gVRbHEsY9ij0M8h5+quRUe2/inw5Gjlzu39XU0reMgtlU8CCfHq9
	5cgsh4JOfDvdICq/owzp68m1VlCjdTy7lFrI6L67bAJiDGsTC67oe0r6WGj8Ssdi3EbE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: smccc: Preserve argument types in v1.1 SMC
Message-Id: <E1vurHj-004E8W-1G@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 12:13:03 +0000

commit 28af7ed9107cdb14196dcd58cb3dcd78066bf9a9
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Feb 16 08:47:08 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: smccc: Preserve argument types in v1.1 SMC
    
    The SMCCC v1.1 inline helper currently forces a1-a4 into
    unsigned long and uses in/out constraints for r0-r3. In
    contrast, a5-a7 are passed with their original types via
    read-only constraints. On arm64 this means a 32-bit signed
    value in a1-a4 is converted to a 64-bit unsigned value, while
    the same value in a5-a7 keeps its signed 32-bit form. For
    example, a negative int in a2 is widened to unsigned long, but
    a negative int in a5 is passed as a 32-bit signed value, so the
    SMC sees different encodings depending on argument position.
    
    Switch the helper to use typed input registers arg0-arg7
    derived from the call arguments (keeping a0 cast to u32) and
    separate output registers r0-r3. This preserves argument types
    consistently across all positions. Argument evaluation order
    is unchanged, so we do not reintroduce the issue fixed in
    "e00dc325bd9e" ("xen/arm: smccc-1.1: Handle function result as
    parameters").
    
    This also aligns Xen's SMCCC parameter handling with Linux's type-
    preserving behavior (same externally visible argument handling,
    independent implementation) to avoid surprising differences
    between a1-a4 and a5-a7.
    
    Current callers (PSCI, SCMI, platform SMC pass-through, OP-TEE,
    and exynos5) pass unsigned values; exynos5 passes an int CPU id
    which should always be > 0.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 69 ++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 441b3ab65d..5b30dd57b6 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -99,87 +99,68 @@ struct arm_smccc_res {
 #define __count_args(...)                               \
     ___count_args(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0)
 
-#define __constraint_write_0                        \
-    "+r" (r0), "=&r" (r1), "=&r" (r2), "=&r" (r3)
-#define __constraint_write_1                        \
-    "+r" (r0), "+r" (r1), "=&r" (r2), "=&r" (r3)
-#define __constraint_write_2                        \
-    "+r" (r0), "+r" (r1), "+r" (r2), "=&r" (r3)
-#define __constraint_write_3                        \
-    "+r" (r0), "+r" (r1), "+r" (r2), "+r" (r3)
-#define __constraint_write_4    __constraint_write_3
-#define __constraint_write_5    __constraint_write_4
-#define __constraint_write_6    __constraint_write_5
-#define __constraint_write_7    __constraint_write_6
-
-#define __constraint_read_0
-#define __constraint_read_1
-#define __constraint_read_2
-#define __constraint_read_3
-#define __constraint_read_4 "r" (r4)
-#define __constraint_read_5 __constraint_read_4, "r" (r5)
-#define __constraint_read_6 __constraint_read_5, "r" (r6)
-#define __constraint_read_7 __constraint_read_6, "r" (r7)
+#define __constraint_read_0 "r" (arg0)
+#define __constraint_read_1 __constraint_read_0, "r" (arg1)
+#define __constraint_read_2 __constraint_read_1, "r" (arg2)
+#define __constraint_read_3 __constraint_read_2, "r" (arg3)
+#define __constraint_read_4 __constraint_read_3, "r" (arg4)
+#define __constraint_read_5 __constraint_read_4, "r" (arg5)
+#define __constraint_read_6 __constraint_read_5, "r" (arg6)
+#define __constraint_read_7 __constraint_read_6, "r" (arg7)
 
 #define __declare_arg_0(a0, res)                            \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1);                  \
-    register unsigned long  r2 ASM_REG(2);                  \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
 
 #define __declare_arg_1(a0, a1, res)                        \
     typeof(a1) __a1 = (a1);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2);                  \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
     typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2) = __a2;           \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    register typeof(a2)     arg2 ASM_REG(2) = __a2
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
     typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
     typeof(a3) __a3 = (a3);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2) = __a2;           \
-    register unsigned long  r3 ASM_REG(3) = __a3
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    register typeof(a2)     arg2 ASM_REG(2) = __a2;         \
+    register typeof(a3)     arg3 ASM_REG(3) = __a3
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
     typeof(a4) __a4 = (a4);                             \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register unsigned long r4 ASM_REG(4) = __a4
+    register typeof(a4)     arg4 ASM_REG(4) = __a4
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
     typeof(a5) __a5 = (a5);                             \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5) r5 ASM_REG(5) = __a5
+    register typeof(a5)     arg5 ASM_REG(5) = __a5
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
     typeof(a6) __a6 = (a6);                                 \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6) r6 ASM_REG(6) = __a6
+    register typeof(a6)     arg6 ASM_REG(6) = __a6
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
     typeof(a7) __a7 = (a7);                                     \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7) r7 ASM_REG(7) = __a7
+    register typeof(a7)     arg7 ASM_REG(7) = __a7
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
 
 #define ___constraints(count)                       \
-    : __constraint_write_ ## count                  \
+    : "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3)     \
     : __constraint_read_ ## count                   \
     : "memory"
 #define __constraints(count)    ___constraints(count)
@@ -204,6 +185,10 @@ struct arm_smccc_res {
  */
 #define arm_smccc_1_1_smc(...)                                  \
     do {                                                        \
+        register unsigned long r0 ASM_REG(0);                   \
+        register unsigned long r1 ASM_REG(1);                   \
+        register unsigned long r2 ASM_REG(2);                   \
+        register unsigned long r3 ASM_REG(3);                   \
         __declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
         asm volatile("smc #0\n"                                 \
                      __constraints(__count_args(__VA_ARGS__))); \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:08 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240055.1541514 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vushn-0005bE-1e; Tue, 24 Feb 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 1240055.1541514; Tue, 24 Feb 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 1vushm-0005b7-VE; Tue, 24 Feb 2026 13:44:02 +0000
Received: by outflank-mailman (input) for mailman id 1240055;
 Tue, 24 Feb 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 1vushm-0005b1-JS
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vushm-007rBJ-1b
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vushm-004JYN-1R
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=4fRl3eQh2U4k+9KVpMBDmlXH8RD6hlXMLbXFareWD0Y=; b=m+l+rKp/3bYB2Uqtp1e8H48T/C
	rHHcwNxeHsasC+1bsRHECci0/y32fMOHjB9ZzuQIzfweGL0sRAqRzdUifdJNKduyGpwDflT2pAFIi
	Pi/2Z0YKIMxOV9huRS103GF4gA5o9SNfO6Uk+RUGbD6y4dkFxkps+vXK4uBBGCraJsIY=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Add endpoint lookup helper
Message-Id: <E1vushm-004JYN-1R@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:02 +0000

commit 4ed7f66fab333f7ea22c48e9645d974e96631b28
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:25 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add endpoint lookup helper
    
    Direct messaging paths duplicate endpoint validation and RCU domain
    lookup logic across multiple call sites, which makes the checks easy to
    drift and complicates maintenance.
    
    Introduce ffa_endpoint_domain_lookup() to centralize this logic. The
    helper validates the endpoint ID (rejecting ID 0 for the hypervisor),
    performs RCU domain lookup, ensures the domain is live and has an
    initialized FF-A context with a negotiated version, and returns the
    domain locked via RCU.
    
    Switch ffa_msg_send2_vm() to use the helper, replacing its open-coded
    validation sequence. This consolidates approximately 20 lines of
    duplicated checks into a single call.
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         | 45 ++++++++++++++++++++++++++++++++++++++++++
 xen/arch/arm/tee/ffa_msg.c     | 24 +++-------------------
 xen/arch/arm/tee/ffa_private.h |  3 +++
 3 files changed, 51 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ed18e76080..6de2b9f8ac 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -433,6 +433,51 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
     return true;
 }
 
+/*
+ * Look up a domain by its FF-A endpoint ID and validate it's ready for FF-A.
+ * Returns FFA_RET_OK on success with domain locked via RCU.
+ * Caller must call rcu_unlock_domain() when done.
+ *
+ * Validates:
+ * - endpoint_id is not 0 (the hypervisor)
+ * - domain exists and is live
+ * - domain has FF-A context initialized
+ * - domain has negotiated an FF-A version
+ */
+int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
+                                   struct ffa_ctx **ctx_out)
+{
+    struct domain *d;
+    struct ffa_ctx *ctx;
+    int err;
+
+    if ( endpoint_id == 0 )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    err = rcu_lock_live_remote_domain_by_id(endpoint_id - 1, &d);
+    if ( err )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( !d->arch.tee )
+    {
+        rcu_unlock_domain(d);
+        return FFA_RET_INVALID_PARAMETERS;
+    }
+
+    ctx = d->arch.tee;
+    if ( !ACCESS_ONCE(ctx->guest_vers) )
+    {
+        rcu_unlock_domain(d);
+        return FFA_RET_INVALID_PARAMETERS;
+    }
+
+    *d_out = d;
+    if ( ctx_out )
+        *ctx_out = ctx;
+
+    return FFA_RET_OK;
+}
+
 static int ffa_domain_init(struct domain *d)
 {
     struct ffa_ctx *ctx;
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 4e26596461..10856fddcb 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -161,30 +161,12 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     struct ffa_part_msg_rxtx_1_2 *dst_msg;
     void *rx_buf;
     size_t rx_size;
-    int err;
     int32_t ret;
 
-    if ( dst_id == 0 )
-        /* FF-A ID 0 is the hypervisor, this is not valid */
-        return FFA_RET_INVALID_PARAMETERS;
-
     /* This is also checking that dest is not src */
-    err = rcu_lock_live_remote_domain_by_id(dst_id - 1, &dst_d);
-    if ( err )
-        return FFA_RET_INVALID_PARAMETERS;
-
-    if ( dst_d->arch.tee == NULL )
-    {
-        ret = FFA_RET_INVALID_PARAMETERS;
-        goto out_unlock;
-    }
-
-    dst_ctx = dst_d->arch.tee;
-    if ( !ACCESS_ONCE(dst_ctx->guest_vers) )
-    {
-        ret = FFA_RET_INVALID_PARAMETERS;
-        goto out_unlock;
-    }
+    ret = ffa_endpoint_domain_lookup(dst_id, &dst_d, &dst_ctx);
+    if ( ret )
+        return ret;
 
     /* This also checks that destination has set a Rx buffer */
     ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 282c105f3b..cd7ecabc7e 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -437,6 +437,9 @@ int32_t ffa_partinfo_domain_init(struct domain *d);
 bool ffa_partinfo_domain_destroy(struct domain *d);
 void ffa_handle_partition_info_get(struct cpu_user_regs *regs);
 
+int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
+                                   struct ffa_ctx **ctx_out);
+
 bool ffa_rxtx_spmc_init(void);
 void ffa_rxtx_spmc_destroy(void);
 void *ffa_rxtx_spmc_rx_acquire(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240056.1541517 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vushx-0005d3-2x; Tue, 24 Feb 2026 13:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240056.1541517; Tue, 24 Feb 2026 13: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 1vushx-0005cw-0T; Tue, 24 Feb 2026 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1240056;
 Tue, 24 Feb 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 1vushw-0005co-KP
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vushw-007rBN-1s
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vushw-004JZz-1m
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=O4WYBl2hH4rnQBEX1nGTcIk7ad/qGnpDWjtAipNg2AE=; b=hlB8nzUdyUUSJkhnMJlj0uPXa7
	kzVhRzHu9ba4wLtmUbZiRnoFbq+APjtXcMdg2k8EMWmlajiBOCTjvUrHyd0lMEslU5Ky162SXUY9Q
	dXeY/h0luY1L7gGlo8ITjDls8wYsFDQwY5eaFXXNFJ1KE9zRHSNJKS1jr4Woi79QByro=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix MEM_SHARE NS attribute handling
Message-Id: <E1vushw-004JZz-1m@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:12 +0000

commit edf036fac2b09b131b0b3db5c1c93c17ffd1600a
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:26 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix MEM_SHARE NS attribute handling
    
    The FF-A memory attribute encoding is currently a literal value (0x2f),
    which makes reviews and validation harder. In addition, MEM_SHARE
    accepts the NS (non-secure) attribute bit even though the normal world
    must not set it according to FF-A specification.
    
    Introduce named attribute bit masks and express FFA_NORMAL_MEM_REG_ATTR
    in terms of them for clarity.
    
    Reject MEM_SHARE descriptors with the NS bit set, returning
    INVALID_PARAMETERS to match FF-A v1.1 rules that prohibit normal world
    from setting this bit.
    
    Functional impact: MEM_SHARE now rejects descriptors with NS bit set
    with the right error code, INVALID_PARAMETER.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_private.h | 17 ++++++++++++++++-
 xen/arch/arm/tee/ffa_shm.c     |  6 ++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index cd7ecabc7e..b625f1c729 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -129,11 +129,26 @@
 #define FFA_HANDLE_HYP_FLAG             BIT(63, ULL)
 #define FFA_HANDLE_INVALID              0xffffffffffffffffULL
 
+/* NS attribute was introduced in v1.1 */
+#define FFA_MEM_ATTR_NS                 BIT(6, U)
+
+#define FFA_MEM_ATTR_TYPE_DEV           (1U << 3)
+#define FFA_MEM_ATTR_TYPE_MEM           (2U << 4)
+
+#define FFA_MEM_ATTR_NC                 (1U << 2)
+#define FFA_MEM_ATTR_WB                 (3U << 2)
+
+#define FFA_MEM_ATTR_NON_SHARE          (0U)
+#define FFA_MEM_ATTR_OUT_SHARE          (2U)
+#define FFA_MEM_ATTR_INN_SHARE          (3U)
+
 /*
  * Memory attributes: Normal memory, Write-Back cacheable, Inner shareable
  * Defined in FF-A-1.1-REL0 Table 10.18 at page 175.
  */
-#define FFA_NORMAL_MEM_REG_ATTR         0x2fU
+#define FFA_NORMAL_MEM_REG_ATTR         (FFA_MEM_ATTR_TYPE_MEM | \
+                                         FFA_MEM_ATTR_WB | \
+                                         FFA_MEM_ATTR_INN_SHARE)
 /*
  * Memory access permissions: Read-write
  * Defined in FF-A-1.1-REL0 Table 10.15 at page 168.
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 8282bacf85..90800e44a8 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -512,6 +512,12 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out_unlock;
 
+    if ( trans.mem_reg_attr & FFA_MEM_ATTR_NS )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
     if ( trans.mem_reg_attr != FFA_NORMAL_MEM_REG_ATTR )
     {
         ret = FFA_RET_NOT_SUPPORTED;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240057.1541522 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusi7-0005gz-4S; Tue, 24 Feb 2026 13:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240057.1541522; Tue, 24 Feb 2026 13: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 1vusi7-0005gr-1t; Tue, 24 Feb 2026 13:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1240057;
 Tue, 24 Feb 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 1vusi6-0005gj-N5
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusi6-007rBh-2C
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusi6-004JbI-23
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=k4sy/U6O7Nm6LHAZ9oSjptRMjbulBEyy2y306wTBDKs=; b=sypU3IpSIeeKhGbSO0qw0UhLxH
	JiiUPamwRFV1AbLco1G4pg4qq+Sjgzu6UtGqlYHv7V4V3mYH+4W8ErVt/aiM3MoDtm8g/VDG2J0Ar
	PDilMkAxVtWWG28laPBFHd2lMC6FzEDieo/UyLoWGjrL2B+pVPUmIdpz80mXbO71dsRM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Harden shm page parsing
Message-Id: <E1vusi6-004JbI-23@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:22 +0000

commit 01c79ad9c6f3ea39ec684bd10ad1b202f90271fc
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:27 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Harden shm page parsing
    
    get_shm_pages() uses unchecked address arithmetic and does not enforce
    alignment, so malformed descriptors can cause overflow or slip through
    validation. The reclaim path also repeats handle-to-shm-mem conversion
    in multiple places, duplicating error handling.
    
    Harden page parsing and reclaim handling:
    - add ffa_safe_addr_add() and use it to detect address overflows
    - enforce alignment checks in get_shm_pages() and return FF-A errors
    - introduce ffa_secure_reclaim() and use it for MEM_RECLAIM and teardown
    - simplify ffa_mem_share() argument handling and allow max page count
    
    While there rename ffa_mem_share to ffa_spmc_share and ffa_mem_reclaim
    to ffa_spmc_reclaim to have coherent names with other parts of ffa
    implementation for SMC wrappers to the SPMC.
    
    Functional impact: invalid or misaligned memory ranges now fail earlier
    with proper error codes; behavior for valid descriptors is unchanged.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_private.h | 11 ++++++++
 xen/arch/arm/tee/ffa_shm.c     | 60 ++++++++++++++++++++----------------------
 2 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index b625f1c729..58562d8e73 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -632,4 +632,15 @@ static inline void ffa_uuid_set(struct ffa_uuid *id, uint32_t val0,
     id->val[1] = ((uint64_t)val3 << 32U) | val2;
 }
 
+/*
+ * Common overflow-safe helper to verify that adding a number of pages to an
+ * address will not wrap around.
+ */
+static inline bool ffa_safe_addr_add(uint64_t addr, uint64_t pages)
+{
+    uint64_t off = pages * FFA_PAGE_SIZE;
+
+    return (off / FFA_PAGE_SIZE) == pages && addr <= UINT64_MAX - off;
+}
+
 #endif /*__FFA_PRIVATE_H__*/
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 90800e44a8..adc7e645a1 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -96,16 +96,14 @@ struct ffa_shm_mem {
     struct page_info *pages[];
 };
 
-static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
-                             register_t addr, uint32_t pg_count,
-                             uint64_t *handle)
+static int32_t ffa_spmc_share(uint32_t tot_len, uint64_t *handle)
 {
     struct arm_smccc_1_2_regs arg = {
         .a0 = FFA_MEM_SHARE_64,
         .a1 = tot_len,
-        .a2 = frag_len,
-        .a3 = addr,
-        .a4 = pg_count,
+        .a2 = tot_len,
+        .a3 = 0,
+        .a4 = 0,
     };
     struct arm_smccc_1_2_regs resp;
 
@@ -131,12 +129,16 @@ static int32_t ffa_mem_share(uint32_t tot_len, uint32_t frag_len,
     }
 }
 
-static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
-                               uint32_t flags)
+static int32_t ffa_spmc_reclaim(struct ffa_shm_mem *shm, uint32_t flags)
 {
+    register_t handle_hi;
+    register_t handle_lo;
+
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
         return FFA_RET_NOT_SUPPORTED;
 
+    uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
+
     return ffa_simple_call(FFA_MEM_RECLAIM, handle_lo, handle_hi, flags, 0);
 }
 
@@ -145,7 +147,7 @@ static int32_t ffa_mem_reclaim(uint32_t handle_lo, uint32_t handle_hi,
  * this function fails then the caller is still expected to call
  * put_shm_pages() as a cleanup.
  */
-static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
+static int32_t get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
                          const struct ffa_address_range *range,
                          uint32_t range_count)
 {
@@ -156,17 +158,26 @@ static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
     p2m_type_t t;
     uint64_t addr;
     uint64_t page_count;
+    uint64_t gaddr;
 
     for ( n = 0; n < range_count; n++ )
     {
         page_count = ACCESS_ONCE(range[n].page_count);
         addr = ACCESS_ONCE(range[n].address);
+
+        if ( !IS_ALIGNED(addr, FFA_PAGE_SIZE) )
+            return FFA_RET_INVALID_PARAMETERS;
+
         for ( m = 0; m < page_count; m++ )
         {
             if ( pg_idx >= shm->page_count )
                 return FFA_RET_INVALID_PARAMETERS;
 
-            gfn = gaddr_to_gfn(addr + m * FFA_PAGE_SIZE);
+            if ( !ffa_safe_addr_add(addr, m) )
+                return FFA_RET_INVALID_PARAMETERS;
+
+            gaddr = addr + m * FFA_PAGE_SIZE;
+            gfn = gaddr_to_gfn(gaddr);
             shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
 						   P2M_ALLOC);
             if ( !shm->pages[pg_idx] )
@@ -180,7 +191,7 @@ static int get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
 
     /* The ranges must add up */
     if ( pg_idx < shm->page_count )
-            return FFA_RET_INVALID_PARAMETERS;
+        return FFA_RET_INVALID_PARAMETERS;
 
     return FFA_RET_OK;
 }
@@ -198,15 +209,11 @@ static void put_shm_pages(struct ffa_shm_mem *shm)
 
 static bool inc_ctx_shm_count(struct domain *d, struct ffa_ctx *ctx)
 {
-    bool ret = true;
+    bool ret = false;
 
     spin_lock(&ctx->lock);
 
-    if ( ctx->shm_count >= FFA_MAX_SHM_COUNT )
-    {
-        ret = false;
-    }
-    else
+    if ( ctx->shm_count < FFA_MAX_SHM_COUNT )
     {
         /*
          * If this is the first shm added, increase the domain reference
@@ -217,6 +224,7 @@ static bool inc_ctx_shm_count(struct domain *d, struct ffa_ctx *ctx)
             get_knownalive_domain(d);
 
         ctx->shm_count++;
+        ret = true;
     }
 
     spin_unlock(&ctx->lock);
@@ -251,7 +259,7 @@ static struct ffa_shm_mem *alloc_ffa_shm_mem(struct domain *d,
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
 
-    if ( page_count >= FFA_MAX_SHM_PAGE_COUNT )
+    if ( page_count > FFA_MAX_SHM_PAGE_COUNT )
         return NULL;
     if ( !inc_ctx_shm_count(d, ctx) )
         return NULL;
@@ -297,7 +305,6 @@ static int share_shm(struct ffa_shm_mem *shm)
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
     const unsigned int region_count = 1;
-    uint32_t frag_len;
     uint32_t tot_len;
     paddr_t last_pa;
     unsigned int n;
@@ -350,7 +357,6 @@ static int share_shm(struct ffa_shm_mem *shm)
     }
 
     addr_range = region_descr->address_range_array;
-    frag_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count, 1);
     last_pa = page_to_maddr(shm->pages[0]);
     init_range(addr_range, last_pa);
     for ( n = 1; n < shm->page_count; last_pa = pa, n++ )
@@ -362,12 +368,11 @@ static int share_shm(struct ffa_shm_mem *shm)
             continue;
         }
 
-        frag_len += sizeof(*addr_range);
         addr_range++;
         init_range(addr_range, pa);
     }
 
-    ret = ffa_mem_share(tot_len, frag_len, 0, 0, &shm->handle);
+    ret = ffa_spmc_share(tot_len, &shm->handle);
 
 out:
     ffa_rxtx_spmc_tx_release();
@@ -637,8 +642,6 @@ int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
     struct ffa_shm_mem *shm;
-    register_t handle_hi;
-    register_t handle_lo;
     int32_t ret;
 
     if ( !ffa_fw_supports_fid(FFA_MEM_RECLAIM) )
@@ -652,8 +655,7 @@ int32_t ffa_handle_mem_reclaim(uint64_t handle, uint32_t flags)
     if ( !shm )
         return FFA_RET_INVALID_PARAMETERS;
 
-    uint64_to_regpair(&handle_hi, &handle_lo, handle);
-    ret = ffa_mem_reclaim(handle_lo, handle_hi, flags);
+    ret = ffa_spmc_reclaim(shm, flags);
 
     if ( ret )
     {
@@ -677,11 +679,7 @@ bool ffa_shm_domain_destroy(struct domain *d)
 
     list_for_each_entry_safe(shm, tmp, &ctx->shm_list, list)
     {
-        register_t handle_hi;
-        register_t handle_lo;
-
-        uint64_to_regpair(&handle_hi, &handle_lo, shm->handle);
-        res = ffa_mem_reclaim(handle_lo, handle_hi, 0);
+        res = ffa_spmc_reclaim(shm, 0);
         switch ( res ) {
         case FFA_RET_OK:
             printk(XENLOG_G_DEBUG "%pd: ffa: Reclaimed handle %#lx\n",
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:33 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240058.1541526 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusiH-0005j1-63; Tue, 24 Feb 2026 13:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240058.1541526; Tue, 24 Feb 2026 13: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 1vusiH-0005it-3a; Tue, 24 Feb 2026 13:44:33 +0000
Received: by outflank-mailman (input) for mailman id 1240058;
 Tue, 24 Feb 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 1vusiG-0005in-Qa
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusiG-007rBl-2X
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusiG-004JcO-2N
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=S37fIBQY5IV1TqiMrAoVjzB48hBcwGauf9hQk6NyPmE=; b=P5lOGOINqH36LtQQlSUJ3FoTYE
	WqsjO/jHEA08blZLMO7BPRHfn0fGG4Fx7rmfau0pr99WDHAHNV74tYrqUCD104cc2iuR21M7mbSOm
	mof/k49Lr31t+K8FavQ393PbXnSqAIwMgz29UAtqHU2JJt4bR80393pEUbTO54vE9ah8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors
Message-Id: <E1vusiG-004JcO-2N@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:32 +0000

commit a90376c6adbc732f803a0ccf13cde7ffa74e2020
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:28 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add FF-A 1.2 endpoint memory access descriptors
    
    FF-A 1.2 extends the endpoint memory access descriptor (EMAD) from
    16 to 32 bytes, adding implementation-defined (IMPDEF) fields and
    reserved space. The MEM_SHARE path currently assumes the 1.1 EMAD
    size and rejects the 1.2 layout.
    
    Add FF-A 1.2 EMAD support to MEM_SHARE:
    - define ffa_mem_access_1_2 and store IMPDEF payload in ffa_shm_mem
    - emit 1.2 EMADs to the SPMC for FF-A 1.2 guests, forwarding IMPDEF
    - refactor header parsing into read_mem_transaction() for 1.0/1.1+
    - detect EMAD format by mem_access_size to allow 1.1 on 1.2 guests
    
    Export ffa_fw_version to build memory descriptors according to the
    firmware version to relay share memory requests and remove unused offset
    macros.
    
    Functional impact: MEM_SHARE supports FF-A 1.2 EMADs.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c         |   2 +-
 xen/arch/arm/tee/ffa_private.h |   1 +
 xen/arch/arm/tee/ffa_shm.c     | 121 +++++++++++++++++++++++++++++------------
 3 files changed, 87 insertions(+), 37 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 6de2b9f8ac..23e1f40848 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -70,7 +70,7 @@
 #include "ffa_private.h"
 
 /* Negotiated FF-A version to use with the SPMC, 0 if not there or supported */
-static uint32_t __ro_after_init ffa_fw_version;
+uint32_t __ro_after_init ffa_fw_version;
 
 /* Features supported by the SPMC or secure world when present */
 DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index 58562d8e73..ccef2f7631 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -436,6 +436,7 @@ struct ffa_ctx {
 };
 
 extern DECLARE_BITMAP(ffa_fw_abi_supported, FFA_ABI_BITMAP_SIZE);
+extern uint32_t __ro_after_init ffa_fw_version;
 
 extern struct list_head ffa_ctx_head;
 extern rwlock_t ffa_ctx_list_rwlock;
diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index adc7e645a1..070babce96 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -30,6 +30,14 @@ struct ffa_mem_access {
     uint64_t reserved;
 };
 
+/* Endpoint memory access descriptor (FF-A 1.2) */
+struct ffa_mem_access_1_2 {
+    struct ffa_mem_access_perm access_perm;
+    uint32_t region_offs;
+    uint8_t impdef[16];
+    uint8_t reserved[8];
+};
+
 /* Lend, donate or share memory transaction descriptor */
 struct ffa_mem_transaction_1_0 {
     uint16_t sender_id;
@@ -55,25 +63,10 @@ struct ffa_mem_transaction_1_1 {
     uint8_t reserved[12];
 };
 
-/* Calculate offset of struct ffa_mem_access from start of buffer */
-#define MEM_ACCESS_OFFSET(access_idx) \
-    ( sizeof(struct ffa_mem_transaction_1_1) + \
-      ( access_idx ) * sizeof(struct ffa_mem_access) )
-
-/* Calculate offset of struct ffa_mem_region from start of buffer */
-#define REGION_OFFSET(access_count, region_idx) \
-    ( MEM_ACCESS_OFFSET(access_count) + \
-      ( region_idx ) * sizeof(struct ffa_mem_region) )
-
-/* Calculate offset of struct ffa_address_range from start of buffer */
-#define ADDR_RANGE_OFFSET(access_count, region_count, range_idx) \
-    ( REGION_OFFSET(access_count, region_count) + \
-      ( range_idx ) * sizeof(struct ffa_address_range) )
-
 /*
  * The parts needed from struct ffa_mem_transaction_1_0 or struct
  * ffa_mem_transaction_1_1, used to provide an abstraction of difference in
- * data structures between version 1.0 and 1.1. This is just an internal
+ * data structures between version 1.0 and 1.2. This is just an internal
  * interface and can be changed without changing any ABI.
  */
 struct ffa_mem_transaction_int {
@@ -92,6 +85,8 @@ struct ffa_shm_mem {
     uint16_t sender_id;
     uint16_t ep_id;     /* endpoint, the one lending */
     uint64_t handle;    /* FFA_HANDLE_INVALID if not set yet */
+    /* Endpoint memory access descriptor IMPDEF value (FF-A 1.2). */
+    uint64_t impdef[2];
     unsigned int page_count;
     struct page_info *pages[];
 };
@@ -297,16 +292,20 @@ static void init_range(struct ffa_address_range *addr_range,
  * This function uses the ffa_spmc tx buffer to transmit the memory transaction
  * descriptor.
  */
-static int share_shm(struct ffa_shm_mem *shm)
+static int share_shm(struct ffa_shm_mem *shm, uint32_t ffa_vers)
 {
     const uint32_t max_frag_len = FFA_RXTX_PAGE_COUNT * FFA_PAGE_SIZE;
     struct ffa_mem_access *mem_access_array;
+    struct ffa_mem_access_1_2 *mem_access_array_1_2;
     struct ffa_mem_transaction_1_1 *descr;
     struct ffa_address_range *addr_range;
     struct ffa_mem_region *region_descr;
-    const unsigned int region_count = 1;
     uint32_t tot_len;
+    uint32_t mem_access_size;
+    uint32_t mem_access_offs;
+    uint32_t region_offs;
     paddr_t last_pa;
+    uint32_t range_count;
     unsigned int n;
     paddr_t pa;
     int32_t ret;
@@ -325,16 +324,35 @@ static int share_shm(struct ffa_shm_mem *shm)
     descr->handle = shm->handle;
     descr->mem_reg_attr = FFA_NORMAL_MEM_REG_ATTR;
     descr->mem_access_count = 1;
-    descr->mem_access_size = sizeof(*mem_access_array);
-    descr->mem_access_offs = MEM_ACCESS_OFFSET(0);
+    if ( ffa_vers >= FFA_VERSION_1_2 )
+        mem_access_size = sizeof(struct ffa_mem_access_1_2);
+    else
+        mem_access_size = sizeof(struct ffa_mem_access);
+    mem_access_offs = sizeof(struct ffa_mem_transaction_1_1);
+    region_offs = mem_access_offs + mem_access_size;
+    descr->mem_access_size = mem_access_size;
+    descr->mem_access_offs = mem_access_offs;
 
-    mem_access_array = buf + descr->mem_access_offs;
-    memset(mem_access_array, 0, sizeof(*mem_access_array));
-    mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
-    mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
-    mem_access_array[0].region_offs = REGION_OFFSET(descr->mem_access_count, 0);
+    if ( ffa_vers >= FFA_VERSION_1_2 )
+    {
+        mem_access_array_1_2 = buf + mem_access_offs;
+        memset(mem_access_array_1_2, 0, sizeof(*mem_access_array_1_2));
+        mem_access_array_1_2[0].access_perm.endpoint_id = shm->ep_id;
+        mem_access_array_1_2[0].access_perm.perm = FFA_MEM_ACC_RW;
+        mem_access_array_1_2[0].region_offs = region_offs;
+        memcpy(mem_access_array_1_2[0].impdef, shm->impdef,
+               sizeof(mem_access_array_1_2[0].impdef));
+    }
+    else
+    {
+        mem_access_array = buf + mem_access_offs;
+        memset(mem_access_array, 0, sizeof(*mem_access_array));
+        mem_access_array[0].access_perm.endpoint_id = shm->ep_id;
+        mem_access_array[0].access_perm.perm = FFA_MEM_ACC_RW;
+        mem_access_array[0].region_offs = region_offs;
+    }
 
-    region_descr = buf + mem_access_array[0].region_offs;
+    region_descr = buf + region_offs;
     memset(region_descr, 0, sizeof(*region_descr));
     region_descr->total_page_count = shm->page_count;
 
@@ -348,8 +366,9 @@ static int share_shm(struct ffa_shm_mem *shm)
         region_descr->address_range_count++;
     }
 
-    tot_len = ADDR_RANGE_OFFSET(descr->mem_access_count, region_count,
-                                region_descr->address_range_count);
+    range_count = region_descr->address_range_count;
+    tot_len = region_offs + sizeof(*region_descr) +
+              range_count * sizeof(struct ffa_address_range);
     if ( tot_len > max_frag_len )
     {
         ret = FFA_RET_NOT_SUPPORTED;
@@ -445,6 +464,12 @@ static int read_mem_transaction(uint32_t ffa_vers, const void *buf, size_t blen,
     if ( size * count + offs > blen )
         return FFA_RET_INVALID_PARAMETERS;
 
+    if ( size < sizeof(struct ffa_mem_access) )
+        return FFA_RET_INVALID_PARAMETERS;
+
+    if ( offs & 0xF )
+        return FFA_RET_INVALID_PARAMETERS;
+
     trans->mem_reg_attr = mem_reg_attr;
     trans->flags = flags;
     trans->mem_access_size = size;
@@ -461,7 +486,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     uint64_t addr = get_user_reg(regs, 3);
     uint32_t page_count = get_user_reg(regs, 4);
     const struct ffa_mem_region *region_descr;
-    const struct ffa_mem_access *mem_access;
+    const struct ffa_mem_access_1_2 *mem_access;
     struct ffa_mem_transaction_int trans;
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
@@ -471,9 +496,12 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     register_t handle_hi = 0;
     register_t handle_lo = 0;
     int ret = FFA_RET_DENIED;
+    uint32_t ffa_vers;
     uint32_t range_count;
     uint32_t region_offs;
     uint16_t dst_id;
+    uint8_t perm;
+    uint64_t impdef[2];
 
     if ( !ffa_fw_supports_fid(FFA_MEM_SHARE_64) )
     {
@@ -512,8 +540,8 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( frag_len > tx_size )
         goto out_unlock;
 
-    ret = read_mem_transaction(ACCESS_ONCE(ctx->guest_vers), tx_buf,
-                               frag_len, &trans);
+    ffa_vers = ACCESS_ONCE(ctx->guest_vers);
+    ret = read_mem_transaction(ffa_vers, tx_buf, frag_len, &trans);
     if ( ret )
         goto out_unlock;
 
@@ -542,13 +570,35 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
+    if ( trans.mem_access_size < sizeof(struct ffa_mem_access) )
+    {
+        ret = FFA_RET_INVALID_PARAMETERS;
+        goto out_unlock;
+    }
+
     /* Check that it fits in the supplied data */
     if ( trans.mem_access_offs + trans.mem_access_size > frag_len )
         goto out_unlock;
 
     mem_access = tx_buf + trans.mem_access_offs;
-
     dst_id = ACCESS_ONCE(mem_access->access_perm.endpoint_id);
+    perm = ACCESS_ONCE(mem_access->access_perm.perm);
+    region_offs = ACCESS_ONCE(mem_access->region_offs);
+
+    /*
+     * FF-A 1.2 introduced an extended mem_access descriptor with impdef
+     * fields, but guests can still use the 1.1 format if they don't need
+     * implementation-defined data. Detect which format is used based on
+     * the mem_access_size field rather than the negotiated FF-A version.
+     */
+    if ( trans.mem_access_size >= sizeof(struct ffa_mem_access_1_2) )
+        memcpy(impdef, mem_access->impdef, sizeof(impdef));
+    else
+    {
+        impdef[0] = 0;
+        impdef[1] = 0;
+    }
+
     if ( !FFA_ID_IS_SECURE(dst_id) )
     {
         /* we do not support sharing with VMs */
@@ -556,13 +606,11 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
         goto out_unlock;
     }
 
-    if ( ACCESS_ONCE(mem_access->access_perm.perm) != FFA_MEM_ACC_RW )
+    if ( perm != FFA_MEM_ACC_RW )
     {
         ret = FFA_RET_NOT_SUPPORTED;
         goto out_unlock;
     }
-
-    region_offs = ACCESS_ONCE(mem_access->region_offs);
     if ( sizeof(*region_descr) + region_offs > frag_len )
     {
         ret = FFA_RET_NOT_SUPPORTED;
@@ -587,6 +635,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     }
     shm->sender_id = trans.sender_id;
     shm->ep_id = dst_id;
+    memcpy(shm->impdef, impdef, sizeof(shm->impdef));
 
     /*
      * Check that the Composite memory region descriptor fits.
@@ -602,7 +651,7 @@ void ffa_handle_mem_share(struct cpu_user_regs *regs)
     if ( ret )
         goto out;
 
-    ret = share_shm(shm);
+    ret = share_shm(shm, ffa_fw_version);
     if ( ret )
         goto out;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240059.1541530 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusiS-0005lp-9O; Tue, 24 Feb 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 1240059.1541530; Tue, 24 Feb 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 1vusiS-0005lh-6q; Tue, 24 Feb 2026 13:44:44 +0000
Received: by outflank-mailman (input) for mailman id 1240059;
 Tue, 24 Feb 2026 13: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 1vusiQ-0005lZ-Vs
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusiQ-007rBt-35
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusiQ-004JdU-2i
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=nbRsxaNtaj7rORegvlr1AFflw2rWj+6WpxAe1X9OaQk=; b=iNjCA9LhORhw/egp+xCPHKEgJy
	c62ECcTWmXuY/SUJf4ZHdFWCf/HrGRZ9wm8/MejKo4XyGOtXCyEG45uw+FnF612+C4J1LoSmXmTTA
	QLevwwVb7iJ2dX2mvK46qDy4CKxb1M10BP/xp1wUdaZNTN/29/3H6uqDPLAJsoCrYC3M=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix PARTINFO RX release errors
Message-Id: <E1vusiQ-004JdU-2i@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:42 +0000

commit a97fe0a4c7b0ad4167cc162455a085d5112f3aea
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:29 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix PARTINFO RX release errors
    
    On PARTITION_INFO_GET error paths, Xen unconditionally called
    FFA_RX_RELEASE for the SPMC RX buffer. If the SPMC didn't grant RX
    ownership (i.e., the call failed early), this issues a spurious release
    that returns DENIED and produces warnings.
    
    Modify ffa_rxtx_spmc_rx_release() to return the release status and let
    callers choose whether to log it. Only issue FFA_RX_RELEASE after a
    successful PARTINFO SMC, while always releasing the local RX lock to
    avoid deadlocks.
    
    Update handle_partition_info_get() to only release the SPMC RX buffer
    after successful fw_ret checks, and ignore release errors during the
    error path.
    
    Functional impact: eliminates spurious FFA_RX_RELEASE calls and
    associated DENIED warnings when PARTITION_INFO_GET fails before
    obtaining SPMC RX buffer ownership.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_partinfo.c | 14 ++++++++++++--
 xen/arch/arm/tee/ffa_private.h  |  2 +-
 xen/arch/arm/tee/ffa_rxtx.c     | 14 +++++++++-----
 3 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index bf906ed0c8..015097bd4d 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -92,9 +92,11 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
                                    uint32_t dst_size)
 {
     int32_t ret;
+    int32_t release_ret;
     uint32_t src_size, real_sp_count;
     void *src_buf;
     uint32_t count = 0;
+    bool notify_fw = false;
 
     /* We need to use the RX buffer to receive the list */
     src_buf = ffa_rxtx_spmc_rx_acquire();
@@ -104,6 +106,7 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
     ret = ffa_partition_info_get(uuid, 0, &real_sp_count, &src_size);
     if ( ret )
         goto out;
+    notify_fw = true;
 
     /* Validate the src_size we got */
     if ( src_size < sizeof(struct ffa_partition_info_1_0) ||
@@ -157,7 +160,10 @@ static int32_t ffa_get_sp_partinfo(struct ffa_uuid uuid, uint32_t *sp_count,
     *sp_count = count;
 
 out:
-    ffa_rxtx_spmc_rx_release();
+    release_ret = ffa_rxtx_spmc_rx_release(notify_fw);
+    if ( release_ret )
+        gprintk(XENLOG_WARNING,
+                "ffa: Error releasing SPMC RX buffer: %d\n", release_ret);
     return ret;
 }
 
@@ -507,6 +513,7 @@ bool ffa_partinfo_init(void)
     int32_t e;
     void *spmc_rx;
     struct ffa_uuid nil_uuid = { .val = { 0ULL, 0ULL } };
+    bool notify_fw = false;
 
     if ( !ffa_fw_supports_fid(FFA_PARTITION_INFO_GET) ||
          !ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ_32))
@@ -522,6 +529,7 @@ bool ffa_partinfo_init(void)
         printk(XENLOG_ERR "ffa: Failed to get list of SPs: %d\n", e);
         goto out;
     }
+    notify_fw = true;
 
     if ( count >= FFA_MAX_NUM_SP )
     {
@@ -533,7 +541,9 @@ bool ffa_partinfo_init(void)
     ret = init_subscribers(spmc_rx, count, fpi_size);
 
 out:
-    ffa_rxtx_spmc_rx_release();
+    e = ffa_rxtx_spmc_rx_release(notify_fw);
+    if ( e )
+        printk(XENLOG_WARNING "ffa: Error releasing SPMC RX buffer: %d\n", e);
     return ret;
 }
 
diff --git a/xen/arch/arm/tee/ffa_private.h b/xen/arch/arm/tee/ffa_private.h
index ccef2f7631..1a632983c8 100644
--- a/xen/arch/arm/tee/ffa_private.h
+++ b/xen/arch/arm/tee/ffa_private.h
@@ -459,7 +459,7 @@ int32_t ffa_endpoint_domain_lookup(uint16_t endpoint_id, struct domain **d_out,
 bool ffa_rxtx_spmc_init(void);
 void ffa_rxtx_spmc_destroy(void);
 void *ffa_rxtx_spmc_rx_acquire(void);
-void ffa_rxtx_spmc_rx_release(void);
+int32_t ffa_rxtx_spmc_rx_release(bool notify_fw);
 void *ffa_rxtx_spmc_tx_acquire(void);
 void ffa_rxtx_spmc_tx_release(void);
 
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 7d8bb4f4d0..50758fb57c 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -375,18 +375,22 @@ void *ffa_rxtx_spmc_rx_acquire(void)
     return NULL;
 }
 
-void ffa_rxtx_spmc_rx_release(void)
+int32_t ffa_rxtx_spmc_rx_release(bool notify_fw)
 {
     int32_t ret;
 
     ASSERT(spin_is_locked(&ffa_spmc_rx_lock));
 
-    /* Inform the SPMC that we are done with our RX buffer */
-    ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
-    if ( ret != FFA_RET_OK )
-        printk(XENLOG_DEBUG "Error releasing SPMC RX buffer: %d\n", ret);
+    if ( notify_fw )
+    {
+        /* Inform the SPMC that we are done with our RX buffer */
+        ret = ffa_simple_call(FFA_RX_RELEASE, 0, 0, 0, 0);
+    }
+    else
+        ret = FFA_RET_OK;
 
     spin_unlock(&ffa_spmc_rx_lock);
+    return ret;
 }
 
 void *ffa_rxtx_spmc_tx_acquire(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:44:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:44:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240060.1541534 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusic-0005o4-Ak; Tue, 24 Feb 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 1240060.1541534; Tue, 24 Feb 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 1vusic-0005nv-8G; Tue, 24 Feb 2026 13:44:54 +0000
Received: by outflank-mailman (input) for mailman id 1240060;
 Tue, 24 Feb 2026 13: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 1vusib-0005no-2L
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 13: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 1vusib-007rBx-08
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:44:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusib-004Je4-02
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13: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=oacfDqK6V8l57bod8vpw4ssnEJ/mTk7bFTzan9+gcJk=; b=eD7+T8JtEgwO06qzC2NuhGSN+P
	DTjY/FRKCK4Z/yeMKC+Vzec1BbsIMPmT87IB6K5xNML+csFyc/IAQndBsvzrTik/rTzNW7yHPWVTf
	DWQNiosyhfg/UxSSb916I2y9+5wtDNrqgfX1jQWkKDJ7T79WOiYKQoSBBuyAaSjXAUCg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix RX/TX map layout and errors
Message-Id: <E1vusib-004Je4-02@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:44:53 +0000

commit d1b958a92ca8137a843f063eed7b8e558c125eda
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:30 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix RX/TX map layout and errors
    
    FFA_RXTX_MAP builds a descriptor for the SPMC and the composite region
    offsets must be 8-byte aligned. Xen currently uses a 12-byte header
    size, which produces misaligned RX/TX offsets. Mapping failures also
    return INVALID_PARAMETERS even when the failure is due to resource
    exhaustion, which misreports the error condition.
    
    Round the descriptor header size up to 8 bytes before placing the RX
    region and derive the TX offset from the aligned RX offset. Return
    FFA_RET_NO_MEMORY when the TX or RX buffer mapping fails before the
    error paths unwind.
    
    Functional impact: RXTX_MAP now returns NO_MEMORY on mapping failures
    and the SPMC receives an aligned RX/TX descriptor layout.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_rxtx.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index 50758fb57c..eff95a7955 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -119,11 +119,17 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
     tx = __map_domain_page_global(tx_pg);
     if ( !tx )
+    {
+        ret = FFA_RET_NO_MEMORY;
         goto err_put_rx_pg;
+    }
 
     rx = __map_domain_page_global(rx_pg);
     if ( !rx )
+    {
+        ret = FFA_RET_NO_MEMORY;
         goto err_unmap_tx;
+    }
 
     /*
      * Transmit the RX/TX buffer information to the SPM if acquire is supported
@@ -136,7 +142,8 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
         struct ffa_mem_region *mem_reg;
 
         /* All must fit in our TX buffer */
-        BUILD_BUG_ON(sizeof(*rxtx_desc) + sizeof(*mem_reg) * 2 +
+        BUILD_BUG_ON(ROUNDUP(sizeof(*rxtx_desc), 8) +
+                     sizeof(*mem_reg) * 2 +
                      sizeof(struct ffa_address_range) * 2 >
                      FFA_MAX_RXTX_PAGE_COUNT * FFA_PAGE_SIZE);
 
@@ -153,8 +160,8 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
          */
         rxtx_desc->sender_id = ffa_get_vm_id(d);
         rxtx_desc->reserved = 0;
-        rxtx_desc->rx_region_offs = sizeof(*rxtx_desc);
-        rxtx_desc->tx_region_offs = sizeof(*rxtx_desc) +
+        rxtx_desc->rx_region_offs = ROUNDUP(sizeof(*rxtx_desc), 8);
+        rxtx_desc->tx_region_offs = rxtx_desc->rx_region_offs +
                                     offsetof(struct ffa_mem_region,
                                              address_range_array[1]);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240061.1541538 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusim-0005q5-CD; Tue, 24 Feb 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 1240061.1541538; Tue, 24 Feb 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 1vusim-0005pw-9b; Tue, 24 Feb 2026 13:45:04 +0000
Received: by outflank-mailman (input) for mailman id 1240061;
 Tue, 24 Feb 2026 13: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 1vusil-0005pq-53
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 13: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 1vusil-007rCU-0O
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusil-004Jeh-0J
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13: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=xUDlK7Y7m3P44lKV7XBxWAYLClzsPzbaLpWhOLw/QKA=; b=EB949+A4rD7M0zVaRD4heUHXE0
	o4I8AmtqzVInneJCLV03UJZD1mo7sv8pzlkPDiR9Hvxur0EgaceqtpLa++wZOx6QBpfJnRBdtP/AE
	3DVFo4VFU8ibRFQg6whOqtXJ7MBtJwjyQC3XTklUC8uExdUJcFUBqwJ9uYml/+zHDew4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix RXTX_UNMAP ownership race
Message-Id: <E1vusil-004Jeh-0J@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:03 +0000

commit 309e8edfe32ffd95374fd1f4ccf5104db82378be
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:31 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix RXTX_UNMAP ownership race
    
    rxtx_unmap() checks RX ownership without holding the RX/TX locks and
    only enforces the ownership rule when FFA_RX_ACQUIRE is supported. This
    allows a vCPU to acquire RX between the check and unmap, and it lets
    RXTX_UNMAP proceed while RX is owned when buffers are not forwarded to
    firmware.
    
    Hold rx_lock/tx_lock across the ownership check and unmap, and deny
    RXTX_UNMAP whenever RX is owned, independent of RX_ACQUIRE support. For
    teardown, release RX ownership under the same lock window; use
    FFA_RX_RELEASE directly because rx_lock is held, and clear the local
    flag when the firmware path is unavailable.
    
    Functional impact: RXTX_UNMAP now reliably returns DENIED while RX is
    owned, and teardown releases/clears ownership without a race.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_rxtx.c | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index eff95a7955..c4fc4c4934 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -220,7 +220,7 @@ err_unlock_rxtx:
     return ret;
 }
 
-static int32_t rxtx_unmap(struct domain *d)
+static int32_t rxtx_unmap(struct domain *d, bool teardown)
 {
     struct ffa_ctx *ctx = d->arch.tee;
     int32_t ret = FFA_RET_OK;
@@ -234,6 +234,32 @@ static int32_t rxtx_unmap(struct domain *d)
         goto err_unlock_rxtx;
     }
 
+    if ( !ctx->rx_is_free )
+    {
+        if ( teardown )
+        {
+            if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
+            {
+                int32_t rel_ret;
+
+                /* Can't use ffa_rx_release() while holding rx_lock. */
+                rel_ret = ffa_simple_call(FFA_RX_RELEASE, ctx->ffa_id,
+                                          0, 0, 0);
+                if ( rel_ret )
+                    gdprintk(XENLOG_DEBUG,
+                             "ffa: RX release during teardown failed: %d\n",
+                             rel_ret);
+            }
+        }
+        else
+        {
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: RXTX_UNMAP denied, RX buffer owned by VM\n");
+            ret = FFA_RET_DENIED;
+            goto err_unlock_rxtx;
+        }
+    }
+
     if ( ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
     {
         ret = ffa_rxtx_unmap(ffa_get_vm_id(d));
@@ -261,7 +287,7 @@ err_unlock_rxtx:
 
 int32_t ffa_handle_rxtx_unmap(void)
 {
-    return rxtx_unmap(current->domain);
+    return rxtx_unmap(current->domain, false);
 }
 
 int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
@@ -369,7 +395,7 @@ int32_t ffa_rxtx_domain_init(struct domain *d)
 
 void ffa_rxtx_domain_destroy(struct domain *d)
 {
-    rxtx_unmap(d);
+    rxtx_unmap(d, true /* teardown */);
 }
 
 void *ffa_rxtx_spmc_rx_acquire(void)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240062.1541543 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusiw-0005s8-Dt; Tue, 24 Feb 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 1240062.1541543; Tue, 24 Feb 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 1vusiw-0005s0-B0; Tue, 24 Feb 2026 13:45:14 +0000
Received: by outflank-mailman (input) for mailman id 1240062;
 Tue, 24 Feb 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 1vusiv-0005ru-7Y
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusiv-007rCY-0e
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusiv-004JfD-0Z
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13: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=pyy7PJdikljtpgnKaZRo0P069VhfLzAp9NarHzTrrSQ=; b=kriVFwVivw4fAjs36xFMKmRQdv
	8pIzW2mAOv5R2JNEsUpJwmK/cyc3l+FrpWAtcjSow2BHvOtJySRvUSyCdtssTLtQvg+qy0KhsnfeU
	++wgEOrasdOJWLPHt9OKZES6PYXAvFfjukNFwPW3xpgOcMJPWisiS1wn2MP/ngwI/92U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix FFA_FEATURES validation
Message-Id: <E1vusiv-004JfD-0Z@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:13 +0000

commit 4992308e970a3a5619d5fef308c7758870bb05b1
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:32 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix FFA_FEATURES validation
    
    FFA_FEATURES advertises several ABIs unconditionally, even when firmware
    support is missing or when the ABI is physical-instance-only. This can
    mislead guests about what Xen can actually provide and violates FF-A
    calling conventions. Some SPMCs (Hafnium v2.14 or earlier) also fail to
    report FFA_RX_ACQUIRE despite supporting it.
    
    Update FFA_FEATURES validation to match spec and firmware support:
    - do no check w2-w7 input registers during FFA_FEATURES as they are
      flagged Should Be Zero by the FF-A specification or are not used by
      the calls we support.
    - reject 64-bit calling conventions from 32-bit guests with NOT_SUPPORTED
    - return NOT_SUPPORTED for physical-instance-only ABIs
    (FFA_NOTIFICATION_BITMAP_{CREATE,DESTROY}, FFA_RX_ACQUIRE)
    - advertise FFA_INTERRUPT as supported
    - gate message ABIs on firmware support:
    - FFA_MSG_SEND_DIRECT_REQ_{32,64}
    - FFA_MSG_SEND_DIRECT_REQ2 (also requires FF-A 1.2 negotiation)
    - FFA_MSG_SEND2 (or VM-to-VM enabled)
    - report MEM_SHARE_{32,64} only when FFA_MEM_SHARE_64 is supported
    - stop advertising FFA_MSG_YIELD (not implemented)
    
    Update firmware probing: drop FFA_MEM_SHARE_32 checks (deprecated) and
    add FFA_RX_ACQUIRE to the probed set. If FFA_MSG_SEND2 is reported but
    FFA_RX_ACQUIRE is not, assume RX_ACQUIRE support and warn to work
    around the Hafnium bug.
    
    Functional impact: guests now see ABI support that reflects firmware
    capabilities and Xen implementation status. When SEND2 is present but
    RX_ACQUIRE is not reported, Xen assumes RX_ACQUIRE support.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c | 63 +++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 13 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index 23e1f40848..cb8cd95fda 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -91,10 +91,10 @@ static const struct ffa_fw_abi ffa_fw_abi_needed[] = {
     FW_ABI(FFA_PARTITION_INFO_GET),
     FW_ABI(FFA_NOTIFICATION_INFO_GET_64),
     FW_ABI(FFA_NOTIFICATION_GET),
+    FW_ABI(FFA_RX_ACQUIRE),
     FW_ABI(FFA_RX_RELEASE),
     FW_ABI(FFA_RXTX_MAP_64),
     FW_ABI(FFA_RXTX_UNMAP),
-    FW_ABI(FFA_MEM_SHARE_32),
     FW_ABI(FFA_MEM_SHARE_64),
     FW_ABI(FFA_MEM_RECLAIM),
     FW_ABI(FFA_MSG_SEND_DIRECT_REQ_32),
@@ -238,21 +238,30 @@ static void handle_features(struct cpu_user_regs *regs)
     uint32_t a1 = get_user_reg(regs, 1);
     struct domain *d = current->domain;
     struct ffa_ctx *ctx = d->arch.tee;
-    unsigned int n;
 
-    for ( n = 2; n <= 7; n++ )
+    /*
+     * FFA_FEATURES defines w2 as input properties only for specific
+     * function IDs and reserves w3-w7 as SBZ. Xen does not currently
+     * implement any feature that consumes w2, so ignore extra inputs.
+     */
+    if ( !is_64bit_domain(d) && smccc_is_conv_64(a1) )
     {
-        if ( get_user_reg(regs, n) )
-        {
-            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
-            return;
-        }
+        /* 32bit guests should only use 32bit convention calls */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        return;
     }
 
     switch ( a1 )
     {
+    case FFA_NOTIFICATION_BITMAP_CREATE:
+    case FFA_NOTIFICATION_BITMAP_DESTROY:
+    case FFA_RX_ACQUIRE:
+        /* Physical-instance-only ABIs are not exposed to VMs. */
+        ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        break;
     case FFA_ERROR:
     case FFA_VERSION:
+    case FFA_INTERRUPT:
     case FFA_SUCCESS_32:
     case FFA_SUCCESS_64:
     case FFA_FEATURES:
@@ -261,16 +270,25 @@ static void handle_features(struct cpu_user_regs *regs)
     case FFA_RXTX_UNMAP:
     case FFA_MEM_RECLAIM:
     case FFA_PARTITION_INFO_GET:
+        ffa_set_regs_success(regs, 0, 0);
+        break;
     case FFA_MSG_SEND_DIRECT_REQ_32:
     case FFA_MSG_SEND_DIRECT_REQ_64:
-    case FFA_MSG_SEND2:
     case FFA_RUN:
-    case FFA_INTERRUPT:
-    case FFA_MSG_YIELD:
-        ffa_set_regs_success(regs, 0, 0);
+        if ( ffa_fw_supports_fid(a1) )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+        break;
+    case FFA_MSG_SEND2:
+        if ( ffa_fw_supports_fid(a1) || IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
+            ffa_set_regs_success(regs, 0, 0);
+        else
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
         break;
     case FFA_MSG_SEND_DIRECT_REQ2:
-        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 )
+        if ( ACCESS_ONCE(ctx->guest_vers) >= FFA_VERSION_1_2 &&
+             ffa_fw_supports_fid(FFA_MSG_SEND_DIRECT_REQ2) )
         {
             ffa_set_regs_success(regs, 0, 0);
         }
@@ -281,6 +299,11 @@ static void handle_features(struct cpu_user_regs *regs)
         break;
     case FFA_MEM_SHARE_64:
     case FFA_MEM_SHARE_32:
+        if ( !ffa_fw_supports_fid(FFA_MEM_SHARE_64) )
+        {
+            ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
+            break;
+        }
         /*
          * We currently don't support dynamically allocated buffers. Report
          * that with 0 in bit[0] of w2.
@@ -688,6 +711,20 @@ static bool ffa_probe_fw(void)
                    ffa_fw_abi_needed[i].name);
     }
 
+    /*
+     * Hafnium v2.14 or earlier does not report FFA_RX_ACQUIRE in
+     * FFA_FEATURES even though it supports it.
+     */
+    if ( !ffa_fw_supports_fid(FFA_RX_ACQUIRE) &&
+         ffa_fw_supports_fid(FFA_MSG_SEND2) )
+    {
+        printk(XENLOG_WARNING
+               "ARM FF-A Firmware reports FFA_MSG_SEND2 without FFA_RX_ACQUIRE\n");
+        printk(XENLOG_WARNING
+               "ffa: assuming RX_ACQUIRE support (workaround)\n");
+        set_bit(FFA_ABI_BITNUM(FFA_RX_ACQUIRE), ffa_fw_abi_supported);
+    }
+
     if ( !ffa_rxtx_spmc_init() )
     {
         printk(XENLOG_ERR "ffa: Error during RXTX buffer init\n");
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240063.1541545 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusj6-0005uA-Ew; Tue, 24 Feb 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 1240063.1541545; Tue, 24 Feb 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 1vusj6-0005u4-CS; Tue, 24 Feb 2026 13:45:24 +0000
Received: by outflank-mailman (input) for mailman id 1240063;
 Tue, 24 Feb 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 1vusj5-0005tw-AH
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusj5-007rD5-0w
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusj5-004Jfc-0p
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=UlIE8iQI6PIS3CclhcFRhhyg2ASdbZ7i1Phz9TjURqs=; b=3/5jQnvMBd0YZlBjaaNlibOdMf
	Y50PsyxVRpmZWr1lfrtVSjR7rp2MRbrs4vhQUpRUAqgz6iA222gCTu7S0jJ/9Qu9axAqoe35oGclE
	yJ4+YZ5Gj5uNJDnKN7Um9cqYcxB6q0pp4xouncyMoPHlKYaFGL71h/GtoCSLrgsnBkXg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Fix SEND2 SP support gating
Message-Id: <E1vusj5-004Jfc-0p@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:23 +0000

commit e70117a53fe83dafad94538ef4ff50bb297b1d56
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:33 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Fix SEND2 SP support gating
    
    Xen only maps a VM RX/TX buffer into the SPMC when firmware supports
    FFA_RX_ACQUIRE. Without that mapping, the SPMC cannot access the VM TX
    buffer to relay FFA_MSG_SEND2 to a secure partition.
    
    Advertise FFA_MSG_SEND2 to guests only when VM-to-VM is enabled or when
    the firmware supports both FFA_MSG_SEND2 and FFA_RX_ACQUIRE, and reject
    SEND2 to a secure partition otherwise. Add comments to document the
    mapping/ownership dependency.
    
    Functional impact: SEND2 to a secure partition is reported as
    NOT_SUPPORTED when FFA_RX_ACQUIRE is absent.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c     |  8 +++++++-
 xen/arch/arm/tee/ffa_msg.c | 11 +++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index cb8cd95fda..ab02eafdb3 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -281,7 +281,13 @@ static void handle_features(struct cpu_user_regs *regs)
             ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
         break;
     case FFA_MSG_SEND2:
-        if ( ffa_fw_supports_fid(a1) || IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
+        /*
+         * Forwarding SEND2 to an SP requires the SPMC to see the VM TX buffer.
+         * We only map VM RX/TX into the SPMC when RX_ACQUIRE is supported.
+         */
+        if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) ||
+             (ffa_fw_supports_fid(FFA_MSG_SEND2) &&
+              ffa_fw_supports_fid(FFA_RX_ACQUIRE)) )
             ffa_set_regs_success(regs, 0, 0);
         else
             ffa_set_regs_error(regs, FFA_RET_NOT_SUPPORTED);
diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 10856fddcb..928f269f6c 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -274,6 +274,17 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
             ret = FFA_RET_NOT_SUPPORTED;
             goto out;
         }
+        /*
+         * The SPMC needs access to the VM TX buffer to relay SEND2.
+         * We only map VM RX/TX into the SPMC when RX_ACQUIRE is supported.
+         */
+        if ( !ffa_fw_supports_fid(FFA_RX_ACQUIRE) )
+        {
+            ret = FFA_RET_NOT_SUPPORTED;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 to SP requires RX_ACQUIRE\n");
+            goto out;
+        }
 
         ret = ffa_simple_call(FFA_MSG_SEND2,
                               ((uint32_t)ffa_get_vm_id(src_d)) << 16, 0, 0, 0);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240064.1541552 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusjG-0005wu-IV; Tue, 24 Feb 2026 13:45:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240064.1541552; Tue, 24 Feb 2026 13: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 1vusjG-0005wi-F4; Tue, 24 Feb 2026 13:45:34 +0000
Received: by outflank-mailman (input) for mailman id 1240064;
 Tue, 24 Feb 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 1vusjF-0005wb-Dv
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusjF-007rDB-1I
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:33 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusjF-004Jg3-17
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=XVBpfQi5lumSZQ3wF/nkH+hWw36qsVaerwNVnYqQtfE=; b=Ae18zAobeL/IEZpmc6eFhA+H0H
	+5yOF5UJhJEav/xzuXrKm9Z1eiZyvc88IXKEkW+XD5pf/XEgHuIi0cB1qRoSRhjbrZKzW0QARev4p
	eHyZnydSn5CBmmhXa2CLrfjwHbm9XVRxfinyKvBc/Dk16JmdJsZiyMa2UJbtmUqWSZBw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Reduce logging noise
Message-Id: <E1vusjF-004Jg3-17@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:33 +0000

commit 9d63e7e9caa3398b0c9fc75eec2a439f205dff92
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:34 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Reduce logging noise
    
    Several FF-A paths log warnings for expected or recoverable conditions,
    leading to noisy logs during normal operation.
    
    Reduce log noise by:
    - demoting unhandled FID warnings to debug
    - ratelimiting notification and VM teardown failures
    - printing the bit-15 convention warning once per boot
    - adjusting log prefixes for hypervisor-only events
    - adding debug diagnostics for RX/TX acquire failures, with busy cases
      ratelimited
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa.c          | 11 ++++++-----
 xen/arch/arm/tee/ffa_notif.c    | 11 ++++++-----
 xen/arch/arm/tee/ffa_partinfo.c | 15 ++++++++-------
 xen/arch/arm/tee/ffa_rxtx.c     | 21 +++++++++++++++++++--
 4 files changed, 39 insertions(+), 19 deletions(-)

diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c
index ab02eafdb3..aa43ae2595 100644
--- a/xen/arch/arm/tee/ffa.c
+++ b/xen/arch/arm/tee/ffa.c
@@ -450,7 +450,7 @@ static bool ffa_handle_call(struct cpu_user_regs *regs)
         break;
 
     default:
-        gprintk(XENLOG_ERR, "ffa: unhandled fid 0x%x\n", fid);
+        gdprintk(XENLOG_DEBUG, "ffa: unhandled fid 0x%x\n", fid);
         e = FFA_RET_NOT_SUPPORTED;
         break;
     }
@@ -570,7 +570,8 @@ static void ffa_domain_teardown_continue(struct ffa_ctx *ctx, bool first_time)
 
     if ( retry )
     {
-        printk(XENLOG_G_INFO "%pd: ffa: Remaining cleanup, retrying\n", ctx->teardown_d);
+        printk(XENLOG_G_DEBUG "%pd: ffa: Remaining cleanup, retrying\n",
+               ctx->teardown_d);
 
         ctx->teardown_expire = NOW() + FFA_CTX_TEARDOWN_DELAY;
 
@@ -611,7 +612,7 @@ static void ffa_teardown_timer_callback(void *arg)
     if ( ctx )
         ffa_domain_teardown_continue(ctx, false /* !first_time */);
     else
-        printk(XENLOG_G_ERR "%s: teardown list is empty\n", __func__);
+        printk(XENLOG_ERR "%s: teardown list is empty\n", __func__);
 }
 
 /* This function is supposed to undo what ffa_domain_init() has done */
@@ -673,7 +674,7 @@ static bool ffa_probe_fw(void)
 
     if ( !ffa_get_version(&vers) )
     {
-        gprintk(XENLOG_ERR, "Cannot retrieve the FFA version\n");
+        printk(XENLOG_ERR "ffa: Cannot retrieve the FFA version\n");
         goto err_no_fw;
     }
 
@@ -713,7 +714,7 @@ static bool ffa_probe_fw(void)
             set_bit(FFA_ABI_BITNUM(ffa_fw_abi_needed[i].id),
                     ffa_fw_abi_supported);
         else
-            printk(XENLOG_INFO "ARM FF-A Firmware does not support %s\n",
+            printk(XENLOG_WARNING "ARM FF-A Firmware does not support %s\n",
                    ffa_fw_abi_needed[i].name);
     }
 
diff --git a/xen/arch/arm/tee/ffa_notif.c b/xen/arch/arm/tee/ffa_notif.c
index 37b05747cd..186e726412 100644
--- a/xen/arch/arm/tee/ffa_notif.c
+++ b/xen/arch/arm/tee/ffa_notif.c
@@ -292,8 +292,9 @@ static void notif_vm_pend_intr(uint16_t vm_id)
             break;
         }
     }
-    if ( !v )
-        printk(XENLOG_ERR "ffa: can't inject NPI, all vCPUs offline\n");
+    if ( !v && printk_ratelimit() )
+        printk(XENLOG_G_DEBUG "%pd: ffa: can't inject NPI, all vCPUs offline\n",
+               d);
 
 out_unlock:
     rcu_unlock_domain(d);
@@ -316,9 +317,9 @@ static void notif_sri_action(void *unused)
         res = ffa_get_ret_code(&resp);
         if ( res )
         {
-            if ( res != FFA_RET_NO_DATA )
-                printk(XENLOG_ERR "ffa: notification info get failed: error %d\n",
-                       res);
+            if ( res != FFA_RET_NO_DATA && printk_ratelimit() )
+                printk(XENLOG_WARNING
+                       "ffa: notification info get failed: error %d\n", res);
             return;
         }
 
diff --git a/xen/arch/arm/tee/ffa_partinfo.c b/xen/arch/arm/tee/ffa_partinfo.c
index 015097bd4d..fdb03dae9a 100644
--- a/xen/arch/arm/tee/ffa_partinfo.c
+++ b/xen/arch/arm/tee/ffa_partinfo.c
@@ -461,9 +461,11 @@ static bool init_subscribers(void *buf, uint16_t count, uint32_t fpi_size)
          */
         if ( !FFA_ID_IS_SECURE(fpi->id) )
         {
-            printk(XENLOG_ERR "ffa: Firmware is not using bit 15 convention for IDs !!\n"
-                              "ffa: Secure partition with id 0x%04x cannot be used\n",
-                              fpi->id);
+            printk_once(XENLOG_ERR
+                        "ffa: Firmware is not using bit 15 convention for IDs !!\n");
+            printk(XENLOG_ERR
+                   "ffa: Secure partition with id 0x%04x cannot be used\n",
+                   fpi->id);
         }
         else
         {
@@ -632,11 +634,10 @@ bool ffa_partinfo_domain_destroy(struct domain *d)
         res = ffa_direct_req_send_vm(subscr_vm_destroyed[n], ffa_get_vm_id(d),
                                      FFA_MSG_SEND_VM_DESTROYED);
 
-        if ( res )
-        {
-            printk(XENLOG_ERR "%pd: ffa: Failed to report destruction of vm_id %u to %u: res %d\n",
+        if ( res && printk_ratelimit() )
+            printk(XENLOG_WARNING
+                   "%pd: ffa: Failed to report destruction of vm_id %u to %u: res %d\n",
                    d, ffa_get_vm_id(d), subscr_vm_destroyed[n], res);
-        }
 
         /*
          * For these two error codes the hypervisor is expected to resend
diff --git a/xen/arch/arm/tee/ffa_rxtx.c b/xen/arch/arm/tee/ffa_rxtx.c
index c4fc4c4934..26a04f056f 100644
--- a/xen/arch/arm/tee/ffa_rxtx.c
+++ b/xen/arch/arm/tee/ffa_rxtx.c
@@ -4,6 +4,7 @@
  */
 
 #include <xen/const.h>
+#include <xen/lib.h>
 #include <xen/domain_page.h>
 #include <xen/mm.h>
 #include <xen/sizes.h>
@@ -82,8 +83,9 @@ int32_t ffa_handle_rxtx_map(uint32_t fid, register_t tx_addr,
 
     if ( page_count > FFA_MAX_RXTX_PAGE_COUNT || !page_count )
     {
-        printk(XENLOG_ERR "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
-               page_count, FFA_MAX_RXTX_PAGE_COUNT);
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: RXTX_MAP: error: %u pages requested (limit %u)\n",
+                 page_count, FFA_MAX_RXTX_PAGE_COUNT);
         return FFA_RET_INVALID_PARAMETERS;
     }
 
@@ -299,12 +301,15 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
     if ( !ctx->page_count )
     {
         ret = FFA_RET_DENIED;
+        gdprintk(XENLOG_DEBUG, "ffa: RX acquire denied, no RX/TX mapped\n");
         goto out;
     }
 
     if ( !ctx->rx_is_free )
     {
         ret = FFA_RET_BUSY;
+        if ( printk_ratelimit() )
+            gdprintk(XENLOG_DEBUG, "ffa: RX acquire busy\n");
         goto out;
     }
 
@@ -312,7 +317,10 @@ int32_t ffa_rx_acquire(struct ffa_ctx *ctx, void **buf, size_t *buf_size)
     {
         ret = ffa_simple_call(FFA_RX_ACQUIRE, ctx->ffa_id, 0, 0, 0);
         if ( ret != FFA_RET_OK )
+        {
+            gdprintk(XENLOG_DEBUG, "ffa: RX acquire failed: %d\n", ret);
             goto out;
+        }
     }
     ctx->rx_is_free = false;
     *buf = ctx->rx;
@@ -351,13 +359,22 @@ int32_t ffa_tx_acquire(struct ffa_ctx *ctx, const void **buf, size_t *buf_size)
     int32_t ret = FFA_RET_DENIED;
 
     if ( !spin_trylock(&ctx->tx_lock) )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire busy\n");
         return FFA_RET_BUSY;
+    }
 
     if ( !ctx->page_count )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, no RX/TX mapped\n");
         goto err_unlock;
+    }
 
     if ( !ctx->tx )
+    {
+        gdprintk(XENLOG_DEBUG, "ffa: TX acquire denied, TX buffer missing\n");
         goto err_unlock;
+    }
 
     *buf = ctx->tx;
     *buf_size = ctx->page_count * FFA_PAGE_SIZE;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240065.1541554 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusjQ-0005z6-JD; Tue, 24 Feb 2026 13:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240065.1541554; Tue, 24 Feb 2026 13: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 1vusjQ-0005yy-GZ; Tue, 24 Feb 2026 13:45:44 +0000
Received: by outflank-mailman (input) for mailman id 1240065;
 Tue, 24 Feb 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 1vusjP-0005ys-H9
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 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 1vusjP-007rDF-1Z
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:43 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusjP-004Jip-1T
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 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=5f3vv3QEV041P3DvWie39s5EGzBKsnV/rbzuxLpVt/Q=; b=2D/rtTH1BqJd0b4Jfl3QpySTt8
	zqfujPFcdkac/oUeT/6Ib3YIEReSnnMiR3quOxyA1wNuP8b9ociVXoGhWbuooScLnz89VXJ6hN1Bh
	Wnv+spCy4tqZoI8Tv3n+s+UVm8IM7QreD4s7ksiC+15MDGc/LOsAIsbn3eTIznT8MXT4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Add MEM_SHARE page diagnostics
Message-Id: <E1vusjP-004Jip-1T@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:43 +0000

commit 4d39261835719362548f0da978bcf081662feabb
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:35 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add MEM_SHARE page diagnostics
    
    MEM_SHARE failures in get_shm_pages() are silent, which makes malformed
    ranges and page mapping failures hard to diagnose.
    
    Add debug logging for page validation failures:
    - descriptor validation failures (unaligned, range short/overflow)
    - per-page mapping failures (unmapped GFN, wrong p2m type)
    - address overflow detection in range walks
    
    Ratelimit temporary reclaim failures and log permanent reclaim failures
    as errors.
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_shm.c | 39 ++++++++++++++++++++++++++++++++++++---
 1 file changed, 36 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/tee/ffa_shm.c b/xen/arch/arm/tee/ffa_shm.c
index 070babce96..3d61caaeba 100644
--- a/xen/arch/arm/tee/ffa_shm.c
+++ b/xen/arch/arm/tee/ffa_shm.c
@@ -161,32 +161,62 @@ static int32_t get_shm_pages(struct domain *d, struct ffa_shm_mem *shm,
         addr = ACCESS_ONCE(range[n].address);
 
         if ( !IS_ALIGNED(addr, FFA_PAGE_SIZE) )
+        {
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: mem share pages invalid: unaligned range %u address %#lx\n",
+                     n, (unsigned long)addr);
             return FFA_RET_INVALID_PARAMETERS;
+        }
 
         for ( m = 0; m < page_count; m++ )
         {
             if ( pg_idx >= shm->page_count )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: range overflow rg %u pg %u\n",
+                         n, m);
                 return FFA_RET_INVALID_PARAMETERS;
+            }
 
             if ( !ffa_safe_addr_add(addr, m) )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: addr overflow rg %u pg %u base %#lx\n",
+                         n, m, (unsigned long)addr);
                 return FFA_RET_INVALID_PARAMETERS;
+            }
 
             gaddr = addr + m * FFA_PAGE_SIZE;
             gfn = gaddr_to_gfn(gaddr);
             shm->pages[pg_idx] = get_page_from_gfn(d, gfn_x(gfn), &t,
 						   P2M_ALLOC);
             if ( !shm->pages[pg_idx] )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: gfn unmapped rg %u pg %u addr %#lx\n",
+                         n, m, (unsigned long)gaddr);
                 return FFA_RET_DENIED;
+            }
             /* Only normal RW RAM for now */
             if ( t != p2m_ram_rw )
+            {
+                gdprintk(XENLOG_DEBUG,
+                         "ffa: mem share pages invalid: p2m type %u rg %u pg %u addr %#lx\n",
+                         t, n, m, (unsigned long)gaddr);
                 return FFA_RET_DENIED;
+            }
             pg_idx++;
         }
     }
 
     /* The ranges must add up */
     if ( pg_idx < shm->page_count )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: mem share pages invalid: range short pg %u\n",
+                 pg_idx);
         return FFA_RET_INVALID_PARAMETERS;
+    }
 
     return FFA_RET_OK;
 }
@@ -741,8 +771,10 @@ bool ffa_shm_domain_destroy(struct domain *d)
              * A temporary error that may get resolved a bit later, it's
              * worth retrying.
              */
-            printk(XENLOG_G_INFO "%pd: ffa: Failed to reclaim handle %#lx : %d\n",
-                   d, shm->handle, res);
+            if ( printk_ratelimit() )
+                printk(XENLOG_G_WARNING
+                       "%pd: ffa: Failed to reclaim handle %#lx : %d\n",
+                       d, shm->handle, res);
             break; /* We will retry later */
         default:
             /*
@@ -754,7 +786,8 @@ bool ffa_shm_domain_destroy(struct domain *d)
              * FFA_RET_NO_MEMORY might be a temporary error as it it could
              * succeed if retried later, but treat it as permanent for now.
              */
-            printk(XENLOG_G_INFO "%pd: ffa: Permanent failure to reclaim handle %#lx : %d\n",
+            printk(XENLOG_G_ERR
+                   "%pd: ffa: Permanent failure to reclaim handle %#lx : %d\n",
                    d, shm->handle, res);
 
             /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:45:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:45:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240066.1541558 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusja-000618-KY; Tue, 24 Feb 2026 13:45:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240066.1541558; Tue, 24 Feb 2026 13: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 1vusja-000610-I2; Tue, 24 Feb 2026 13:45:54 +0000
Received: by outflank-mailman (input) for mailman id 1240066;
 Tue, 24 Feb 2026 13: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 1vusjZ-00060u-JO
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 13: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 1vusjZ-007rDJ-1q
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:45:53 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusjZ-004Jjj-1k
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13: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=aVo0t2clK3qWtyKdQaRLkBbzrN/yAJ9IVxfog6c60ys=; b=oQQr9BBFbclUx87P4kAl6hPbxU
	hYFH8CQ3bi3MFm9E3CpT/h3dMKF1Rf62fxnfng89y2g8b4E3w5ITDSgGXj0A/yaURZYKN5R8dZAp6
	X/T+tB6dUwrT3SAsw7Uv2mhZsbP9ywubJUfb7EmV+0LxvqHISFai7sCeJv9qraJTAtlw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: ffa: Add message parameter diagnostics
Message-Id: <E1vusjZ-004Jjj-1k@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:45:53 +0000

commit b5174863a465b5a8a0ba842f5f6e5f2691d42812
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Wed Feb 11 18:15:36 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: ffa: Add message parameter diagnostics
    
    MSG_SEND2 and direct request validation failures are silent, making it
    hard to diagnose invalid IDs, oversized messages, or unsupported
    destination types.
    
    Add debug logs for parameter validation failures:
    - invalid endpoint IDs
    - oversized messages
    - unsupported destination types
    - invalid sender/receiver combinations
    - ratelimit MSG_SEND2 busy failures to avoid log flooding
    
    No functional changes.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
---
 xen/arch/arm/tee/ffa_msg.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/xen/arch/arm/tee/ffa_msg.c b/xen/arch/arm/tee/ffa_msg.c
index 928f269f6c..1eadc62870 100644
--- a/xen/arch/arm/tee/ffa_msg.c
+++ b/xen/arch/arm/tee/ffa_msg.c
@@ -4,6 +4,7 @@
  */
 
 #include <xen/const.h>
+#include <xen/lib.h>
 #include <xen/sizes.h>
 #include <xen/types.h>
 
@@ -100,6 +101,7 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     if ( !ffa_fw_supports_fid(fid) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: direct req fid %#x not supported\n", fid);
         goto out;
     }
 
@@ -108,6 +110,9 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
          (src_dst & GENMASK(15,0)) == ffa_get_vm_id(d) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: direct req invalid src/dst %#x\n",
+                 (uint32_t)src_dst);
         goto out;
     }
 
@@ -115,6 +120,9 @@ void ffa_handle_msg_send_direct_req(struct cpu_user_regs *regs, uint32_t fid)
     if ( !FFA_ID_IS_SECURE(src_dst & GENMASK(15,0)) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: direct req to non-secure dst %#x\n",
+                 (uint32_t)(src_dst & GENMASK(15, 0)));
         goto out;
     }
 
@@ -166,7 +174,12 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* This is also checking that dest is not src */
     ret = ffa_endpoint_domain_lookup(dst_id, &dst_d, &dst_ctx);
     if ( ret )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 lookup failed: dst %#x ret %d\n",
+                 dst_id, ret);
         return ret;
+    }
 
     /* This also checks that destination has set a Rx buffer */
     ret = ffa_rx_acquire(dst_ctx , &rx_buf, &rx_size);
@@ -199,6 +212,16 @@ static int32_t ffa_msg_send2_vm(uint16_t dst_id, const void *src_buf,
     /* receiver rx buffer will be released by the receiver*/
 
 out_unlock:
+    if ( ret )
+    {
+        /**
+         * Always print other errors than BUSY but ratelimit BUSY prints
+         * to prevent large number of prints when sender retries on BUSY.
+         */
+        if ( ret != FFA_RET_BUSY || printk_ratelimit() )
+            gdprintk(XENLOG_DEBUG, "ffa: msg_send2 to %#x failed: %d\n",
+                     dst_id, ret);
+    }
     rcu_unlock_domain(dst_d);
     if ( !ret )
         ffa_raise_rx_buffer_full(dst_d);
@@ -226,7 +249,11 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
     ret = ffa_tx_acquire(src_ctx, &tx_buf, &tx_size);
     if ( ret != FFA_RET_OK )
+    {
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 TX acquire failed: %d\n", ret);
         return ret;
+    }
 
     /* create a copy of the message header */
     memcpy(&src_msg, tx_buf, sizeof(src_msg));
@@ -238,6 +265,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
          dst_id == ffa_get_vm_id(src_d) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid src/dst src %#x dst %#x\n",
+                 src_id, dst_id);
         goto out;
     }
 
@@ -246,6 +276,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         if (src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_1))
         {
             ret = FFA_RET_INVALID_PARAMETERS;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 invalid msg_offset %u (v1.1)\n",
+                     src_msg.msg_offset);
             goto out;
         }
         /* Set uuid to Nil UUID for v1.1 guests */
@@ -255,6 +288,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
     else if ( src_msg.msg_offset < sizeof(struct ffa_part_msg_rxtx_1_2) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid msg_offset %u (v1.2)\n",
+                 src_msg.msg_offset);
         goto out;
     }
 
@@ -263,6 +299,9 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
             src_msg.msg_size > (tx_size - src_msg.msg_offset) )
     {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 invalid msg_size %u offset %u tx %zu\n",
+                 src_msg.msg_size, src_msg.msg_offset, tx_size);
         goto out;
     }
 
@@ -272,6 +311,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         if ( !ffa_fw_supports_fid(FFA_MSG_SEND2) )
         {
             ret = FFA_RET_NOT_SUPPORTED;
+            gdprintk(XENLOG_DEBUG,
+                     "ffa: msg_send2 to SP not supported\n");
             goto out;
         }
         /*
@@ -288,6 +329,8 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
 
         ret = ffa_simple_call(FFA_MSG_SEND2,
                               ((uint32_t)ffa_get_vm_id(src_d)) << 16, 0, 0, 0);
+        if ( ret )
+            gdprintk(XENLOG_DEBUG, "ffa: msg_send2 to SP failed: %d\n", ret);
     }
     else if ( IS_ENABLED(CONFIG_FFA_VM_TO_VM) )
     {
@@ -295,7 +338,11 @@ int32_t ffa_handle_msg_send2(struct cpu_user_regs *regs)
         ret = ffa_msg_send2_vm(dst_id, tx_buf, &src_msg);
     }
     else
+    {
         ret = FFA_RET_INVALID_PARAMETERS;
+        gdprintk(XENLOG_DEBUG,
+                 "ffa: msg_send2 to VM disabled (dst %#x)\n", dst_id);
+    }
 
 out:
     ffa_tx_release(src_ctx);
@@ -311,6 +358,7 @@ void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
     if ( !ffa_fw_supports_fid(fid) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: run fid %#x not supported\n", fid);
         goto out;
     }
 
@@ -322,6 +370,7 @@ void ffa_handle_run(struct cpu_user_regs *regs, uint32_t fid)
     if ( !FFA_ID_IS_SECURE(dst >> 16) )
     {
         ret = FFA_RET_NOT_SUPPORTED;
+        gdprintk(XENLOG_DEBUG, "ffa: run to non-secure dst %#x\n", dst);
         goto out;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Tue Feb 24 13:46:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 24 Feb 2026 13:46:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240067.1541562 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vusjk-000635-MN; Tue, 24 Feb 2026 13:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240067.1541562; Tue, 24 Feb 2026 13: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 1vusjk-00062y-JO; Tue, 24 Feb 2026 13:46:04 +0000
Received: by outflank-mailman (input) for mailman id 1240067;
 Tue, 24 Feb 2026 13: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 1vusjj-00062s-Lq
 for xen-changelog@lists.xenproject.org; Tue, 24 Feb 2026 13: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 1vusjj-007rDb-26
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13:46:03 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vusjj-004Jld-20
 for xen-changelog@lists.xenproject.org;
 Tue, 24 Feb 2026 13: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=8ePs4yPvZAzyUibUJ9pVRk+9i+u3m59/x+qrgClHIcw=; b=LketK26X0nvQdp3hb6mfCKrRmx
	d1QEuoDIp9zBvErAyFmevSlqZx6nzOMf+oWVd7kcg/ZidYPkrgQEyJofyHnp5koQ+sLnfsXnWRIup
	zyFBb71u0r75HHnPyzE5i+9zGWTnLAJgerW0SWIkab7ZSrs4fDmb+hN/3GNfL+Cnu5ak=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: smccc: Preserve argument types in v1.1 SMC
Message-Id: <E1vusjj-004Jld-20@xenbits.xenproject.org>
Date: Tue, 24 Feb 2026 13:46:03 +0000

commit 28af7ed9107cdb14196dcd58cb3dcd78066bf9a9
Author:     Bertrand Marquis <bertrand.marquis@arm.com>
AuthorDate: Mon Feb 16 08:47:08 2026 +0100
Commit:     Michal Orzel <michal.orzel@amd.com>
CommitDate: Tue Feb 24 12:54:38 2026 +0100

    xen/arm: smccc: Preserve argument types in v1.1 SMC
    
    The SMCCC v1.1 inline helper currently forces a1-a4 into
    unsigned long and uses in/out constraints for r0-r3. In
    contrast, a5-a7 are passed with their original types via
    read-only constraints. On arm64 this means a 32-bit signed
    value in a1-a4 is converted to a 64-bit unsigned value, while
    the same value in a5-a7 keeps its signed 32-bit form. For
    example, a negative int in a2 is widened to unsigned long, but
    a negative int in a5 is passed as a 32-bit signed value, so the
    SMC sees different encodings depending on argument position.
    
    Switch the helper to use typed input registers arg0-arg7
    derived from the call arguments (keeping a0 cast to u32) and
    separate output registers r0-r3. This preserves argument types
    consistently across all positions. Argument evaluation order
    is unchanged, so we do not reintroduce the issue fixed in
    "e00dc325bd9e" ("xen/arm: smccc-1.1: Handle function result as
    parameters").
    
    This also aligns Xen's SMCCC parameter handling with Linux's type-
    preserving behavior (same externally visible argument handling,
    independent implementation) to avoid surprising differences
    between a1-a4 and a5-a7.
    
    Current callers (PSCI, SCMI, platform SMC pass-through, OP-TEE,
    and exynos5) pass unsigned values; exynos5 passes an int CPU id
    which should always be > 0.
    
    Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 69 ++++++++++++++++------------------------
 1 file changed, 27 insertions(+), 42 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 441b3ab65d..5b30dd57b6 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -99,87 +99,68 @@ struct arm_smccc_res {
 #define __count_args(...)                               \
     ___count_args(__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0)
 
-#define __constraint_write_0                        \
-    "+r" (r0), "=&r" (r1), "=&r" (r2), "=&r" (r3)
-#define __constraint_write_1                        \
-    "+r" (r0), "+r" (r1), "=&r" (r2), "=&r" (r3)
-#define __constraint_write_2                        \
-    "+r" (r0), "+r" (r1), "+r" (r2), "=&r" (r3)
-#define __constraint_write_3                        \
-    "+r" (r0), "+r" (r1), "+r" (r2), "+r" (r3)
-#define __constraint_write_4    __constraint_write_3
-#define __constraint_write_5    __constraint_write_4
-#define __constraint_write_6    __constraint_write_5
-#define __constraint_write_7    __constraint_write_6
-
-#define __constraint_read_0
-#define __constraint_read_1
-#define __constraint_read_2
-#define __constraint_read_3
-#define __constraint_read_4 "r" (r4)
-#define __constraint_read_5 __constraint_read_4, "r" (r5)
-#define __constraint_read_6 __constraint_read_5, "r" (r6)
-#define __constraint_read_7 __constraint_read_6, "r" (r7)
+#define __constraint_read_0 "r" (arg0)
+#define __constraint_read_1 __constraint_read_0, "r" (arg1)
+#define __constraint_read_2 __constraint_read_1, "r" (arg2)
+#define __constraint_read_3 __constraint_read_2, "r" (arg3)
+#define __constraint_read_4 __constraint_read_3, "r" (arg4)
+#define __constraint_read_5 __constraint_read_4, "r" (arg5)
+#define __constraint_read_6 __constraint_read_5, "r" (arg6)
+#define __constraint_read_7 __constraint_read_6, "r" (arg7)
 
 #define __declare_arg_0(a0, res)                            \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1);                  \
-    register unsigned long  r2 ASM_REG(2);                  \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
 
 #define __declare_arg_1(a0, a1, res)                        \
     typeof(a1) __a1 = (a1);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2);                  \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
     typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2) = __a2;           \
-    register unsigned long  r3 ASM_REG(3)
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    register typeof(a2)     arg2 ASM_REG(2) = __a2
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
     typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
     typeof(a3) __a3 = (a3);                                 \
     struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  r0 ASM_REG(0) = (uint32_t)(a0); \
-    register unsigned long  r1 ASM_REG(1) = __a1;           \
-    register unsigned long  r2 ASM_REG(2) = __a2;           \
-    register unsigned long  r3 ASM_REG(3) = __a3
+    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    register typeof(a2)     arg2 ASM_REG(2) = __a2;         \
+    register typeof(a3)     arg3 ASM_REG(3) = __a3
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
     typeof(a4) __a4 = (a4);                             \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register unsigned long r4 ASM_REG(4) = __a4
+    register typeof(a4)     arg4 ASM_REG(4) = __a4
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
     typeof(a5) __a5 = (a5);                             \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5) r5 ASM_REG(5) = __a5
+    register typeof(a5)     arg5 ASM_REG(5) = __a5
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
     typeof(a6) __a6 = (a6);                                 \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6) r6 ASM_REG(6) = __a6
+    register typeof(a6)     arg6 ASM_REG(6) = __a6
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
     typeof(a7) __a7 = (a7);                                     \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7) r7 ASM_REG(7) = __a7
+    register typeof(a7)     arg7 ASM_REG(7) = __a7
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
 
 #define ___constraints(count)                       \
-    : __constraint_write_ ## count                  \
+    : "=r" (r0), "=r" (r1), "=r" (r2), "=r" (r3)     \
     : __constraint_read_ ## count                   \
     : "memory"
 #define __constraints(count)    ___constraints(count)
@@ -204,6 +185,10 @@ struct arm_smccc_res {
  */
 #define arm_smccc_1_1_smc(...)                                  \
     do {                                                        \
+        register unsigned long r0 ASM_REG(0);                   \
+        register unsigned long r1 ASM_REG(1);                   \
+        register unsigned long r2 ASM_REG(2);                   \
+        register unsigned long r3 ASM_REG(3);                   \
         __declare_args(__count_args(__VA_ARGS__), __VA_ARGS__); \
         asm volatile("smc #0\n"                                 \
                      __constraints(__count_args(__VA_ARGS__))); \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 12:55:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 12:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240726.1542004 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvEPv-0006NT-H9; Wed, 25 Feb 2026 12:55:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240726.1542004; Wed, 25 Feb 2026 12: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 1vvEPv-0006NL-Dp; Wed, 25 Feb 2026 12:55:03 +0000
Received: by outflank-mailman (input) for mailman id 1240726;
 Wed, 25 Feb 2026 12: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 1vvEPu-0006NF-I4
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 12: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 1vvEPu-009VnE-1V
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvEPu-005b5k-18
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12: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=2tTXQ19UQ82MM4ESe4XRMEWZocOOXMmNpzoTGCFS/hs=; b=qUJhvNxi1j4oYBCfRmRWMEqAnc
	XOIV4gd5nOqrqpVsfnnvgeHEt6kGqHoqA0CNUbVSoe6rOG6+SeB9xVAGXLz91PnRO6gXxece5oWV9
	z+IKO1CS+JkJj2j9cY0hYoypsMoBweWKrcUAzN0K9M81vuktcf7cwCBQXIlv3c+EbUGw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu-policy: move CPU policy library code
Message-Id: <E1vvEPu-005b5k-18@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 12:55:02 +0000

commit 7326c1725432166cbb7a284df78c373b95be82aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 25 12:31:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:31:08 2026 +0100

    x86/cpu-policy: move CPU policy library code
    
    ... to a dedicated subdir of x86's private lib/ sub-tree.
    
    For the CPU policy harnesses and libxenguest use $(lib-y) as set by the
    new Makefile.common, whereas for the emulator harnesses stick to building
    just cpuid.o for the time being.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/cpu-policy/Makefile               |   7 +-
 tools/fuzz/x86_instruction_emulator/Makefile |   2 +-
 tools/libs/guest/Makefile.common             |   7 +-
 tools/tests/cpu-policy/Makefile              |   7 +-
 tools/tests/x86_emulator/Makefile            |   2 +-
 xen/arch/x86/arch.mk                         |   1 +
 xen/arch/x86/lib/Makefile                    |   2 +
 xen/arch/x86/lib/cpu-policy/Makefile         |   1 +
 xen/arch/x86/lib/cpu-policy/Makefile.common  |   3 +
 xen/arch/x86/lib/cpu-policy/cpuid.c          | 559 +++++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/msr.c            | 130 +++++++
 xen/arch/x86/lib/cpu-policy/policy.c         |  54 +++
 xen/arch/x86/lib/cpu-policy/private.h        |  78 ++++
 xen/lib/Makefile                             |   2 -
 xen/lib/x86/Makefile                         |   3 -
 xen/lib/x86/cpuid.c                          | 559 ---------------------------
 xen/lib/x86/msr.c                            | 130 -------
 xen/lib/x86/policy.c                         |  54 ---
 xen/lib/x86/private.h                        |  78 ----
 19 files changed, 845 insertions(+), 834 deletions(-)

diff --git a/tools/fuzz/cpu-policy/Makefile b/tools/fuzz/cpu-policy/Makefile
index 6e7743e0aa..76ecf20e8d 100644
--- a/tools/fuzz/cpu-policy/Makefile
+++ b/tools/fuzz/cpu-policy/Makefile
@@ -20,9 +20,12 @@ install: all
 CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
 CFLAGS += $(APPEND_CFLAGS) -Og
 
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
-afl-policy-fuzzer: afl-policy-fuzzer.o msr.o cpuid.o
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
+
+afl-policy-fuzzer: afl-policy-fuzzer.o $(lib-y)
 	$(CC) $(CFLAGS) $^ -o $@
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index d104b15f4f..4e4877a203 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -21,7 +21,7 @@ vpath %.h ../../tests/x86_emulator
 CFLAGS += -iquote ../../tests/x86_emulator
 
 # Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
 x86_emulate:
 	mkdir -p $@
diff --git a/tools/libs/guest/Makefile.common b/tools/libs/guest/Makefile.common
index a026a2f662..b928a4a246 100644
--- a/tools/libs/guest/Makefile.common
+++ b/tools/libs/guest/Makefile.common
@@ -33,9 +33,12 @@ LIBELF_OBJS += libelf-dominfo.o
 OBJS-y += $(LIBELF_OBJS)
 
 ifeq ($(CONFIG_X86),y) # Add libx86 to the build
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
-OBJS-y                 += cpuid.o msr.o policy.o
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
+
+OBJS-y                 += $(lib-y)
 endif
 
 # new domain builder
diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 24f87e2eca..d8e4d222f4 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -42,11 +42,14 @@ CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(APPEND_LDFLAGS)
 
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
+
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
 
 %.o: Makefile
 
-test-cpu-policy: test-cpu-policy.o msr.o cpuid.o policy.o
+test-cpu-policy: test-cpu-policy.o $(lib-y)
 	$(CC) $^ -o $@ $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 376cfe244d..e18725d0c3 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -17,7 +17,7 @@ vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
 HOSTCFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
 
 # Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
 CFLAGS += $(CFLAGS_xeninclude)
 
diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 37fe65bc13..0b42e6312f 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -4,6 +4,7 @@
 export XEN_IMG_OFFSET := 0x200000
 
 ARCH_LIBS-y += arch/x86/lib/lib.a
+ARCH_LIBS-y += arch/x86/lib/cpu-policy/lib.a
 
 CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET)
 
diff --git a/xen/arch/x86/lib/Makefile b/xen/arch/x86/lib/Makefile
index b9a65c662a..fe9a271879 100644
--- a/xen/arch/x86/lib/Makefile
+++ b/xen/arch/x86/lib/Makefile
@@ -6,3 +6,5 @@ lib-y += generic-hweightl.o
 lib-y += memcpy.o
 lib-y += memset.o
 lib-y += scrub-page.o
+
+obj-y += cpu-policy/
diff --git a/xen/arch/x86/lib/cpu-policy/Makefile b/xen/arch/x86/lib/cpu-policy/Makefile
new file mode 100644
index 0000000000..b12cf7836d
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/Makefile
@@ -0,0 +1 @@
+include $(srcdir)/Makefile.common
diff --git a/xen/arch/x86/lib/cpu-policy/Makefile.common b/xen/arch/x86/lib/cpu-policy/Makefile.common
new file mode 100644
index 0000000000..35475af780
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/Makefile.common
@@ -0,0 +1,3 @@
+lib-y += cpuid.o
+lib-y += msr.o
+lib-y += policy.o
diff --git a/xen/arch/x86/lib/cpu-policy/cpuid.c b/xen/arch/x86/lib/cpu-policy/cpuid.c
new file mode 100644
index 0000000000..6298d051f2
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/cpuid.c
@@ -0,0 +1,559 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+static void zero_leaves(struct cpuid_leaf *l,
+                        unsigned int first, unsigned int last)
+{
+    if ( first <= last )
+        memset(&l[first], 0, sizeof(*l) * (last - first + 1));
+}
+
+unsigned int x86_cpuid_lookup_vendor(uint32_t ebx, uint32_t ecx, uint32_t edx)
+{
+    switch ( ebx )
+    {
+    case X86_VENDOR_INTEL_EBX:
+        if ( ecx == X86_VENDOR_INTEL_ECX &&
+             edx == X86_VENDOR_INTEL_EDX )
+            return X86_VENDOR_INTEL;
+        break;
+
+    case X86_VENDOR_AMD_EBX:
+        if ( ecx == X86_VENDOR_AMD_ECX &&
+             edx == X86_VENDOR_AMD_EDX )
+            return X86_VENDOR_AMD;
+        break;
+
+    case X86_VENDOR_CENTAUR_EBX:
+        if ( ecx == X86_VENDOR_CENTAUR_ECX &&
+             edx == X86_VENDOR_CENTAUR_EDX )
+            return X86_VENDOR_CENTAUR;
+        break;
+
+    case X86_VENDOR_SHANGHAI_EBX:
+        if ( ecx == X86_VENDOR_SHANGHAI_ECX &&
+             edx == X86_VENDOR_SHANGHAI_EDX )
+            return X86_VENDOR_SHANGHAI;
+        break;
+
+    case X86_VENDOR_HYGON_EBX:
+        if ( ecx == X86_VENDOR_HYGON_ECX &&
+             edx == X86_VENDOR_HYGON_EDX )
+            return X86_VENDOR_HYGON;
+        break;
+    }
+
+    return X86_VENDOR_UNKNOWN;
+}
+
+const char *x86_cpuid_vendor_to_str(unsigned int vendor)
+{
+    switch ( vendor )
+    {
+    case X86_VENDOR_INTEL:    return "Intel";
+    case X86_VENDOR_AMD:      return "AMD";
+    case X86_VENDOR_CENTAUR:  return "Centaur";
+    case X86_VENDOR_SHANGHAI: return "Shanghai";
+    case X86_VENDOR_HYGON:    return "Hygon";
+    default:                  return "Unknown";
+    }
+}
+
+void x86_cpu_policy_to_featureset(
+    const struct cpu_policy *p, uint32_t fs[FEATURESET_NR_ENTRIES])
+{
+    fs[FEATURESET_1d]        = p->basic._1d;
+    fs[FEATURESET_1c]        = p->basic._1c;
+    fs[FEATURESET_e1d]       = p->extd.e1d;
+    fs[FEATURESET_e1c]       = p->extd.e1c;
+    fs[FEATURESET_Da1]       = p->xstate.Da1;
+    fs[FEATURESET_7b0]       = p->feat._7b0;
+    fs[FEATURESET_7c0]       = p->feat._7c0;
+    fs[FEATURESET_e7d]       = p->extd.e7d;
+    fs[FEATURESET_e8b]       = p->extd.e8b;
+    fs[FEATURESET_7d0]       = p->feat._7d0;
+    fs[FEATURESET_7a1]       = p->feat._7a1;
+    fs[FEATURESET_e21a]      = p->extd.e21a;
+    fs[FEATURESET_7b1]       = p->feat._7b1;
+    fs[FEATURESET_7d2]       = p->feat._7d2;
+    fs[FEATURESET_7c1]       = p->feat._7c1;
+    fs[FEATURESET_7d1]       = p->feat._7d1;
+    fs[FEATURESET_m10Al]     = p->arch_caps.lo;
+    fs[FEATURESET_m10Ah]     = p->arch_caps.hi;
+    fs[FEATURESET_e21c]      = p->extd.e21c;
+}
+
+void x86_cpu_featureset_to_policy(
+    const uint32_t fs[FEATURESET_NR_ENTRIES], struct cpu_policy *p)
+{
+    p->basic._1d             = fs[FEATURESET_1d];
+    p->basic._1c             = fs[FEATURESET_1c];
+    p->extd.e1d              = fs[FEATURESET_e1d];
+    p->extd.e1c              = fs[FEATURESET_e1c];
+    p->xstate.Da1            = fs[FEATURESET_Da1];
+    p->feat._7b0             = fs[FEATURESET_7b0];
+    p->feat._7c0             = fs[FEATURESET_7c0];
+    p->extd.e7d              = fs[FEATURESET_e7d];
+    p->extd.e8b              = fs[FEATURESET_e8b];
+    p->feat._7d0             = fs[FEATURESET_7d0];
+    p->feat._7a1             = fs[FEATURESET_7a1];
+    p->extd.e21a             = fs[FEATURESET_e21a];
+    p->feat._7b1             = fs[FEATURESET_7b1];
+    p->feat._7d2             = fs[FEATURESET_7d2];
+    p->feat._7c1             = fs[FEATURESET_7c1];
+    p->feat._7d1             = fs[FEATURESET_7d1];
+    p->arch_caps.lo          = fs[FEATURESET_m10Al];
+    p->arch_caps.hi          = fs[FEATURESET_m10Ah];
+    p->extd.e21c             = fs[FEATURESET_e21c];
+}
+
+void x86_cpu_policy_recalc_synth(struct cpu_policy *p)
+{
+    p->x86_vendor = x86_cpuid_lookup_vendor(
+        p->basic.vendor_ebx, p->basic.vendor_ecx, p->basic.vendor_edx);
+}
+
+void x86_cpu_policy_fill_native(struct cpu_policy *p)
+{
+    unsigned int i;
+
+    cpuid_leaf(0, &p->basic.raw[0]);
+    for ( i = 1; i <= MIN(p->basic.max_leaf,
+                          ARRAY_SIZE(p->basic.raw) - 1); ++i )
+    {
+        switch ( i )
+        {
+        case 0x4: case 0x7: case 0xb: case 0xd:
+            /* Multi-invocation leaves.  Deferred. */
+            continue;
+        }
+
+        cpuid_leaf(i, &p->basic.raw[i]);
+    }
+
+    if ( p->basic.max_leaf >= 4 )
+    {
+        for ( i = 0; i < ARRAY_SIZE(p->cache.raw); ++i )
+        {
+            union {
+                struct cpuid_leaf l;
+                struct cpuid_cache_leaf c;
+            } u;
+
+            cpuid_count_leaf(4, i, &u.l);
+
+            if ( u.c.type == 0 )
+                break;
+
+            p->cache.subleaf[i] = u.c;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_CACHE is arbitrary.  It is expected
+         * that it will eventually need increasing for future hardware.
+         */
+#ifdef __XEN__
+        if ( i == ARRAY_SIZE(p->cache.raw) )
+            printk(XENLOG_WARNING
+                   "CPUID: Insufficient Leaf 4 space for this hardware\n");
+#endif
+    }
+
+    if ( p->basic.max_leaf >= 7 )
+    {
+        cpuid_count_leaf(7, 0, &p->feat.raw[0]);
+
+        for ( i = 1; i <= MIN(p->feat.max_subleaf,
+                              ARRAY_SIZE(p->feat.raw) - 1); ++i )
+            cpuid_count_leaf(7, i, &p->feat.raw[i]);
+    }
+
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);
+
+            if ( u.t.type == 0 )
+                break;
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future hardware.
+         */
+#ifdef __XEN__
+        if ( i == ARRAY_SIZE(p->topo.raw) &&
+             (cpuid_count_leaf(0xb, i, &u.l), u.t.type != 0) )
+            printk(XENLOG_WARNING
+                   "CPUID: Insufficient Leaf 0xb space for this hardware\n");
+#endif
+    }
+
+    if ( p->basic.max_leaf >= 0xd )
+    {
+        uint64_t xstates;
+
+        cpuid_count_leaf(0xd, 0, &p->xstate.raw[0]);
+        cpuid_count_leaf(0xd, 1, &p->xstate.raw[1]);
+
+        xstates = cpu_policy_xstates(p);
+
+        /* This logic will probably need adjusting when XCR0[63] gets used. */
+        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
+
+        for ( i = 2; i < min_t(unsigned int, 63,
+                               ARRAY_SIZE(p->xstate.raw)); ++i )
+        {
+            if ( xstates & (1ULL << i) )
+                cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
+        }
+    }
+
+    /* Extended leaves. */
+    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
+    for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
+                          ARRAY_SIZE(p->extd.raw) - 1); ++i )
+        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
+
+    /* Don't report leaves from possible lower level hypervisor, for now. */
+    p->hv_limit = 0;
+    p->hv2_limit = 0;
+
+#ifdef __XEN__
+    /* TODO MSR_PLATFORM_INFO */
+
+    if ( p->feat.arch_caps )
+        rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
+#endif
+
+    x86_cpu_policy_recalc_synth(p);
+}
+
+void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p)
+{
+    unsigned int i;
+
+    zero_leaves(p->basic.raw, p->basic.max_leaf + 1,
+                ARRAY_SIZE(p->basic.raw) - 1);
+
+    if ( p->basic.max_leaf < 4 )
+        memset(p->cache.raw, 0, sizeof(p->cache.raw));
+    else
+    {
+        for ( i = 0; (i < ARRAY_SIZE(p->cache.raw) &&
+                      p->cache.subleaf[i].type); ++i )
+            ;
+
+        zero_leaves(p->cache.raw, i, ARRAY_SIZE(p->cache.raw) - 1);
+    }
+
+    if ( p->basic.max_leaf < 7 )
+        memset(p->feat.raw, 0, sizeof(p->feat.raw));
+    else
+        zero_leaves(p->feat.raw, p->feat.max_subleaf + 1,
+                    ARRAY_SIZE(p->feat.raw) - 1);
+
+    if ( p->basic.max_leaf < 0xb )
+        memset(p->topo.raw, 0, sizeof(p->topo.raw));
+    else
+    {
+        for ( i = 0; (i < ARRAY_SIZE(p->topo.raw) &&
+                      p->topo.subleaf[i].type); ++i )
+            ;
+
+        zero_leaves(p->topo.raw, i, ARRAY_SIZE(p->topo.raw) - 1);
+    }
+
+    if ( p->basic.max_leaf < 0xd || !cpu_policy_xstates(p) )
+        memset(p->xstate.raw, 0, sizeof(p->xstate.raw));
+    else
+    {
+        /* This logic will probably need adjusting when XCR0[63] gets used. */
+        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
+
+        /* First two leaves always valid.  Rest depend on xstates. */
+        i = max(2, 64 - __builtin_clzll(cpu_policy_xstates(p)));
+
+        zero_leaves(p->xstate.raw, i,
+                    ARRAY_SIZE(p->xstate.raw) - 1);
+    }
+
+    zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
+                ARRAY_SIZE(p->extd.raw) - 1);
+}
+
+const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
+{
+    static const uint32_t deep_features[] = INIT_DEEP_FEATURES;
+    static const struct {
+        uint32_t feature;
+        uint32_t fs[FEATURESET_NR_ENTRIES];
+    } deep_deps[] = INIT_DEEP_DEPS;
+    unsigned int start = 0, end = ARRAY_SIZE(deep_deps);
+
+    BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS);
+
+    /* Fast early exit. */
+    if ( !test_bit(feature, deep_features) )
+        return NULL;
+
+    /* deep_deps[] is sorted.  Perform a binary search. */
+    while ( start < end )
+    {
+        unsigned int mid = start + ((end - start) / 2);
+
+        if ( deep_deps[mid].feature > feature )
+            end = mid;
+        else if ( deep_deps[mid].feature < feature )
+            start = mid + 1;
+        else
+            return deep_deps[mid].fs;
+    }
+
+    return NULL;
+}
+
+/*
+ * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
+ * performing boundary checking against the buffer size.
+ */
+static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
+                               const struct cpuid_leaf *data,
+                               cpuid_leaf_buffer_t leaves,
+                               uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_cpuid_leaf_t val = {
+        leaf, subleaf, data->a, data->b, data->c, data->d,
+    };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0, leaf, subleaf;
+
+#define COPY_LEAF(l, s, data)                                       \
+    ({                                                              \
+        int ret;                                                    \
+                                                                    \
+        if ( (ret = copy_leaf_to_buffer(                            \
+                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
+            return ret;                                             \
+    })
+
+    /* Basic leaves. */
+    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
+                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
+    {
+        switch ( leaf )
+        {
+        case 0x4:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
+
+                if ( p->cache.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0x7:
+            for ( subleaf = 0;
+                  subleaf <= MIN(p->feat.max_subleaf,
+                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
+            break;
+
+        case 0xb:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
+
+                if ( p->topo.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0xd:
+        {
+            uint64_t xstates = cpu_policy_xstates(p);
+
+            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
+            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
+
+            for ( xstates >>= 2, subleaf = 2;
+                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
+                  xstates >>= 1, ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
+            break;
+        }
+
+        default:
+            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
+            break;
+        }
+    }
+
+    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
+    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv_limit });
+    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv2_limit });
+
+    /* Extended leaves. */
+    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
+                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+
+#undef COPY_LEAF
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
+                               const cpuid_leaf_buffer_t leaves,
+                               uint32_t nr_entries, uint32_t *err_leaf,
+                               uint32_t *err_subleaf)
+{
+    unsigned int i;
+    xen_cpuid_leaf_t data;
+
+    if ( err_leaf )
+        *err_leaf = -1;
+    if ( err_subleaf )
+        *err_subleaf = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with leaves in order,
+     * and without any repetitions.  However, due to per-vendor differences,
+     * and in the case of upgrade or levelled scenarios, we typically expect
+     * fewer than MAX leaves to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX leaves are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; ++i )
+    {
+        struct cpuid_leaf l;
+
+        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
+            return -EFAULT;
+
+        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
+
+        switch ( data.leaf )
+        {
+        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
+            switch ( data.leaf )
+            {
+            case 0x4:
+                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->cache.raw, data.subleaf) = l;
+                break;
+
+            case 0x7:
+                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->feat.raw, data.subleaf) = l;
+                break;
+
+            case 0xb:
+                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->topo.raw, data.subleaf) = l;
+                break;
+
+            case 0xd:
+                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->xstate.raw, data.subleaf) = l;
+                break;
+
+            default:
+                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                    goto out_of_range;
+
+                array_access_nospec(p->basic.raw, data.leaf) = l;
+                break;
+            }
+            break;
+
+        case 0x40000000:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv_limit = l.a;
+            break;
+
+        case 0x40000100:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv2_limit = l.a;
+            break;
+
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
+            break;
+
+        default:
+            goto out_of_range;
+        }
+    }
+
+    x86_cpu_policy_recalc_synth(p);
+
+    return 0;
+
+ out_of_range:
+    if ( err_leaf )
+        *err_leaf = data.leaf;
+    if ( err_subleaf )
+        *err_subleaf = data.subleaf;
+
+    return -ERANGE;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/msr.c b/xen/arch/x86/lib/cpu-policy/msr.c
new file mode 100644
index 0000000000..e04b9ca013
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/msr.c
@@ -0,0 +1,130 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+/*
+ * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
+ * boundary check against the buffer size.
+ */
+static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
+                              msr_entry_buffer_t msrs,
+                              uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_msr_entry_t ent = { .idx = idx, .val = val };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0;
+
+#define COPY_MSR(idx, val)                                      \
+    ({                                                          \
+        int ret;                                                \
+                                                                \
+        if ( (ret = copy_msr_to_buffer(                         \
+                  idx, val, msrs, &curr_entry, nr_entries)) )   \
+            return ret;                                         \
+    })
+
+    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
+    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
+
+#undef COPY_MSR
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
+                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
+                             uint32_t *err_msr)
+{
+    unsigned int i;
+    xen_msr_entry_t data;
+    int rc;
+
+    if ( err_msr )
+        *err_msr = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with entries in
+     * order, and without any repetitions.  However, due to per-vendor
+     * differences, and in the case of upgrade or levelled scenarios, we
+     * typically expect fewer than MAX entries to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX entries are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
+            return -EFAULT;
+
+        if ( data.flags ) /* .flags MBZ */
+        {
+            rc = -EINVAL;
+            goto err;
+        }
+
+        switch ( data.idx )
+        {
+            /*
+             * Assign data.val to p->field, checking for truncation if the
+             * backing storage for field is smaller than uint64_t
+             */
+#define ASSIGN(field)                             \
+({                                                \
+    if ( (typeof(p->field))data.val != data.val ) \
+    {                                             \
+        rc = -EOVERFLOW;                          \
+        goto err;                                 \
+    }                                             \
+    p->field = data.val;                          \
+})
+
+        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
+        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
+
+#undef ASSIGN
+
+        default:
+            rc = -ERANGE;
+            goto err;
+        }
+    }
+
+    return 0;
+
+ err:
+    if ( err_msr )
+        *err_msr = data.idx;
+
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/policy.c b/xen/arch/x86/lib/cpu-policy/policy.c
new file mode 100644
index 0000000000..f033d22785
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/policy.c
@@ -0,0 +1,54 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
+                                    const struct cpu_policy *guest,
+                                    struct cpu_policy_errors *err)
+{
+    struct cpu_policy_errors e = INIT_CPU_POLICY_ERRORS;
+    int ret = -EINVAL;
+
+#define NA XEN_CPUID_NO_SUBLEAF
+#define FAIL_CPUID(l, s) \
+    do { e.leaf = (l); e.subleaf = (s); goto out; } while ( 0 )
+#define FAIL_MSR(m) \
+    do { e.msr = (m); goto out; } while ( 0 )
+
+    if ( guest->basic.max_leaf > host->basic.max_leaf )
+        FAIL_CPUID(0, NA);
+
+    if ( guest->feat.max_subleaf > host->feat.max_subleaf )
+        FAIL_CPUID(7, 0);
+
+    if ( guest->extd.max_leaf > host->extd.max_leaf )
+        FAIL_CPUID(0x80000000U, NA);
+
+    /* TODO: Audit more CPUID data. */
+
+    if ( ~host->platform_info.raw & guest->platform_info.raw )
+        FAIL_MSR(MSR_INTEL_PLATFORM_INFO);
+
+#undef FAIL_MSR
+#undef FAIL_CPUID
+#undef NA
+
+    /* Success. */
+    ret = 0;
+
+ out:
+    if ( err )
+        *err = e;
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/private.h b/xen/arch/x86/lib/cpu-policy/private.h
new file mode 100644
index 0000000000..aedd8e4821
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/private.h
@@ -0,0 +1,78 @@
+#ifndef XEN_LIB_X86_PRIVATE_H
+#define XEN_LIB_X86_PRIVATE_H
+
+#ifdef __XEN__
+
+#include <xen/bitops.h>
+#include <xen/guest_access.h>
+#include <xen/kernel.h>
+#include <xen/lib.h>
+#include <xen/nospec.h>
+#include <xen/types.h>
+
+#include <asm/msr.h>
+
+#define copy_to_buffer_offset copy_to_guest_offset
+#define copy_from_buffer_offset copy_from_guest_offset
+
+#else
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+#include <xen/asm/x86-vendors.h>
+
+#include <xen-tools/common-macros.h>
+
+static inline bool test_bit(unsigned int bit, const void *vaddr)
+{
+    const char *addr = vaddr;
+
+    return addr[bit / 8] & (1u << (bit % 8));
+}
+
+#define array_access_nospec(a, i) (a)[(i)]
+
+/* memcpy(), but with copy_to_guest_offset()'s API. */
+#define copy_to_buffer_offset(dst, index, src, nr)      \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[index_ + i_] = src_[i_];                   \
+    0;                                                  \
+})
+
+/* memcpy(), but with copy_from_guest_offset()'s API. */
+#define copy_from_buffer_offset(dst, src, index, nr)    \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[i_] = src_[index_ + i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#endif /* XEN_LIB_X86_PRIVATE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 3b0137902c..dcef1610b2 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -1,5 +1,3 @@
-obj-$(CONFIG_X86) += x86/
-
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
diff --git a/xen/lib/x86/Makefile b/xen/lib/x86/Makefile
deleted file mode 100644
index 780ea05db1..0000000000
--- a/xen/lib/x86/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-obj-y += cpuid.o
-obj-y += msr.o
-obj-y += policy.o
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
deleted file mode 100644
index 6298d051f2..0000000000
--- a/xen/lib/x86/cpuid.c
+++ /dev/null
@@ -1,559 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-static void zero_leaves(struct cpuid_leaf *l,
-                        unsigned int first, unsigned int last)
-{
-    if ( first <= last )
-        memset(&l[first], 0, sizeof(*l) * (last - first + 1));
-}
-
-unsigned int x86_cpuid_lookup_vendor(uint32_t ebx, uint32_t ecx, uint32_t edx)
-{
-    switch ( ebx )
-    {
-    case X86_VENDOR_INTEL_EBX:
-        if ( ecx == X86_VENDOR_INTEL_ECX &&
-             edx == X86_VENDOR_INTEL_EDX )
-            return X86_VENDOR_INTEL;
-        break;
-
-    case X86_VENDOR_AMD_EBX:
-        if ( ecx == X86_VENDOR_AMD_ECX &&
-             edx == X86_VENDOR_AMD_EDX )
-            return X86_VENDOR_AMD;
-        break;
-
-    case X86_VENDOR_CENTAUR_EBX:
-        if ( ecx == X86_VENDOR_CENTAUR_ECX &&
-             edx == X86_VENDOR_CENTAUR_EDX )
-            return X86_VENDOR_CENTAUR;
-        break;
-
-    case X86_VENDOR_SHANGHAI_EBX:
-        if ( ecx == X86_VENDOR_SHANGHAI_ECX &&
-             edx == X86_VENDOR_SHANGHAI_EDX )
-            return X86_VENDOR_SHANGHAI;
-        break;
-
-    case X86_VENDOR_HYGON_EBX:
-        if ( ecx == X86_VENDOR_HYGON_ECX &&
-             edx == X86_VENDOR_HYGON_EDX )
-            return X86_VENDOR_HYGON;
-        break;
-    }
-
-    return X86_VENDOR_UNKNOWN;
-}
-
-const char *x86_cpuid_vendor_to_str(unsigned int vendor)
-{
-    switch ( vendor )
-    {
-    case X86_VENDOR_INTEL:    return "Intel";
-    case X86_VENDOR_AMD:      return "AMD";
-    case X86_VENDOR_CENTAUR:  return "Centaur";
-    case X86_VENDOR_SHANGHAI: return "Shanghai";
-    case X86_VENDOR_HYGON:    return "Hygon";
-    default:                  return "Unknown";
-    }
-}
-
-void x86_cpu_policy_to_featureset(
-    const struct cpu_policy *p, uint32_t fs[FEATURESET_NR_ENTRIES])
-{
-    fs[FEATURESET_1d]        = p->basic._1d;
-    fs[FEATURESET_1c]        = p->basic._1c;
-    fs[FEATURESET_e1d]       = p->extd.e1d;
-    fs[FEATURESET_e1c]       = p->extd.e1c;
-    fs[FEATURESET_Da1]       = p->xstate.Da1;
-    fs[FEATURESET_7b0]       = p->feat._7b0;
-    fs[FEATURESET_7c0]       = p->feat._7c0;
-    fs[FEATURESET_e7d]       = p->extd.e7d;
-    fs[FEATURESET_e8b]       = p->extd.e8b;
-    fs[FEATURESET_7d0]       = p->feat._7d0;
-    fs[FEATURESET_7a1]       = p->feat._7a1;
-    fs[FEATURESET_e21a]      = p->extd.e21a;
-    fs[FEATURESET_7b1]       = p->feat._7b1;
-    fs[FEATURESET_7d2]       = p->feat._7d2;
-    fs[FEATURESET_7c1]       = p->feat._7c1;
-    fs[FEATURESET_7d1]       = p->feat._7d1;
-    fs[FEATURESET_m10Al]     = p->arch_caps.lo;
-    fs[FEATURESET_m10Ah]     = p->arch_caps.hi;
-    fs[FEATURESET_e21c]      = p->extd.e21c;
-}
-
-void x86_cpu_featureset_to_policy(
-    const uint32_t fs[FEATURESET_NR_ENTRIES], struct cpu_policy *p)
-{
-    p->basic._1d             = fs[FEATURESET_1d];
-    p->basic._1c             = fs[FEATURESET_1c];
-    p->extd.e1d              = fs[FEATURESET_e1d];
-    p->extd.e1c              = fs[FEATURESET_e1c];
-    p->xstate.Da1            = fs[FEATURESET_Da1];
-    p->feat._7b0             = fs[FEATURESET_7b0];
-    p->feat._7c0             = fs[FEATURESET_7c0];
-    p->extd.e7d              = fs[FEATURESET_e7d];
-    p->extd.e8b              = fs[FEATURESET_e8b];
-    p->feat._7d0             = fs[FEATURESET_7d0];
-    p->feat._7a1             = fs[FEATURESET_7a1];
-    p->extd.e21a             = fs[FEATURESET_e21a];
-    p->feat._7b1             = fs[FEATURESET_7b1];
-    p->feat._7d2             = fs[FEATURESET_7d2];
-    p->feat._7c1             = fs[FEATURESET_7c1];
-    p->feat._7d1             = fs[FEATURESET_7d1];
-    p->arch_caps.lo          = fs[FEATURESET_m10Al];
-    p->arch_caps.hi          = fs[FEATURESET_m10Ah];
-    p->extd.e21c             = fs[FEATURESET_e21c];
-}
-
-void x86_cpu_policy_recalc_synth(struct cpu_policy *p)
-{
-    p->x86_vendor = x86_cpuid_lookup_vendor(
-        p->basic.vendor_ebx, p->basic.vendor_ecx, p->basic.vendor_edx);
-}
-
-void x86_cpu_policy_fill_native(struct cpu_policy *p)
-{
-    unsigned int i;
-
-    cpuid_leaf(0, &p->basic.raw[0]);
-    for ( i = 1; i <= MIN(p->basic.max_leaf,
-                          ARRAY_SIZE(p->basic.raw) - 1); ++i )
-    {
-        switch ( i )
-        {
-        case 0x4: case 0x7: case 0xb: case 0xd:
-            /* Multi-invocation leaves.  Deferred. */
-            continue;
-        }
-
-        cpuid_leaf(i, &p->basic.raw[i]);
-    }
-
-    if ( p->basic.max_leaf >= 4 )
-    {
-        for ( i = 0; i < ARRAY_SIZE(p->cache.raw); ++i )
-        {
-            union {
-                struct cpuid_leaf l;
-                struct cpuid_cache_leaf c;
-            } u;
-
-            cpuid_count_leaf(4, i, &u.l);
-
-            if ( u.c.type == 0 )
-                break;
-
-            p->cache.subleaf[i] = u.c;
-        }
-
-        /*
-         * The choice of CPUID_GUEST_NR_CACHE is arbitrary.  It is expected
-         * that it will eventually need increasing for future hardware.
-         */
-#ifdef __XEN__
-        if ( i == ARRAY_SIZE(p->cache.raw) )
-            printk(XENLOG_WARNING
-                   "CPUID: Insufficient Leaf 4 space for this hardware\n");
-#endif
-    }
-
-    if ( p->basic.max_leaf >= 7 )
-    {
-        cpuid_count_leaf(7, 0, &p->feat.raw[0]);
-
-        for ( i = 1; i <= MIN(p->feat.max_subleaf,
-                              ARRAY_SIZE(p->feat.raw) - 1); ++i )
-            cpuid_count_leaf(7, i, &p->feat.raw[i]);
-    }
-
-    if ( p->basic.max_leaf >= 0xb )
-    {
-        union {
-            struct cpuid_leaf l;
-            struct cpuid_topo_leaf t;
-        } u;
-
-        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
-        {
-            cpuid_count_leaf(0xb, i, &u.l);
-
-            if ( u.t.type == 0 )
-                break;
-
-            p->topo.subleaf[i] = u.t;
-        }
-
-        /*
-         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
-         * to grow for future hardware.
-         */
-#ifdef __XEN__
-        if ( i == ARRAY_SIZE(p->topo.raw) &&
-             (cpuid_count_leaf(0xb, i, &u.l), u.t.type != 0) )
-            printk(XENLOG_WARNING
-                   "CPUID: Insufficient Leaf 0xb space for this hardware\n");
-#endif
-    }
-
-    if ( p->basic.max_leaf >= 0xd )
-    {
-        uint64_t xstates;
-
-        cpuid_count_leaf(0xd, 0, &p->xstate.raw[0]);
-        cpuid_count_leaf(0xd, 1, &p->xstate.raw[1]);
-
-        xstates = cpu_policy_xstates(p);
-
-        /* This logic will probably need adjusting when XCR0[63] gets used. */
-        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
-
-        for ( i = 2; i < min_t(unsigned int, 63,
-                               ARRAY_SIZE(p->xstate.raw)); ++i )
-        {
-            if ( xstates & (1ULL << i) )
-                cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
-        }
-    }
-
-    /* Extended leaves. */
-    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
-    for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
-                          ARRAY_SIZE(p->extd.raw) - 1); ++i )
-        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
-
-    /* Don't report leaves from possible lower level hypervisor, for now. */
-    p->hv_limit = 0;
-    p->hv2_limit = 0;
-
-#ifdef __XEN__
-    /* TODO MSR_PLATFORM_INFO */
-
-    if ( p->feat.arch_caps )
-        rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
-#endif
-
-    x86_cpu_policy_recalc_synth(p);
-}
-
-void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p)
-{
-    unsigned int i;
-
-    zero_leaves(p->basic.raw, p->basic.max_leaf + 1,
-                ARRAY_SIZE(p->basic.raw) - 1);
-
-    if ( p->basic.max_leaf < 4 )
-        memset(p->cache.raw, 0, sizeof(p->cache.raw));
-    else
-    {
-        for ( i = 0; (i < ARRAY_SIZE(p->cache.raw) &&
-                      p->cache.subleaf[i].type); ++i )
-            ;
-
-        zero_leaves(p->cache.raw, i, ARRAY_SIZE(p->cache.raw) - 1);
-    }
-
-    if ( p->basic.max_leaf < 7 )
-        memset(p->feat.raw, 0, sizeof(p->feat.raw));
-    else
-        zero_leaves(p->feat.raw, p->feat.max_subleaf + 1,
-                    ARRAY_SIZE(p->feat.raw) - 1);
-
-    if ( p->basic.max_leaf < 0xb )
-        memset(p->topo.raw, 0, sizeof(p->topo.raw));
-    else
-    {
-        for ( i = 0; (i < ARRAY_SIZE(p->topo.raw) &&
-                      p->topo.subleaf[i].type); ++i )
-            ;
-
-        zero_leaves(p->topo.raw, i, ARRAY_SIZE(p->topo.raw) - 1);
-    }
-
-    if ( p->basic.max_leaf < 0xd || !cpu_policy_xstates(p) )
-        memset(p->xstate.raw, 0, sizeof(p->xstate.raw));
-    else
-    {
-        /* This logic will probably need adjusting when XCR0[63] gets used. */
-        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
-
-        /* First two leaves always valid.  Rest depend on xstates. */
-        i = max(2, 64 - __builtin_clzll(cpu_policy_xstates(p)));
-
-        zero_leaves(p->xstate.raw, i,
-                    ARRAY_SIZE(p->xstate.raw) - 1);
-    }
-
-    zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
-                ARRAY_SIZE(p->extd.raw) - 1);
-}
-
-const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
-{
-    static const uint32_t deep_features[] = INIT_DEEP_FEATURES;
-    static const struct {
-        uint32_t feature;
-        uint32_t fs[FEATURESET_NR_ENTRIES];
-    } deep_deps[] = INIT_DEEP_DEPS;
-    unsigned int start = 0, end = ARRAY_SIZE(deep_deps);
-
-    BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS);
-
-    /* Fast early exit. */
-    if ( !test_bit(feature, deep_features) )
-        return NULL;
-
-    /* deep_deps[] is sorted.  Perform a binary search. */
-    while ( start < end )
-    {
-        unsigned int mid = start + ((end - start) / 2);
-
-        if ( deep_deps[mid].feature > feature )
-            end = mid;
-        else if ( deep_deps[mid].feature < feature )
-            start = mid + 1;
-        else
-            return deep_deps[mid].fs;
-    }
-
-    return NULL;
-}
-
-/*
- * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
- * performing boundary checking against the buffer size.
- */
-static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
-                               const struct cpuid_leaf *data,
-                               cpuid_leaf_buffer_t leaves,
-                               uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_cpuid_leaf_t val = {
-        leaf, subleaf, data->a, data->b, data->c, data->d,
-    };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0, leaf, subleaf;
-
-#define COPY_LEAF(l, s, data)                                       \
-    ({                                                              \
-        int ret;                                                    \
-                                                                    \
-        if ( (ret = copy_leaf_to_buffer(                            \
-                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
-            return ret;                                             \
-    })
-
-    /* Basic leaves. */
-    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
-                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
-    {
-        switch ( leaf )
-        {
-        case 0x4:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
-
-                if ( p->cache.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0x7:
-            for ( subleaf = 0;
-                  subleaf <= MIN(p->feat.max_subleaf,
-                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
-            break;
-
-        case 0xb:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
-
-                if ( p->topo.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0xd:
-        {
-            uint64_t xstates = cpu_policy_xstates(p);
-
-            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
-            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
-
-            for ( xstates >>= 2, subleaf = 2;
-                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
-                  xstates >>= 1, ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
-            break;
-        }
-
-        default:
-            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
-            break;
-        }
-    }
-
-    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
-    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv_limit });
-    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv2_limit });
-
-    /* Extended leaves. */
-    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
-                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
-
-#undef COPY_LEAF
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
-                               const cpuid_leaf_buffer_t leaves,
-                               uint32_t nr_entries, uint32_t *err_leaf,
-                               uint32_t *err_subleaf)
-{
-    unsigned int i;
-    xen_cpuid_leaf_t data;
-
-    if ( err_leaf )
-        *err_leaf = -1;
-    if ( err_subleaf )
-        *err_subleaf = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with leaves in order,
-     * and without any repetitions.  However, due to per-vendor differences,
-     * and in the case of upgrade or levelled scenarios, we typically expect
-     * fewer than MAX leaves to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX leaves are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; ++i )
-    {
-        struct cpuid_leaf l;
-
-        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
-            return -EFAULT;
-
-        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
-
-        switch ( data.leaf )
-        {
-        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
-            switch ( data.leaf )
-            {
-            case 0x4:
-                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->cache.raw, data.subleaf) = l;
-                break;
-
-            case 0x7:
-                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->feat.raw, data.subleaf) = l;
-                break;
-
-            case 0xb:
-                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->topo.raw, data.subleaf) = l;
-                break;
-
-            case 0xd:
-                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->xstate.raw, data.subleaf) = l;
-                break;
-
-            default:
-                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                    goto out_of_range;
-
-                array_access_nospec(p->basic.raw, data.leaf) = l;
-                break;
-            }
-            break;
-
-        case 0x40000000:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv_limit = l.a;
-            break;
-
-        case 0x40000100:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv2_limit = l.a;
-            break;
-
-        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
-            break;
-
-        default:
-            goto out_of_range;
-        }
-    }
-
-    x86_cpu_policy_recalc_synth(p);
-
-    return 0;
-
- out_of_range:
-    if ( err_leaf )
-        *err_leaf = data.leaf;
-    if ( err_subleaf )
-        *err_subleaf = data.subleaf;
-
-    return -ERANGE;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/msr.c b/xen/lib/x86/msr.c
deleted file mode 100644
index e04b9ca013..0000000000
--- a/xen/lib/x86/msr.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-/*
- * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
- * boundary check against the buffer size.
- */
-static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
-                              msr_entry_buffer_t msrs,
-                              uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_msr_entry_t ent = { .idx = idx, .val = val };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_to_buffer(const struct cpu_policy *p,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0;
-
-#define COPY_MSR(idx, val)                                      \
-    ({                                                          \
-        int ret;                                                \
-                                                                \
-        if ( (ret = copy_msr_to_buffer(                         \
-                  idx, val, msrs, &curr_entry, nr_entries)) )   \
-            return ret;                                         \
-    })
-
-    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
-    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
-
-#undef COPY_MSR
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_from_buffer(struct cpu_policy *p,
-                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
-                             uint32_t *err_msr)
-{
-    unsigned int i;
-    xen_msr_entry_t data;
-    int rc;
-
-    if ( err_msr )
-        *err_msr = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with entries in
-     * order, and without any repetitions.  However, due to per-vendor
-     * differences, and in the case of upgrade or levelled scenarios, we
-     * typically expect fewer than MAX entries to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX entries are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; i++ )
-    {
-        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
-            return -EFAULT;
-
-        if ( data.flags ) /* .flags MBZ */
-        {
-            rc = -EINVAL;
-            goto err;
-        }
-
-        switch ( data.idx )
-        {
-            /*
-             * Assign data.val to p->field, checking for truncation if the
-             * backing storage for field is smaller than uint64_t
-             */
-#define ASSIGN(field)                             \
-({                                                \
-    if ( (typeof(p->field))data.val != data.val ) \
-    {                                             \
-        rc = -EOVERFLOW;                          \
-        goto err;                                 \
-    }                                             \
-    p->field = data.val;                          \
-})
-
-        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
-        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
-
-#undef ASSIGN
-
-        default:
-            rc = -ERANGE;
-            goto err;
-        }
-    }
-
-    return 0;
-
- err:
-    if ( err_msr )
-        *err_msr = data.idx;
-
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
deleted file mode 100644
index f033d22785..0000000000
--- a/xen/lib/x86/policy.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
-                                    const struct cpu_policy *guest,
-                                    struct cpu_policy_errors *err)
-{
-    struct cpu_policy_errors e = INIT_CPU_POLICY_ERRORS;
-    int ret = -EINVAL;
-
-#define NA XEN_CPUID_NO_SUBLEAF
-#define FAIL_CPUID(l, s) \
-    do { e.leaf = (l); e.subleaf = (s); goto out; } while ( 0 )
-#define FAIL_MSR(m) \
-    do { e.msr = (m); goto out; } while ( 0 )
-
-    if ( guest->basic.max_leaf > host->basic.max_leaf )
-        FAIL_CPUID(0, NA);
-
-    if ( guest->feat.max_subleaf > host->feat.max_subleaf )
-        FAIL_CPUID(7, 0);
-
-    if ( guest->extd.max_leaf > host->extd.max_leaf )
-        FAIL_CPUID(0x80000000U, NA);
-
-    /* TODO: Audit more CPUID data. */
-
-    if ( ~host->platform_info.raw & guest->platform_info.raw )
-        FAIL_MSR(MSR_INTEL_PLATFORM_INFO);
-
-#undef FAIL_MSR
-#undef FAIL_CPUID
-#undef NA
-
-    /* Success. */
-    ret = 0;
-
- out:
-    if ( err )
-        *err = e;
-
-    return ret;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h
deleted file mode 100644
index aedd8e4821..0000000000
--- a/xen/lib/x86/private.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef XEN_LIB_X86_PRIVATE_H
-#define XEN_LIB_X86_PRIVATE_H
-
-#ifdef __XEN__
-
-#include <xen/bitops.h>
-#include <xen/guest_access.h>
-#include <xen/kernel.h>
-#include <xen/lib.h>
-#include <xen/nospec.h>
-#include <xen/types.h>
-
-#include <asm/msr.h>
-
-#define copy_to_buffer_offset copy_to_guest_offset
-#define copy_from_buffer_offset copy_from_guest_offset
-
-#else
-
-#include <errno.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <string.h>
-
-#include <xen/asm/msr-index.h>
-#include <xen/asm/x86-vendors.h>
-
-#include <xen-tools/common-macros.h>
-
-static inline bool test_bit(unsigned int bit, const void *vaddr)
-{
-    const char *addr = vaddr;
-
-    return addr[bit / 8] & (1u << (bit % 8));
-}
-
-#define array_access_nospec(a, i) (a)[(i)]
-
-/* memcpy(), but with copy_to_guest_offset()'s API. */
-#define copy_to_buffer_offset(dst, index, src, nr)      \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[index_ + i_] = src_[i_];                   \
-    0;                                                  \
-})
-
-/* memcpy(), but with copy_from_guest_offset()'s API. */
-#define copy_from_buffer_offset(dst, src, index, nr)    \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[i_] = src_[index_ + i_];                   \
-    0;                                                  \
-})
-
-#endif /* __XEN__ */
-
-#endif /* XEN_LIB_X86_PRIVATE_H */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 12:55:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 12:55:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240727.1542008 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvEQ5-0006Pu-Ke; Wed, 25 Feb 2026 12:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240727.1542008; Wed, 25 Feb 2026 12: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 1vvEQ5-0006Pk-HW; Wed, 25 Feb 2026 12:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1240727;
 Wed, 25 Feb 2026 12: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 1vvEQ4-0006Pe-JW
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 12: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 1vvEQ4-009VnI-1n
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvEQ4-005b6G-1g
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12: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=+BUUNHF8rA/pdYd59g6/86vO3JhK3ReLPVqhB5nKw44=; b=1ajJ2JhrxZPV7XmLrOKYbeWUbY
	JyEdyyZPcgoXsxGLJvwonXvVEC3fsrYdSjbg9EUEyCYI1T2pB6JVAWRyUxa+rcef2jVRpUO4mKtqV
	Uv1daG8/vviPlZsWPaXoaOqowxIRiR4vYuWiBPPp78fHFbwuaqY/WtBav/AiLOokXT0U=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/cpu-policy: split out copy-in/-out functions
Message-Id: <E1vvEQ4-005b6G-1g@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 12:55:12 +0000

commit d8402e6cfcc4acd74ae0d771b3f21b9fff270823
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 25 12:31:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:31:35 2026 +0100

    x86/cpu-policy: split out copy-in/-out functions
    
    This is to aid with MGMT_HYPERCALL work, leaving the functions potentially
    unreferenced (which Misra dislikes). By moving them to separate archive
    members, the linker simply will not pick them up when not needed.
    
    As the CPUID and MSR ones are always used together, put the "from" and
    "to" variants of each together in one file respectively.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/lib/cpu-policy/Makefile.common    |   3 +-
 xen/arch/x86/lib/cpu-policy/copy-from-buffer.c | 238 +++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/copy-to-buffer.c   | 204 +++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/cpuid.c            | 226 -----------------------
 xen/arch/x86/lib/cpu-policy/msr.c              | 130 --------------
 xen/arch/x86/lib/cpu-policy/private.h          |  31 ----
 6 files changed, 444 insertions(+), 388 deletions(-)

diff --git a/xen/arch/x86/lib/cpu-policy/Makefile.common b/xen/arch/x86/lib/cpu-policy/Makefile.common
index 35475af780..aff662aae8 100644
--- a/xen/arch/x86/lib/cpu-policy/Makefile.common
+++ b/xen/arch/x86/lib/cpu-policy/Makefile.common
@@ -1,3 +1,4 @@
+lib-y += copy-from-buffer.o
+lib-y += copy-to-buffer.o
 lib-y += cpuid.o
-lib-y += msr.o
 lib-y += policy.o
diff --git a/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c b/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c
new file mode 100644
index 0000000000..24f7bc79d2
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c
@@ -0,0 +1,238 @@
+#ifdef __XEN__
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/nospec.h>
+#include <xen/types.h>
+
+#include <asm/msr-index.h>
+
+#define copy_from_buffer_offset copy_from_guest_offset
+
+#else /* !__XEN__ */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+
+#include <xen-tools/common-macros.h>
+
+#define array_access_nospec(a, i) (a)[(i)]
+
+/* memcpy(), but with copy_from_guest_offset()'s API. */
+#define copy_from_buffer_offset(dst, src, index, nr)    \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[i_] = src_[index_ + i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#include <xen/lib/x86/cpu-policy.h>
+
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
+                               const cpuid_leaf_buffer_t leaves,
+                               uint32_t nr_entries, uint32_t *err_leaf,
+                               uint32_t *err_subleaf)
+{
+    unsigned int i;
+    xen_cpuid_leaf_t data;
+
+    if ( err_leaf )
+        *err_leaf = -1;
+    if ( err_subleaf )
+        *err_subleaf = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with leaves in order,
+     * and without any repetitions.  However, due to per-vendor differences,
+     * and in the case of upgrade or levelled scenarios, we typically expect
+     * fewer than MAX leaves to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX leaves are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; ++i )
+    {
+        struct cpuid_leaf l;
+
+        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
+            return -EFAULT;
+
+        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
+
+        switch ( data.leaf )
+        {
+        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
+            switch ( data.leaf )
+            {
+            case 0x4:
+                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->cache.raw, data.subleaf) = l;
+                break;
+
+            case 0x7:
+                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->feat.raw, data.subleaf) = l;
+                break;
+
+            case 0xb:
+                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->topo.raw, data.subleaf) = l;
+                break;
+
+            case 0xd:
+                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->xstate.raw, data.subleaf) = l;
+                break;
+
+            default:
+                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                    goto out_of_range;
+
+                array_access_nospec(p->basic.raw, data.leaf) = l;
+                break;
+            }
+            break;
+
+        case 0x40000000:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv_limit = l.a;
+            break;
+
+        case 0x40000100:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv2_limit = l.a;
+            break;
+
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
+            break;
+
+        default:
+            goto out_of_range;
+        }
+    }
+
+    x86_cpu_policy_recalc_synth(p);
+
+    return 0;
+
+ out_of_range:
+    if ( err_leaf )
+        *err_leaf = data.leaf;
+    if ( err_subleaf )
+        *err_subleaf = data.subleaf;
+
+    return -ERANGE;
+}
+
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
+                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
+                             uint32_t *err_msr)
+{
+    unsigned int i;
+    xen_msr_entry_t data;
+    int rc;
+
+    if ( err_msr )
+        *err_msr = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with entries in
+     * order, and without any repetitions.  However, due to per-vendor
+     * differences, and in the case of upgrade or levelled scenarios, we
+     * typically expect fewer than MAX entries to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX entries are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
+            return -EFAULT;
+
+        if ( data.flags ) /* .flags MBZ */
+        {
+            rc = -EINVAL;
+            goto err;
+        }
+
+        switch ( data.idx )
+        {
+            /*
+             * Assign data.val to p->field, checking for truncation if the
+             * backing storage for field is smaller than uint64_t
+             */
+#define ASSIGN(field)                             \
+({                                                \
+    if ( (typeof(p->field))data.val != data.val ) \
+    {                                             \
+        rc = -EOVERFLOW;                          \
+        goto err;                                 \
+    }                                             \
+    p->field = data.val;                          \
+})
+
+        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
+        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
+
+#undef ASSIGN
+
+        default:
+            rc = -ERANGE;
+            goto err;
+        }
+    }
+
+    return 0;
+
+ err:
+    if ( err_msr )
+        *err_msr = data.idx;
+
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c b/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c
new file mode 100644
index 0000000000..190dac746c
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c
@@ -0,0 +1,204 @@
+#ifdef __XEN__
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/types.h>
+
+#include <asm/msr-index.h>
+
+#define copy_to_buffer_offset copy_to_guest_offset
+
+#else /* !__XEN__ */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+
+#include <xen-tools/common-macros.h>
+
+/* memcpy(), but with copy_to_guest_offset()'s API. */
+#define copy_to_buffer_offset(dst, index, src, nr)      \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[index_ + i_] = src_[i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#include <xen/lib/x86/cpu-policy.h>
+
+/*
+ * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
+ * performing boundary checking against the buffer size.
+ */
+static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
+                               const struct cpuid_leaf *data,
+                               cpuid_leaf_buffer_t leaves,
+                               uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_cpuid_leaf_t val = {
+        leaf, subleaf, data->a, data->b, data->c, data->d,
+    };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0, leaf, subleaf;
+
+#define COPY_LEAF(l, s, data)                                       \
+    ({                                                              \
+        int ret;                                                    \
+                                                                    \
+        if ( (ret = copy_leaf_to_buffer(                            \
+                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
+            return ret;                                             \
+    })
+
+    /* Basic leaves. */
+    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
+                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
+    {
+        switch ( leaf )
+        {
+        case 0x4:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
+
+                if ( p->cache.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0x7:
+            for ( subleaf = 0;
+                  subleaf <= MIN(p->feat.max_subleaf,
+                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
+            break;
+
+        case 0xb:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
+
+                if ( p->topo.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0xd:
+        {
+            uint64_t xstates = cpu_policy_xstates(p);
+
+            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
+            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
+
+            for ( xstates >>= 2, subleaf = 2;
+                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
+                  xstates >>= 1, ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
+            break;
+        }
+
+        default:
+            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
+            break;
+        }
+    }
+
+    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
+    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv_limit });
+    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv2_limit });
+
+    /* Extended leaves. */
+    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
+                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+
+#undef COPY_LEAF
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+/*
+ * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
+ * boundary check against the buffer size.
+ */
+static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
+                              msr_entry_buffer_t msrs,
+                              uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_msr_entry_t ent = { .idx = idx, .val = val };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0;
+
+#define COPY_MSR(idx, val)                                      \
+    ({                                                          \
+        int ret;                                                \
+                                                                \
+        if ( (ret = copy_msr_to_buffer(                         \
+                  idx, val, msrs, &curr_entry, nr_entries)) )   \
+            return ret;                                         \
+    })
+
+    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
+    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
+
+#undef COPY_MSR
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/cpuid.c b/xen/arch/x86/lib/cpu-policy/cpuid.c
index 6298d051f2..3162e795bc 100644
--- a/xen/arch/x86/lib/cpu-policy/cpuid.c
+++ b/xen/arch/x86/lib/cpu-policy/cpuid.c
@@ -322,232 +322,6 @@ const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
     return NULL;
 }
 
-/*
- * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
- * performing boundary checking against the buffer size.
- */
-static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
-                               const struct cpuid_leaf *data,
-                               cpuid_leaf_buffer_t leaves,
-                               uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_cpuid_leaf_t val = {
-        leaf, subleaf, data->a, data->b, data->c, data->d,
-    };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0, leaf, subleaf;
-
-#define COPY_LEAF(l, s, data)                                       \
-    ({                                                              \
-        int ret;                                                    \
-                                                                    \
-        if ( (ret = copy_leaf_to_buffer(                            \
-                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
-            return ret;                                             \
-    })
-
-    /* Basic leaves. */
-    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
-                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
-    {
-        switch ( leaf )
-        {
-        case 0x4:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
-
-                if ( p->cache.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0x7:
-            for ( subleaf = 0;
-                  subleaf <= MIN(p->feat.max_subleaf,
-                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
-            break;
-
-        case 0xb:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
-
-                if ( p->topo.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0xd:
-        {
-            uint64_t xstates = cpu_policy_xstates(p);
-
-            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
-            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
-
-            for ( xstates >>= 2, subleaf = 2;
-                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
-                  xstates >>= 1, ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
-            break;
-        }
-
-        default:
-            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
-            break;
-        }
-    }
-
-    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
-    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv_limit });
-    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv2_limit });
-
-    /* Extended leaves. */
-    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
-                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
-
-#undef COPY_LEAF
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
-                               const cpuid_leaf_buffer_t leaves,
-                               uint32_t nr_entries, uint32_t *err_leaf,
-                               uint32_t *err_subleaf)
-{
-    unsigned int i;
-    xen_cpuid_leaf_t data;
-
-    if ( err_leaf )
-        *err_leaf = -1;
-    if ( err_subleaf )
-        *err_subleaf = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with leaves in order,
-     * and without any repetitions.  However, due to per-vendor differences,
-     * and in the case of upgrade or levelled scenarios, we typically expect
-     * fewer than MAX leaves to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX leaves are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; ++i )
-    {
-        struct cpuid_leaf l;
-
-        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
-            return -EFAULT;
-
-        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
-
-        switch ( data.leaf )
-        {
-        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
-            switch ( data.leaf )
-            {
-            case 0x4:
-                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->cache.raw, data.subleaf) = l;
-                break;
-
-            case 0x7:
-                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->feat.raw, data.subleaf) = l;
-                break;
-
-            case 0xb:
-                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->topo.raw, data.subleaf) = l;
-                break;
-
-            case 0xd:
-                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->xstate.raw, data.subleaf) = l;
-                break;
-
-            default:
-                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                    goto out_of_range;
-
-                array_access_nospec(p->basic.raw, data.leaf) = l;
-                break;
-            }
-            break;
-
-        case 0x40000000:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv_limit = l.a;
-            break;
-
-        case 0x40000100:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv2_limit = l.a;
-            break;
-
-        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
-            break;
-
-        default:
-            goto out_of_range;
-        }
-    }
-
-    x86_cpu_policy_recalc_synth(p);
-
-    return 0;
-
- out_of_range:
-    if ( err_leaf )
-        *err_leaf = data.leaf;
-    if ( err_subleaf )
-        *err_subleaf = data.subleaf;
-
-    return -ERANGE;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/lib/cpu-policy/msr.c b/xen/arch/x86/lib/cpu-policy/msr.c
deleted file mode 100644
index e04b9ca013..0000000000
--- a/xen/arch/x86/lib/cpu-policy/msr.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-/*
- * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
- * boundary check against the buffer size.
- */
-static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
-                              msr_entry_buffer_t msrs,
-                              uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_msr_entry_t ent = { .idx = idx, .val = val };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_to_buffer(const struct cpu_policy *p,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0;
-
-#define COPY_MSR(idx, val)                                      \
-    ({                                                          \
-        int ret;                                                \
-                                                                \
-        if ( (ret = copy_msr_to_buffer(                         \
-                  idx, val, msrs, &curr_entry, nr_entries)) )   \
-            return ret;                                         \
-    })
-
-    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
-    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
-
-#undef COPY_MSR
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_from_buffer(struct cpu_policy *p,
-                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
-                             uint32_t *err_msr)
-{
-    unsigned int i;
-    xen_msr_entry_t data;
-    int rc;
-
-    if ( err_msr )
-        *err_msr = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with entries in
-     * order, and without any repetitions.  However, due to per-vendor
-     * differences, and in the case of upgrade or levelled scenarios, we
-     * typically expect fewer than MAX entries to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX entries are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; i++ )
-    {
-        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
-            return -EFAULT;
-
-        if ( data.flags ) /* .flags MBZ */
-        {
-            rc = -EINVAL;
-            goto err;
-        }
-
-        switch ( data.idx )
-        {
-            /*
-             * Assign data.val to p->field, checking for truncation if the
-             * backing storage for field is smaller than uint64_t
-             */
-#define ASSIGN(field)                             \
-({                                                \
-    if ( (typeof(p->field))data.val != data.val ) \
-    {                                             \
-        rc = -EOVERFLOW;                          \
-        goto err;                                 \
-    }                                             \
-    p->field = data.val;                          \
-})
-
-        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
-        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
-
-#undef ASSIGN
-
-        default:
-            rc = -ERANGE;
-            goto err;
-        }
-    }
-
-    return 0;
-
- err:
-    if ( err_msr )
-        *err_msr = data.idx;
-
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/lib/cpu-policy/private.h b/xen/arch/x86/lib/cpu-policy/private.h
index aedd8e4821..57f254c3e9 100644
--- a/xen/arch/x86/lib/cpu-policy/private.h
+++ b/xen/arch/x86/lib/cpu-policy/private.h
@@ -12,9 +12,6 @@
 
 #include <asm/msr.h>
 
-#define copy_to_buffer_offset copy_to_guest_offset
-#define copy_from_buffer_offset copy_from_guest_offset
-
 #else
 
 #include <errno.h>
@@ -35,34 +32,6 @@ static inline bool test_bit(unsigned int bit, const void *vaddr)
     return addr[bit / 8] & (1u << (bit % 8));
 }
 
-#define array_access_nospec(a, i) (a)[(i)]
-
-/* memcpy(), but with copy_to_guest_offset()'s API. */
-#define copy_to_buffer_offset(dst, index, src, nr)      \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[index_ + i_] = src_[i_];                   \
-    0;                                                  \
-})
-
-/* memcpy(), but with copy_from_guest_offset()'s API. */
-#define copy_from_buffer_offset(dst, src, index, nr)    \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[i_] = src_[index_ + i_];                   \
-    0;                                                  \
-})
-
 #endif /* __XEN__ */
 
 #endif /* XEN_LIB_X86_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 12:55:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 12:55:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240729.1542012 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvEQG-0006Sx-Nu; Wed, 25 Feb 2026 12:55:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240729.1542012; Wed, 25 Feb 2026 12: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 1vvEQG-0006Sp-LC; Wed, 25 Feb 2026 12:55:24 +0000
Received: by outflank-mailman (input) for mailman id 1240729;
 Wed, 25 Feb 2026 12: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 1vvEQE-0006Sc-Lo
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 12: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 1vvEQE-009VnO-25
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvEQE-005b6f-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 12: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=dhrNx6rdN3ZDILe1vCCwo97HYBWqu3O6lnasQmcRk3U=; b=DMWrnIMXIXv8lxxnT64k2iIq3M
	r40OCOOjsBNQuVFrn1X76cRV37tzJCNPK/5aFDMgY74Y3D2iC10dkWpPgXz6G1rZBtCC//45GseIl
	hmDsl8tby9Q46WDWoSC9EtTK4QG1oX2tD6ZLwIcTp/E4Qw/FWGH6ylKSS4xj7dV5wJvM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] tools/tests/vpci/main.c: drop unused variables
Message-Id: <E1vvEQE-005b6f-1y@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 12:55:22 +0000

commit 474e4f9264efe2853f58e2d974307aebfc69e427
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Wed Feb 25 12:32:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:32:04 2026 +0100

    tools/tests/vpci/main.c: drop unused variables
    
    They may become build failures.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/tests/vpci/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/tests/vpci/main.c b/tools/tests/vpci/main.c
index 2ef8d4e03f..3753417e86 100644
--- a/tools/tests/vpci/main.c
+++ b/tools/tests/vpci/main.c
@@ -189,8 +189,6 @@ main(int argc, char **argv)
     uint32_t r24 = 0;
     uint8_t r28, r30;
     struct mask_data r32;
-    unsigned int i;
-    int rc;
 
     INIT_LIST_HEAD(&vpci.handlers);
     spin_lock_init(&vpci.lock);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 13:11:05 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 13:11:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240754.1542035 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvEfP-0001MN-8m; Wed, 25 Feb 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 1240754.1542035; Wed, 25 Feb 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 1vvEfP-0001MF-6D; Wed, 25 Feb 2026 13:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1240754;
 Wed, 25 Feb 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 1vvEfO-0001M7-CM
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 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 1vvEfO-009W8O-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvEfO-005c6E-0o
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 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=tgemxduAEe731TZFkUdzCWC2AfQyUBZMgwTgqQBZ0K0=; b=wbTfry4unm2L2C+SPE62ALh/1D
	K39ewG4hrGMldh3XGl9szeBB8GVojfgTIE6rO8nIRQNTd5WN2MOvdHUKquJX0uGa5eR4MblS72/yj
	PL2CCBaUP6i04SpAwZYRJVepy0993lgBSMhrCnKyV7sj17Lrlv2tyeu1DRexhWYBQesk=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Simplify SMCCC handling by reusing __declare_arg_$()
Message-Id: <E1vvEfO-005c6E-0o@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 13:11:02 +0000

commit cd9cd05b2eba6a93fb7dc3d1bd1fe7a21426fd79
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 24 12:11:02 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 13:06:55 2026 +0000

    xen/arm: Simplify SMCCC handling by reusing __declare_arg_$()
    
    Now that the type handling is entirely uniform, it's easier to see that
    __declare_arg_3() can use __declare_arg_2() and so on, just like the larger
    __declare_arg_$()'s already do.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 5b30dd57b6..590daf7b27 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -114,26 +114,17 @@ struct arm_smccc_res {
 
 #define __declare_arg_1(a0, a1, res)                        \
     typeof(a1) __a1 = (a1);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    __declare_arg_0(a0, res);                               \
     register typeof(a1)     arg1 ASM_REG(1) = __a1
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
-    typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
-    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    __declare_arg_1(a0, a1, res);                           \
     register typeof(a2)     arg2 ASM_REG(2) = __a2
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
-    typeof(a1) __a1 = (a1);                                 \
-    typeof(a2) __a2 = (a2);                                 \
     typeof(a3) __a3 = (a3);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
-    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
-    register typeof(a2)     arg2 ASM_REG(2) = __a2;         \
+    __declare_arg_2(a0, a1, a2, res);                       \
     register typeof(a3)     arg3 ASM_REG(3) = __a3
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 13:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 13:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240755.1542040 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvEfZ-0001OL-AN; Wed, 25 Feb 2026 13:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240755.1542040; Wed, 25 Feb 2026 13: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 1vvEfZ-0001OD-7d; Wed, 25 Feb 2026 13:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1240755;
 Wed, 25 Feb 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 1vvEfY-0001O4-DY
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 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 1vvEfY-009W8V-1G
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvEfY-005c8g-18
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 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=4GrkXuKpkLvgau4IzUQzDJ9IX1GB5+QD6yTLTkGAfW8=; b=eJA5DmmbgkXC/ndoJ1B4pYZ1S8
	3dkRXRafzSyuZ0FraNzHBf/a2glkz29yRgJc3LOzJ36UwKXd38UEohfzj9ZZLl1LzH+HQq49PU45k
	FytLRc/0Gel4BUqQ1rASNkodgKD2PS7wWjhjylXgKXfLq61H+TCNpxXyJKUW2n/dDOn4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/arm: Simplify type handling for SMCCC declarations
Message-Id: <E1vvEfY-005c8g-18@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 13:11:12 +0000

commit 67bcf5eae7098a8c720550f468c347370acd3eaf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 24 12:25:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 13:06:56 2026 +0000

    xen/arm: Simplify type handling for SMCCC declarations
    
    There's no use creating a typed copy of a macro argument, simply to use it to
    create a second typed copy.  Remove the indirection, halving the number of
    local variables created in scope.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 590daf7b27..5fdefc43d9 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -113,39 +113,32 @@ struct arm_smccc_res {
     register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
 
 #define __declare_arg_1(a0, a1, res)                        \
-    typeof(a1) __a1 = (a1);                                 \
     __declare_arg_0(a0, res);                               \
-    register typeof(a1)     arg1 ASM_REG(1) = __a1
+    register typeof(a1)     arg1 ASM_REG(1) = (a1)
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
-    typeof(a2) __a2 = (a2);                                 \
     __declare_arg_1(a0, a1, res);                           \
-    register typeof(a2)     arg2 ASM_REG(2) = __a2
+    register typeof(a2)     arg2 ASM_REG(2) = (a2)
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
-    typeof(a3) __a3 = (a3);                                 \
     __declare_arg_2(a0, a1, a2, res);                       \
-    register typeof(a3)     arg3 ASM_REG(3) = __a3
+    register typeof(a3)     arg3 ASM_REG(3) = (a3)
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
-    typeof(a4) __a4 = (a4);                             \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register typeof(a4)     arg4 ASM_REG(4) = __a4
+    register typeof(a4)     arg4 ASM_REG(4) = (a4)
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
-    typeof(a5) __a5 = (a5);                             \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5)     arg5 ASM_REG(5) = __a5
+    register typeof(a5)     arg5 ASM_REG(5) = (a5)
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
-    typeof(a6) __a6 = (a6);                                 \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6)     arg6 ASM_REG(6) = __a6
+    register typeof(a6)     arg6 ASM_REG(6) = (a6)
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
-    typeof(a7) __a7 = (a7);                                     \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7)     arg7 ASM_REG(7) = __a7
+    register typeof(a7)     arg7 ASM_REG(7) = (a7)
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 13:55:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 13:55:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240781.1542044 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvFLy-0005zA-9c; Wed, 25 Feb 2026 13:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240781.1542044; Wed, 25 Feb 2026 13: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 1vvFLy-0005z1-6T; Wed, 25 Feb 2026 13:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1240781;
 Wed, 25 Feb 2026 13: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 1vvFLx-0005yv-Ky
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 13: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 1vvFLx-009X0H-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13:55:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvFLx-005ehl-1n
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13: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=6pG1LpJ2ROmzoI+W0w3DHvkaJP51OQjS8sbNu5dBLuc=; b=Jrt/PzqcywGEg+xC+FelKOx/ni
	gxGtAVRMqAUG16q5fHVl/RYshH2PLd4O5pIxQnI1ydK6WKHTjt0sz8Sabg388biO81Nv0yWVX/C1R
	hDGdcAyfDqZ8LE7oca3uQDNN9NgHJYPV+TZc8rwUtylT4oSqRr5NDaf4Tqnm7WcQV5vQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: move CPU policy library code
Message-Id: <E1vvFLx-005ehl-1n@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 13:55:01 +0000

commit 7326c1725432166cbb7a284df78c373b95be82aa
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 25 12:31:08 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:31:08 2026 +0100

    x86/cpu-policy: move CPU policy library code
    
    ... to a dedicated subdir of x86's private lib/ sub-tree.
    
    For the CPU policy harnesses and libxenguest use $(lib-y) as set by the
    new Makefile.common, whereas for the emulator harnesses stick to building
    just cpuid.o for the time being.
    
    Requested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/fuzz/cpu-policy/Makefile               |   7 +-
 tools/fuzz/x86_instruction_emulator/Makefile |   2 +-
 tools/libs/guest/Makefile.common             |   7 +-
 tools/tests/cpu-policy/Makefile              |   7 +-
 tools/tests/x86_emulator/Makefile            |   2 +-
 xen/arch/x86/arch.mk                         |   1 +
 xen/arch/x86/lib/Makefile                    |   2 +
 xen/arch/x86/lib/cpu-policy/Makefile         |   1 +
 xen/arch/x86/lib/cpu-policy/Makefile.common  |   3 +
 xen/arch/x86/lib/cpu-policy/cpuid.c          | 559 +++++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/msr.c            | 130 +++++++
 xen/arch/x86/lib/cpu-policy/policy.c         |  54 +++
 xen/arch/x86/lib/cpu-policy/private.h        |  78 ++++
 xen/lib/Makefile                             |   2 -
 xen/lib/x86/Makefile                         |   3 -
 xen/lib/x86/cpuid.c                          | 559 ---------------------------
 xen/lib/x86/msr.c                            | 130 -------
 xen/lib/x86/policy.c                         |  54 ---
 xen/lib/x86/private.h                        |  78 ----
 19 files changed, 845 insertions(+), 834 deletions(-)

diff --git a/tools/fuzz/cpu-policy/Makefile b/tools/fuzz/cpu-policy/Makefile
index 6e7743e0aa..76ecf20e8d 100644
--- a/tools/fuzz/cpu-policy/Makefile
+++ b/tools/fuzz/cpu-policy/Makefile
@@ -20,9 +20,12 @@ install: all
 CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
 CFLAGS += $(APPEND_CFLAGS) -Og
 
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
-afl-policy-fuzzer: afl-policy-fuzzer.o msr.o cpuid.o
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
+
+afl-policy-fuzzer: afl-policy-fuzzer.o $(lib-y)
 	$(CC) $(CFLAGS) $^ -o $@
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile
index d104b15f4f..4e4877a203 100644
--- a/tools/fuzz/x86_instruction_emulator/Makefile
+++ b/tools/fuzz/x86_instruction_emulator/Makefile
@@ -21,7 +21,7 @@ vpath %.h ../../tests/x86_emulator
 CFLAGS += -iquote ../../tests/x86_emulator
 
 # Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
 x86_emulate:
 	mkdir -p $@
diff --git a/tools/libs/guest/Makefile.common b/tools/libs/guest/Makefile.common
index a026a2f662..b928a4a246 100644
--- a/tools/libs/guest/Makefile.common
+++ b/tools/libs/guest/Makefile.common
@@ -33,9 +33,12 @@ LIBELF_OBJS += libelf-dominfo.o
 OBJS-y += $(LIBELF_OBJS)
 
 ifeq ($(CONFIG_X86),y) # Add libx86 to the build
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
-OBJS-y                 += cpuid.o msr.o policy.o
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
+
+OBJS-y                 += $(lib-y)
 endif
 
 # new domain builder
diff --git a/tools/tests/cpu-policy/Makefile b/tools/tests/cpu-policy/Makefile
index 24f87e2eca..d8e4d222f4 100644
--- a/tools/tests/cpu-policy/Makefile
+++ b/tools/tests/cpu-policy/Makefile
@@ -42,11 +42,14 @@ CFLAGS += $(APPEND_CFLAGS)
 
 LDFLAGS += $(APPEND_LDFLAGS)
 
-vpath %.c ../../../xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
+
+lib-y :=
+include $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy/Makefile.common
 
 %.o: Makefile
 
-test-cpu-policy: test-cpu-policy.o msr.o cpuid.o policy.o
+test-cpu-policy: test-cpu-policy.o $(lib-y)
 	$(CC) $^ -o $@ $(LDFLAGS)
 
 -include $(DEPS_INCLUDE)
diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile
index 376cfe244d..e18725d0c3 100644
--- a/tools/tests/x86_emulator/Makefile
+++ b/tools/tests/x86_emulator/Makefile
@@ -17,7 +17,7 @@ vpath x86_emulate/%.h $(XEN_ROOT)/xen/arch/x86
 HOSTCFLAGS += -iquote $(XEN_ROOT)/xen/arch/x86
 
 # Add libx86 to the build
-vpath %.c $(XEN_ROOT)/xen/lib/x86
+vpath %.c $(XEN_ROOT)/xen/arch/x86/lib/cpu-policy
 
 CFLAGS += $(CFLAGS_xeninclude)
 
diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk
index 37fe65bc13..0b42e6312f 100644
--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -4,6 +4,7 @@
 export XEN_IMG_OFFSET := 0x200000
 
 ARCH_LIBS-y += arch/x86/lib/lib.a
+ARCH_LIBS-y += arch/x86/lib/cpu-policy/lib.a
 
 CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET)
 
diff --git a/xen/arch/x86/lib/Makefile b/xen/arch/x86/lib/Makefile
index b9a65c662a..fe9a271879 100644
--- a/xen/arch/x86/lib/Makefile
+++ b/xen/arch/x86/lib/Makefile
@@ -6,3 +6,5 @@ lib-y += generic-hweightl.o
 lib-y += memcpy.o
 lib-y += memset.o
 lib-y += scrub-page.o
+
+obj-y += cpu-policy/
diff --git a/xen/arch/x86/lib/cpu-policy/Makefile b/xen/arch/x86/lib/cpu-policy/Makefile
new file mode 100644
index 0000000000..b12cf7836d
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/Makefile
@@ -0,0 +1 @@
+include $(srcdir)/Makefile.common
diff --git a/xen/arch/x86/lib/cpu-policy/Makefile.common b/xen/arch/x86/lib/cpu-policy/Makefile.common
new file mode 100644
index 0000000000..35475af780
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/Makefile.common
@@ -0,0 +1,3 @@
+lib-y += cpuid.o
+lib-y += msr.o
+lib-y += policy.o
diff --git a/xen/arch/x86/lib/cpu-policy/cpuid.c b/xen/arch/x86/lib/cpu-policy/cpuid.c
new file mode 100644
index 0000000000..6298d051f2
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/cpuid.c
@@ -0,0 +1,559 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+static void zero_leaves(struct cpuid_leaf *l,
+                        unsigned int first, unsigned int last)
+{
+    if ( first <= last )
+        memset(&l[first], 0, sizeof(*l) * (last - first + 1));
+}
+
+unsigned int x86_cpuid_lookup_vendor(uint32_t ebx, uint32_t ecx, uint32_t edx)
+{
+    switch ( ebx )
+    {
+    case X86_VENDOR_INTEL_EBX:
+        if ( ecx == X86_VENDOR_INTEL_ECX &&
+             edx == X86_VENDOR_INTEL_EDX )
+            return X86_VENDOR_INTEL;
+        break;
+
+    case X86_VENDOR_AMD_EBX:
+        if ( ecx == X86_VENDOR_AMD_ECX &&
+             edx == X86_VENDOR_AMD_EDX )
+            return X86_VENDOR_AMD;
+        break;
+
+    case X86_VENDOR_CENTAUR_EBX:
+        if ( ecx == X86_VENDOR_CENTAUR_ECX &&
+             edx == X86_VENDOR_CENTAUR_EDX )
+            return X86_VENDOR_CENTAUR;
+        break;
+
+    case X86_VENDOR_SHANGHAI_EBX:
+        if ( ecx == X86_VENDOR_SHANGHAI_ECX &&
+             edx == X86_VENDOR_SHANGHAI_EDX )
+            return X86_VENDOR_SHANGHAI;
+        break;
+
+    case X86_VENDOR_HYGON_EBX:
+        if ( ecx == X86_VENDOR_HYGON_ECX &&
+             edx == X86_VENDOR_HYGON_EDX )
+            return X86_VENDOR_HYGON;
+        break;
+    }
+
+    return X86_VENDOR_UNKNOWN;
+}
+
+const char *x86_cpuid_vendor_to_str(unsigned int vendor)
+{
+    switch ( vendor )
+    {
+    case X86_VENDOR_INTEL:    return "Intel";
+    case X86_VENDOR_AMD:      return "AMD";
+    case X86_VENDOR_CENTAUR:  return "Centaur";
+    case X86_VENDOR_SHANGHAI: return "Shanghai";
+    case X86_VENDOR_HYGON:    return "Hygon";
+    default:                  return "Unknown";
+    }
+}
+
+void x86_cpu_policy_to_featureset(
+    const struct cpu_policy *p, uint32_t fs[FEATURESET_NR_ENTRIES])
+{
+    fs[FEATURESET_1d]        = p->basic._1d;
+    fs[FEATURESET_1c]        = p->basic._1c;
+    fs[FEATURESET_e1d]       = p->extd.e1d;
+    fs[FEATURESET_e1c]       = p->extd.e1c;
+    fs[FEATURESET_Da1]       = p->xstate.Da1;
+    fs[FEATURESET_7b0]       = p->feat._7b0;
+    fs[FEATURESET_7c0]       = p->feat._7c0;
+    fs[FEATURESET_e7d]       = p->extd.e7d;
+    fs[FEATURESET_e8b]       = p->extd.e8b;
+    fs[FEATURESET_7d0]       = p->feat._7d0;
+    fs[FEATURESET_7a1]       = p->feat._7a1;
+    fs[FEATURESET_e21a]      = p->extd.e21a;
+    fs[FEATURESET_7b1]       = p->feat._7b1;
+    fs[FEATURESET_7d2]       = p->feat._7d2;
+    fs[FEATURESET_7c1]       = p->feat._7c1;
+    fs[FEATURESET_7d1]       = p->feat._7d1;
+    fs[FEATURESET_m10Al]     = p->arch_caps.lo;
+    fs[FEATURESET_m10Ah]     = p->arch_caps.hi;
+    fs[FEATURESET_e21c]      = p->extd.e21c;
+}
+
+void x86_cpu_featureset_to_policy(
+    const uint32_t fs[FEATURESET_NR_ENTRIES], struct cpu_policy *p)
+{
+    p->basic._1d             = fs[FEATURESET_1d];
+    p->basic._1c             = fs[FEATURESET_1c];
+    p->extd.e1d              = fs[FEATURESET_e1d];
+    p->extd.e1c              = fs[FEATURESET_e1c];
+    p->xstate.Da1            = fs[FEATURESET_Da1];
+    p->feat._7b0             = fs[FEATURESET_7b0];
+    p->feat._7c0             = fs[FEATURESET_7c0];
+    p->extd.e7d              = fs[FEATURESET_e7d];
+    p->extd.e8b              = fs[FEATURESET_e8b];
+    p->feat._7d0             = fs[FEATURESET_7d0];
+    p->feat._7a1             = fs[FEATURESET_7a1];
+    p->extd.e21a             = fs[FEATURESET_e21a];
+    p->feat._7b1             = fs[FEATURESET_7b1];
+    p->feat._7d2             = fs[FEATURESET_7d2];
+    p->feat._7c1             = fs[FEATURESET_7c1];
+    p->feat._7d1             = fs[FEATURESET_7d1];
+    p->arch_caps.lo          = fs[FEATURESET_m10Al];
+    p->arch_caps.hi          = fs[FEATURESET_m10Ah];
+    p->extd.e21c             = fs[FEATURESET_e21c];
+}
+
+void x86_cpu_policy_recalc_synth(struct cpu_policy *p)
+{
+    p->x86_vendor = x86_cpuid_lookup_vendor(
+        p->basic.vendor_ebx, p->basic.vendor_ecx, p->basic.vendor_edx);
+}
+
+void x86_cpu_policy_fill_native(struct cpu_policy *p)
+{
+    unsigned int i;
+
+    cpuid_leaf(0, &p->basic.raw[0]);
+    for ( i = 1; i <= MIN(p->basic.max_leaf,
+                          ARRAY_SIZE(p->basic.raw) - 1); ++i )
+    {
+        switch ( i )
+        {
+        case 0x4: case 0x7: case 0xb: case 0xd:
+            /* Multi-invocation leaves.  Deferred. */
+            continue;
+        }
+
+        cpuid_leaf(i, &p->basic.raw[i]);
+    }
+
+    if ( p->basic.max_leaf >= 4 )
+    {
+        for ( i = 0; i < ARRAY_SIZE(p->cache.raw); ++i )
+        {
+            union {
+                struct cpuid_leaf l;
+                struct cpuid_cache_leaf c;
+            } u;
+
+            cpuid_count_leaf(4, i, &u.l);
+
+            if ( u.c.type == 0 )
+                break;
+
+            p->cache.subleaf[i] = u.c;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_CACHE is arbitrary.  It is expected
+         * that it will eventually need increasing for future hardware.
+         */
+#ifdef __XEN__
+        if ( i == ARRAY_SIZE(p->cache.raw) )
+            printk(XENLOG_WARNING
+                   "CPUID: Insufficient Leaf 4 space for this hardware\n");
+#endif
+    }
+
+    if ( p->basic.max_leaf >= 7 )
+    {
+        cpuid_count_leaf(7, 0, &p->feat.raw[0]);
+
+        for ( i = 1; i <= MIN(p->feat.max_subleaf,
+                              ARRAY_SIZE(p->feat.raw) - 1); ++i )
+            cpuid_count_leaf(7, i, &p->feat.raw[i]);
+    }
+
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);
+
+            if ( u.t.type == 0 )
+                break;
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future hardware.
+         */
+#ifdef __XEN__
+        if ( i == ARRAY_SIZE(p->topo.raw) &&
+             (cpuid_count_leaf(0xb, i, &u.l), u.t.type != 0) )
+            printk(XENLOG_WARNING
+                   "CPUID: Insufficient Leaf 0xb space for this hardware\n");
+#endif
+    }
+
+    if ( p->basic.max_leaf >= 0xd )
+    {
+        uint64_t xstates;
+
+        cpuid_count_leaf(0xd, 0, &p->xstate.raw[0]);
+        cpuid_count_leaf(0xd, 1, &p->xstate.raw[1]);
+
+        xstates = cpu_policy_xstates(p);
+
+        /* This logic will probably need adjusting when XCR0[63] gets used. */
+        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
+
+        for ( i = 2; i < min_t(unsigned int, 63,
+                               ARRAY_SIZE(p->xstate.raw)); ++i )
+        {
+            if ( xstates & (1ULL << i) )
+                cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
+        }
+    }
+
+    /* Extended leaves. */
+    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
+    for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
+                          ARRAY_SIZE(p->extd.raw) - 1); ++i )
+        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
+
+    /* Don't report leaves from possible lower level hypervisor, for now. */
+    p->hv_limit = 0;
+    p->hv2_limit = 0;
+
+#ifdef __XEN__
+    /* TODO MSR_PLATFORM_INFO */
+
+    if ( p->feat.arch_caps )
+        rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
+#endif
+
+    x86_cpu_policy_recalc_synth(p);
+}
+
+void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p)
+{
+    unsigned int i;
+
+    zero_leaves(p->basic.raw, p->basic.max_leaf + 1,
+                ARRAY_SIZE(p->basic.raw) - 1);
+
+    if ( p->basic.max_leaf < 4 )
+        memset(p->cache.raw, 0, sizeof(p->cache.raw));
+    else
+    {
+        for ( i = 0; (i < ARRAY_SIZE(p->cache.raw) &&
+                      p->cache.subleaf[i].type); ++i )
+            ;
+
+        zero_leaves(p->cache.raw, i, ARRAY_SIZE(p->cache.raw) - 1);
+    }
+
+    if ( p->basic.max_leaf < 7 )
+        memset(p->feat.raw, 0, sizeof(p->feat.raw));
+    else
+        zero_leaves(p->feat.raw, p->feat.max_subleaf + 1,
+                    ARRAY_SIZE(p->feat.raw) - 1);
+
+    if ( p->basic.max_leaf < 0xb )
+        memset(p->topo.raw, 0, sizeof(p->topo.raw));
+    else
+    {
+        for ( i = 0; (i < ARRAY_SIZE(p->topo.raw) &&
+                      p->topo.subleaf[i].type); ++i )
+            ;
+
+        zero_leaves(p->topo.raw, i, ARRAY_SIZE(p->topo.raw) - 1);
+    }
+
+    if ( p->basic.max_leaf < 0xd || !cpu_policy_xstates(p) )
+        memset(p->xstate.raw, 0, sizeof(p->xstate.raw));
+    else
+    {
+        /* This logic will probably need adjusting when XCR0[63] gets used. */
+        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
+
+        /* First two leaves always valid.  Rest depend on xstates. */
+        i = max(2, 64 - __builtin_clzll(cpu_policy_xstates(p)));
+
+        zero_leaves(p->xstate.raw, i,
+                    ARRAY_SIZE(p->xstate.raw) - 1);
+    }
+
+    zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
+                ARRAY_SIZE(p->extd.raw) - 1);
+}
+
+const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
+{
+    static const uint32_t deep_features[] = INIT_DEEP_FEATURES;
+    static const struct {
+        uint32_t feature;
+        uint32_t fs[FEATURESET_NR_ENTRIES];
+    } deep_deps[] = INIT_DEEP_DEPS;
+    unsigned int start = 0, end = ARRAY_SIZE(deep_deps);
+
+    BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS);
+
+    /* Fast early exit. */
+    if ( !test_bit(feature, deep_features) )
+        return NULL;
+
+    /* deep_deps[] is sorted.  Perform a binary search. */
+    while ( start < end )
+    {
+        unsigned int mid = start + ((end - start) / 2);
+
+        if ( deep_deps[mid].feature > feature )
+            end = mid;
+        else if ( deep_deps[mid].feature < feature )
+            start = mid + 1;
+        else
+            return deep_deps[mid].fs;
+    }
+
+    return NULL;
+}
+
+/*
+ * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
+ * performing boundary checking against the buffer size.
+ */
+static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
+                               const struct cpuid_leaf *data,
+                               cpuid_leaf_buffer_t leaves,
+                               uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_cpuid_leaf_t val = {
+        leaf, subleaf, data->a, data->b, data->c, data->d,
+    };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0, leaf, subleaf;
+
+#define COPY_LEAF(l, s, data)                                       \
+    ({                                                              \
+        int ret;                                                    \
+                                                                    \
+        if ( (ret = copy_leaf_to_buffer(                            \
+                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
+            return ret;                                             \
+    })
+
+    /* Basic leaves. */
+    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
+                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
+    {
+        switch ( leaf )
+        {
+        case 0x4:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
+
+                if ( p->cache.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0x7:
+            for ( subleaf = 0;
+                  subleaf <= MIN(p->feat.max_subleaf,
+                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
+            break;
+
+        case 0xb:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
+
+                if ( p->topo.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0xd:
+        {
+            uint64_t xstates = cpu_policy_xstates(p);
+
+            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
+            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
+
+            for ( xstates >>= 2, subleaf = 2;
+                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
+                  xstates >>= 1, ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
+            break;
+        }
+
+        default:
+            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
+            break;
+        }
+    }
+
+    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
+    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv_limit });
+    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv2_limit });
+
+    /* Extended leaves. */
+    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
+                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+
+#undef COPY_LEAF
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
+                               const cpuid_leaf_buffer_t leaves,
+                               uint32_t nr_entries, uint32_t *err_leaf,
+                               uint32_t *err_subleaf)
+{
+    unsigned int i;
+    xen_cpuid_leaf_t data;
+
+    if ( err_leaf )
+        *err_leaf = -1;
+    if ( err_subleaf )
+        *err_subleaf = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with leaves in order,
+     * and without any repetitions.  However, due to per-vendor differences,
+     * and in the case of upgrade or levelled scenarios, we typically expect
+     * fewer than MAX leaves to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX leaves are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; ++i )
+    {
+        struct cpuid_leaf l;
+
+        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
+            return -EFAULT;
+
+        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
+
+        switch ( data.leaf )
+        {
+        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
+            switch ( data.leaf )
+            {
+            case 0x4:
+                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->cache.raw, data.subleaf) = l;
+                break;
+
+            case 0x7:
+                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->feat.raw, data.subleaf) = l;
+                break;
+
+            case 0xb:
+                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->topo.raw, data.subleaf) = l;
+                break;
+
+            case 0xd:
+                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->xstate.raw, data.subleaf) = l;
+                break;
+
+            default:
+                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                    goto out_of_range;
+
+                array_access_nospec(p->basic.raw, data.leaf) = l;
+                break;
+            }
+            break;
+
+        case 0x40000000:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv_limit = l.a;
+            break;
+
+        case 0x40000100:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv2_limit = l.a;
+            break;
+
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
+            break;
+
+        default:
+            goto out_of_range;
+        }
+    }
+
+    x86_cpu_policy_recalc_synth(p);
+
+    return 0;
+
+ out_of_range:
+    if ( err_leaf )
+        *err_leaf = data.leaf;
+    if ( err_subleaf )
+        *err_subleaf = data.subleaf;
+
+    return -ERANGE;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/msr.c b/xen/arch/x86/lib/cpu-policy/msr.c
new file mode 100644
index 0000000000..e04b9ca013
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/msr.c
@@ -0,0 +1,130 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+/*
+ * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
+ * boundary check against the buffer size.
+ */
+static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
+                              msr_entry_buffer_t msrs,
+                              uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_msr_entry_t ent = { .idx = idx, .val = val };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0;
+
+#define COPY_MSR(idx, val)                                      \
+    ({                                                          \
+        int ret;                                                \
+                                                                \
+        if ( (ret = copy_msr_to_buffer(                         \
+                  idx, val, msrs, &curr_entry, nr_entries)) )   \
+            return ret;                                         \
+    })
+
+    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
+    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
+
+#undef COPY_MSR
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
+                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
+                             uint32_t *err_msr)
+{
+    unsigned int i;
+    xen_msr_entry_t data;
+    int rc;
+
+    if ( err_msr )
+        *err_msr = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with entries in
+     * order, and without any repetitions.  However, due to per-vendor
+     * differences, and in the case of upgrade or levelled scenarios, we
+     * typically expect fewer than MAX entries to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX entries are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
+            return -EFAULT;
+
+        if ( data.flags ) /* .flags MBZ */
+        {
+            rc = -EINVAL;
+            goto err;
+        }
+
+        switch ( data.idx )
+        {
+            /*
+             * Assign data.val to p->field, checking for truncation if the
+             * backing storage for field is smaller than uint64_t
+             */
+#define ASSIGN(field)                             \
+({                                                \
+    if ( (typeof(p->field))data.val != data.val ) \
+    {                                             \
+        rc = -EOVERFLOW;                          \
+        goto err;                                 \
+    }                                             \
+    p->field = data.val;                          \
+})
+
+        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
+        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
+
+#undef ASSIGN
+
+        default:
+            rc = -ERANGE;
+            goto err;
+        }
+    }
+
+    return 0;
+
+ err:
+    if ( err_msr )
+        *err_msr = data.idx;
+
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/policy.c b/xen/arch/x86/lib/cpu-policy/policy.c
new file mode 100644
index 0000000000..f033d22785
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/policy.c
@@ -0,0 +1,54 @@
+#include "private.h"
+
+#include <xen/lib/x86/cpu-policy.h>
+
+int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
+                                    const struct cpu_policy *guest,
+                                    struct cpu_policy_errors *err)
+{
+    struct cpu_policy_errors e = INIT_CPU_POLICY_ERRORS;
+    int ret = -EINVAL;
+
+#define NA XEN_CPUID_NO_SUBLEAF
+#define FAIL_CPUID(l, s) \
+    do { e.leaf = (l); e.subleaf = (s); goto out; } while ( 0 )
+#define FAIL_MSR(m) \
+    do { e.msr = (m); goto out; } while ( 0 )
+
+    if ( guest->basic.max_leaf > host->basic.max_leaf )
+        FAIL_CPUID(0, NA);
+
+    if ( guest->feat.max_subleaf > host->feat.max_subleaf )
+        FAIL_CPUID(7, 0);
+
+    if ( guest->extd.max_leaf > host->extd.max_leaf )
+        FAIL_CPUID(0x80000000U, NA);
+
+    /* TODO: Audit more CPUID data. */
+
+    if ( ~host->platform_info.raw & guest->platform_info.raw )
+        FAIL_MSR(MSR_INTEL_PLATFORM_INFO);
+
+#undef FAIL_MSR
+#undef FAIL_CPUID
+#undef NA
+
+    /* Success. */
+    ret = 0;
+
+ out:
+    if ( err )
+        *err = e;
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/private.h b/xen/arch/x86/lib/cpu-policy/private.h
new file mode 100644
index 0000000000..aedd8e4821
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/private.h
@@ -0,0 +1,78 @@
+#ifndef XEN_LIB_X86_PRIVATE_H
+#define XEN_LIB_X86_PRIVATE_H
+
+#ifdef __XEN__
+
+#include <xen/bitops.h>
+#include <xen/guest_access.h>
+#include <xen/kernel.h>
+#include <xen/lib.h>
+#include <xen/nospec.h>
+#include <xen/types.h>
+
+#include <asm/msr.h>
+
+#define copy_to_buffer_offset copy_to_guest_offset
+#define copy_from_buffer_offset copy_from_guest_offset
+
+#else
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+#include <xen/asm/x86-vendors.h>
+
+#include <xen-tools/common-macros.h>
+
+static inline bool test_bit(unsigned int bit, const void *vaddr)
+{
+    const char *addr = vaddr;
+
+    return addr[bit / 8] & (1u << (bit % 8));
+}
+
+#define array_access_nospec(a, i) (a)[(i)]
+
+/* memcpy(), but with copy_to_guest_offset()'s API. */
+#define copy_to_buffer_offset(dst, index, src, nr)      \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[index_ + i_] = src_[i_];                   \
+    0;                                                  \
+})
+
+/* memcpy(), but with copy_from_guest_offset()'s API. */
+#define copy_from_buffer_offset(dst, src, index, nr)    \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[i_] = src_[index_ + i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#endif /* XEN_LIB_X86_PRIVATE_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index 3b0137902c..dcef1610b2 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -1,5 +1,3 @@
-obj-$(CONFIG_X86) += x86/
-
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
diff --git a/xen/lib/x86/Makefile b/xen/lib/x86/Makefile
deleted file mode 100644
index 780ea05db1..0000000000
--- a/xen/lib/x86/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-obj-y += cpuid.o
-obj-y += msr.o
-obj-y += policy.o
diff --git a/xen/lib/x86/cpuid.c b/xen/lib/x86/cpuid.c
deleted file mode 100644
index 6298d051f2..0000000000
--- a/xen/lib/x86/cpuid.c
+++ /dev/null
@@ -1,559 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-static void zero_leaves(struct cpuid_leaf *l,
-                        unsigned int first, unsigned int last)
-{
-    if ( first <= last )
-        memset(&l[first], 0, sizeof(*l) * (last - first + 1));
-}
-
-unsigned int x86_cpuid_lookup_vendor(uint32_t ebx, uint32_t ecx, uint32_t edx)
-{
-    switch ( ebx )
-    {
-    case X86_VENDOR_INTEL_EBX:
-        if ( ecx == X86_VENDOR_INTEL_ECX &&
-             edx == X86_VENDOR_INTEL_EDX )
-            return X86_VENDOR_INTEL;
-        break;
-
-    case X86_VENDOR_AMD_EBX:
-        if ( ecx == X86_VENDOR_AMD_ECX &&
-             edx == X86_VENDOR_AMD_EDX )
-            return X86_VENDOR_AMD;
-        break;
-
-    case X86_VENDOR_CENTAUR_EBX:
-        if ( ecx == X86_VENDOR_CENTAUR_ECX &&
-             edx == X86_VENDOR_CENTAUR_EDX )
-            return X86_VENDOR_CENTAUR;
-        break;
-
-    case X86_VENDOR_SHANGHAI_EBX:
-        if ( ecx == X86_VENDOR_SHANGHAI_ECX &&
-             edx == X86_VENDOR_SHANGHAI_EDX )
-            return X86_VENDOR_SHANGHAI;
-        break;
-
-    case X86_VENDOR_HYGON_EBX:
-        if ( ecx == X86_VENDOR_HYGON_ECX &&
-             edx == X86_VENDOR_HYGON_EDX )
-            return X86_VENDOR_HYGON;
-        break;
-    }
-
-    return X86_VENDOR_UNKNOWN;
-}
-
-const char *x86_cpuid_vendor_to_str(unsigned int vendor)
-{
-    switch ( vendor )
-    {
-    case X86_VENDOR_INTEL:    return "Intel";
-    case X86_VENDOR_AMD:      return "AMD";
-    case X86_VENDOR_CENTAUR:  return "Centaur";
-    case X86_VENDOR_SHANGHAI: return "Shanghai";
-    case X86_VENDOR_HYGON:    return "Hygon";
-    default:                  return "Unknown";
-    }
-}
-
-void x86_cpu_policy_to_featureset(
-    const struct cpu_policy *p, uint32_t fs[FEATURESET_NR_ENTRIES])
-{
-    fs[FEATURESET_1d]        = p->basic._1d;
-    fs[FEATURESET_1c]        = p->basic._1c;
-    fs[FEATURESET_e1d]       = p->extd.e1d;
-    fs[FEATURESET_e1c]       = p->extd.e1c;
-    fs[FEATURESET_Da1]       = p->xstate.Da1;
-    fs[FEATURESET_7b0]       = p->feat._7b0;
-    fs[FEATURESET_7c0]       = p->feat._7c0;
-    fs[FEATURESET_e7d]       = p->extd.e7d;
-    fs[FEATURESET_e8b]       = p->extd.e8b;
-    fs[FEATURESET_7d0]       = p->feat._7d0;
-    fs[FEATURESET_7a1]       = p->feat._7a1;
-    fs[FEATURESET_e21a]      = p->extd.e21a;
-    fs[FEATURESET_7b1]       = p->feat._7b1;
-    fs[FEATURESET_7d2]       = p->feat._7d2;
-    fs[FEATURESET_7c1]       = p->feat._7c1;
-    fs[FEATURESET_7d1]       = p->feat._7d1;
-    fs[FEATURESET_m10Al]     = p->arch_caps.lo;
-    fs[FEATURESET_m10Ah]     = p->arch_caps.hi;
-    fs[FEATURESET_e21c]      = p->extd.e21c;
-}
-
-void x86_cpu_featureset_to_policy(
-    const uint32_t fs[FEATURESET_NR_ENTRIES], struct cpu_policy *p)
-{
-    p->basic._1d             = fs[FEATURESET_1d];
-    p->basic._1c             = fs[FEATURESET_1c];
-    p->extd.e1d              = fs[FEATURESET_e1d];
-    p->extd.e1c              = fs[FEATURESET_e1c];
-    p->xstate.Da1            = fs[FEATURESET_Da1];
-    p->feat._7b0             = fs[FEATURESET_7b0];
-    p->feat._7c0             = fs[FEATURESET_7c0];
-    p->extd.e7d              = fs[FEATURESET_e7d];
-    p->extd.e8b              = fs[FEATURESET_e8b];
-    p->feat._7d0             = fs[FEATURESET_7d0];
-    p->feat._7a1             = fs[FEATURESET_7a1];
-    p->extd.e21a             = fs[FEATURESET_e21a];
-    p->feat._7b1             = fs[FEATURESET_7b1];
-    p->feat._7d2             = fs[FEATURESET_7d2];
-    p->feat._7c1             = fs[FEATURESET_7c1];
-    p->feat._7d1             = fs[FEATURESET_7d1];
-    p->arch_caps.lo          = fs[FEATURESET_m10Al];
-    p->arch_caps.hi          = fs[FEATURESET_m10Ah];
-    p->extd.e21c             = fs[FEATURESET_e21c];
-}
-
-void x86_cpu_policy_recalc_synth(struct cpu_policy *p)
-{
-    p->x86_vendor = x86_cpuid_lookup_vendor(
-        p->basic.vendor_ebx, p->basic.vendor_ecx, p->basic.vendor_edx);
-}
-
-void x86_cpu_policy_fill_native(struct cpu_policy *p)
-{
-    unsigned int i;
-
-    cpuid_leaf(0, &p->basic.raw[0]);
-    for ( i = 1; i <= MIN(p->basic.max_leaf,
-                          ARRAY_SIZE(p->basic.raw) - 1); ++i )
-    {
-        switch ( i )
-        {
-        case 0x4: case 0x7: case 0xb: case 0xd:
-            /* Multi-invocation leaves.  Deferred. */
-            continue;
-        }
-
-        cpuid_leaf(i, &p->basic.raw[i]);
-    }
-
-    if ( p->basic.max_leaf >= 4 )
-    {
-        for ( i = 0; i < ARRAY_SIZE(p->cache.raw); ++i )
-        {
-            union {
-                struct cpuid_leaf l;
-                struct cpuid_cache_leaf c;
-            } u;
-
-            cpuid_count_leaf(4, i, &u.l);
-
-            if ( u.c.type == 0 )
-                break;
-
-            p->cache.subleaf[i] = u.c;
-        }
-
-        /*
-         * The choice of CPUID_GUEST_NR_CACHE is arbitrary.  It is expected
-         * that it will eventually need increasing for future hardware.
-         */
-#ifdef __XEN__
-        if ( i == ARRAY_SIZE(p->cache.raw) )
-            printk(XENLOG_WARNING
-                   "CPUID: Insufficient Leaf 4 space for this hardware\n");
-#endif
-    }
-
-    if ( p->basic.max_leaf >= 7 )
-    {
-        cpuid_count_leaf(7, 0, &p->feat.raw[0]);
-
-        for ( i = 1; i <= MIN(p->feat.max_subleaf,
-                              ARRAY_SIZE(p->feat.raw) - 1); ++i )
-            cpuid_count_leaf(7, i, &p->feat.raw[i]);
-    }
-
-    if ( p->basic.max_leaf >= 0xb )
-    {
-        union {
-            struct cpuid_leaf l;
-            struct cpuid_topo_leaf t;
-        } u;
-
-        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
-        {
-            cpuid_count_leaf(0xb, i, &u.l);
-
-            if ( u.t.type == 0 )
-                break;
-
-            p->topo.subleaf[i] = u.t;
-        }
-
-        /*
-         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
-         * to grow for future hardware.
-         */
-#ifdef __XEN__
-        if ( i == ARRAY_SIZE(p->topo.raw) &&
-             (cpuid_count_leaf(0xb, i, &u.l), u.t.type != 0) )
-            printk(XENLOG_WARNING
-                   "CPUID: Insufficient Leaf 0xb space for this hardware\n");
-#endif
-    }
-
-    if ( p->basic.max_leaf >= 0xd )
-    {
-        uint64_t xstates;
-
-        cpuid_count_leaf(0xd, 0, &p->xstate.raw[0]);
-        cpuid_count_leaf(0xd, 1, &p->xstate.raw[1]);
-
-        xstates = cpu_policy_xstates(p);
-
-        /* This logic will probably need adjusting when XCR0[63] gets used. */
-        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
-
-        for ( i = 2; i < min_t(unsigned int, 63,
-                               ARRAY_SIZE(p->xstate.raw)); ++i )
-        {
-            if ( xstates & (1ULL << i) )
-                cpuid_count_leaf(0xd, i, &p->xstate.raw[i]);
-        }
-    }
-
-    /* Extended leaves. */
-    cpuid_leaf(0x80000000U, &p->extd.raw[0]);
-    for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
-                          ARRAY_SIZE(p->extd.raw) - 1); ++i )
-        cpuid_leaf(0x80000000U + i, &p->extd.raw[i]);
-
-    /* Don't report leaves from possible lower level hypervisor, for now. */
-    p->hv_limit = 0;
-    p->hv2_limit = 0;
-
-#ifdef __XEN__
-    /* TODO MSR_PLATFORM_INFO */
-
-    if ( p->feat.arch_caps )
-        rdmsrl(MSR_ARCH_CAPABILITIES, p->arch_caps.raw);
-#endif
-
-    x86_cpu_policy_recalc_synth(p);
-}
-
-void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p)
-{
-    unsigned int i;
-
-    zero_leaves(p->basic.raw, p->basic.max_leaf + 1,
-                ARRAY_SIZE(p->basic.raw) - 1);
-
-    if ( p->basic.max_leaf < 4 )
-        memset(p->cache.raw, 0, sizeof(p->cache.raw));
-    else
-    {
-        for ( i = 0; (i < ARRAY_SIZE(p->cache.raw) &&
-                      p->cache.subleaf[i].type); ++i )
-            ;
-
-        zero_leaves(p->cache.raw, i, ARRAY_SIZE(p->cache.raw) - 1);
-    }
-
-    if ( p->basic.max_leaf < 7 )
-        memset(p->feat.raw, 0, sizeof(p->feat.raw));
-    else
-        zero_leaves(p->feat.raw, p->feat.max_subleaf + 1,
-                    ARRAY_SIZE(p->feat.raw) - 1);
-
-    if ( p->basic.max_leaf < 0xb )
-        memset(p->topo.raw, 0, sizeof(p->topo.raw));
-    else
-    {
-        for ( i = 0; (i < ARRAY_SIZE(p->topo.raw) &&
-                      p->topo.subleaf[i].type); ++i )
-            ;
-
-        zero_leaves(p->topo.raw, i, ARRAY_SIZE(p->topo.raw) - 1);
-    }
-
-    if ( p->basic.max_leaf < 0xd || !cpu_policy_xstates(p) )
-        memset(p->xstate.raw, 0, sizeof(p->xstate.raw));
-    else
-    {
-        /* This logic will probably need adjusting when XCR0[63] gets used. */
-        BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) > 63);
-
-        /* First two leaves always valid.  Rest depend on xstates. */
-        i = max(2, 64 - __builtin_clzll(cpu_policy_xstates(p)));
-
-        zero_leaves(p->xstate.raw, i,
-                    ARRAY_SIZE(p->xstate.raw) - 1);
-    }
-
-    zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
-                ARRAY_SIZE(p->extd.raw) - 1);
-}
-
-const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
-{
-    static const uint32_t deep_features[] = INIT_DEEP_FEATURES;
-    static const struct {
-        uint32_t feature;
-        uint32_t fs[FEATURESET_NR_ENTRIES];
-    } deep_deps[] = INIT_DEEP_DEPS;
-    unsigned int start = 0, end = ARRAY_SIZE(deep_deps);
-
-    BUILD_BUG_ON(ARRAY_SIZE(deep_deps) != NR_DEEP_DEPS);
-
-    /* Fast early exit. */
-    if ( !test_bit(feature, deep_features) )
-        return NULL;
-
-    /* deep_deps[] is sorted.  Perform a binary search. */
-    while ( start < end )
-    {
-        unsigned int mid = start + ((end - start) / 2);
-
-        if ( deep_deps[mid].feature > feature )
-            end = mid;
-        else if ( deep_deps[mid].feature < feature )
-            start = mid + 1;
-        else
-            return deep_deps[mid].fs;
-    }
-
-    return NULL;
-}
-
-/*
- * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
- * performing boundary checking against the buffer size.
- */
-static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
-                               const struct cpuid_leaf *data,
-                               cpuid_leaf_buffer_t leaves,
-                               uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_cpuid_leaf_t val = {
-        leaf, subleaf, data->a, data->b, data->c, data->d,
-    };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0, leaf, subleaf;
-
-#define COPY_LEAF(l, s, data)                                       \
-    ({                                                              \
-        int ret;                                                    \
-                                                                    \
-        if ( (ret = copy_leaf_to_buffer(                            \
-                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
-            return ret;                                             \
-    })
-
-    /* Basic leaves. */
-    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
-                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
-    {
-        switch ( leaf )
-        {
-        case 0x4:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
-
-                if ( p->cache.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0x7:
-            for ( subleaf = 0;
-                  subleaf <= MIN(p->feat.max_subleaf,
-                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
-            break;
-
-        case 0xb:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
-
-                if ( p->topo.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0xd:
-        {
-            uint64_t xstates = cpu_policy_xstates(p);
-
-            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
-            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
-
-            for ( xstates >>= 2, subleaf = 2;
-                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
-                  xstates >>= 1, ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
-            break;
-        }
-
-        default:
-            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
-            break;
-        }
-    }
-
-    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
-    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv_limit });
-    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv2_limit });
-
-    /* Extended leaves. */
-    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
-                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
-
-#undef COPY_LEAF
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
-                               const cpuid_leaf_buffer_t leaves,
-                               uint32_t nr_entries, uint32_t *err_leaf,
-                               uint32_t *err_subleaf)
-{
-    unsigned int i;
-    xen_cpuid_leaf_t data;
-
-    if ( err_leaf )
-        *err_leaf = -1;
-    if ( err_subleaf )
-        *err_subleaf = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with leaves in order,
-     * and without any repetitions.  However, due to per-vendor differences,
-     * and in the case of upgrade or levelled scenarios, we typically expect
-     * fewer than MAX leaves to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX leaves are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; ++i )
-    {
-        struct cpuid_leaf l;
-
-        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
-            return -EFAULT;
-
-        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
-
-        switch ( data.leaf )
-        {
-        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
-            switch ( data.leaf )
-            {
-            case 0x4:
-                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->cache.raw, data.subleaf) = l;
-                break;
-
-            case 0x7:
-                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->feat.raw, data.subleaf) = l;
-                break;
-
-            case 0xb:
-                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->topo.raw, data.subleaf) = l;
-                break;
-
-            case 0xd:
-                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->xstate.raw, data.subleaf) = l;
-                break;
-
-            default:
-                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                    goto out_of_range;
-
-                array_access_nospec(p->basic.raw, data.leaf) = l;
-                break;
-            }
-            break;
-
-        case 0x40000000:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv_limit = l.a;
-            break;
-
-        case 0x40000100:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv2_limit = l.a;
-            break;
-
-        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
-            break;
-
-        default:
-            goto out_of_range;
-        }
-    }
-
-    x86_cpu_policy_recalc_synth(p);
-
-    return 0;
-
- out_of_range:
-    if ( err_leaf )
-        *err_leaf = data.leaf;
-    if ( err_subleaf )
-        *err_subleaf = data.subleaf;
-
-    return -ERANGE;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/msr.c b/xen/lib/x86/msr.c
deleted file mode 100644
index e04b9ca013..0000000000
--- a/xen/lib/x86/msr.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-/*
- * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
- * boundary check against the buffer size.
- */
-static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
-                              msr_entry_buffer_t msrs,
-                              uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_msr_entry_t ent = { .idx = idx, .val = val };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_to_buffer(const struct cpu_policy *p,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0;
-
-#define COPY_MSR(idx, val)                                      \
-    ({                                                          \
-        int ret;                                                \
-                                                                \
-        if ( (ret = copy_msr_to_buffer(                         \
-                  idx, val, msrs, &curr_entry, nr_entries)) )   \
-            return ret;                                         \
-    })
-
-    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
-    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
-
-#undef COPY_MSR
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_from_buffer(struct cpu_policy *p,
-                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
-                             uint32_t *err_msr)
-{
-    unsigned int i;
-    xen_msr_entry_t data;
-    int rc;
-
-    if ( err_msr )
-        *err_msr = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with entries in
-     * order, and without any repetitions.  However, due to per-vendor
-     * differences, and in the case of upgrade or levelled scenarios, we
-     * typically expect fewer than MAX entries to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX entries are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; i++ )
-    {
-        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
-            return -EFAULT;
-
-        if ( data.flags ) /* .flags MBZ */
-        {
-            rc = -EINVAL;
-            goto err;
-        }
-
-        switch ( data.idx )
-        {
-            /*
-             * Assign data.val to p->field, checking for truncation if the
-             * backing storage for field is smaller than uint64_t
-             */
-#define ASSIGN(field)                             \
-({                                                \
-    if ( (typeof(p->field))data.val != data.val ) \
-    {                                             \
-        rc = -EOVERFLOW;                          \
-        goto err;                                 \
-    }                                             \
-    p->field = data.val;                          \
-})
-
-        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
-        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
-
-#undef ASSIGN
-
-        default:
-            rc = -ERANGE;
-            goto err;
-        }
-    }
-
-    return 0;
-
- err:
-    if ( err_msr )
-        *err_msr = data.idx;
-
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
deleted file mode 100644
index f033d22785..0000000000
--- a/xen/lib/x86/policy.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
-                                    const struct cpu_policy *guest,
-                                    struct cpu_policy_errors *err)
-{
-    struct cpu_policy_errors e = INIT_CPU_POLICY_ERRORS;
-    int ret = -EINVAL;
-
-#define NA XEN_CPUID_NO_SUBLEAF
-#define FAIL_CPUID(l, s) \
-    do { e.leaf = (l); e.subleaf = (s); goto out; } while ( 0 )
-#define FAIL_MSR(m) \
-    do { e.msr = (m); goto out; } while ( 0 )
-
-    if ( guest->basic.max_leaf > host->basic.max_leaf )
-        FAIL_CPUID(0, NA);
-
-    if ( guest->feat.max_subleaf > host->feat.max_subleaf )
-        FAIL_CPUID(7, 0);
-
-    if ( guest->extd.max_leaf > host->extd.max_leaf )
-        FAIL_CPUID(0x80000000U, NA);
-
-    /* TODO: Audit more CPUID data. */
-
-    if ( ~host->platform_info.raw & guest->platform_info.raw )
-        FAIL_MSR(MSR_INTEL_PLATFORM_INFO);
-
-#undef FAIL_MSR
-#undef FAIL_CPUID
-#undef NA
-
-    /* Success. */
-    ret = 0;
-
- out:
-    if ( err )
-        *err = e;
-
-    return ret;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h
deleted file mode 100644
index aedd8e4821..0000000000
--- a/xen/lib/x86/private.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef XEN_LIB_X86_PRIVATE_H
-#define XEN_LIB_X86_PRIVATE_H
-
-#ifdef __XEN__
-
-#include <xen/bitops.h>
-#include <xen/guest_access.h>
-#include <xen/kernel.h>
-#include <xen/lib.h>
-#include <xen/nospec.h>
-#include <xen/types.h>
-
-#include <asm/msr.h>
-
-#define copy_to_buffer_offset copy_to_guest_offset
-#define copy_from_buffer_offset copy_from_guest_offset
-
-#else
-
-#include <errno.h>
-#include <inttypes.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <string.h>
-
-#include <xen/asm/msr-index.h>
-#include <xen/asm/x86-vendors.h>
-
-#include <xen-tools/common-macros.h>
-
-static inline bool test_bit(unsigned int bit, const void *vaddr)
-{
-    const char *addr = vaddr;
-
-    return addr[bit / 8] & (1u << (bit % 8));
-}
-
-#define array_access_nospec(a, i) (a)[(i)]
-
-/* memcpy(), but with copy_to_guest_offset()'s API. */
-#define copy_to_buffer_offset(dst, index, src, nr)      \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[index_ + i_] = src_[i_];                   \
-    0;                                                  \
-})
-
-/* memcpy(), but with copy_from_guest_offset()'s API. */
-#define copy_from_buffer_offset(dst, src, index, nr)    \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[i_] = src_[index_ + i_];                   \
-    0;                                                  \
-})
-
-#endif /* __XEN__ */
-
-#endif /* XEN_LIB_X86_PRIVATE_H */
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 13:55:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 13:55:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240782.1542048 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvFM9-00061N-D1; Wed, 25 Feb 2026 13:55:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240782.1542048; Wed, 25 Feb 2026 13: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 1vvFM9-00061F-A3; Wed, 25 Feb 2026 13:55:13 +0000
Received: by outflank-mailman (input) for mailman id 1240782;
 Wed, 25 Feb 2026 13: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 1vvFM8-000618-Gl
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 13: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 1vvFM8-009X0W-1a
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvFM7-005eii-26
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13: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=NHSyEh2UPjZ8JkWewjkNA4BAfILIoGxFZJRWNR5xhEk=; b=ZXYl+uzVIhCmOGIYndzGfRtk1v
	9Vdioy+gO/iAuiVgVxacNBxhaamSBuMM1VuDUYhkCt9O8uG2urF4caXsf34X3qSXOLeVXrx0VAqTm
	BDTBB+THb6rOuBvu4KZCw+3O/MuAXSQJhpprdbAhdvBK5Z4AxdfDIuLSpNrJdtvgv7fg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/cpu-policy: split out copy-in/-out functions
Message-Id: <E1vvFM7-005eii-26@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 13:55:11 +0000

commit d8402e6cfcc4acd74ae0d771b3f21b9fff270823
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Feb 25 12:31:35 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:31:35 2026 +0100

    x86/cpu-policy: split out copy-in/-out functions
    
    This is to aid with MGMT_HYPERCALL work, leaving the functions potentially
    unreferenced (which Misra dislikes). By moving them to separate archive
    members, the linker simply will not pick them up when not needed.
    
    As the CPUID and MSR ones are always used together, put the "from" and
    "to" variants of each together in one file respectively.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/lib/cpu-policy/Makefile.common    |   3 +-
 xen/arch/x86/lib/cpu-policy/copy-from-buffer.c | 238 +++++++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/copy-to-buffer.c   | 204 +++++++++++++++++++++
 xen/arch/x86/lib/cpu-policy/cpuid.c            | 226 -----------------------
 xen/arch/x86/lib/cpu-policy/msr.c              | 130 --------------
 xen/arch/x86/lib/cpu-policy/private.h          |  31 ----
 6 files changed, 444 insertions(+), 388 deletions(-)

diff --git a/xen/arch/x86/lib/cpu-policy/Makefile.common b/xen/arch/x86/lib/cpu-policy/Makefile.common
index 35475af780..aff662aae8 100644
--- a/xen/arch/x86/lib/cpu-policy/Makefile.common
+++ b/xen/arch/x86/lib/cpu-policy/Makefile.common
@@ -1,3 +1,4 @@
+lib-y += copy-from-buffer.o
+lib-y += copy-to-buffer.o
 lib-y += cpuid.o
-lib-y += msr.o
 lib-y += policy.o
diff --git a/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c b/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c
new file mode 100644
index 0000000000..24f7bc79d2
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/copy-from-buffer.c
@@ -0,0 +1,238 @@
+#ifdef __XEN__
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/nospec.h>
+#include <xen/types.h>
+
+#include <asm/msr-index.h>
+
+#define copy_from_buffer_offset copy_from_guest_offset
+
+#else /* !__XEN__ */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+
+#include <xen-tools/common-macros.h>
+
+#define array_access_nospec(a, i) (a)[(i)]
+
+/* memcpy(), but with copy_from_guest_offset()'s API. */
+#define copy_from_buffer_offset(dst, src, index, nr)    \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[i_] = src_[index_ + i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#include <xen/lib/x86/cpu-policy.h>
+
+int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
+                               const cpuid_leaf_buffer_t leaves,
+                               uint32_t nr_entries, uint32_t *err_leaf,
+                               uint32_t *err_subleaf)
+{
+    unsigned int i;
+    xen_cpuid_leaf_t data;
+
+    if ( err_leaf )
+        *err_leaf = -1;
+    if ( err_subleaf )
+        *err_subleaf = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with leaves in order,
+     * and without any repetitions.  However, due to per-vendor differences,
+     * and in the case of upgrade or levelled scenarios, we typically expect
+     * fewer than MAX leaves to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX leaves are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; ++i )
+    {
+        struct cpuid_leaf l;
+
+        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
+            return -EFAULT;
+
+        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
+
+        switch ( data.leaf )
+        {
+        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
+            switch ( data.leaf )
+            {
+            case 0x4:
+                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->cache.raw, data.subleaf) = l;
+                break;
+
+            case 0x7:
+                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->feat.raw, data.subleaf) = l;
+                break;
+
+            case 0xb:
+                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->topo.raw, data.subleaf) = l;
+                break;
+
+            case 0xd:
+                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->xstate.raw, data.subleaf) = l;
+                break;
+
+            default:
+                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                    goto out_of_range;
+
+                array_access_nospec(p->basic.raw, data.leaf) = l;
+                break;
+            }
+            break;
+
+        case 0x40000000:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv_limit = l.a;
+            break;
+
+        case 0x40000100:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            p->hv2_limit = l.a;
+            break;
+
+        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
+            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
+                goto out_of_range;
+
+            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
+            break;
+
+        default:
+            goto out_of_range;
+        }
+    }
+
+    x86_cpu_policy_recalc_synth(p);
+
+    return 0;
+
+ out_of_range:
+    if ( err_leaf )
+        *err_leaf = data.leaf;
+    if ( err_subleaf )
+        *err_subleaf = data.subleaf;
+
+    return -ERANGE;
+}
+
+int x86_msr_copy_from_buffer(struct cpu_policy *p,
+                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
+                             uint32_t *err_msr)
+{
+    unsigned int i;
+    xen_msr_entry_t data;
+    int rc;
+
+    if ( err_msr )
+        *err_msr = -1;
+
+    /*
+     * A well formed caller is expected to pass an array with entries in
+     * order, and without any repetitions.  However, due to per-vendor
+     * differences, and in the case of upgrade or levelled scenarios, we
+     * typically expect fewer than MAX entries to be passed.
+     *
+     * Detecting repeated entries is prohibitively complicated, so we don't
+     * bother.  That said, one way or another if more than MAX entries are
+     * passed, something is wrong.
+     */
+    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
+        return -E2BIG;
+
+    for ( i = 0; i < nr_entries; i++ )
+    {
+        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
+            return -EFAULT;
+
+        if ( data.flags ) /* .flags MBZ */
+        {
+            rc = -EINVAL;
+            goto err;
+        }
+
+        switch ( data.idx )
+        {
+            /*
+             * Assign data.val to p->field, checking for truncation if the
+             * backing storage for field is smaller than uint64_t
+             */
+#define ASSIGN(field)                             \
+({                                                \
+    if ( (typeof(p->field))data.val != data.val ) \
+    {                                             \
+        rc = -EOVERFLOW;                          \
+        goto err;                                 \
+    }                                             \
+    p->field = data.val;                          \
+})
+
+        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
+        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
+
+#undef ASSIGN
+
+        default:
+            rc = -ERANGE;
+            goto err;
+        }
+    }
+
+    return 0;
+
+ err:
+    if ( err_msr )
+        *err_msr = data.idx;
+
+    return rc;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c b/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c
new file mode 100644
index 0000000000..190dac746c
--- /dev/null
+++ b/xen/arch/x86/lib/cpu-policy/copy-to-buffer.c
@@ -0,0 +1,204 @@
+#ifdef __XEN__
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/types.h>
+
+#include <asm/msr-index.h>
+
+#define copy_to_buffer_offset copy_to_guest_offset
+
+#else /* !__XEN__ */
+
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+#include <xen/asm/msr-index.h>
+
+#include <xen-tools/common-macros.h>
+
+/* memcpy(), but with copy_to_guest_offset()'s API. */
+#define copy_to_buffer_offset(dst, index, src, nr)      \
+({                                                      \
+    const typeof(*(src)) *src_ = (src);                 \
+    typeof(*(dst)) *dst_ = (dst);                       \
+    typeof(index) index_ = (index);                     \
+    typeof(nr) nr_ = (nr), i_;                          \
+                                                        \
+    for ( i_ = 0; i_ < nr_; i_++ )                      \
+        dst_[index_ + i_] = src_[i_];                   \
+    0;                                                  \
+})
+
+#endif /* __XEN__ */
+
+#include <xen/lib/x86/cpu-policy.h>
+
+/*
+ * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
+ * performing boundary checking against the buffer size.
+ */
+static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
+                               const struct cpuid_leaf *data,
+                               cpuid_leaf_buffer_t leaves,
+                               uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_cpuid_leaf_t val = {
+        leaf, subleaf, data->a, data->b, data->c, data->d,
+    };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
+                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0, leaf, subleaf;
+
+#define COPY_LEAF(l, s, data)                                       \
+    ({                                                              \
+        int ret;                                                    \
+                                                                    \
+        if ( (ret = copy_leaf_to_buffer(                            \
+                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
+            return ret;                                             \
+    })
+
+    /* Basic leaves. */
+    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
+                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
+    {
+        switch ( leaf )
+        {
+        case 0x4:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
+
+                if ( p->cache.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0x7:
+            for ( subleaf = 0;
+                  subleaf <= MIN(p->feat.max_subleaf,
+                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
+            break;
+
+        case 0xb:
+            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
+            {
+                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
+
+                if ( p->topo.subleaf[subleaf].type == 0 )
+                    break;
+            }
+            break;
+
+        case 0xd:
+        {
+            uint64_t xstates = cpu_policy_xstates(p);
+
+            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
+            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
+
+            for ( xstates >>= 2, subleaf = 2;
+                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
+                  xstates >>= 1, ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
+            break;
+        }
+
+        default:
+            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
+            break;
+        }
+    }
+
+    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
+    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv_limit });
+    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
+              &(struct cpuid_leaf){ p->hv2_limit });
+
+    /* Extended leaves. */
+    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
+                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
+        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
+
+#undef COPY_LEAF
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+/*
+ * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
+ * boundary check against the buffer size.
+ */
+static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
+                              msr_entry_buffer_t msrs,
+                              uint32_t *curr_entry, const uint32_t nr_entries)
+{
+    const xen_msr_entry_t ent = { .idx = idx, .val = val };
+
+    if ( *curr_entry == nr_entries )
+        return -ENOBUFS;
+
+    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
+        return -EFAULT;
+
+    ++*curr_entry;
+
+    return 0;
+}
+
+int x86_msr_copy_to_buffer(const struct cpu_policy *p,
+                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
+{
+    const uint32_t nr_entries = *nr_entries_p;
+    uint32_t curr_entry = 0;
+
+#define COPY_MSR(idx, val)                                      \
+    ({                                                          \
+        int ret;                                                \
+                                                                \
+        if ( (ret = copy_msr_to_buffer(                         \
+                  idx, val, msrs, &curr_entry, nr_entries)) )   \
+            return ret;                                         \
+    })
+
+    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
+    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
+
+#undef COPY_MSR
+
+    *nr_entries_p = curr_entry;
+
+    return 0;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/lib/cpu-policy/cpuid.c b/xen/arch/x86/lib/cpu-policy/cpuid.c
index 6298d051f2..3162e795bc 100644
--- a/xen/arch/x86/lib/cpu-policy/cpuid.c
+++ b/xen/arch/x86/lib/cpu-policy/cpuid.c
@@ -322,232 +322,6 @@ const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
     return NULL;
 }
 
-/*
- * Copy a single cpuid_leaf into a provided xen_cpuid_leaf_t buffer,
- * performing boundary checking against the buffer size.
- */
-static int copy_leaf_to_buffer(uint32_t leaf, uint32_t subleaf,
-                               const struct cpuid_leaf *data,
-                               cpuid_leaf_buffer_t leaves,
-                               uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_cpuid_leaf_t val = {
-        leaf, subleaf, data->a, data->b, data->c, data->d,
-    };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(leaves, *curr_entry, &val, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_to_buffer(const struct cpu_policy *p,
-                             cpuid_leaf_buffer_t leaves, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0, leaf, subleaf;
-
-#define COPY_LEAF(l, s, data)                                       \
-    ({                                                              \
-        int ret;                                                    \
-                                                                    \
-        if ( (ret = copy_leaf_to_buffer(                            \
-                  l, s, data, leaves, &curr_entry, nr_entries)) )   \
-            return ret;                                             \
-    })
-
-    /* Basic leaves. */
-    for ( leaf = 0; leaf <= MIN(p->basic.max_leaf,
-                                ARRAY_SIZE(p->basic.raw) - 1); ++leaf )
-    {
-        switch ( leaf )
-        {
-        case 0x4:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->cache.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->cache.raw[subleaf]);
-
-                if ( p->cache.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0x7:
-            for ( subleaf = 0;
-                  subleaf <= MIN(p->feat.max_subleaf,
-                                 ARRAY_SIZE(p->feat.raw) - 1); ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->feat.raw[subleaf]);
-            break;
-
-        case 0xb:
-            for ( subleaf = 0; subleaf < ARRAY_SIZE(p->topo.raw); ++subleaf )
-            {
-                COPY_LEAF(leaf, subleaf, &p->topo.raw[subleaf]);
-
-                if ( p->topo.subleaf[subleaf].type == 0 )
-                    break;
-            }
-            break;
-
-        case 0xd:
-        {
-            uint64_t xstates = cpu_policy_xstates(p);
-
-            COPY_LEAF(leaf, 0, &p->xstate.raw[0]);
-            COPY_LEAF(leaf, 1, &p->xstate.raw[1]);
-
-            for ( xstates >>= 2, subleaf = 2;
-                  xstates && subleaf < ARRAY_SIZE(p->xstate.raw);
-                  xstates >>= 1, ++subleaf )
-                COPY_LEAF(leaf, subleaf, &p->xstate.raw[subleaf]);
-            break;
-        }
-
-        default:
-            COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
-            break;
-        }
-    }
-
-    /* TODO: Port Xen and Viridian leaves to the new CPUID infrastructure. */
-    COPY_LEAF(0x40000000, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv_limit });
-    COPY_LEAF(0x40000100, XEN_CPUID_NO_SUBLEAF,
-              &(struct cpuid_leaf){ p->hv2_limit });
-
-    /* Extended leaves. */
-    for ( leaf = 0; leaf <= MIN(p->extd.max_leaf & 0xffffUL,
-                                ARRAY_SIZE(p->extd.raw) - 1); ++leaf )
-        COPY_LEAF(0x80000000U | leaf, XEN_CPUID_NO_SUBLEAF, &p->extd.raw[leaf]);
-
-#undef COPY_LEAF
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_cpuid_copy_from_buffer(struct cpu_policy *p,
-                               const cpuid_leaf_buffer_t leaves,
-                               uint32_t nr_entries, uint32_t *err_leaf,
-                               uint32_t *err_subleaf)
-{
-    unsigned int i;
-    xen_cpuid_leaf_t data;
-
-    if ( err_leaf )
-        *err_leaf = -1;
-    if ( err_subleaf )
-        *err_subleaf = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with leaves in order,
-     * and without any repetitions.  However, due to per-vendor differences,
-     * and in the case of upgrade or levelled scenarios, we typically expect
-     * fewer than MAX leaves to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX leaves are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > CPUID_MAX_SERIALISED_LEAVES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; ++i )
-    {
-        struct cpuid_leaf l;
-
-        if ( copy_from_buffer_offset(&data, leaves, i, 1) )
-            return -EFAULT;
-
-        l = (struct cpuid_leaf){ data.a, data.b, data.c, data.d };
-
-        switch ( data.leaf )
-        {
-        case 0 ... ARRAY_SIZE(p->basic.raw) - 1:
-            switch ( data.leaf )
-            {
-            case 0x4:
-                if ( data.subleaf >= ARRAY_SIZE(p->cache.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->cache.raw, data.subleaf) = l;
-                break;
-
-            case 0x7:
-                if ( data.subleaf >= ARRAY_SIZE(p->feat.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->feat.raw, data.subleaf) = l;
-                break;
-
-            case 0xb:
-                if ( data.subleaf >= ARRAY_SIZE(p->topo.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->topo.raw, data.subleaf) = l;
-                break;
-
-            case 0xd:
-                if ( data.subleaf >= ARRAY_SIZE(p->xstate.raw) )
-                    goto out_of_range;
-
-                array_access_nospec(p->xstate.raw, data.subleaf) = l;
-                break;
-
-            default:
-                if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                    goto out_of_range;
-
-                array_access_nospec(p->basic.raw, data.leaf) = l;
-                break;
-            }
-            break;
-
-        case 0x40000000:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv_limit = l.a;
-            break;
-
-        case 0x40000100:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            p->hv2_limit = l.a;
-            break;
-
-        case 0x80000000U ... 0x80000000U + ARRAY_SIZE(p->extd.raw) - 1:
-            if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
-                goto out_of_range;
-
-            array_access_nospec(p->extd.raw, data.leaf & 0xffff) = l;
-            break;
-
-        default:
-            goto out_of_range;
-        }
-    }
-
-    x86_cpu_policy_recalc_synth(p);
-
-    return 0;
-
- out_of_range:
-    if ( err_leaf )
-        *err_leaf = data.leaf;
-    if ( err_subleaf )
-        *err_subleaf = data.subleaf;
-
-    return -ERANGE;
-}
-
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/lib/cpu-policy/msr.c b/xen/arch/x86/lib/cpu-policy/msr.c
deleted file mode 100644
index e04b9ca013..0000000000
--- a/xen/arch/x86/lib/cpu-policy/msr.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "private.h"
-
-#include <xen/lib/x86/cpu-policy.h>
-
-/*
- * Copy a single MSR into the provided msr_entry_buffer_t buffer, performing a
- * boundary check against the buffer size.
- */
-static int copy_msr_to_buffer(uint32_t idx, uint64_t val,
-                              msr_entry_buffer_t msrs,
-                              uint32_t *curr_entry, const uint32_t nr_entries)
-{
-    const xen_msr_entry_t ent = { .idx = idx, .val = val };
-
-    if ( *curr_entry == nr_entries )
-        return -ENOBUFS;
-
-    if ( copy_to_buffer_offset(msrs, *curr_entry, &ent, 1) )
-        return -EFAULT;
-
-    ++*curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_to_buffer(const struct cpu_policy *p,
-                           msr_entry_buffer_t msrs, uint32_t *nr_entries_p)
-{
-    const uint32_t nr_entries = *nr_entries_p;
-    uint32_t curr_entry = 0;
-
-#define COPY_MSR(idx, val)                                      \
-    ({                                                          \
-        int ret;                                                \
-                                                                \
-        if ( (ret = copy_msr_to_buffer(                         \
-                  idx, val, msrs, &curr_entry, nr_entries)) )   \
-            return ret;                                         \
-    })
-
-    COPY_MSR(MSR_INTEL_PLATFORM_INFO, p->platform_info.raw);
-    COPY_MSR(MSR_ARCH_CAPABILITIES,   p->arch_caps.raw);
-
-#undef COPY_MSR
-
-    *nr_entries_p = curr_entry;
-
-    return 0;
-}
-
-int x86_msr_copy_from_buffer(struct cpu_policy *p,
-                             const msr_entry_buffer_t msrs, uint32_t nr_entries,
-                             uint32_t *err_msr)
-{
-    unsigned int i;
-    xen_msr_entry_t data;
-    int rc;
-
-    if ( err_msr )
-        *err_msr = -1;
-
-    /*
-     * A well formed caller is expected to pass an array with entries in
-     * order, and without any repetitions.  However, due to per-vendor
-     * differences, and in the case of upgrade or levelled scenarios, we
-     * typically expect fewer than MAX entries to be passed.
-     *
-     * Detecting repeated entries is prohibitively complicated, so we don't
-     * bother.  That said, one way or another if more than MAX entries are
-     * passed, something is wrong.
-     */
-    if ( nr_entries > MSR_MAX_SERIALISED_ENTRIES )
-        return -E2BIG;
-
-    for ( i = 0; i < nr_entries; i++ )
-    {
-        if ( copy_from_buffer_offset(&data, msrs, i, 1) )
-            return -EFAULT;
-
-        if ( data.flags ) /* .flags MBZ */
-        {
-            rc = -EINVAL;
-            goto err;
-        }
-
-        switch ( data.idx )
-        {
-            /*
-             * Assign data.val to p->field, checking for truncation if the
-             * backing storage for field is smaller than uint64_t
-             */
-#define ASSIGN(field)                             \
-({                                                \
-    if ( (typeof(p->field))data.val != data.val ) \
-    {                                             \
-        rc = -EOVERFLOW;                          \
-        goto err;                                 \
-    }                                             \
-    p->field = data.val;                          \
-})
-
-        case MSR_INTEL_PLATFORM_INFO: ASSIGN(platform_info.raw); break;
-        case MSR_ARCH_CAPABILITIES:   ASSIGN(arch_caps.raw);     break;
-
-#undef ASSIGN
-
-        default:
-            rc = -ERANGE;
-            goto err;
-        }
-    }
-
-    return 0;
-
- err:
-    if ( err_msr )
-        *err_msr = data.idx;
-
-    return rc;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/x86/lib/cpu-policy/private.h b/xen/arch/x86/lib/cpu-policy/private.h
index aedd8e4821..57f254c3e9 100644
--- a/xen/arch/x86/lib/cpu-policy/private.h
+++ b/xen/arch/x86/lib/cpu-policy/private.h
@@ -12,9 +12,6 @@
 
 #include <asm/msr.h>
 
-#define copy_to_buffer_offset copy_to_guest_offset
-#define copy_from_buffer_offset copy_from_guest_offset
-
 #else
 
 #include <errno.h>
@@ -35,34 +32,6 @@ static inline bool test_bit(unsigned int bit, const void *vaddr)
     return addr[bit / 8] & (1u << (bit % 8));
 }
 
-#define array_access_nospec(a, i) (a)[(i)]
-
-/* memcpy(), but with copy_to_guest_offset()'s API. */
-#define copy_to_buffer_offset(dst, index, src, nr)      \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[index_ + i_] = src_[i_];                   \
-    0;                                                  \
-})
-
-/* memcpy(), but with copy_from_guest_offset()'s API. */
-#define copy_from_buffer_offset(dst, src, index, nr)    \
-({                                                      \
-    const typeof(*(src)) *src_ = (src);                 \
-    typeof(*(dst)) *dst_ = (dst);                       \
-    typeof(index) index_ = (index);                     \
-    typeof(nr) nr_ = (nr), i_;                          \
-                                                        \
-    for ( i_ = 0; i_ < nr_; i_++ )                      \
-        dst_[i_] = src_[index_ + i_];                   \
-    0;                                                  \
-})
-
 #endif /* __XEN__ */
 
 #endif /* XEN_LIB_X86_PRIVATE_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 13:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 13:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240783.1542052 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvFMJ-000646-Fk; Wed, 25 Feb 2026 13:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240783.1542052; Wed, 25 Feb 2026 13: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 1vvFMJ-00063y-D0; Wed, 25 Feb 2026 13:55:23 +0000
Received: by outflank-mailman (input) for mailman id 1240783;
 Wed, 25 Feb 2026 13: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 1vvFMI-00063r-KD
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 13: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 1vvFMI-009X0c-1v
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvFMI-005ejb-1k
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 13: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=Y3QhAKjyM3MhHMp8hS+7pW37VAcUD0XTBmEIGZ/cSd8=; b=QB4knMYu1nb8Jc3wLgbprfhCnG
	14nygtcY0SVIqYpLv3ZbiBSMQtRAWhO3ohnIbo4w/1erXRAR+L/HleThnILWk8gbaZsAl41WAbFSU
	kZxzCRlmH3Kkok2NBvFSQVV9pbTeU5uwugQ2WFlS57oCisPilTf/LMEy1r8T7o9UxK74=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] tools/tests/vpci/main.c: drop unused variables
Message-Id: <E1vvFMI-005ejb-1k@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 13:55:22 +0000

commit 474e4f9264efe2853f58e2d974307aebfc69e427
Author:     Edwin Török <edwin.torok@citrix.com>
AuthorDate: Wed Feb 25 12:32:04 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Feb 25 12:32:04 2026 +0100

    tools/tests/vpci/main.c: drop unused variables
    
    They may become build failures.
    
    Signed-off-by: Edwin Török <edwin.torok@citrix.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/tests/vpci/main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/tests/vpci/main.c b/tools/tests/vpci/main.c
index 2ef8d4e03f..3753417e86 100644
--- a/tools/tests/vpci/main.c
+++ b/tools/tests/vpci/main.c
@@ -189,8 +189,6 @@ main(int argc, char **argv)
     uint32_t r24 = 0;
     uint8_t r28, r30;
     struct mask_data r32;
-    unsigned int i;
-    int rc;
 
     INIT_LIST_HEAD(&vpci.handlers);
     spin_lock_init(&vpci.lock);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 15:11:11 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 15:11:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240834.1542086 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvGXX-0008Gg-0R; Wed, 25 Feb 2026 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240834.1542086; Wed, 25 Feb 2026 15: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 1vvGXW-0008GX-Tv; Wed, 25 Feb 2026 15:11:02 +0000
Received: by outflank-mailman (input) for mailman id 1240834;
 Wed, 25 Feb 2026 15: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 1vvGXV-0008GR-QJ
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 15: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 1vvGXV-009YY8-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 15:11:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvGXV-005iCe-2B
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 15: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=dcRfe7+WDXHVIhOtX/E9dRd5QAXAaF5GoSVo1WDt43U=; b=WglEKTKMyIO5PYsPZBwsy6eRDl
	bz0VWpWELLK/96Cbg/aDtgUa5SZ55jUHxzWRY5IAsva/fNqVfbb8INqkYPQqmCodSkd38BhrVXZEi
	btO4tu4SMFffgPCzzutYYCnNDITAOxhed/9BjgQ5ZErYP91s1YhEO8rGeJttYKGGVzqo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Simplify SMCCC handling by reusing __declare_arg_$()
Message-Id: <E1vvGXV-005iCe-2B@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 15:11:01 +0000

commit cd9cd05b2eba6a93fb7dc3d1bd1fe7a21426fd79
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 24 12:11:02 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 13:06:55 2026 +0000

    xen/arm: Simplify SMCCC handling by reusing __declare_arg_$()
    
    Now that the type handling is entirely uniform, it's easier to see that
    __declare_arg_3() can use __declare_arg_2() and so on, just like the larger
    __declare_arg_$()'s already do.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 5b30dd57b6..590daf7b27 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -114,26 +114,17 @@ struct arm_smccc_res {
 
 #define __declare_arg_1(a0, a1, res)                        \
     typeof(a1) __a1 = (a1);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
+    __declare_arg_0(a0, res);                               \
     register typeof(a1)     arg1 ASM_REG(1) = __a1
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
-    typeof(a1) __a1 = (a1);                                 \
     typeof(a2) __a2 = (a2);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
-    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
+    __declare_arg_1(a0, a1, res);                           \
     register typeof(a2)     arg2 ASM_REG(2) = __a2
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
-    typeof(a1) __a1 = (a1);                                 \
-    typeof(a2) __a2 = (a2);                                 \
     typeof(a3) __a3 = (a3);                                 \
-    struct arm_smccc_res    *___res = (res);                \
-    register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0);\
-    register typeof(a1)     arg1 ASM_REG(1) = __a1;         \
-    register typeof(a2)     arg2 ASM_REG(2) = __a2;         \
+    __declare_arg_2(a0, a1, a2, res);                       \
     register typeof(a3)     arg3 ASM_REG(3) = __a3
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 15:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 15:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240835.1542090 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvGXh-0008IE-1j; Wed, 25 Feb 2026 15:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240835.1542090; Wed, 25 Feb 2026 15: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 1vvGXg-0008I6-VL; Wed, 25 Feb 2026 15:11:12 +0000
Received: by outflank-mailman (input) for mailman id 1240835;
 Wed, 25 Feb 2026 15: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 1vvGXf-0008Hw-RF
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 15: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 1vvGXf-009YYT-2c
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 15:11:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvGXf-005iDB-2U
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 15: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=Hb1jN/Gld6LIfE1bBwtFviCg+FxHLRhm0EmjK3WyuEU=; b=NEwZv7spn6fhmLPMMUX9UtW41l
	6fYWhNkl8OOsgpUTYCwITz66b74INEOxP99c+/IdEOfpEFqB3hPDsfGHgX/DVv+ZxaGQelYZuj6ae
	IibLX0muh4oGp+kc8bYDZXut1sZWx1OKr/AE7jY/krUKLDDcCOmnnQBp3vqnMUpfLQzc=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/arm: Simplify type handling for SMCCC declarations
Message-Id: <E1vvGXf-005iDB-2U@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 15:11:11 +0000

commit 67bcf5eae7098a8c720550f468c347370acd3eaf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 24 12:25:45 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 13:06:56 2026 +0000

    xen/arm: Simplify type handling for SMCCC declarations
    
    There's no use creating a typed copy of a macro argument, simply to use it to
    create a second typed copy.  Remove the indirection, halving the number of
    local variables created in scope.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/smccc.h | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 590daf7b27..5fdefc43d9 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -113,39 +113,32 @@ struct arm_smccc_res {
     register unsigned long  arg0 ASM_REG(0) = (uint32_t)(a0)
 
 #define __declare_arg_1(a0, a1, res)                        \
-    typeof(a1) __a1 = (a1);                                 \
     __declare_arg_0(a0, res);                               \
-    register typeof(a1)     arg1 ASM_REG(1) = __a1
+    register typeof(a1)     arg1 ASM_REG(1) = (a1)
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
-    typeof(a2) __a2 = (a2);                                 \
     __declare_arg_1(a0, a1, res);                           \
-    register typeof(a2)     arg2 ASM_REG(2) = __a2
+    register typeof(a2)     arg2 ASM_REG(2) = (a2)
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
-    typeof(a3) __a3 = (a3);                                 \
     __declare_arg_2(a0, a1, a2, res);                       \
-    register typeof(a3)     arg3 ASM_REG(3) = __a3
+    register typeof(a3)     arg3 ASM_REG(3) = (a3)
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
-    typeof(a4) __a4 = (a4);                             \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register typeof(a4)     arg4 ASM_REG(4) = __a4
+    register typeof(a4)     arg4 ASM_REG(4) = (a4)
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
-    typeof(a5) __a5 = (a5);                             \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5)     arg5 ASM_REG(5) = __a5
+    register typeof(a5)     arg5 ASM_REG(5) = (a5)
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
-    typeof(a6) __a6 = (a6);                                 \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6)     arg6 ASM_REG(6) = __a6
+    register typeof(a6)     arg6 ASM_REG(6) = (a6)
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
-    typeof(a7) __a7 = (a7);                                     \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7)     arg7 ASM_REG(7) = __a7
+    register typeof(a7)     arg7 ASM_REG(7) = (a7)
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240988.1542195 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJB5-0000J3-PK; Wed, 25 Feb 2026 18:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240988.1542195; Wed, 25 Feb 2026 18: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 1vvJB5-0000IZ-KT; Wed, 25 Feb 2026 18:00:03 +0000
Received: by outflank-mailman (input) for mailman id 1240988;
 Wed, 25 Feb 2026 18: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 1vvJB3-0008N1-VP
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJB3-009cQL-2t
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:01 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJB3-005yeh-2e
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=sq6B25oxhWEETBVWHYgs+W9sSmGl6iUO61DSyr/yZe0=; b=omTfut/A7FnfTQev9xXbqMGX3S
	f9OCIcBZ2wUxJB4GIRp1zWpXdAtWChtKnZiNBTCoTStWvhFfy2bROcmpsG2WXG2KYbVH+SY3u85e4
	BMbjPNJ70sTGU7K56ntyxF04ISt1YKD6MVIDK+DwuoxvgGxUjdoW8BgXRltTPizXfspw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/treewide: More typeof() -> auto conversions
Message-Id: <E1vvJB3-005yeh-2e@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:01 +0000

commit 7f15d5d132216c49ee042730a12ec78c5443f72e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 9 22:42:37 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 15:44:55 2026 +0000

    xen/treewide: More typeof() -> auto conversions
    
    All of these are simple cases of using typeof() to avoid multiple parameter
    evaluation.  Using auto avoids multiple textural expansion also.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/include/asm/smccc.h            | 14 ++---
 xen/arch/x86/include/asm/alternative-call.h | 84 ++++++++++++++---------------
 xen/common/bitops.c                         |  2 +-
 xen/include/xen/bitops.h                    |  4 +-
 xen/include/xen/nospec.h                    |  4 +-
 xen/include/xen/self-tests.h                |  4 +-
 6 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 5fdefc43d9..62c6985e73 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -114,31 +114,31 @@ struct arm_smccc_res {
 
 #define __declare_arg_1(a0, a1, res)                        \
     __declare_arg_0(a0, res);                               \
-    register typeof(a1)     arg1 ASM_REG(1) = (a1)
+    register auto           arg1 ASM_REG(1) = (a1)
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
     __declare_arg_1(a0, a1, res);                           \
-    register typeof(a2)     arg2 ASM_REG(2) = (a2)
+    register auto           arg2 ASM_REG(2) = (a2)
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
     __declare_arg_2(a0, a1, a2, res);                       \
-    register typeof(a3)     arg3 ASM_REG(3) = (a3)
+    register auto           arg3 ASM_REG(3) = (a3)
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register typeof(a4)     arg4 ASM_REG(4) = (a4)
+    register auto           arg4 ASM_REG(4) = (a4)
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5)     arg5 ASM_REG(5) = (a5)
+    register auto           arg5 ASM_REG(5) = (a5)
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6)     arg6 ASM_REG(6) = (a6)
+    register auto           arg6 ASM_REG(6) = (a6)
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7)     arg7 ASM_REG(7) = (a7)
+    register auto           arg7 ASM_REG(7) = (a7)
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index b22c10c322..27024797f5 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -111,7 +111,7 @@ struct alt_call {
 })
 
 #define alternative_vcall1(func, arg) ({           \
-    typeof(arg) v1_ = (arg);                       \
+    auto v1_ = (arg);                              \
     ALT_CALL_ARG(v1_, 1);                          \
     ALT_CALL_NO_ARG2;                              \
     (void)sizeof(func(arg));                       \
@@ -119,15 +119,15 @@ struct alt_call {
 })
 
 #define alternative_call1(func, arg) ({            \
-    typeof(arg) v1_ = (arg);                       \
+    auto v1_ = (arg);                              \
     ALT_CALL_ARG(v1_, 1);                          \
     ALT_CALL_NO_ARG2;                              \
     alternative_callN(1, typeof(func(arg)), func); \
 })
 
 #define alternative_vcall2(func, arg1, arg2) ({           \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
+    auto v1_ = (arg1);                                    \
+    auto v2_ = (arg2);                                    \
     ALT_CALL_ARG(v1_, 1);                                 \
     ALT_CALL_ARG(v2_, 2);                                 \
     ALT_CALL_NO_ARG3;                                     \
@@ -136,8 +136,8 @@ struct alt_call {
 })
 
 #define alternative_call2(func, arg1, arg2) ({            \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
+    auto v1_ = (arg1);                                    \
+    auto v2_ = (arg2);                                    \
     ALT_CALL_ARG(v1_, 1);                                 \
     ALT_CALL_ARG(v2_, 2);                                 \
     ALT_CALL_NO_ARG3;                                     \
@@ -145,9 +145,9 @@ struct alt_call {
 })
 
 #define alternative_vcall3(func, arg1, arg2, arg3) ({    \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
+    auto v1_ = (arg1);                                   \
+    auto v2_ = (arg2);                                   \
+    auto v3_ = (arg3);                                   \
     ALT_CALL_ARG(v1_, 1);                                \
     ALT_CALL_ARG(v2_, 2);                                \
     ALT_CALL_ARG(v3_, 3);                                \
@@ -157,9 +157,9 @@ struct alt_call {
 })
 
 #define alternative_call3(func, arg1, arg2, arg3) ({     \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
+    auto v1_ = (arg1);                                   \
+    auto v2_ = (arg2);                                   \
+    auto v3_ = (arg3);                                   \
     ALT_CALL_ARG(v1_, 1);                                \
     ALT_CALL_ARG(v2_, 2);                                \
     ALT_CALL_ARG(v3_, 3);                                \
@@ -169,10 +169,10 @@ struct alt_call {
 })
 
 #define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
+    auto v1_ = (arg1);                                      \
+    auto v2_ = (arg2);                                      \
+    auto v3_ = (arg3);                                      \
+    auto v4_ = (arg4);                                      \
     ALT_CALL_ARG(v1_, 1);                                   \
     ALT_CALL_ARG(v2_, 2);                                   \
     ALT_CALL_ARG(v3_, 3);                                   \
@@ -183,10 +183,10 @@ struct alt_call {
 })
 
 #define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
+    auto v1_ = (arg1);                                      \
+    auto v2_ = (arg2);                                      \
+    auto v3_ = (arg3);                                      \
+    auto v4_ = (arg4);                                      \
     ALT_CALL_ARG(v1_, 1);                                   \
     ALT_CALL_ARG(v2_, 2);                                   \
     ALT_CALL_ARG(v3_, 3);                                   \
@@ -198,11 +198,11 @@ struct alt_call {
 })
 
 #define alternative_vcall5(func, arg1, arg2, arg3, arg4, arg5) ({ \
-    typeof(arg1) v1_ = (arg1);                                    \
-    typeof(arg2) v2_ = (arg2);                                    \
-    typeof(arg3) v3_ = (arg3);                                    \
-    typeof(arg4) v4_ = (arg4);                                    \
-    typeof(arg5) v5_ = (arg5);                                    \
+    auto v1_ = (arg1);                                            \
+    auto v2_ = (arg2);                                            \
+    auto v3_ = (arg3);                                            \
+    auto v4_ = (arg4);                                            \
+    auto v5_ = (arg5);                                            \
     ALT_CALL_ARG(v1_, 1);                                         \
     ALT_CALL_ARG(v2_, 2);                                         \
     ALT_CALL_ARG(v3_, 3);                                         \
@@ -214,11 +214,11 @@ struct alt_call {
 })
 
 #define alternative_call5(func, arg1, arg2, arg3, arg4, arg5) ({  \
-    typeof(arg1) v1_ = (arg1);                                    \
-    typeof(arg2) v2_ = (arg2);                                    \
-    typeof(arg3) v3_ = (arg3);                                    \
-    typeof(arg4) v4_ = (arg4);                                    \
-    typeof(arg5) v5_ = (arg5);                                    \
+    auto v1_ = (arg1);                                            \
+    auto v2_ = (arg2);                                            \
+    auto v3_ = (arg3);                                            \
+    auto v4_ = (arg4);                                            \
+    auto v5_ = (arg5);                                            \
     ALT_CALL_ARG(v1_, 1);                                         \
     ALT_CALL_ARG(v2_, 2);                                         \
     ALT_CALL_ARG(v3_, 3);                                         \
@@ -231,12 +231,12 @@ struct alt_call {
 })
 
 #define alternative_vcall6(func, arg1, arg2, arg3, arg4, arg5, arg6) ({ \
-    typeof(arg1) v1_ = (arg1);                                          \
-    typeof(arg2) v2_ = (arg2);                                          \
-    typeof(arg3) v3_ = (arg3);                                          \
-    typeof(arg4) v4_ = (arg4);                                          \
-    typeof(arg5) v5_ = (arg5);                                          \
-    typeof(arg6) v6_ = (arg6);                                          \
+    auto v1_ = (arg1);                                                  \
+    auto v2_ = (arg2);                                                  \
+    auto v3_ = (arg3);                                                  \
+    auto v4_ = (arg4);                                                  \
+    auto v5_ = (arg5);                                                  \
+    auto v6_ = (arg6);                                                  \
     ALT_CALL_ARG(v1_, 1);                                               \
     ALT_CALL_ARG(v2_, 2);                                               \
     ALT_CALL_ARG(v3_, 3);                                               \
@@ -248,12 +248,12 @@ struct alt_call {
 })
 
 #define alternative_call6(func, arg1, arg2, arg3, arg4, arg5, arg6) ({  \
-    typeof(arg1) v1_ = (arg1);                                          \
-    typeof(arg2) v2_ = (arg2);                                          \
-    typeof(arg3) v3_ = (arg3);                                          \
-    typeof(arg4) v4_ = (arg4);                                          \
-    typeof(arg5) v5_ = (arg5);                                          \
-    typeof(arg6) v6_ = (arg6);                                          \
+    auto v1_ = (arg1);                                                  \
+    auto v2_ = (arg2);                                                  \
+    auto v3_ = (arg3);                                                  \
+    auto v4_ = (arg4);                                                  \
+    auto v5_ = (arg5);                                                  \
+    auto v6_ = (arg6);                                                  \
     ALT_CALL_ARG(v1_, 1);                                               \
     ALT_CALL_ARG(v2_, 2);                                               \
     ALT_CALL_ARG(v3_, 3);                                               \
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index e46ea1d3ec..859a4ca5c1 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -147,7 +147,7 @@ static void __init test_for_each_set_bit(void)
  * A copy of @val is taken internally.
  */
 #define for_each_set_bit_reverse(iter, val)             \
-    for ( typeof(val) __v = (val); __v; __v = 0 )       \
+    for ( auto __v = (val); __v; __v = 0 )              \
         for ( unsigned int (iter);                      \
               __v && ((iter) = fls_g(__v) - 1, true);   \
               __clear_bit(iter, &__v) )
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index a4d31ec02a..24882fb482 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -299,7 +299,7 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
  * A copy of @val is taken internally.
  */
 #define for_each_set_bit(iter, val)                     \
-    for ( typeof(val) __v = (val); __v; __v = 0 )       \
+    for ( auto __v = (val); __v; __v = 0 )              \
         for ( unsigned int (iter);                      \
               __v && ((iter) = ffs_g(__v) - 1, true);   \
               __v &= __v - 1 )
@@ -310,7 +310,7 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
  */
 #define multiple_bits_set(x)                    \
     ({                                          \
-        typeof(x) _v = (x);                     \
+        auto _v = (x);                          \
         (_v & (_v - 1)) != 0;                   \
     })
 
diff --git a/xen/include/xen/nospec.h b/xen/include/xen/nospec.h
index c8167a8a24..0e474145b4 100644
--- a/xen/include/xen/nospec.h
+++ b/xen/include/xen/nospec.h
@@ -51,8 +51,8 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
  */
 #define array_index_nospec(index, size)                                 \
 ({                                                                      \
-    typeof(index) _i = (index);                                         \
-    typeof(size) _s = (size);                                           \
+    auto _i = (index);                                                  \
+    auto _s = (size);                                                   \
     unsigned long _mask = array_index_mask_nospec(_i, _s);              \
                                                                         \
     BUILD_BUG_ON(sizeof(_i) > sizeof(long));                            \
diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h
index c57cceb3b9..c4937e781f 100644
--- a/xen/include/xen/self-tests.h
+++ b/xen/include/xen/self-tests.h
@@ -18,7 +18,7 @@
  */
 #define COMPILE_CHECK(fn, val, res)                                     \
     do {                                                                \
-        typeof(fn(val)) real = fn(val);                                 \
+        auto real = fn(val);                                            \
                                                                         \
         if ( !__builtin_constant_p(real) )                              \
             BUILD_ERROR("'" STR(fn(val)) "' not compile-time constant"); \
@@ -36,7 +36,7 @@
  */
 #define RUNTIME_CHECK(fn, val, res)                     \
     do {                                                \
-        typeof(fn(val)) real = fn(HIDE(val));           \
+        auto real = fn(HIDE(val));                      \
                                                         \
         if ( real != (res) )                            \
             panic("%s: %s(%s) expected %u, got %u\n",   \
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:15 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240990.1542198 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBE-0000yv-QA; Wed, 25 Feb 2026 18:00:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240990.1542198; Wed, 25 Feb 2026 18: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 1vvJBE-0000yn-NY; Wed, 25 Feb 2026 18:00:12 +0000
Received: by outflank-mailman (input) for mailman id 1240990;
 Wed, 25 Feb 2026 18: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 1vvJBE-0000yf-0n
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJBD-009cQU-3D
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:11 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJBD-005yfu-34
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=YKPlvLAsjWvyVkU5oPBdd0I/t4szClCEvv7SVmenDcQ=; b=d/mB+HzmmF8Bw+uRwRv0ngk4Pa
	p9ne0lwknDQX34KUtq9zIEz9pY1M+Spnn6Pxjms3uUootl0bmSIylue9sBoIp46DyTWAPq/o1E6jZ
	yfVoYzGv5g1DUmw4YV6lMkTbTa7Q0acDavjHkPQ6p+phnDqDfkpiQnrhtLa0J2FgwFwo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm: Use __func__ in acpi_boot_table_init()
Message-Id: <E1vvJBD-005yfu-34@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:11 +0000

commit afee8d04ad6f88556f0f5a69e3583862cee4b06f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 11:28:10 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    arm: Use __func__ in acpi_boot_table_init()
    
    ECLAIR reports __FUNCTION__ as nonstandard syntax and a R1.1 violation.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/acpi/boot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index db5085e15d..4ac0fd8f51 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -264,14 +264,14 @@ int __init acpi_boot_table_init(void)
     if ( error )
     {
         printk("%s: Unable to initialize table parser (%d)\n",
-               __FUNCTION__, error);
+               __func__, error);
         goto disable;
     }
 
     error = acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
     if ( error )
     {
-        printk("%s: FADT not found (%d)\n", __FUNCTION__, error);
+        printk("%s: FADT not found (%d)\n", __func__, error);
         goto disable;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:22 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240991.1542202 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBO-00011T-Rj; Wed, 25 Feb 2026 18:00:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240991.1542202; Wed, 25 Feb 2026 18: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 1vvJBO-00011J-Ot; Wed, 25 Feb 2026 18:00:22 +0000
Received: by outflank-mailman (input) for mailman id 1240991;
 Wed, 25 Feb 2026 18: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 1vvJBO-00011B-4Q
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJBO-009cQa-0L
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJBO-005ygm-0C
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=16C18fvTlo7mwr7z2Oy/cWpbv8uOa74y27Qj8i5/EOM=; b=QczzOwUzUXGx6J4LPfUJbvH1z6
	aXuIpNXsTFgUAHb/TbRqtNofuCACESESN4l1mB9NQJuYTWaHqHcQQ7/LXIQax3xV6oF1LPaxKWNBK
	qV2xMLpJfipGpQYse+mIN3/hwFoSpZ5psRpgkY++LCs8S7+fPcZQDGJE0qbOt14kGmI0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/treewide: Adjust suffixes on integer literals
Message-Id: <E1vvJBO-005ygm-0C@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:22 +0000

commit 8d061c5b7a879c8590b616257b2a27754d740ec3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 16:13:36 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/treewide: Adjust suffixes on integer literals
    
    Use U where necessary (Misra Rule 7.2) and uppercase L (Misra Rule 7.3).
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3-its.c                |  2 +-
 xen/arch/arm/include/asm/tee/optee_msg.h | 16 ++++++++--------
 xen/arch/arm/include/asm/tee/optee_smc.h |  8 ++++----
 xen/arch/arm/tee/optee.c                 |  6 +++---
 xen/arch/x86/guest/xen/xen.c             |  2 +-
 xen/arch/x86/include/asm/config.h        |  2 +-
 xen/arch/x86/include/asm/guest/hyperv.h  |  2 +-
 xen/arch/x86/pv/emul-gate-op.c           |  2 +-
 xen/arch/x86/tboot.c                     |  4 ++--
 xen/drivers/char/xhci-dbc.c              | 14 +++++++-------
 10 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 34833166ad..9ba068c46f 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -76,7 +76,7 @@ static const struct its_quirk its_quirks[] = {
     {
         .desc	= "R-Car Gen4",
         .iidr	= 0x0201743b,
-        .mask	= 0xffffffff,
+        .mask	= 0xffffffffU,
         .init	= gicv3_its_enable_quirk_gen4,
     },
     {
diff --git a/xen/arch/arm/include/asm/tee/optee_msg.h b/xen/arch/arm/include/asm/tee/optee_msg.h
index fe743dbde3..09820ff863 100644
--- a/xen/arch/arm/include/asm/tee/optee_msg.h
+++ b/xen/arch/arm/include/asm/tee/optee_msg.h
@@ -222,10 +222,10 @@ struct optee_msg_arg {
  * Represented in 4 32-bit words in OPTEE_MSG_UID_0, OPTEE_MSG_UID_1,
  * OPTEE_MSG_UID_2, OPTEE_MSG_UID_3.
  */
-#define OPTEE_MSG_UID_0			0x384fb3e0
-#define OPTEE_MSG_UID_1			0xe7f811e3
-#define OPTEE_MSG_UID_2			0xaf630002
-#define OPTEE_MSG_UID_3			0xa5d5c51b
+#define OPTEE_MSG_UID_0			0x384fb3e0U
+#define OPTEE_MSG_UID_1			0xe7f811e3U
+#define OPTEE_MSG_UID_2			0xaf630002U
+#define OPTEE_MSG_UID_3			0xa5d5c51bU
 #define OPTEE_MSG_FUNCID_CALLS_UID	0xFF01
 
 /*
@@ -246,10 +246,10 @@ struct optee_msg_arg {
  * Returns UUID in 4 32-bit words in the same way as
  * OPTEE_MSG_FUNCID_CALLS_UID described above.
  */
-#define OPTEE_MSG_OS_OPTEE_UUID_0	0x486178e0
-#define OPTEE_MSG_OS_OPTEE_UUID_1	0xe7f811e3
-#define OPTEE_MSG_OS_OPTEE_UUID_2	0xbc5e0002
-#define OPTEE_MSG_OS_OPTEE_UUID_3	0xa5d5c51b
+#define OPTEE_MSG_OS_OPTEE_UUID_0	0x486178e0U
+#define OPTEE_MSG_OS_OPTEE_UUID_1	0xe7f811e3U
+#define OPTEE_MSG_OS_OPTEE_UUID_2	0xbc5e0002U
+#define OPTEE_MSG_OS_OPTEE_UUID_3	0xa5d5c51bU
 #define OPTEE_MSG_FUNCID_GET_OS_UUID	0x0000
 
 /*
diff --git a/xen/arch/arm/include/asm/tee/optee_smc.h b/xen/arch/arm/include/asm/tee/optee_smc.h
index 2f5c702326..39c04eb5ad 100644
--- a/xen/arch/arm/include/asm/tee/optee_smc.h
+++ b/xen/arch/arm/include/asm/tee/optee_smc.h
@@ -443,9 +443,9 @@
 #define OPTEE_SMC_CALL_RETURN_FROM_RPC \
 	OPTEE_SMC_STD_CALL_VAL(OPTEE_SMC_FUNCID_RETURN_FROM_RPC)
 
-#define OPTEE_SMC_RETURN_RPC_PREFIX_MASK	0xFFFF0000
-#define OPTEE_SMC_RETURN_RPC_PREFIX		0xFFFF0000
-#define OPTEE_SMC_RETURN_RPC_FUNC_MASK		0x0000FFFF
+#define OPTEE_SMC_RETURN_RPC_PREFIX_MASK	0xFFFF0000U
+#define OPTEE_SMC_RETURN_RPC_PREFIX		0xFFFF0000U
+#define OPTEE_SMC_RETURN_RPC_FUNC_MASK		0x0000FFFFU
 
 #define OPTEE_SMC_RETURN_GET_RPC_FUNC(ret) \
 	((ret) & OPTEE_SMC_RETURN_RPC_FUNC_MASK)
@@ -548,7 +548,7 @@
 	OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_CMD)
 
 /* Returned in a0 */
-#define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
+#define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFFU
 
 /* Returned in a0 only from Trusted OS functions */
 #define OPTEE_SMC_RETURN_OK		0x0
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 5151bd90ed..699e8d5368 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -49,16 +49,16 @@
 #define TEEC_ORIGIN_COMMS 0x00000002
 
 /* "Non-specific cause" as in GP TEE Client API Specification */
-#define TEEC_ERROR_GENERIC 0xFFFF0000
+#define TEEC_ERROR_GENERIC 0xFFFF0000U
 
 /*
  * "Input parameters were invalid" as described
  * in GP TEE Client API Specification.
  */
-#define TEEC_ERROR_BAD_PARAMETERS 0xFFFF0006
+#define TEEC_ERROR_BAD_PARAMETERS 0xFFFF0006U
 
 /* "System ran out of resources" as in GP TEE Client API Specification */
-#define TEEC_ERROR_OUT_OF_MEMORY 0xFFFF000C
+#define TEEC_ERROR_OUT_OF_MEMORY 0xFFFF000CU
 
 /* Client ID 0 is reserved for the hypervisor itself */
 #define OPTEE_CLIENT_ID(domain) ((domain)->domain_id + 1)
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 77a3a8742a..315e5ded05 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -120,7 +120,7 @@ static void map_shared_info(void)
 
     /* Mask all upcalls */
     for ( i = 0; i < ARRAY_SIZE(XEN_shared_info->evtchn_mask); i++ )
-        write_atomic(&XEN_shared_info->evtchn_mask[i], ~0ul);
+        write_atomic(&XEN_shared_info->evtchn_mask[i], ~0UL);
 }
 
 static int map_vcpuinfo(void)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index cc80f2c623..1b28349a42 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -200,7 +200,7 @@
 #ifdef CONFIG_PV32
 
 /* This is not a fixed value, just a lower limit. */
-#define __HYPERVISOR_COMPAT_VIRT_START 0xF5800000
+#define __HYPERVISOR_COMPAT_VIRT_START 0xF5800000U
 #define HYPERVISOR_COMPAT_VIRT_START(d) ((d)->arch.pv.hv_compat_vstart)
 
 #else /* !CONFIG_PV32 */
diff --git a/xen/arch/x86/include/asm/guest/hyperv.h b/xen/arch/x86/include/asm/guest/hyperv.h
index c05efdce71..dabc62727b 100644
--- a/xen/arch/x86/include/asm/guest/hyperv.h
+++ b/xen/arch/x86/include/asm/guest/hyperv.h
@@ -11,7 +11,7 @@
 #include <xen/types.h>
 
 /* Use top-most MFN for hypercall page */
-#define HV_HCALL_MFN   (((1ull << paddr_bits) - 1) >> HV_HYP_PAGE_SHIFT)
+#define HV_HCALL_MFN   (((1ULL << paddr_bits) - 1) >> HV_HYP_PAGE_SHIFT)
 
 /*
  * The specification says: "The partition reference time is computed
diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index dcac0a0401..1faf13b962 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -32,7 +32,7 @@ static int read_gate_descriptor(unsigned int gate_sel,
         return 0;
 
     *sel = (desc.a >> 16) & 0x0000fffc;
-    *off = (desc.a & 0x0000ffff) | (desc.b & 0xffff0000);
+    *off = (desc.a & 0x0000ffff) | (desc.b & 0xffff0000U);
     *ar = desc.b & 0x0000ffff;
 
     /*
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 9d9bb6e7cf..0b3d596690 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -41,8 +41,8 @@ static bool __ro_after_init is_vtd;
  * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE)
  */
 
-#define TXT_PUB_CONFIG_REGS_BASE       0xfed30000
-#define TXT_PRIV_CONFIG_REGS_BASE      0xfed20000
+#define TXT_PUB_CONFIG_REGS_BASE       0xfed30000U
+#define TXT_PRIV_CONFIG_REGS_BASE      0xfed20000U
 
 /* # pages for each config regs space - used by fixmap */
 #define NR_TXT_CONFIG_PAGES     ((TXT_PUB_CONFIG_REGS_BASE -                \
diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c
index 1f7d4395dc..c1ff528de6 100644
--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -353,8 +353,8 @@ static bool __init dbc_init_xhc(struct dbc *dbc)
     cmd = pci_conf_read16(dbc->sbdf, PCI_COMMAND);
     pci_conf_write16(dbc->sbdf, PCI_COMMAND, cmd & ~PCI_COMMAND_MEMORY);
 
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, 0xFFFFFFFF);
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, 0xFFFFFFFF);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, 0xFFFFFFFFU);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, 0xFFFFFFFFU);
     bar_size = pci_conf_read32(dbc->sbdf, PCI_BASE_ADDRESS_0);
     bar_size |= (uint64_t)pci_conf_read32(dbc->sbdf, PCI_BASE_ADDRESS_1) << 32;
     xhc_mmio_size = ~(bar_size & PCI_BASE_ADDRESS_MEM_MASK) + 1;
@@ -398,7 +398,7 @@ static struct dbc_reg __iomem *xhci_find_dbc(struct dbc *dbc)
      * This is initially an offset to the first capability. All the offsets
      * (both in HCCP1 and then next capability pointer) are dword-based.
      */
-    next = (readl(hccp1) & 0xFFFF0000) >> 16;
+    next = readl(hccp1) >> 16;
 
     while ( id != DBC_ID && next && ttl-- )
     {
@@ -735,7 +735,7 @@ static void dbc_init_ep(uint32_t *ep, uint64_t mbs, uint32_t type,
     memset(ep, 0, DBC_CTX_BYTES);
 
     ep[1] = (1024 << 16) | ((uint32_t)mbs << 8) | (type << 3);
-    ep[2] = (ring_dma & 0xFFFFFFFF) | 1;
+    ep[2] = (uint32_t)ring_dma | 1;
     ep[3] = ring_dma >> 32;
     ep[4] = 3 * 1024;
 }
@@ -816,7 +816,7 @@ static void dbc_reset_debug_port(struct dbc *dbc)
      * This is initially an offset to the first capability. All the offsets
      * (both in HCCP1 and then next capability pointer are dword-based.
      */
-    next = (readl(hccp1) & 0xFFFF0000) >> 16;
+    next = readl(hccp1) >> 16;
 
     /*
      * Look for "supported protocol" capability, major revision 3.
@@ -1094,7 +1094,7 @@ static void dbc_enqueue_in(struct dbc *dbc, struct xhci_trb_ring *trb,
                            struct dbc_work_ring *wrk)
 {
     struct dbc_reg *reg = dbc->dbc_reg;
-    uint32_t db = (readl(&reg->db) & 0xFFFF00FF) | (trb->db << 8);
+    uint32_t db = (readl(&reg->db) & 0xFFFF00FFU) | (trb->db << 8);
 
     /* Check if there is already queued TRB */
     if ( xhci_trb_ring_size(trb) >= 1 )
@@ -1289,7 +1289,7 @@ static void cf_check dbc_uart_resume(struct serial_port *port)
     struct dbc_uart *uart = port->uart;
     struct dbc *dbc = &uart->dbc;
 
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, dbc->bar_val & 0xFFFFFFFF);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, dbc->bar_val);
     pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, dbc->bar_val >> 32);
     pci_conf_write16(dbc->sbdf, PCI_COMMAND, dbc->pci_cr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:32 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240992.1542206 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBY-00013n-Sv; Wed, 25 Feb 2026 18:00:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240992.1542206; Wed, 25 Feb 2026 18:00: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 1vvJBY-00013d-QI; Wed, 25 Feb 2026 18:00:32 +0000
Received: by outflank-mailman (input) for mailman id 1240992;
 Wed, 25 Feb 2026 18: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 1vvJBY-00013S-7h
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJBY-009cQe-0f
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJBY-005yho-0X
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=ZEVKhG1W0E8XPNyF482X4JtG5JZyqqzmyKtzhGJ1Xq8=; b=SRWTNgu9ETTYcMAy1TN/TaxqBh
	63gGgC7oImKh3A5DuVNbWeUVEx6Ch5tFE4nekAXKimYxskgP20QI6WrkVMVCpI1zNbaOFf8NxagHV
	2+ToZ9lvfT5TOEbYqtWRrPvxOvTDdWWpBCivLks9FDgeu9/kWs4vxlAkGR/36mIocl+I=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/treewide: Adjust parameter names and types
Message-Id: <E1vvJBY-005yho-0X@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:32 +0000

commit 7df89867c6c8a81f968f7956a5e44f33ca595136
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 16:31:28 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/treewide: Adjust parameter names and types
    
    MISRA Rule 8.2 says that parameters must all have names.  Rule 8.3 says that
    the names and types must match between declaration and definition.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/pci.h    |  2 +-
 xen/arch/arm/pci/pci-access.c     |  4 ++--
 xen/arch/x86/include/asm/compat.h |  2 +-
 xen/arch/x86/include/asm/p2m.h    |  2 +-
 xen/arch/x86/mm/mem_paging.c      |  2 +-
 xen/crypto/vmac.c                 |  2 +-
 xen/include/crypto/rijndael.h     | 16 ++++++++--------
 xen/include/xen/acpi.h            |  2 +-
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
index 08ffcd4438..73c3be74ae 100644
--- a/xen/arch/arm/include/asm/pci.h
+++ b/xen/arch/arm/include/asm/pci.h
@@ -98,7 +98,7 @@ struct pci_ecam_ops {
     unsigned int            bus_shift;
     struct pci_ops          pci_ops;
     int (*cfg_reg_index)(struct dt_device_node *dev);
-    int (*init)(struct pci_config_window *);
+    int (*init)(struct pci_config_window *cfg);
 };
 
 /* Default ECAM ops */
diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c
index 4a94867501..c0533c00c9 100644
--- a/xen/arch/arm/pci/pci-access.c
+++ b/xen/arch/arm/pci/pci-access.c
@@ -135,9 +135,9 @@ static void pci_config_write(pci_sbdf_t sbdf, unsigned int reg,
 
 #define PCI_OP_WRITE(size, type)                            \
     void pci_conf_write##size(pci_sbdf_t sbdf,              \
-                              unsigned int reg, type val)   \
+                              unsigned int reg, type data)  \
 {                                                           \
-    pci_config_write(sbdf, reg, size / 8, val);             \
+    pci_config_write(sbdf, reg, size / 8, data);            \
 }
 
 #define PCI_OP_READ(size, type)                             \
diff --git a/xen/arch/x86/include/asm/compat.h b/xen/arch/x86/include/asm/compat.h
index 30ed8f2fd0..f12f4f24d8 100644
--- a/xen/arch/x86/include/asm/compat.h
+++ b/xen/arch/x86/include/asm/compat.h
@@ -16,7 +16,7 @@ typedef unsigned long full_ptr_t;
 
 struct domain;
 #ifdef CONFIG_PV32
-int switch_compat(struct domain *);
+int switch_compat(struct domain *d);
 #else
 #include <xen/errno.h>
 static inline int switch_compat(struct domain *d) { return -EOPNOTSUPP; }
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 1ceb248b9d..3a5a5fd43c 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -773,7 +773,7 @@ static inline int relinquish_p2m_mapping(struct domain *d)
  */
 
 /* Modify p2m table for shared gfn */
-int set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn);
 
 /* Tell xenpaging to drop a paged out frame */
 void p2m_mem_paging_drop_page(struct domain *d, gfn_t gfn, p2m_type_t p2mt);
diff --git a/xen/arch/x86/mm/mem_paging.c b/xen/arch/x86/mm/mem_paging.c
index ac8d34ffa0..d4b3cb990c 100644
--- a/xen/arch/x86/mm/mem_paging.c
+++ b/xen/arch/x86/mm/mem_paging.c
@@ -156,7 +156,7 @@ void p2m_mem_paging_populate(struct domain *d, gfn_t gfn)
  *
  * If the gfn was dropped the vcpu needs to be unpaused.
  */
-void p2m_mem_paging_resume(struct domain *d, vm_event_response_t *rsp)
+void p2m_mem_paging_resume(struct domain *d, struct vm_event_st *rsp)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     p2m_type_t p2mt;
diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index acb4e015f5..f1f6d75f8e 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -702,7 +702,7 @@ static uint64_t l3hash(uint64_t p1, uint64_t p2,
 
 /* ----------------------------------------------------------------------- */
 
-void vhash_update(unsigned char *m,
+void vhash_update(unsigned char  m[],
                   unsigned int   mbytes, /* Pos multiple of VMAC_NHBYTES */
                   vmac_ctx_t    *ctx)
 {
diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 4386be5878..aa66051fd3 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -45,14 +45,14 @@ typedef struct {
 	u32	dk[4*(AES_MAXROUNDS + 1)];	/* decrypt key schedule */
 } rijndael_ctx;
 
-int	 rijndael_set_key(rijndael_ctx *, const unsigned char *, int);
-int	 rijndael_set_key_enc_only(rijndael_ctx *, const unsigned char *, int);
-void	 rijndael_decrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
-void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
+int	rijndael_set_key(rijndael_ctx *ctx, const unsigned char *key, int bits);
+int	rijndael_set_key_enc_only(rijndael_ctx *ctx, const unsigned char *key, int bits);
+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 [], const unsigned char [], int);
-int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
-	    unsigned char [16]);
+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]);
 
 #endif /* __RIJNDAEL_H */
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 90635ba0f3..ca87cd15a8 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -75,7 +75,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
 typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
 
 unsigned int acpi_get_processor_id (unsigned int cpu);
-char * __acpi_map_table (paddr_t phys_addr, unsigned long size);
+char * __acpi_map_table (paddr_t phys, unsigned long size);
 bool __acpi_unmap_table(const void *ptr, unsigned long size);
 int acpi_boot_init (void);
 int acpi_boot_table_init (void);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:42 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240993.1542210 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBi-00015r-UL; Wed, 25 Feb 2026 18:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240993.1542210; Wed, 25 Feb 2026 18:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBi-00015h-Ri; Wed, 25 Feb 2026 18:00:42 +0000
Received: by outflank-mailman (input) for mailman id 1240993;
 Wed, 25 Feb 2026 18: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 1vvJBi-00015V-BE
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJBi-009cQi-0y
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJBi-005yiw-0r
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=OW6MXNHczv4qBsCnh9t0MibYuo77dmFd9HwLU3ksC88=; b=fjReA0eQEjz1zVEyOpj1HtiBLt
	6iVdpBdhj45i0vCNcIOo5AbOaYbYeL9rb9/tuU18R+MxkjNZ1TS/SeopaV4IkLJL+BHAFtI/vpjun
	a8hmIOtasIJ3fxCYENTOG+u9haPVw9iFUelwNEETfRGV9XwvLOtdMQzHDWoKzycjzywg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Include suitable headers to make declarations visible
Message-Id: <E1vvJBi-005yiw-0r@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:42 +0000

commit 44416a8431572264d537dceec9de514dbead694e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 20:41:11 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen: Include suitable headers to make declarations visible
    
    A range of functions can't see their declarations, requiring the inclusion of
    appropriate headers.
    
    For pv/mm.h and pv/traps.h, this requires adjustments to become stand-alone.
    
    In pv/mm.h, swap xen/lib.h for xen/bug.h now that ASSERT_UNREACHABLE() has
    moved.  For pv/traps.h, pv_trap_callback_registered() needs to see a complete
    struct vcpu, and xen/sched.h is not something appropriate to pull in
    conditionally.
    
    stack-protector.c can't see the declaration of __stack_chk_guard, and fixing
    that reveals that stack-protector.h needs get_cycles() too.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/pv/mm.h    | 8 +++++++-
 xen/arch/x86/include/asm/pv/traps.h | 6 ++----
 xen/arch/x86/mm/mem_paging.c        | 6 ++++--
 xen/arch/x86/pv/emul-gate-op.c      | 2 ++
 xen/arch/x86/pv/emul-inv-op.c       | 1 +
 xen/arch/x86/pv/emul-priv-op.c      | 1 +
 xen/arch/x86/pv/emulate.c           | 1 +
 xen/arch/x86/pv/grant_table.c       | 1 +
 xen/arch/x86/pv/mm.c                | 1 +
 xen/arch/x86/pv/ro-page-fault.c     | 1 +
 xen/arch/x86/pv/traps.c             | 1 +
 xen/arch/x86/x86_64/machine_kexec.c | 3 ++-
 xen/common/stack-protector.c        | 1 +
 xen/include/xen/stack-protector.h   | 2 ++
 14 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/pv/mm.h b/xen/arch/x86/include/asm/pv/mm.h
index a574590820..11a43f15e2 100644
--- a/xen/arch/x86/include/asm/pv/mm.h
+++ b/xen/arch/x86/include/asm/pv/mm.h
@@ -10,6 +10,12 @@
 #ifndef __X86_PV_MM_H__
 #define __X86_PV_MM_H__
 
+#include <xen/stdbool.h>
+
+struct cpu_user_regs;
+struct page_info;
+struct vcpu;
+
 #ifdef CONFIG_PV
 
 int pv_ro_page_fault(unsigned long addr, struct cpu_user_regs *regs);
@@ -26,7 +32,7 @@ int validate_segdesc_page(struct page_info *page);
 #else
 
 #include <xen/errno.h>
-#include <xen/lib.h>
+#include <xen/bug.h>
 
 static inline int pv_ro_page_fault(unsigned long addr,
                                    struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/include/asm/pv/traps.h b/xen/arch/x86/include/asm/pv/traps.h
index 8c31d5a793..8c20119092 100644
--- a/xen/arch/x86/include/asm/pv/traps.h
+++ b/xen/arch/x86/include/asm/pv/traps.h
@@ -10,9 +10,9 @@
 #ifndef __X86_PV_TRAPS_H__
 #define __X86_PV_TRAPS_H__
 
-#ifdef CONFIG_PV
+#include <xen/sched.h>
 
-#include <public/xen.h>
+#ifdef CONFIG_PV
 
 int pv_raise_nmi(struct vcpu *v);
 
@@ -28,8 +28,6 @@ static inline bool pv_trap_callback_registered(const struct vcpu *v,
 
 #else  /* !CONFIG_PV */
 
-#include <xen/errno.h>
-
 static inline int pv_raise_nmi(struct vcpu *v) { return -EOPNOTSUPP; }
 
 static inline int pv_emulate_privileged_op(struct cpu_user_regs *regs) { return 0; }
diff --git a/xen/arch/x86/mm/mem_paging.c b/xen/arch/x86/mm/mem_paging.c
index d4b3cb990c..33929b526a 100644
--- a/xen/arch/x86/mm/mem_paging.c
+++ b/xen/arch/x86/mm/mem_paging.c
@@ -7,10 +7,12 @@
  * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
  */
 
-
-#include <asm/p2m.h>
 #include <xen/guest_access.h>
 #include <xen/vm_event.h>
+
+#include <asm/mem_paging.h>
+#include <asm/p2m.h>
+
 #include <xsm/xsm.h>
 
 #include "mm-locks.h"
diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index 1faf13b962..c2c699fbff 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -9,6 +9,8 @@
 
 #include <xen/err.h>
 
+#include <asm/pv/traps.h>
+
 #include "emulate.h"
 
 static int read_gate_descriptor(unsigned int gate_sel,
diff --git a/xen/arch/x86/pv/emul-inv-op.c b/xen/arch/x86/pv/emul-inv-op.c
index 346ac1124d..23d2928b00 100644
--- a/xen/arch/x86/pv/emul-inv-op.c
+++ b/xen/arch/x86/pv/emul-inv-op.c
@@ -8,6 +8,7 @@
  */
 
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 
 #include "emulate.h"
 
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 1d9e57ad27..a3c1fd1262 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -21,6 +21,7 @@
 #include <asm/mc146818rtc.h>
 #include <asm/pv/domain.h>
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 #include <asm/shared.h>
 #include <asm/stubs.h>
 
diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c
index 0022e0f55e..a00d1c6c82 100644
--- a/xen/arch/x86/pv/emulate.c
+++ b/xen/arch/x86/pv/emulate.c
@@ -10,6 +10,7 @@
 #include <xen/guest_access.h>
 
 #include <asm/debugreg.h>
+#include <asm/pv/domain.h>
 
 #include "emulate.h"
 
diff --git a/xen/arch/x86/pv/grant_table.c b/xen/arch/x86/pv/grant_table.c
index 247436a015..1df68440a2 100644
--- a/xen/arch/x86/pv/grant_table.c
+++ b/xen/arch/x86/pv/grant_table.c
@@ -12,6 +12,7 @@
 #include <public/grant_table.h>
 
 #include <asm/p2m.h>
+#include <asm/pv/grant_table.h>
 #include <asm/pv/mm.h>
 
 #include "mm.h"
diff --git a/xen/arch/x86/pv/mm.c b/xen/arch/x86/pv/mm.c
index 187f5f6a3e..3f2e9dedcd 100644
--- a/xen/arch/x86/pv/mm.c
+++ b/xen/arch/x86/pv/mm.c
@@ -12,6 +12,7 @@
 
 #include <asm/current.h>
 #include <asm/p2m.h>
+#include <asm/pv/mm.h>
 
 #include "mm.h"
 
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 9c6f668846..d89306d34f 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -8,6 +8,7 @@
  * Copyright (c) 2004 Christian Limpach
  */
 
+#include <asm/pv/mm.h>
 #include <asm/pv/trace.h>
 #include <asm/shadow.h>
 
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 26a468108a..b0395b9914 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -16,6 +16,7 @@
 #include <asm/idt.h>
 #include <asm/irq-vectors.h>
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 #include <asm/shared.h>
 #include <asm/traps.h>
 
diff --git a/xen/arch/x86/x86_64/machine_kexec.c b/xen/arch/x86/x86_64/machine_kexec.c
index f4a005cd0c..f9e54d86fb 100644
--- a/xen/arch/x86/x86_64/machine_kexec.c
+++ b/xen/arch/x86/x86_64/machine_kexec.c
@@ -6,8 +6,9 @@
  * - Magnus Damm <magnus@valinux.co.jp>
  */
 
-#include <xen/types.h>
 #include <xen/kernel.h>
+#include <xen/kexec.h>
+
 #include <asm/page.h>
 #include <public/kexec.h>
 
diff --git a/xen/common/stack-protector.c b/xen/common/stack-protector.c
index 2115912c3b..05e57d4509 100644
--- a/xen/common/stack-protector.c
+++ b/xen/common/stack-protector.c
@@ -2,6 +2,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/random.h>
+#include <xen/stack-protector.h>
 #include <xen/time.h>
 
 /*
diff --git a/xen/include/xen/stack-protector.h b/xen/include/xen/stack-protector.h
index 931affd919..65488bdabc 100644
--- a/xen/include/xen/stack-protector.h
+++ b/xen/include/xen/stack-protector.h
@@ -1,6 +1,8 @@
 #ifndef __XEN_STACK_PROTECTOR_H__
 #define __XEN_STACK_PROTECTOR_H__
 
+#include <xen/time.h>
+
 extern unsigned long __stack_chk_guard;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:00:53 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:00:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240994.1542214 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBt-00018C-0d; Wed, 25 Feb 2026 18:00:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240994.1542214; Wed, 25 Feb 2026 18:00:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJBs-000185-UO; Wed, 25 Feb 2026 18:00:52 +0000
Received: by outflank-mailman (input) for mailman id 1240994;
 Wed, 25 Feb 2026 18: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 1vvJBs-00017t-DY
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18: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 1vvJBs-009cR4-1G
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:00:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJBs-005yk0-19
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18: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=dI1RslbOswNqeziNntiBdgyBKiQ9HxjfZZenrI79xd8=; b=iK/cAyUb81nxPuMoCkhAa/Rhp6
	pwfPIX0I/TCfbn3YU9S0YL5VajYwJzZ31e3lGQ4hVTAnCWLSd6jQC7LFG1X0XVbMgBWUIPxGdoDSQ
	LX1o43tIy38l/9m+0gZGaZi+2fKKsZq97aetytt5wAwTuj6jGM1iNuHmRZ9cQye3FkmM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen/vmac: Const the key parameter of vmac_set_key()
Message-Id: <E1vvJBs-005yk0-19@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:00:52 +0000

commit 619d317cec14db2cdc205393bda1810ea98647f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 20:15:28 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/vmac: Const the key parameter of vmac_set_key()
    
    ECLAIR reports that tboot_gen_domain_integrity() is casting away
    constness (Rule 11.8 violation).
    
    vmac_set_key() doesn't modify the user_key parameter, so it can become const,
    removing the need to cast.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/tboot.c      | 6 +++---
 xen/crypto/vmac.c         | 2 +-
 xen/include/crypto/vmac.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 0b3d596690..5ae27f481f 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -202,7 +202,7 @@ static void tboot_gen_domain_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for_each_domain( d )
     {
         if ( !(d->options & XEN_DOMCTL_CDF_s3_integrity) )
@@ -241,7 +241,7 @@ static void tboot_gen_xenheap_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for ( mfn = 0; mfn < max_page; mfn++ )
     {
         struct page_info *page = mfn_to_page(_mfn(mfn));
@@ -272,7 +272,7 @@ static void tboot_gen_frametable_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for ( sidx = 0; ; sidx = nidx )
     {
         eidx = find_next_zero_bit(pdx_group_valid, max_idx, sidx);
diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index f1f6d75f8e..c9914d2c7c 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -924,7 +924,7 @@ uint64_t vmac(unsigned char m[],
 
 /* ----------------------------------------------------------------------- */
 
-void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx)
+void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx)
 {
     uint64_t in[2] = {0}, out[2];
     unsigned i;
diff --git a/xen/include/crypto/vmac.h b/xen/include/crypto/vmac.h
index 457f3f5dd6..7574c4a3f3 100644
--- a/xen/include/crypto/vmac.h
+++ b/xen/include/crypto/vmac.h
@@ -161,7 +161,7 @@ uint64_t vhash(unsigned char m[],
  * When passed a VMAC_KEY_LEN bit user_key, this function initialazies ctx.
  * ----------------------------------------------------------------------- */
 
-void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx);
+void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx);
 
 /* --------------------------------------------------------------------- */
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:01:03 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240995.1542218 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJC3-0001Af-2L; Wed, 25 Feb 2026 18:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240995.1542218; Wed, 25 Feb 2026 18:01: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 1vvJC2-0001AW-Vq; Wed, 25 Feb 2026 18:01:02 +0000
Received: by outflank-mailman (input) for mailman id 1240995;
 Wed, 25 Feb 2026 18:01: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 1vvJC2-0001AO-I8
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18:01: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 1vvJC2-009cRN-1h
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJC2-005yky-1Q
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01: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=awP2qC2fNPSGVrZ2yS6qQMQmvi4gRKOApx3OTLjTsvo=; b=JWHQHNy5l9bdDehgDp9J+epZf/
	dNm+eEGC7RcXsKVHJ05e0tIszrMs7U/4Wg6ny94uRkyUqNadkPeERNa/ZyJVNhRnwXCRLBwY9fs5R
	ASQBwlzHjyRbr2DCL8ueTq36csBeWoDLrYD/k8GvC2JPf0Q81VuJs6S52nCi2D8AUbB8=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] arm/pci-designware: Fix MISRA violations
Message-Id: <E1vvJC2-005yky-1Q@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:01:02 +0000

commit 25bb2560ab08e80ce5dc5ace125a867b5377a6a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 11:27:13 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    arm/pci-designware: Fix MISRA violations
    
     * Move includes inside the header guards (D4.10)
     * Use NULL in preference to 0 (R11.9)
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/pci/pci-designware.c | 2 +-
 xen/arch/arm/pci/pci-designware.h | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/pci/pci-designware.c b/xen/arch/arm/pci/pci-designware.c
index 0bd67524ac..6b85213f63 100644
--- a/xen/arch/arm/pci/pci-designware.c
+++ b/xen/arch/arm/pci/pci-designware.c
@@ -285,7 +285,7 @@ void __iomem *dw_pcie_child_map_bus(struct pci_host_bridge *bridge,
                                     bridge->child_cfg->phys_addr, busdev,
                                     bridge->child_cfg->size);
     if ( ret )
-        return 0;
+        return NULL;
 
     return bridge->child_cfg->win + where;
 }
diff --git a/xen/arch/arm/pci/pci-designware.h b/xen/arch/arm/pci/pci-designware.h
index b9deb3b138..bd93dab6f2 100644
--- a/xen/arch/arm/pci/pci-designware.h
+++ b/xen/arch/arm/pci/pci-designware.h
@@ -6,12 +6,11 @@
  * Based on xen/arch/arm/pci/pci-host-generic.c
  */
 
-#include <xen/pci.h>
-#include <xen/init.h>
-
 #ifndef __PCI_DESIGNWARE_H__
 #define __PCI_DESIGNWARE_H__
 
+#include <xen/pci.h>
+#include <xen/init.h>
 
 #define PCIE_ATU_VIEWPORT               0x900
 #define PCIE_ATU_REGION_OUTBOUND        0
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:01:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:01:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240996.1542222 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJCE-0001Cd-3f; Wed, 25 Feb 2026 18:01:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240996.1542222; Wed, 25 Feb 2026 18:01: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 1vvJCE-0001CV-0s; Wed, 25 Feb 2026 18:01:14 +0000
Received: by outflank-mailman (input) for mailman id 1240996;
 Wed, 25 Feb 2026 18:01: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 1vvJCC-0001CH-LB
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18:01: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 1vvJCC-009cRU-21
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJCC-005ylK-1s
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01: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=8cxhEdgQgYW5mISIlg0XkPAC9kEZ7Ae2zVGlPrG39iw=; b=krS+jyD6Kyi0u1s211qEsTucfz
	cE3/Wb1SwjYjSLp2JAxgeoqs6TB1SyHiw1hv0q+/ogZBxaEaeh+Twvw2Y1cJ8V41feNmprLFPIDhK
	L7dVWoqSTljS5MuJ/aL+8Wj2bDpWGdShOaGBpSHgJiqJzwLDEXmIAUqD2SnBE8mWLHTg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: Rework write_atomic() call in shadow_write_entries()
Message-Id: <E1vvJCC-005ylK-1s@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:01:12 +0000

commit 495d470d9fdce210529c0aba16ff469ae0fbe952
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 21:28:52 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    x86/shadow: Rework write_atomic() call in shadow_write_entries()
    
    ECLAIR reports an unevaluated side effect in a sizeof() expression (R13.6
    violation).
    
    write_atomic() does take care to evaluates each parameter only once, but
    expression is complicated to follow.  Rewrite it to less resemble an entry
    from an obfuscation contest.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/mm/shadow/set.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/set.c b/xen/arch/x86/mm/shadow/set.c
index 8f9690f0df..2d02e1434c 100644
--- a/xen/arch/x86/mm/shadow/set.c
+++ b/xen/arch/x86/mm/shadow/set.c
@@ -62,8 +62,8 @@ shadow_write_entries(void *d, const void *s, unsigned int entries, mfn_t mfn)
 
     ASSERT(IS_ALIGNED((unsigned long)dst, sizeof(*dst)));
 
-    for ( ; i < entries; i++ )
-        write_atomic(&dst++->l1, src++->l1);
+    for ( ; i < entries; i++, dst++, src++ )
+        write_atomic(&dst->l1, src->l1);
 
     unmap_domain_page(map);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 18:01:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 18:01:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1240997.1542226 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvJCO-0001Ed-51; Wed, 25 Feb 2026 18:01:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1240997.1542226; Wed, 25 Feb 2026 18:01: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 1vvJCO-0001EV-2L; Wed, 25 Feb 2026 18:01:24 +0000
Received: by outflank-mailman (input) for mailman id 1240997;
 Wed, 25 Feb 2026 18:01: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 1vvJCM-0001EL-Nn
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 18:01: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 1vvJCM-009cRc-2I
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvJCM-005ynY-2C
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 18:01: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=Pi0u4BrkYi5XGruRS1voX4jN7Zc0CNK1bUSOoDTFfsg=; b=DOm+VX8l/XFFcx0BjKgRbY1fti
	J2l+oVJWdaIsLddA7ET/bkbhKLHX6qhwJ6qAzwBifQaVEHc3dPjAgcQRd2KZ5nVYY/cI6drcdEwKh
	LMFd+V7M0NvnFJnRRy/lKnn8Buu9DfN4adLe17vAv5vuq63HkaX52BVboiEe1MJFQ3QA=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] xen: Adjust break/fallthrough statements
Message-Id: <E1vvJCM-005ynY-2C@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 18:01:22 +0000

commit 70c47ec5d65fa985ef7becd74b2d7b6d744b4c97
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 15:46:26 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen: Adjust break/fallthrough statements
    
    sh_destroy_shadow() has a spelling of fallthrough which doesn't match the
    permitted pattern.  Convert it to a real fallthrough (psedo)keyword.
    
    Elsewhere, insert breaks at the end of the default statements.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/pci/pci-access.c     | 2 ++
 xen/arch/arm/pci/pci-designware.c | 2 ++
 xen/arch/arm/tee/optee.c          | 1 +
 xen/arch/x86/mm/shadow/common.c   | 2 +-
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c
index c0533c00c9..2b23d552bb 100644
--- a/xen/arch/arm/pci/pci-access.c
+++ b/xen/arch/arm/pci/pci-access.c
@@ -63,6 +63,7 @@ int pci_generic_config_read(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
@@ -89,6 +90,7 @@ int pci_generic_config_write(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
diff --git a/xen/arch/arm/pci/pci-designware.c b/xen/arch/arm/pci/pci-designware.c
index 6b85213f63..902da19e8c 100644
--- a/xen/arch/arm/pci/pci-designware.c
+++ b/xen/arch/arm/pci/pci-designware.c
@@ -48,6 +48,7 @@ static int dw_pcie_read(void __iomem *addr, unsigned int len, uint32_t *val)
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
@@ -71,6 +72,7 @@ static int dw_pcie_write(void __iomem *addr, unsigned int len, uint32_t val)
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 699e8d5368..f719d9d767 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -1206,6 +1206,7 @@ static void do_call_with_arg(struct optee_domain *ctx,
     default:
         /* Free any temporary shared buffers */
         free_shm_buffers(ctx, call->xen_arg);
+        break;
     }
 
     put_std_call(ctx, call);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index e07ba6d5a7..dd2d04d049 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1213,7 +1213,7 @@ void sh_destroy_shadow(struct domain *d, mfn_t smfn)
 #ifdef CONFIG_PV32
     case SH_type_l2h_64_shadow:
         ASSERT(is_pv_32bit_domain(d));
-        /* Fall through... */
+        fallthrough;
 #endif
     case SH_type_l2_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 4)(d, smfn);
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:09 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241018.1542230 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKHn-0000bV-Rq; Wed, 25 Feb 2026 19:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241018.1542230; Wed, 25 Feb 2026 19: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 1vvKHn-0000bN-PD; Wed, 25 Feb 2026 19:11:03 +0000
Received: by outflank-mailman (input) for mailman id 1241018;
 Wed, 25 Feb 2026 19: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 1vvKHm-0000bH-BZ
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKHm-009dkh-0s
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKHm-0062aT-0V
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=KTQ7Iq8N/MFhsVaVhQ52X9FBimzIvG/4Kbze/GZuLa0=; b=v9ixZq3tnYK7JGkXkyhlY8u+Ei
	U8oh8EXoheFErWgNzhIrFrkYz2GylZlv1FZT6cBZdCA0e6355Tj5wAEJwiEv+wNY6dGlZlFNEZUZc
	ll14mtnpPprwH8aOJS+YrNrfLjjt85BtBOcqyJoxEdtKKylYxGZ5WCsP17g9TpwdcADQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/treewide: More typeof() -> auto conversions
Message-Id: <E1vvKHm-0062aT-0V@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:02 +0000

commit 7f15d5d132216c49ee042730a12ec78c5443f72e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Jan 9 22:42:37 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 15:44:55 2026 +0000

    xen/treewide: More typeof() -> auto conversions
    
    All of these are simple cases of using typeof() to avoid multiple parameter
    evaluation.  Using auto avoids multiple textural expansion also.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
 xen/arch/arm/include/asm/smccc.h            | 14 ++---
 xen/arch/x86/include/asm/alternative-call.h | 84 ++++++++++++++---------------
 xen/common/bitops.c                         |  2 +-
 xen/include/xen/bitops.h                    |  4 +-
 xen/include/xen/nospec.h                    |  4 +-
 xen/include/xen/self-tests.h                |  4 +-
 6 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/xen/arch/arm/include/asm/smccc.h b/xen/arch/arm/include/asm/smccc.h
index 5fdefc43d9..62c6985e73 100644
--- a/xen/arch/arm/include/asm/smccc.h
+++ b/xen/arch/arm/include/asm/smccc.h
@@ -114,31 +114,31 @@ struct arm_smccc_res {
 
 #define __declare_arg_1(a0, a1, res)                        \
     __declare_arg_0(a0, res);                               \
-    register typeof(a1)     arg1 ASM_REG(1) = (a1)
+    register auto           arg1 ASM_REG(1) = (a1)
 
 #define __declare_arg_2(a0, a1, a2, res)                    \
     __declare_arg_1(a0, a1, res);                           \
-    register typeof(a2)     arg2 ASM_REG(2) = (a2)
+    register auto           arg2 ASM_REG(2) = (a2)
 
 #define __declare_arg_3(a0, a1, a2, a3, res)                \
     __declare_arg_2(a0, a1, a2, res);                       \
-    register typeof(a3)     arg3 ASM_REG(3) = (a3)
+    register auto           arg3 ASM_REG(3) = (a3)
 
 #define __declare_arg_4(a0, a1, a2, a3, a4, res)        \
     __declare_arg_3(a0, a1, a2, a3, res);               \
-    register typeof(a4)     arg4 ASM_REG(4) = (a4)
+    register auto           arg4 ASM_REG(4) = (a4)
 
 #define __declare_arg_5(a0, a1, a2, a3, a4, a5, res)    \
     __declare_arg_4(a0, a1, a2, a3, a4, res);           \
-    register typeof(a5)     arg5 ASM_REG(5) = (a5)
+    register auto           arg5 ASM_REG(5) = (a5)
 
 #define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res)    \
     __declare_arg_5(a0, a1, a2, a3, a4, a5, res);           \
-    register typeof(a6)     arg6 ASM_REG(6) = (a6)
+    register auto           arg6 ASM_REG(6) = (a6)
 
 #define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res)    \
     __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res);           \
-    register typeof(a7)     arg7 ASM_REG(7) = (a7)
+    register auto           arg7 ASM_REG(7) = (a7)
 
 #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__)
 #define __declare_args(count, ...)  ___declare_args(count, __VA_ARGS__)
diff --git a/xen/arch/x86/include/asm/alternative-call.h b/xen/arch/x86/include/asm/alternative-call.h
index b22c10c322..27024797f5 100644
--- a/xen/arch/x86/include/asm/alternative-call.h
+++ b/xen/arch/x86/include/asm/alternative-call.h
@@ -111,7 +111,7 @@ struct alt_call {
 })
 
 #define alternative_vcall1(func, arg) ({           \
-    typeof(arg) v1_ = (arg);                       \
+    auto v1_ = (arg);                              \
     ALT_CALL_ARG(v1_, 1);                          \
     ALT_CALL_NO_ARG2;                              \
     (void)sizeof(func(arg));                       \
@@ -119,15 +119,15 @@ struct alt_call {
 })
 
 #define alternative_call1(func, arg) ({            \
-    typeof(arg) v1_ = (arg);                       \
+    auto v1_ = (arg);                              \
     ALT_CALL_ARG(v1_, 1);                          \
     ALT_CALL_NO_ARG2;                              \
     alternative_callN(1, typeof(func(arg)), func); \
 })
 
 #define alternative_vcall2(func, arg1, arg2) ({           \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
+    auto v1_ = (arg1);                                    \
+    auto v2_ = (arg2);                                    \
     ALT_CALL_ARG(v1_, 1);                                 \
     ALT_CALL_ARG(v2_, 2);                                 \
     ALT_CALL_NO_ARG3;                                     \
@@ -136,8 +136,8 @@ struct alt_call {
 })
 
 #define alternative_call2(func, arg1, arg2) ({            \
-    typeof(arg1) v1_ = (arg1);                            \
-    typeof(arg2) v2_ = (arg2);                            \
+    auto v1_ = (arg1);                                    \
+    auto v2_ = (arg2);                                    \
     ALT_CALL_ARG(v1_, 1);                                 \
     ALT_CALL_ARG(v2_, 2);                                 \
     ALT_CALL_NO_ARG3;                                     \
@@ -145,9 +145,9 @@ struct alt_call {
 })
 
 #define alternative_vcall3(func, arg1, arg2, arg3) ({    \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
+    auto v1_ = (arg1);                                   \
+    auto v2_ = (arg2);                                   \
+    auto v3_ = (arg3);                                   \
     ALT_CALL_ARG(v1_, 1);                                \
     ALT_CALL_ARG(v2_, 2);                                \
     ALT_CALL_ARG(v3_, 3);                                \
@@ -157,9 +157,9 @@ struct alt_call {
 })
 
 #define alternative_call3(func, arg1, arg2, arg3) ({     \
-    typeof(arg1) v1_ = (arg1);                           \
-    typeof(arg2) v2_ = (arg2);                           \
-    typeof(arg3) v3_ = (arg3);                           \
+    auto v1_ = (arg1);                                   \
+    auto v2_ = (arg2);                                   \
+    auto v3_ = (arg3);                                   \
     ALT_CALL_ARG(v1_, 1);                                \
     ALT_CALL_ARG(v2_, 2);                                \
     ALT_CALL_ARG(v3_, 3);                                \
@@ -169,10 +169,10 @@ struct alt_call {
 })
 
 #define alternative_vcall4(func, arg1, arg2, arg3, arg4) ({ \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
+    auto v1_ = (arg1);                                      \
+    auto v2_ = (arg2);                                      \
+    auto v3_ = (arg3);                                      \
+    auto v4_ = (arg4);                                      \
     ALT_CALL_ARG(v1_, 1);                                   \
     ALT_CALL_ARG(v2_, 2);                                   \
     ALT_CALL_ARG(v3_, 3);                                   \
@@ -183,10 +183,10 @@ struct alt_call {
 })
 
 #define alternative_call4(func, arg1, arg2, arg3, arg4) ({  \
-    typeof(arg1) v1_ = (arg1);                              \
-    typeof(arg2) v2_ = (arg2);                              \
-    typeof(arg3) v3_ = (arg3);                              \
-    typeof(arg4) v4_ = (arg4);                              \
+    auto v1_ = (arg1);                                      \
+    auto v2_ = (arg2);                                      \
+    auto v3_ = (arg3);                                      \
+    auto v4_ = (arg4);                                      \
     ALT_CALL_ARG(v1_, 1);                                   \
     ALT_CALL_ARG(v2_, 2);                                   \
     ALT_CALL_ARG(v3_, 3);                                   \
@@ -198,11 +198,11 @@ struct alt_call {
 })
 
 #define alternative_vcall5(func, arg1, arg2, arg3, arg4, arg5) ({ \
-    typeof(arg1) v1_ = (arg1);                                    \
-    typeof(arg2) v2_ = (arg2);                                    \
-    typeof(arg3) v3_ = (arg3);                                    \
-    typeof(arg4) v4_ = (arg4);                                    \
-    typeof(arg5) v5_ = (arg5);                                    \
+    auto v1_ = (arg1);                                            \
+    auto v2_ = (arg2);                                            \
+    auto v3_ = (arg3);                                            \
+    auto v4_ = (arg4);                                            \
+    auto v5_ = (arg5);                                            \
     ALT_CALL_ARG(v1_, 1);                                         \
     ALT_CALL_ARG(v2_, 2);                                         \
     ALT_CALL_ARG(v3_, 3);                                         \
@@ -214,11 +214,11 @@ struct alt_call {
 })
 
 #define alternative_call5(func, arg1, arg2, arg3, arg4, arg5) ({  \
-    typeof(arg1) v1_ = (arg1);                                    \
-    typeof(arg2) v2_ = (arg2);                                    \
-    typeof(arg3) v3_ = (arg3);                                    \
-    typeof(arg4) v4_ = (arg4);                                    \
-    typeof(arg5) v5_ = (arg5);                                    \
+    auto v1_ = (arg1);                                            \
+    auto v2_ = (arg2);                                            \
+    auto v3_ = (arg3);                                            \
+    auto v4_ = (arg4);                                            \
+    auto v5_ = (arg5);                                            \
     ALT_CALL_ARG(v1_, 1);                                         \
     ALT_CALL_ARG(v2_, 2);                                         \
     ALT_CALL_ARG(v3_, 3);                                         \
@@ -231,12 +231,12 @@ struct alt_call {
 })
 
 #define alternative_vcall6(func, arg1, arg2, arg3, arg4, arg5, arg6) ({ \
-    typeof(arg1) v1_ = (arg1);                                          \
-    typeof(arg2) v2_ = (arg2);                                          \
-    typeof(arg3) v3_ = (arg3);                                          \
-    typeof(arg4) v4_ = (arg4);                                          \
-    typeof(arg5) v5_ = (arg5);                                          \
-    typeof(arg6) v6_ = (arg6);                                          \
+    auto v1_ = (arg1);                                                  \
+    auto v2_ = (arg2);                                                  \
+    auto v3_ = (arg3);                                                  \
+    auto v4_ = (arg4);                                                  \
+    auto v5_ = (arg5);                                                  \
+    auto v6_ = (arg6);                                                  \
     ALT_CALL_ARG(v1_, 1);                                               \
     ALT_CALL_ARG(v2_, 2);                                               \
     ALT_CALL_ARG(v3_, 3);                                               \
@@ -248,12 +248,12 @@ struct alt_call {
 })
 
 #define alternative_call6(func, arg1, arg2, arg3, arg4, arg5, arg6) ({  \
-    typeof(arg1) v1_ = (arg1);                                          \
-    typeof(arg2) v2_ = (arg2);                                          \
-    typeof(arg3) v3_ = (arg3);                                          \
-    typeof(arg4) v4_ = (arg4);                                          \
-    typeof(arg5) v5_ = (arg5);                                          \
-    typeof(arg6) v6_ = (arg6);                                          \
+    auto v1_ = (arg1);                                                  \
+    auto v2_ = (arg2);                                                  \
+    auto v3_ = (arg3);                                                  \
+    auto v4_ = (arg4);                                                  \
+    auto v5_ = (arg5);                                                  \
+    auto v6_ = (arg6);                                                  \
     ALT_CALL_ARG(v1_, 1);                                               \
     ALT_CALL_ARG(v2_, 2);                                               \
     ALT_CALL_ARG(v3_, 3);                                               \
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index e46ea1d3ec..859a4ca5c1 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -147,7 +147,7 @@ static void __init test_for_each_set_bit(void)
  * A copy of @val is taken internally.
  */
 #define for_each_set_bit_reverse(iter, val)             \
-    for ( typeof(val) __v = (val); __v; __v = 0 )       \
+    for ( auto __v = (val); __v; __v = 0 )              \
         for ( unsigned int (iter);                      \
               __v && ((iter) = fls_g(__v) - 1, true);   \
               __clear_bit(iter, &__v) )
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index a4d31ec02a..24882fb482 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -299,7 +299,7 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
  * A copy of @val is taken internally.
  */
 #define for_each_set_bit(iter, val)                     \
-    for ( typeof(val) __v = (val); __v; __v = 0 )       \
+    for ( auto __v = (val); __v; __v = 0 )              \
         for ( unsigned int (iter);                      \
               __v && ((iter) = ffs_g(__v) - 1, true);   \
               __v &= __v - 1 )
@@ -310,7 +310,7 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
  */
 #define multiple_bits_set(x)                    \
     ({                                          \
-        typeof(x) _v = (x);                     \
+        auto _v = (x);                          \
         (_v & (_v - 1)) != 0;                   \
     })
 
diff --git a/xen/include/xen/nospec.h b/xen/include/xen/nospec.h
index c8167a8a24..0e474145b4 100644
--- a/xen/include/xen/nospec.h
+++ b/xen/include/xen/nospec.h
@@ -51,8 +51,8 @@ static inline unsigned long array_index_mask_nospec(unsigned long index,
  */
 #define array_index_nospec(index, size)                                 \
 ({                                                                      \
-    typeof(index) _i = (index);                                         \
-    typeof(size) _s = (size);                                           \
+    auto _i = (index);                                                  \
+    auto _s = (size);                                                   \
     unsigned long _mask = array_index_mask_nospec(_i, _s);              \
                                                                         \
     BUILD_BUG_ON(sizeof(_i) > sizeof(long));                            \
diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h
index c57cceb3b9..c4937e781f 100644
--- a/xen/include/xen/self-tests.h
+++ b/xen/include/xen/self-tests.h
@@ -18,7 +18,7 @@
  */
 #define COMPILE_CHECK(fn, val, res)                                     \
     do {                                                                \
-        typeof(fn(val)) real = fn(val);                                 \
+        auto real = fn(val);                                            \
                                                                         \
         if ( !__builtin_constant_p(real) )                              \
             BUILD_ERROR("'" STR(fn(val)) "' not compile-time constant"); \
@@ -36,7 +36,7 @@
  */
 #define RUNTIME_CHECK(fn, val, res)                     \
     do {                                                \
-        typeof(fn(val)) real = fn(HIDE(val));           \
+        auto real = fn(HIDE(val));                      \
                                                         \
         if ( real != (res) )                            \
             panic("%s: %s(%s) expected %u, got %u\n",   \
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241019.1542234 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKHx-0000dN-Us; Wed, 25 Feb 2026 19:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241019.1542234; Wed, 25 Feb 2026 19: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 1vvKHx-0000dF-S4; Wed, 25 Feb 2026 19:11:13 +0000
Received: by outflank-mailman (input) for mailman id 1241019;
 Wed, 25 Feb 2026 19: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 1vvKHw-0000d3-Dr
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKHw-009dkq-1I
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKHw-0062ap-13
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=xvt3KWygzzl/DiBTGr7rUkz2xTlTcVQB34GA1oB2pJY=; b=AC+x6G5m9FE3NrWJHApFtjp29O
	Ehdx8i3Ms/Y/l/UMa1oG1Aj7vtJjsU5ScnuQmstv6LHKwN41LVskjralRwp3+NvwIQi5U8SmbaShf
	1wekTcmlj1SkwsrjN0tkXNHRveuDxll4xWVZzq3nfAidP8vBj3hoX84u4BR4sYsVDJ5k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm: Use __func__ in acpi_boot_table_init()
Message-Id: <E1vvKHw-0062ap-13@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:12 +0000

commit afee8d04ad6f88556f0f5a69e3583862cee4b06f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 11:28:10 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    arm: Use __func__ in acpi_boot_table_init()
    
    ECLAIR reports __FUNCTION__ as nonstandard syntax and a R1.1 violation.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/acpi/boot.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c
index db5085e15d..4ac0fd8f51 100644
--- a/xen/arch/arm/acpi/boot.c
+++ b/xen/arch/arm/acpi/boot.c
@@ -264,14 +264,14 @@ int __init acpi_boot_table_init(void)
     if ( error )
     {
         printk("%s: Unable to initialize table parser (%d)\n",
-               __FUNCTION__, error);
+               __func__, error);
         goto disable;
     }
 
     error = acpi_table_parse(ACPI_SIG_FADT, acpi_parse_fadt);
     if ( error )
     {
-        printk("%s: FADT not found (%d)\n", __FUNCTION__, error);
+        printk("%s: FADT not found (%d)\n", __func__, error);
         goto disable;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241020.1542238 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKI7-0000fu-W4; Wed, 25 Feb 2026 19:11:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241020.1542238; Wed, 25 Feb 2026 19: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 1vvKI7-0000fm-TQ; Wed, 25 Feb 2026 19:11:23 +0000
Received: by outflank-mailman (input) for mailman id 1241020;
 Wed, 25 Feb 2026 19: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 1vvKI6-0000fb-HR
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKI6-009dky-1b
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKI6-0062c1-1U
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=NKVY3IEikoNetTesqL2RfH3nty62hISpRBw37hEkjXs=; b=5UYjEe01hlGgKR4k2ThC5BeptV
	DqIYhpzD9cNHkZ9B/QP0muto8huRDpGz9/locZWhv6lr82uxu2Pdddnt2iXEMQO04OaxhZobSAP86
	PdQ3K9Uu9OLF3qQxASElgRGb9FcvSDHQkAl6rTkB09Ia4a0HutgjFNgqNQqDPx4NJBz4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/treewide: Adjust suffixes on integer literals
Message-Id: <E1vvKI6-0062c1-1U@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:22 +0000

commit 8d061c5b7a879c8590b616257b2a27754d740ec3
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 16:13:36 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/treewide: Adjust suffixes on integer literals
    
    Use U where necessary (Misra Rule 7.2) and uppercase L (Misra Rule 7.3).
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/gic-v3-its.c                |  2 +-
 xen/arch/arm/include/asm/tee/optee_msg.h | 16 ++++++++--------
 xen/arch/arm/include/asm/tee/optee_smc.h |  8 ++++----
 xen/arch/arm/tee/optee.c                 |  6 +++---
 xen/arch/x86/guest/xen/xen.c             |  2 +-
 xen/arch/x86/include/asm/config.h        |  2 +-
 xen/arch/x86/include/asm/guest/hyperv.h  |  2 +-
 xen/arch/x86/pv/emul-gate-op.c           |  2 +-
 xen/arch/x86/tboot.c                     |  4 ++--
 xen/drivers/char/xhci-dbc.c              | 14 +++++++-------
 10 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 34833166ad..9ba068c46f 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -76,7 +76,7 @@ static const struct its_quirk its_quirks[] = {
     {
         .desc	= "R-Car Gen4",
         .iidr	= 0x0201743b,
-        .mask	= 0xffffffff,
+        .mask	= 0xffffffffU,
         .init	= gicv3_its_enable_quirk_gen4,
     },
     {
diff --git a/xen/arch/arm/include/asm/tee/optee_msg.h b/xen/arch/arm/include/asm/tee/optee_msg.h
index fe743dbde3..09820ff863 100644
--- a/xen/arch/arm/include/asm/tee/optee_msg.h
+++ b/xen/arch/arm/include/asm/tee/optee_msg.h
@@ -222,10 +222,10 @@ struct optee_msg_arg {
  * Represented in 4 32-bit words in OPTEE_MSG_UID_0, OPTEE_MSG_UID_1,
  * OPTEE_MSG_UID_2, OPTEE_MSG_UID_3.
  */
-#define OPTEE_MSG_UID_0			0x384fb3e0
-#define OPTEE_MSG_UID_1			0xe7f811e3
-#define OPTEE_MSG_UID_2			0xaf630002
-#define OPTEE_MSG_UID_3			0xa5d5c51b
+#define OPTEE_MSG_UID_0			0x384fb3e0U
+#define OPTEE_MSG_UID_1			0xe7f811e3U
+#define OPTEE_MSG_UID_2			0xaf630002U
+#define OPTEE_MSG_UID_3			0xa5d5c51bU
 #define OPTEE_MSG_FUNCID_CALLS_UID	0xFF01
 
 /*
@@ -246,10 +246,10 @@ struct optee_msg_arg {
  * Returns UUID in 4 32-bit words in the same way as
  * OPTEE_MSG_FUNCID_CALLS_UID described above.
  */
-#define OPTEE_MSG_OS_OPTEE_UUID_0	0x486178e0
-#define OPTEE_MSG_OS_OPTEE_UUID_1	0xe7f811e3
-#define OPTEE_MSG_OS_OPTEE_UUID_2	0xbc5e0002
-#define OPTEE_MSG_OS_OPTEE_UUID_3	0xa5d5c51b
+#define OPTEE_MSG_OS_OPTEE_UUID_0	0x486178e0U
+#define OPTEE_MSG_OS_OPTEE_UUID_1	0xe7f811e3U
+#define OPTEE_MSG_OS_OPTEE_UUID_2	0xbc5e0002U
+#define OPTEE_MSG_OS_OPTEE_UUID_3	0xa5d5c51bU
 #define OPTEE_MSG_FUNCID_GET_OS_UUID	0x0000
 
 /*
diff --git a/xen/arch/arm/include/asm/tee/optee_smc.h b/xen/arch/arm/include/asm/tee/optee_smc.h
index 2f5c702326..39c04eb5ad 100644
--- a/xen/arch/arm/include/asm/tee/optee_smc.h
+++ b/xen/arch/arm/include/asm/tee/optee_smc.h
@@ -443,9 +443,9 @@
 #define OPTEE_SMC_CALL_RETURN_FROM_RPC \
 	OPTEE_SMC_STD_CALL_VAL(OPTEE_SMC_FUNCID_RETURN_FROM_RPC)
 
-#define OPTEE_SMC_RETURN_RPC_PREFIX_MASK	0xFFFF0000
-#define OPTEE_SMC_RETURN_RPC_PREFIX		0xFFFF0000
-#define OPTEE_SMC_RETURN_RPC_FUNC_MASK		0x0000FFFF
+#define OPTEE_SMC_RETURN_RPC_PREFIX_MASK	0xFFFF0000U
+#define OPTEE_SMC_RETURN_RPC_PREFIX		0xFFFF0000U
+#define OPTEE_SMC_RETURN_RPC_FUNC_MASK		0x0000FFFFU
 
 #define OPTEE_SMC_RETURN_GET_RPC_FUNC(ret) \
 	((ret) & OPTEE_SMC_RETURN_RPC_FUNC_MASK)
@@ -548,7 +548,7 @@
 	OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_CMD)
 
 /* Returned in a0 */
-#define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
+#define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFFU
 
 /* Returned in a0 only from Trusted OS functions */
 #define OPTEE_SMC_RETURN_OK		0x0
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 5151bd90ed..699e8d5368 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -49,16 +49,16 @@
 #define TEEC_ORIGIN_COMMS 0x00000002
 
 /* "Non-specific cause" as in GP TEE Client API Specification */
-#define TEEC_ERROR_GENERIC 0xFFFF0000
+#define TEEC_ERROR_GENERIC 0xFFFF0000U
 
 /*
  * "Input parameters were invalid" as described
  * in GP TEE Client API Specification.
  */
-#define TEEC_ERROR_BAD_PARAMETERS 0xFFFF0006
+#define TEEC_ERROR_BAD_PARAMETERS 0xFFFF0006U
 
 /* "System ran out of resources" as in GP TEE Client API Specification */
-#define TEEC_ERROR_OUT_OF_MEMORY 0xFFFF000C
+#define TEEC_ERROR_OUT_OF_MEMORY 0xFFFF000CU
 
 /* Client ID 0 is reserved for the hypervisor itself */
 #define OPTEE_CLIENT_ID(domain) ((domain)->domain_id + 1)
diff --git a/xen/arch/x86/guest/xen/xen.c b/xen/arch/x86/guest/xen/xen.c
index 77a3a8742a..315e5ded05 100644
--- a/xen/arch/x86/guest/xen/xen.c
+++ b/xen/arch/x86/guest/xen/xen.c
@@ -120,7 +120,7 @@ static void map_shared_info(void)
 
     /* Mask all upcalls */
     for ( i = 0; i < ARRAY_SIZE(XEN_shared_info->evtchn_mask); i++ )
-        write_atomic(&XEN_shared_info->evtchn_mask[i], ~0ul);
+        write_atomic(&XEN_shared_info->evtchn_mask[i], ~0UL);
 }
 
 static int map_vcpuinfo(void)
diff --git a/xen/arch/x86/include/asm/config.h b/xen/arch/x86/include/asm/config.h
index cc80f2c623..1b28349a42 100644
--- a/xen/arch/x86/include/asm/config.h
+++ b/xen/arch/x86/include/asm/config.h
@@ -200,7 +200,7 @@
 #ifdef CONFIG_PV32
 
 /* This is not a fixed value, just a lower limit. */
-#define __HYPERVISOR_COMPAT_VIRT_START 0xF5800000
+#define __HYPERVISOR_COMPAT_VIRT_START 0xF5800000U
 #define HYPERVISOR_COMPAT_VIRT_START(d) ((d)->arch.pv.hv_compat_vstart)
 
 #else /* !CONFIG_PV32 */
diff --git a/xen/arch/x86/include/asm/guest/hyperv.h b/xen/arch/x86/include/asm/guest/hyperv.h
index c05efdce71..dabc62727b 100644
--- a/xen/arch/x86/include/asm/guest/hyperv.h
+++ b/xen/arch/x86/include/asm/guest/hyperv.h
@@ -11,7 +11,7 @@
 #include <xen/types.h>
 
 /* Use top-most MFN for hypercall page */
-#define HV_HCALL_MFN   (((1ull << paddr_bits) - 1) >> HV_HYP_PAGE_SHIFT)
+#define HV_HCALL_MFN   (((1ULL << paddr_bits) - 1) >> HV_HYP_PAGE_SHIFT)
 
 /*
  * The specification says: "The partition reference time is computed
diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index dcac0a0401..1faf13b962 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -32,7 +32,7 @@ static int read_gate_descriptor(unsigned int gate_sel,
         return 0;
 
     *sel = (desc.a >> 16) & 0x0000fffc;
-    *off = (desc.a & 0x0000ffff) | (desc.b & 0xffff0000);
+    *off = (desc.a & 0x0000ffff) | (desc.b & 0xffff0000U);
     *ar = desc.b & 0x0000ffff;
 
     /*
diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 9d9bb6e7cf..0b3d596690 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -41,8 +41,8 @@ static bool __ro_after_init is_vtd;
  * TXT configuration registers (offsets from TXT_{PUB, PRIV}_CONFIG_REGS_BASE)
  */
 
-#define TXT_PUB_CONFIG_REGS_BASE       0xfed30000
-#define TXT_PRIV_CONFIG_REGS_BASE      0xfed20000
+#define TXT_PUB_CONFIG_REGS_BASE       0xfed30000U
+#define TXT_PRIV_CONFIG_REGS_BASE      0xfed20000U
 
 /* # pages for each config regs space - used by fixmap */
 #define NR_TXT_CONFIG_PAGES     ((TXT_PUB_CONFIG_REGS_BASE -                \
diff --git a/xen/drivers/char/xhci-dbc.c b/xen/drivers/char/xhci-dbc.c
index 1f7d4395dc..c1ff528de6 100644
--- a/xen/drivers/char/xhci-dbc.c
+++ b/xen/drivers/char/xhci-dbc.c
@@ -353,8 +353,8 @@ static bool __init dbc_init_xhc(struct dbc *dbc)
     cmd = pci_conf_read16(dbc->sbdf, PCI_COMMAND);
     pci_conf_write16(dbc->sbdf, PCI_COMMAND, cmd & ~PCI_COMMAND_MEMORY);
 
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, 0xFFFFFFFF);
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, 0xFFFFFFFF);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, 0xFFFFFFFFU);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, 0xFFFFFFFFU);
     bar_size = pci_conf_read32(dbc->sbdf, PCI_BASE_ADDRESS_0);
     bar_size |= (uint64_t)pci_conf_read32(dbc->sbdf, PCI_BASE_ADDRESS_1) << 32;
     xhc_mmio_size = ~(bar_size & PCI_BASE_ADDRESS_MEM_MASK) + 1;
@@ -398,7 +398,7 @@ static struct dbc_reg __iomem *xhci_find_dbc(struct dbc *dbc)
      * This is initially an offset to the first capability. All the offsets
      * (both in HCCP1 and then next capability pointer) are dword-based.
      */
-    next = (readl(hccp1) & 0xFFFF0000) >> 16;
+    next = readl(hccp1) >> 16;
 
     while ( id != DBC_ID && next && ttl-- )
     {
@@ -735,7 +735,7 @@ static void dbc_init_ep(uint32_t *ep, uint64_t mbs, uint32_t type,
     memset(ep, 0, DBC_CTX_BYTES);
 
     ep[1] = (1024 << 16) | ((uint32_t)mbs << 8) | (type << 3);
-    ep[2] = (ring_dma & 0xFFFFFFFF) | 1;
+    ep[2] = (uint32_t)ring_dma | 1;
     ep[3] = ring_dma >> 32;
     ep[4] = 3 * 1024;
 }
@@ -816,7 +816,7 @@ static void dbc_reset_debug_port(struct dbc *dbc)
      * This is initially an offset to the first capability. All the offsets
      * (both in HCCP1 and then next capability pointer are dword-based.
      */
-    next = (readl(hccp1) & 0xFFFF0000) >> 16;
+    next = readl(hccp1) >> 16;
 
     /*
      * Look for "supported protocol" capability, major revision 3.
@@ -1094,7 +1094,7 @@ static void dbc_enqueue_in(struct dbc *dbc, struct xhci_trb_ring *trb,
                            struct dbc_work_ring *wrk)
 {
     struct dbc_reg *reg = dbc->dbc_reg;
-    uint32_t db = (readl(&reg->db) & 0xFFFF00FF) | (trb->db << 8);
+    uint32_t db = (readl(&reg->db) & 0xFFFF00FFU) | (trb->db << 8);
 
     /* Check if there is already queued TRB */
     if ( xhci_trb_ring_size(trb) >= 1 )
@@ -1289,7 +1289,7 @@ static void cf_check dbc_uart_resume(struct serial_port *port)
     struct dbc_uart *uart = port->uart;
     struct dbc *dbc = &uart->dbc;
 
-    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, dbc->bar_val & 0xFFFFFFFF);
+    pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_0, dbc->bar_val);
     pci_conf_write32(dbc->sbdf, PCI_BASE_ADDRESS_1, dbc->bar_val >> 32);
     pci_conf_write16(dbc->sbdf, PCI_COMMAND, dbc->pci_cr);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:34 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241021.1542242 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKII-0000i6-16; Wed, 25 Feb 2026 19:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241021.1542242; Wed, 25 Feb 2026 19: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 1vvKIH-0000hy-Um; Wed, 25 Feb 2026 19:11:33 +0000
Received: by outflank-mailman (input) for mailman id 1241021;
 Wed, 25 Feb 2026 19: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 1vvKIG-0000hl-Kj
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKIG-009dl7-1y
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:32 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKIG-0062cY-1m
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=vFY8g9hae+6ACxAtRTTgG6PF718a1a4oY8V8h2EynF4=; b=dbMDCanwDjmDTChWgtu6GewfjU
	xdL9GOQaMhg++NlHh6Sc4TAxT248aRYxqZDF4l0I3KPfibFR6Q3FeJyf3qxMb9cNvEgWu0QRaaOyd
	GVW2pUcpdI5srdmf6E25Q+B41OyWvcE5vAKXmSKDuc0uY+2eKIDvwl1oxGluRkffb+2s=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/treewide: Adjust parameter names and types
Message-Id: <E1vvKIG-0062cY-1m@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:32 +0000

commit 7df89867c6c8a81f968f7956a5e44f33ca595136
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 16:31:28 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/treewide: Adjust parameter names and types
    
    MISRA Rule 8.2 says that parameters must all have names.  Rule 8.3 says that
    the names and types must match between declaration and definition.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/pci.h    |  2 +-
 xen/arch/arm/pci/pci-access.c     |  4 ++--
 xen/arch/x86/include/asm/compat.h |  2 +-
 xen/arch/x86/include/asm/p2m.h    |  2 +-
 xen/arch/x86/mm/mem_paging.c      |  2 +-
 xen/crypto/vmac.c                 |  2 +-
 xen/include/crypto/rijndael.h     | 16 ++++++++--------
 xen/include/xen/acpi.h            |  2 +-
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/include/asm/pci.h b/xen/arch/arm/include/asm/pci.h
index 08ffcd4438..73c3be74ae 100644
--- a/xen/arch/arm/include/asm/pci.h
+++ b/xen/arch/arm/include/asm/pci.h
@@ -98,7 +98,7 @@ struct pci_ecam_ops {
     unsigned int            bus_shift;
     struct pci_ops          pci_ops;
     int (*cfg_reg_index)(struct dt_device_node *dev);
-    int (*init)(struct pci_config_window *);
+    int (*init)(struct pci_config_window *cfg);
 };
 
 /* Default ECAM ops */
diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c
index 4a94867501..c0533c00c9 100644
--- a/xen/arch/arm/pci/pci-access.c
+++ b/xen/arch/arm/pci/pci-access.c
@@ -135,9 +135,9 @@ static void pci_config_write(pci_sbdf_t sbdf, unsigned int reg,
 
 #define PCI_OP_WRITE(size, type)                            \
     void pci_conf_write##size(pci_sbdf_t sbdf,              \
-                              unsigned int reg, type val)   \
+                              unsigned int reg, type data)  \
 {                                                           \
-    pci_config_write(sbdf, reg, size / 8, val);             \
+    pci_config_write(sbdf, reg, size / 8, data);            \
 }
 
 #define PCI_OP_READ(size, type)                             \
diff --git a/xen/arch/x86/include/asm/compat.h b/xen/arch/x86/include/asm/compat.h
index 30ed8f2fd0..f12f4f24d8 100644
--- a/xen/arch/x86/include/asm/compat.h
+++ b/xen/arch/x86/include/asm/compat.h
@@ -16,7 +16,7 @@ typedef unsigned long full_ptr_t;
 
 struct domain;
 #ifdef CONFIG_PV32
-int switch_compat(struct domain *);
+int switch_compat(struct domain *d);
 #else
 #include <xen/errno.h>
 static inline int switch_compat(struct domain *d) { return -EOPNOTSUPP; }
diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h
index 1ceb248b9d..3a5a5fd43c 100644
--- a/xen/arch/x86/include/asm/p2m.h
+++ b/xen/arch/x86/include/asm/p2m.h
@@ -773,7 +773,7 @@ static inline int relinquish_p2m_mapping(struct domain *d)
  */
 
 /* Modify p2m table for shared gfn */
-int set_shared_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
+int set_shared_p2m_entry(struct domain *d, unsigned long gfn_l, mfn_t mfn);
 
 /* Tell xenpaging to drop a paged out frame */
 void p2m_mem_paging_drop_page(struct domain *d, gfn_t gfn, p2m_type_t p2mt);
diff --git a/xen/arch/x86/mm/mem_paging.c b/xen/arch/x86/mm/mem_paging.c
index ac8d34ffa0..d4b3cb990c 100644
--- a/xen/arch/x86/mm/mem_paging.c
+++ b/xen/arch/x86/mm/mem_paging.c
@@ -156,7 +156,7 @@ void p2m_mem_paging_populate(struct domain *d, gfn_t gfn)
  *
  * If the gfn was dropped the vcpu needs to be unpaused.
  */
-void p2m_mem_paging_resume(struct domain *d, vm_event_response_t *rsp)
+void p2m_mem_paging_resume(struct domain *d, struct vm_event_st *rsp)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     p2m_type_t p2mt;
diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index acb4e015f5..f1f6d75f8e 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -702,7 +702,7 @@ static uint64_t l3hash(uint64_t p1, uint64_t p2,
 
 /* ----------------------------------------------------------------------- */
 
-void vhash_update(unsigned char *m,
+void vhash_update(unsigned char  m[],
                   unsigned int   mbytes, /* Pos multiple of VMAC_NHBYTES */
                   vmac_ctx_t    *ctx)
 {
diff --git a/xen/include/crypto/rijndael.h b/xen/include/crypto/rijndael.h
index 4386be5878..aa66051fd3 100644
--- a/xen/include/crypto/rijndael.h
+++ b/xen/include/crypto/rijndael.h
@@ -45,14 +45,14 @@ typedef struct {
 	u32	dk[4*(AES_MAXROUNDS + 1)];	/* decrypt key schedule */
 } rijndael_ctx;
 
-int	 rijndael_set_key(rijndael_ctx *, const unsigned char *, int);
-int	 rijndael_set_key_enc_only(rijndael_ctx *, const unsigned char *, int);
-void	 rijndael_decrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
-void	 rijndael_encrypt(rijndael_ctx *, const unsigned char *, unsigned char *);
+int	rijndael_set_key(rijndael_ctx *ctx, const unsigned char *key, int bits);
+int	rijndael_set_key_enc_only(rijndael_ctx *ctx, const unsigned char *key, int bits);
+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 [], const unsigned char [], int);
-int	rijndaelKeySetupDec(unsigned int [], const unsigned char [], int);
-void	rijndaelEncrypt(const unsigned int [], int, const unsigned char [16],
-	    unsigned char [16]);
+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]);
 
 #endif /* __RIJNDAEL_H */
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 90635ba0f3..ca87cd15a8 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -75,7 +75,7 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
 typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
 
 unsigned int acpi_get_processor_id (unsigned int cpu);
-char * __acpi_map_table (paddr_t phys_addr, unsigned long size);
+char * __acpi_map_table (paddr_t phys, unsigned long size);
 bool __acpi_unmap_table(const void *ptr, unsigned long size);
 int acpi_boot_init (void);
 int acpi_boot_table_init (void);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:44 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241022.1542246 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKIS-0000k7-2b; Wed, 25 Feb 2026 19:11:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241022.1542246; Wed, 25 Feb 2026 19: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 1vvKIR-0000jz-W9; Wed, 25 Feb 2026 19:11:43 +0000
Received: by outflank-mailman (input) for mailman id 1241022;
 Wed, 25 Feb 2026 19: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 1vvKIQ-0000jm-OB
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKIQ-009dlE-2K
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:42 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKIQ-0062d4-2A
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=tNqSl4cNED3at5TggvnzMTK4D9lH8ULZ5p6JUHNbAFk=; b=DfSVqFbCaXmFhKmoeJgD7hq6Vg
	dgIRYgZgzG0HPcFh3bfg6tpgCh73qeKORQc5YtstsY218aRVCpaf/+U0uhLqM5F0QlyV/So+ZUTSZ
	h0iWdipwjUuhSzp5dHLubcNg31goanICuE/1vcUmgQhsvyyEdW0+4Es19iTy+5LzDSxg=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Include suitable headers to make declarations visible
Message-Id: <E1vvKIQ-0062d4-2A@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:42 +0000

commit 44416a8431572264d537dceec9de514dbead694e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jan 5 20:41:11 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen: Include suitable headers to make declarations visible
    
    A range of functions can't see their declarations, requiring the inclusion of
    appropriate headers.
    
    For pv/mm.h and pv/traps.h, this requires adjustments to become stand-alone.
    
    In pv/mm.h, swap xen/lib.h for xen/bug.h now that ASSERT_UNREACHABLE() has
    moved.  For pv/traps.h, pv_trap_callback_registered() needs to see a complete
    struct vcpu, and xen/sched.h is not something appropriate to pull in
    conditionally.
    
    stack-protector.c can't see the declaration of __stack_chk_guard, and fixing
    that reveals that stack-protector.h needs get_cycles() too.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/include/asm/pv/mm.h    | 8 +++++++-
 xen/arch/x86/include/asm/pv/traps.h | 6 ++----
 xen/arch/x86/mm/mem_paging.c        | 6 ++++--
 xen/arch/x86/pv/emul-gate-op.c      | 2 ++
 xen/arch/x86/pv/emul-inv-op.c       | 1 +
 xen/arch/x86/pv/emul-priv-op.c      | 1 +
 xen/arch/x86/pv/emulate.c           | 1 +
 xen/arch/x86/pv/grant_table.c       | 1 +
 xen/arch/x86/pv/mm.c                | 1 +
 xen/arch/x86/pv/ro-page-fault.c     | 1 +
 xen/arch/x86/pv/traps.c             | 1 +
 xen/arch/x86/x86_64/machine_kexec.c | 3 ++-
 xen/common/stack-protector.c        | 1 +
 xen/include/xen/stack-protector.h   | 2 ++
 14 files changed, 27 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/pv/mm.h b/xen/arch/x86/include/asm/pv/mm.h
index a574590820..11a43f15e2 100644
--- a/xen/arch/x86/include/asm/pv/mm.h
+++ b/xen/arch/x86/include/asm/pv/mm.h
@@ -10,6 +10,12 @@
 #ifndef __X86_PV_MM_H__
 #define __X86_PV_MM_H__
 
+#include <xen/stdbool.h>
+
+struct cpu_user_regs;
+struct page_info;
+struct vcpu;
+
 #ifdef CONFIG_PV
 
 int pv_ro_page_fault(unsigned long addr, struct cpu_user_regs *regs);
@@ -26,7 +32,7 @@ int validate_segdesc_page(struct page_info *page);
 #else
 
 #include <xen/errno.h>
-#include <xen/lib.h>
+#include <xen/bug.h>
 
 static inline int pv_ro_page_fault(unsigned long addr,
                                    struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/include/asm/pv/traps.h b/xen/arch/x86/include/asm/pv/traps.h
index 8c31d5a793..8c20119092 100644
--- a/xen/arch/x86/include/asm/pv/traps.h
+++ b/xen/arch/x86/include/asm/pv/traps.h
@@ -10,9 +10,9 @@
 #ifndef __X86_PV_TRAPS_H__
 #define __X86_PV_TRAPS_H__
 
-#ifdef CONFIG_PV
+#include <xen/sched.h>
 
-#include <public/xen.h>
+#ifdef CONFIG_PV
 
 int pv_raise_nmi(struct vcpu *v);
 
@@ -28,8 +28,6 @@ static inline bool pv_trap_callback_registered(const struct vcpu *v,
 
 #else  /* !CONFIG_PV */
 
-#include <xen/errno.h>
-
 static inline int pv_raise_nmi(struct vcpu *v) { return -EOPNOTSUPP; }
 
 static inline int pv_emulate_privileged_op(struct cpu_user_regs *regs) { return 0; }
diff --git a/xen/arch/x86/mm/mem_paging.c b/xen/arch/x86/mm/mem_paging.c
index d4b3cb990c..33929b526a 100644
--- a/xen/arch/x86/mm/mem_paging.c
+++ b/xen/arch/x86/mm/mem_paging.c
@@ -7,10 +7,12 @@
  * Copyright (c) 2009 Citrix Systems, Inc. (Patrick Colp)
  */
 
-
-#include <asm/p2m.h>
 #include <xen/guest_access.h>
 #include <xen/vm_event.h>
+
+#include <asm/mem_paging.h>
+#include <asm/p2m.h>
+
 #include <xsm/xsm.h>
 
 #include "mm-locks.h"
diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index 1faf13b962..c2c699fbff 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -9,6 +9,8 @@
 
 #include <xen/err.h>
 
+#include <asm/pv/traps.h>
+
 #include "emulate.h"
 
 static int read_gate_descriptor(unsigned int gate_sel,
diff --git a/xen/arch/x86/pv/emul-inv-op.c b/xen/arch/x86/pv/emul-inv-op.c
index 346ac1124d..23d2928b00 100644
--- a/xen/arch/x86/pv/emul-inv-op.c
+++ b/xen/arch/x86/pv/emul-inv-op.c
@@ -8,6 +8,7 @@
  */
 
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 
 #include "emulate.h"
 
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 1d9e57ad27..a3c1fd1262 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -21,6 +21,7 @@
 #include <asm/mc146818rtc.h>
 #include <asm/pv/domain.h>
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 #include <asm/shared.h>
 #include <asm/stubs.h>
 
diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c
index 0022e0f55e..a00d1c6c82 100644
--- a/xen/arch/x86/pv/emulate.c
+++ b/xen/arch/x86/pv/emulate.c
@@ -10,6 +10,7 @@
 #include <xen/guest_access.h>
 
 #include <asm/debugreg.h>
+#include <asm/pv/domain.h>
 
 #include "emulate.h"
 
diff --git a/xen/arch/x86/pv/grant_table.c b/xen/arch/x86/pv/grant_table.c
index 247436a015..1df68440a2 100644
--- a/xen/arch/x86/pv/grant_table.c
+++ b/xen/arch/x86/pv/grant_table.c
@@ -12,6 +12,7 @@
 #include <public/grant_table.h>
 
 #include <asm/p2m.h>
+#include <asm/pv/grant_table.h>
 #include <asm/pv/mm.h>
 
 #include "mm.h"
diff --git a/xen/arch/x86/pv/mm.c b/xen/arch/x86/pv/mm.c
index 187f5f6a3e..3f2e9dedcd 100644
--- a/xen/arch/x86/pv/mm.c
+++ b/xen/arch/x86/pv/mm.c
@@ -12,6 +12,7 @@
 
 #include <asm/current.h>
 #include <asm/p2m.h>
+#include <asm/pv/mm.h>
 
 #include "mm.h"
 
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index 9c6f668846..d89306d34f 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -8,6 +8,7 @@
  * Copyright (c) 2004 Christian Limpach
  */
 
+#include <asm/pv/mm.h>
 #include <asm/pv/trace.h>
 #include <asm/shadow.h>
 
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 26a468108a..b0395b9914 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -16,6 +16,7 @@
 #include <asm/idt.h>
 #include <asm/irq-vectors.h>
 #include <asm/pv/trace.h>
+#include <asm/pv/traps.h>
 #include <asm/shared.h>
 #include <asm/traps.h>
 
diff --git a/xen/arch/x86/x86_64/machine_kexec.c b/xen/arch/x86/x86_64/machine_kexec.c
index f4a005cd0c..f9e54d86fb 100644
--- a/xen/arch/x86/x86_64/machine_kexec.c
+++ b/xen/arch/x86/x86_64/machine_kexec.c
@@ -6,8 +6,9 @@
  * - Magnus Damm <magnus@valinux.co.jp>
  */
 
-#include <xen/types.h>
 #include <xen/kernel.h>
+#include <xen/kexec.h>
+
 #include <asm/page.h>
 #include <public/kexec.h>
 
diff --git a/xen/common/stack-protector.c b/xen/common/stack-protector.c
index 2115912c3b..05e57d4509 100644
--- a/xen/common/stack-protector.c
+++ b/xen/common/stack-protector.c
@@ -2,6 +2,7 @@
 #include <xen/init.h>
 #include <xen/lib.h>
 #include <xen/random.h>
+#include <xen/stack-protector.h>
 #include <xen/time.h>
 
 /*
diff --git a/xen/include/xen/stack-protector.h b/xen/include/xen/stack-protector.h
index 931affd919..65488bdabc 100644
--- a/xen/include/xen/stack-protector.h
+++ b/xen/include/xen/stack-protector.h
@@ -1,6 +1,8 @@
 #ifndef __XEN_STACK_PROTECTOR_H__
 #define __XEN_STACK_PROTECTOR_H__
 
+#include <xen/time.h>
+
 extern unsigned long __stack_chk_guard;
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:11:54 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:11:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241023.1542250 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKIc-0000me-5J; Wed, 25 Feb 2026 19:11:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241023.1542250; Wed, 25 Feb 2026 19: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 1vvKIc-0000mW-2Y; Wed, 25 Feb 2026 19:11:54 +0000
Received: by outflank-mailman (input) for mailman id 1241023;
 Wed, 25 Feb 2026 19: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 1vvKIa-0000mK-TF
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19: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 1vvKIa-009dlb-2p
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:11:52 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKIa-0062dS-2V
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19: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=e6WQYZBWfK+lw+yEttn5ky/SGg7EVvEH2Pcm23vjmUY=; b=EnUkbFDeLSxSaVC5sYIqMWYSES
	xL+Ko9xHp3V2G9slMzQZNH9UjOlwFR0HtGePN5Kw/4CzUkiOp54RoZlgVahvR8txKLwDk9fUFbiwl
	yr/bxSLWtlgY6E/gBy5aUHee3TJ6gUvEH1dFlseT4Yamz0h/0jaoUYgrQlzzAWl92NL4=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen/vmac: Const the key parameter of vmac_set_key()
Message-Id: <E1vvKIa-0062dS-2V@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:11:52 +0000

commit 619d317cec14db2cdc205393bda1810ea98647f2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 20:15:28 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen/vmac: Const the key parameter of vmac_set_key()
    
    ECLAIR reports that tboot_gen_domain_integrity() is casting away
    constness (Rule 11.8 violation).
    
    vmac_set_key() doesn't modify the user_key parameter, so it can become const,
    removing the need to cast.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/tboot.c      | 6 +++---
 xen/crypto/vmac.c         | 2 +-
 xen/include/crypto/vmac.h | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/tboot.c b/xen/arch/x86/tboot.c
index 0b3d596690..5ae27f481f 100644
--- a/xen/arch/x86/tboot.c
+++ b/xen/arch/x86/tboot.c
@@ -202,7 +202,7 @@ static void tboot_gen_domain_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for_each_domain( d )
     {
         if ( !(d->options & XEN_DOMCTL_CDF_s3_integrity) )
@@ -241,7 +241,7 @@ static void tboot_gen_xenheap_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for ( mfn = 0; mfn < max_page; mfn++ )
     {
         struct page_info *page = mfn_to_page(_mfn(mfn));
@@ -272,7 +272,7 @@ static void tboot_gen_frametable_integrity(const uint8_t key[TB_KEY_SIZE],
     uint8_t nonce[16] = {};
     vmac_ctx_t ctx;
 
-    vmac_set_key((uint8_t *)key, &ctx);
+    vmac_set_key(key, &ctx);
     for ( sidx = 0; ; sidx = nidx )
     {
         eidx = find_next_zero_bit(pdx_group_valid, max_idx, sidx);
diff --git a/xen/crypto/vmac.c b/xen/crypto/vmac.c
index f1f6d75f8e..c9914d2c7c 100644
--- a/xen/crypto/vmac.c
+++ b/xen/crypto/vmac.c
@@ -924,7 +924,7 @@ uint64_t vmac(unsigned char m[],
 
 /* ----------------------------------------------------------------------- */
 
-void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx)
+void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx)
 {
     uint64_t in[2] = {0}, out[2];
     unsigned i;
diff --git a/xen/include/crypto/vmac.h b/xen/include/crypto/vmac.h
index 457f3f5dd6..7574c4a3f3 100644
--- a/xen/include/crypto/vmac.h
+++ b/xen/include/crypto/vmac.h
@@ -161,7 +161,7 @@ uint64_t vhash(unsigned char m[],
  * When passed a VMAC_KEY_LEN bit user_key, this function initialazies ctx.
  * ----------------------------------------------------------------------- */
 
-void vmac_set_key(unsigned char user_key[], vmac_ctx_t *ctx);
+void vmac_set_key(const unsigned char user_key[], vmac_ctx_t *ctx);
 
 /* --------------------------------------------------------------------- */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:12:04 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241024.1542253 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKIm-0000p2-6d; Wed, 25 Feb 2026 19:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241024.1542253; Wed, 25 Feb 2026 19:12: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 1vvKIm-0000ot-3y; Wed, 25 Feb 2026 19:12:04 +0000
Received: by outflank-mailman (input) for mailman id 1241024;
 Wed, 25 Feb 2026 19:12: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 1vvKIk-0000ol-Vj
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19:12: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 1vvKIk-009dlt-35
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKIk-0062eL-2z
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12: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=SaWj/LIU7gejdBZt+Pi8udtbcdMH3dISgHQFLz0FMNo=; b=NInqCI8pqE/VUd89P2O/kPOZa/
	T+AfjyNyaPcDgt0i0GuuB5nfHM8ZoO3x+4VGYOA7p4eTtLeovh14gbtyFpd6awv++lLY3h3Do/xaZ
	Wye8WiNv6iM00/IdakCXItZS+2gJW0DkHsZTMehFHzwxeYHiB6YFPLF57pKJ0iPEzdv0=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] arm/pci-designware: Fix MISRA violations
Message-Id: <E1vvKIk-0062eL-2z@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:12:02 +0000

commit 25bb2560ab08e80ce5dc5ace125a867b5377a6a1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 11:27:13 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    arm/pci-designware: Fix MISRA violations
    
     * Move includes inside the header guards (D4.10)
     * Use NULL in preference to 0 (R11.9)
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/pci/pci-designware.c | 2 +-
 xen/arch/arm/pci/pci-designware.h | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/pci/pci-designware.c b/xen/arch/arm/pci/pci-designware.c
index 0bd67524ac..6b85213f63 100644
--- a/xen/arch/arm/pci/pci-designware.c
+++ b/xen/arch/arm/pci/pci-designware.c
@@ -285,7 +285,7 @@ void __iomem *dw_pcie_child_map_bus(struct pci_host_bridge *bridge,
                                     bridge->child_cfg->phys_addr, busdev,
                                     bridge->child_cfg->size);
     if ( ret )
-        return 0;
+        return NULL;
 
     return bridge->child_cfg->win + where;
 }
diff --git a/xen/arch/arm/pci/pci-designware.h b/xen/arch/arm/pci/pci-designware.h
index b9deb3b138..bd93dab6f2 100644
--- a/xen/arch/arm/pci/pci-designware.h
+++ b/xen/arch/arm/pci/pci-designware.h
@@ -6,12 +6,11 @@
  * Based on xen/arch/arm/pci/pci-host-generic.c
  */
 
-#include <xen/pci.h>
-#include <xen/init.h>
-
 #ifndef __PCI_DESIGNWARE_H__
 #define __PCI_DESIGNWARE_H__
 
+#include <xen/pci.h>
+#include <xen/init.h>
 
 #define PCIE_ATU_VIEWPORT               0x900
 #define PCIE_ATU_REGION_OUTBOUND        0
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:12:14 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:12:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241025.1542258 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKIw-0000r8-7p; Wed, 25 Feb 2026 19:12:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241025.1542258; Wed, 25 Feb 2026 19:12: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 1vvKIw-0000r0-5H; Wed, 25 Feb 2026 19:12:14 +0000
Received: by outflank-mailman (input) for mailman id 1241025;
 Wed, 25 Feb 2026 19:12: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 1vvKIv-0000qu-27
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19:12: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 1vvKIv-009dly-07
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12:13 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKIv-0062en-01
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12: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=+dxzC+kQFg/5dVHD2siVVXIwtQkt/5vEkrV4sfDNVYM=; b=N/qUjKmXRNbIifOeKSWVkoprZM
	uL6erg8Qu438/nOVUyrjow+0pRfIg5CCw+PGlr0CRThwc9uUznihwKHztigoJPVdc+2Vx+38Pw96g
	f9ne2csx7T7i+dCgxvHjhPNaXbu77mOqah1ri/4MY89khsQAbr3rcT9eIHZLogPrKfys=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: Rework write_atomic() call in shadow_write_entries()
Message-Id: <E1vvKIv-0062en-01@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:12:13 +0000

commit 495d470d9fdce210529c0aba16ff469ae0fbe952
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat Jan 3 21:28:52 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    x86/shadow: Rework write_atomic() call in shadow_write_entries()
    
    ECLAIR reports an unevaluated side effect in a sizeof() expression (R13.6
    violation).
    
    write_atomic() does take care to evaluates each parameter only once, but
    expression is complicated to follow.  Rewrite it to less resemble an entry
    from an obfuscation contest.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/arch/x86/mm/shadow/set.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/set.c b/xen/arch/x86/mm/shadow/set.c
index 8f9690f0df..2d02e1434c 100644
--- a/xen/arch/x86/mm/shadow/set.c
+++ b/xen/arch/x86/mm/shadow/set.c
@@ -62,8 +62,8 @@ shadow_write_entries(void *d, const void *s, unsigned int entries, mfn_t mfn)
 
     ASSERT(IS_ALIGNED((unsigned long)dst, sizeof(*dst)));
 
-    for ( ; i < entries; i++ )
-        write_atomic(&dst++->l1, src++->l1);
+    for ( ; i < entries; i++, dst++, src++ )
+        write_atomic(&dst->l1, src->l1);
 
     unmap_domain_page(map);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Wed Feb 25 19:12:24 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Feb 2026 19:12:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241026.1542262 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvKJ6-0000tD-9j; Wed, 25 Feb 2026 19:12:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241026.1542262; Wed, 25 Feb 2026 19:12: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 1vvKJ6-0000t3-6Y; Wed, 25 Feb 2026 19:12:24 +0000
Received: by outflank-mailman (input) for mailman id 1241026;
 Wed, 25 Feb 2026 19:12: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 1vvKJ5-0000sq-7Y
 for xen-changelog@lists.xenproject.org; Wed, 25 Feb 2026 19:12: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 1vvKJ5-009dm2-0U
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12:23 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvKJ5-0062fM-0J
 for xen-changelog@lists.xenproject.org;
 Wed, 25 Feb 2026 19:12: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=gaBGlxW57Mp213636Xc4pqOx2kOphi1IpRaCPDoP3CU=; b=1/PZhKaH8APqPq6d/0MlV2/RkS
	CFMFnXIdZ9stQSdXQEHKJWyhv3RID0xE1KxpQmLXkLhrSVT3hG2svcgJvimdv9mtgV7aQ5TAB7zma
	sGFc1jcpqrKlZvQttyFSs6nNLgPAUKNmJYXnaQZRaEnhSABwVb6218CZtEMYUNr0JOvI=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] xen: Adjust break/fallthrough statements
Message-Id: <E1vvKJ5-0062fM-0J@xenbits.xenproject.org>
Date: Wed, 25 Feb 2026 19:12:23 +0000

commit 70c47ec5d65fa985ef7becd74b2d7b6d744b4c97
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri Feb 20 15:46:26 2026 +0000
Commit:     Andrew Cooper <andrew.cooper3@citrix.com>
CommitDate: Wed Feb 25 16:06:04 2026 +0000

    xen: Adjust break/fallthrough statements
    
    sh_destroy_shadow() has a spelling of fallthrough which doesn't match the
    permitted pattern.  Convert it to a real fallthrough (psedo)keyword.
    
    Elsewhere, insert breaks at the end of the default statements.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/pci/pci-access.c     | 2 ++
 xen/arch/arm/pci/pci-designware.c | 2 ++
 xen/arch/arm/tee/optee.c          | 1 +
 xen/arch/x86/mm/shadow/common.c   | 2 +-
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/pci/pci-access.c b/xen/arch/arm/pci/pci-access.c
index c0533c00c9..2b23d552bb 100644
--- a/xen/arch/arm/pci/pci-access.c
+++ b/xen/arch/arm/pci/pci-access.c
@@ -63,6 +63,7 @@ int pci_generic_config_read(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
@@ -89,6 +90,7 @@ int pci_generic_config_write(struct pci_host_bridge *bridge, pci_sbdf_t sbdf,
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
diff --git a/xen/arch/arm/pci/pci-designware.c b/xen/arch/arm/pci/pci-designware.c
index 6b85213f63..902da19e8c 100644
--- a/xen/arch/arm/pci/pci-designware.c
+++ b/xen/arch/arm/pci/pci-designware.c
@@ -48,6 +48,7 @@ static int dw_pcie_read(void __iomem *addr, unsigned int len, uint32_t *val)
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
@@ -71,6 +72,7 @@ static int dw_pcie_write(void __iomem *addr, unsigned int len, uint32_t val)
         break;
     default:
         ASSERT_UNREACHABLE();
+        break;
     }
 
     return 0;
diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c
index 699e8d5368..f719d9d767 100644
--- a/xen/arch/arm/tee/optee.c
+++ b/xen/arch/arm/tee/optee.c
@@ -1206,6 +1206,7 @@ static void do_call_with_arg(struct optee_domain *ctx,
     default:
         /* Free any temporary shared buffers */
         free_shm_buffers(ctx, call->xen_arg);
+        break;
     }
 
     put_std_call(ctx, call);
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index e07ba6d5a7..dd2d04d049 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1213,7 +1213,7 @@ void sh_destroy_shadow(struct domain *d, mfn_t smfn)
 #ifdef CONFIG_PV32
     case SH_type_l2h_64_shadow:
         ASSERT(is_pv_32bit_domain(d));
-        /* Fall through... */
+        fallthrough;
 #endif
     case SH_type_l2_64_shadow:
         SHADOW_INTERNAL_NAME(sh_destroy_l2_shadow, 4)(d, smfn);
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 13:44:07 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 13:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241796.1542704 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvbet-0006MA-Qh; Thu, 26 Feb 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 1241796.1542704; Thu, 26 Feb 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 1vvbet-0006M2-O2; Thu, 26 Feb 2026 13:44:03 +0000
Received: by outflank-mailman (input) for mailman id 1241796;
 Thu, 26 Feb 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 1vvbes-0006Lw-Dr
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 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 1vvbes-00BDRm-1D
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 13:44:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvbes-006zP4-0k
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 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=+uFUAFSJLIbELJMT74KMEdzcvrF6XSvlQqBgRA1aAYk=; b=2sFxwZaRpi28w83ap1/DlfIJ4I
	taMQPioo1zJO7AKThcNa0rLo0A/BoN94VekmBYjtgIfeg6tI09GDykyIioK6LmYPIE9Hk/jwPpEFj
	Lgro88Ct6iKJDMXpRQebMhcO32RT3gz6RViWaM1k8RrlVzKCVm1bkq2JNt+m2+U4sumM=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] libxl: constify some local variables for building with glibc 2.43
Message-Id: <E1vvbes-006zP4-0k@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 13:44:02 +0000

commit 44da0e3b4ff7fa15ad28b628f57412a05dae653c
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Thu Feb 26 13:31:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:31:48 2026 +0100

    libxl: constify some local variables for building with glibc 2.43
    
    Archlinux just updated glibc to 2.43+r5+g856c426a7534-1 and that
    causes libxl build failure:
    
        libxl_cpuid.c: In function ‘libxl_cpuid_parse_config_xend’:
        libxl_cpuid.c:447:16: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          447 |         endptr = strchr(str, '=');
              |                ^
        libxl_cpuid.c:452:16: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          452 |         endptr = strchr(str, ',');
              |                ^
        libxl_cpuid.c:454:20: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          454 |             endptr = strchr(str, 0);
              |                    ^
        cc1: all warnings being treated as errors
    
    Add missing consts. Note in libxl_cpuid_parse_config_xend() non-const
    endptr still is needed, to be compatible with the second argument to
    strtoul(). Add second variable for this reason.
    
    And while at it, move semicolon to its own line
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_cpuid.c    | 21 ++++++++++++---------
 tools/libs/light/libxl_internal.c |  2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 8420b2465f..14f08df33a 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -440,29 +440,32 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy,
     str = endptr + 1;
     entry = cpuid_find_match(policy, leaf, subleaf);
     for (str = endptr + 1; *str != 0;) {
+        const char *endptrc;
+
         if (str[0] != 'e' || str[2] != 'x') {
             return 4;
         }
         value = str[1] - 'a';
-        endptr = strchr(str, '=');
-        if (value > 3 || endptr == NULL) {
+        endptrc = strchr(str, '=');
+        if (value > 3 || endptrc == NULL) {
             return 4;
         }
-        str = endptr + 1;
-        endptr = strchr(str, ',');
-        if (endptr == NULL) {
-            endptr = strchr(str, 0);
+        str = endptrc + 1;
+        endptrc = strchr(str, ',');
+        if (endptrc == NULL) {
+            endptrc = strchr(str, 0);
         }
-        if (endptr - str != 32) {
+        if (endptrc - str != 32) {
             return 5;
         }
         entry->policy[value] = calloc(32 + 1, 1);
         strncpy(entry->policy[value], str, 32);
         entry->policy[value][32] = 0;
-        if (*endptr == 0) {
+        if (*endptrc == 0) {
             break;
         }
-        for (str = endptr + 1; *str == ' ' || *str == '\n'; str++);
+        for (str = endptrc + 1; *str == ' ' || *str == '\n'; str++)
+            ;
     }
     return 0;
 }
diff --git a/tools/libs/light/libxl_internal.c b/tools/libs/light/libxl_internal.c
index 2941ca0bbd..d70cfed7d8 100644
--- a/tools/libs/light/libxl_internal.c
+++ b/tools/libs/light/libxl_internal.c
@@ -204,7 +204,7 @@ char *libxl__strndup(libxl__gc *gc, const char *c, size_t n)
 
 char *libxl__dirname(libxl__gc *gc, const char *s)
 {
-    char *c = strrchr(s, '/');
+    const char *c = strrchr(s, '/');
 
     if (!c)
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 13:44:13 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 13:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241797.1542708 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvbf3-0006ON-S7; Thu, 26 Feb 2026 13:44:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241797.1542708; Thu, 26 Feb 2026 13: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 1vvbf3-0006OF-PR; Thu, 26 Feb 2026 13:44:13 +0000
Received: by outflank-mailman (input) for mailman id 1241797;
 Thu, 26 Feb 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 1vvbf2-0006Nt-Fz
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 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 1vvbf2-00BDRq-1V
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 13:44:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvbf2-006zQc-1O
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 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=5eAOAY6A/CsMrVdwUPRsJZoz/dXGqg4SBb8D41Pnhns=; b=zWOwacYD4ETwNp1+wIYKUrxuHs
	0Gz5L7f/wIiXhJaJxALk6yAN7o8M9ytv5wSqSqqWqo5pmImQaQDbaN38fYz8FaZEN03EzR34+YmkH
	PufGl+YGxOHduy7tAj6Bo/6nfGNi4h0zMTZtSpqJ5niplSGp6C7PskV9kInCy45nOYlo=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86: Remove x86 prefixed names from cpuinfo for amd.c
Message-Id: <E1vvbf2-006zQc-1O@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 13:44:12 +0000

commit 481d31a679ab80cc5a993e56505ca0dec9bb4592
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Thu Feb 26 13:32:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:32:28 2026 +0100

    x86: Remove x86 prefixed names from cpuinfo for amd.c
    
    And some AMD related code in emul-priv-op.c.
    
    struct cpuinfo_x86
      .x86        => .family
      .x86_vendor => .vendor
      .x86_model  => .model
      .x86_mask   => .stepping
    
    No functional change.
    
    This work is part of making Xen safe for Intel family 18/19.
    
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/amd.c         | 74 +++++++++++++++++++++---------------------
 xen/arch/x86/pv/emul-priv-op.c | 30 ++++++++---------
 2 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fc496dc43e..2b7f60aa30 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -134,7 +134,7 @@ static void __init noinline probe_masking_msrs(void)
 		cpuidmask_defaults._7ab0 =
 			_probe_mask_msr(MSR_AMD_L7S0_FEATURE_MASK, LCAP_7ab0);
 
-	if (c->x86 == 0x15 && c->cpuid_level >= 6 && cpuid_ecx(6))
+	if (c->family == 0x15 && c->cpuid_level >= 6 && cpuid_ecx(6))
 		cpuidmask_defaults._6c =
 			_probe_mask_msr(MSR_AMD_THRM_FEATURE_MASK, LCAP_6c);
 
@@ -151,7 +151,7 @@ static void __init noinline probe_masking_msrs(void)
 	       expected_levelling_cap, levelling_caps,
 	       (expected_levelling_cap ^ levelling_caps) & levelling_caps);
 	printk(XENLOG_WARNING "Fam %#x, model %#x level %#x\n",
-	       c->x86, c->x86_model, c->cpuid_level);
+	       c->family, c->model, c->cpuid_level);
 	printk(XENLOG_WARNING
 	       "If not running virtualised, please report a bug\n");
 }
@@ -327,7 +327,7 @@ int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)
 	u32 range;
 	u32 ms;
 	
-	if (cpu->x86_vendor != X86_VENDOR_AMD)
+	if (cpu->vendor != X86_VENDOR_AMD)
 		return 0;
 
 	if (osvw_id >= 0 && cpu_has(cpu, X86_FEATURE_OSVW)) {
@@ -348,9 +348,9 @@ int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)
 	/* OSVW unavailable or ID unknown, match family-model-stepping range */
 	va_start(ap, osvw_id);
 
-	ms = (cpu->x86_model << 4) | cpu->x86_mask;
+	ms = (cpu->model << 4) | cpu->stepping;
 	while ((range = va_arg(ap, int))) {
-		if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
+		if ((cpu->family == AMD_MODEL_RANGE_FAMILY(range)) &&
 		    (ms >= AMD_MODEL_RANGE_START(range)) &&
 		    (ms <= AMD_MODEL_RANGE_END(range))) {
 			va_end(ap);
@@ -418,8 +418,8 @@ static void check_syscfg_dram_mod_en(void)
 {
 	uint64_t syscfg;
 
-	if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
-		(boot_cpu_data.x86 >= 0x0f)))
+	if (!((boot_cpu_data.vendor == X86_VENDOR_AMD) &&
+		(boot_cpu_data.family >= 0x0f)))
 		return;
 
 	rdmsrl(MSR_K8_SYSCFG, syscfg);
@@ -462,7 +462,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
                 cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
                 c->x86_num_siblings = ((ebx >> 8) & 0xff) + 1;
 
-                if (c->x86 < 0x17)
+                if (c->family < 0x17)
                         c->compute_unit_id = ebx & 0xFF;
                 else {
                         c->cpu_core_id = ebx & 0xFF;
@@ -520,10 +520,10 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	unsigned int idx = 0, h;
 	uint64_t hi, lo, val;
 
-	if (c->x86 < 0x10 || c->x86 > 0x1A)
+	if (c->family < 0x10 || c->family > 0x1A)
 		return;
 
-	if (c->x86 < 0x17) {
+	if (c->family < 0x17) {
 		unsigned int node = 0;
 		uint64_t nbcfg;
 
@@ -573,7 +573,7 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 				 * accounted for in order to correctly fetch the
 				 * nominal frequency of the processor.
 				 */
-				switch (c->x86) {
+				switch (c->family) {
 				case 0x10: idx = 1; break;
 				case 0x12: idx = 7; break;
 				case 0x14: idx = 7; break;
@@ -593,7 +593,7 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	}
 
 	lo = 0; /* gcc may not recognize the loop having at least 5 iterations */
-	for (h = c->x86 == 0x10 ? 5 : 8; h--; )
+	for (h = c->family == 0x10 ? 5 : 8; h--; )
 		if (!rdmsr_safe(0xC0010064 + h, &lo) && (lo >> 63))
 			break;
 	if (!(lo >> 63))
@@ -603,18 +603,18 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	    !rdmsr_safe(0xC0010064 + idx, &val) && (val >> 63) &&
 	    !rdmsr_safe(0xC0010064, &hi) && (hi >> 63)) {
 		if (nom_mhz)
-			*nom_mhz = amd_parse_freq(c->x86, val);
+			*nom_mhz = amd_parse_freq(c->family, val);
 		if (low_mhz)
-			*low_mhz = amd_parse_freq(c->x86, lo);
+			*low_mhz = amd_parse_freq(c->family, lo);
 		if (hi_mhz)
-			*hi_mhz = amd_parse_freq(c->x86, hi);
+			*hi_mhz = amd_parse_freq(c->family, hi);
 	} else if (h && !rdmsr_safe(0xC0010064, &hi) && (hi >> 63)) {
 		if (low_mhz)
-			*low_mhz = amd_parse_freq(c->x86, lo);
+			*low_mhz = amd_parse_freq(c->family, lo);
 		if (hi_mhz)
-			*hi_mhz = amd_parse_freq(c->x86, hi);
+			*hi_mhz = amd_parse_freq(c->family, hi);
 	} else if (low_mhz)
-		*low_mhz = amd_parse_freq(c->x86, lo);
+		*low_mhz = amd_parse_freq(c->family, lo);
 }
 
 void cf_check early_init_amd(struct cpuinfo_x86 *c)
@@ -654,7 +654,7 @@ static bool set_legacy_ssbd(const struct cpuinfo_x86 *c, bool enable)
 {
 	int bit = -1;
 
-	switch (c->x86) {
+	switch (c->family) {
 	case 0x15: bit = 54; break;
 	case 0x16: bit = 33; break;
 	case 0x17:
@@ -716,7 +716,7 @@ bool __init amd_setup_legacy_ssbd(void)
 {
 	unsigned int i;
 
-	if ((boot_cpu_data.x86 != 0x17 && boot_cpu_data.x86 != 0x18) ||
+	if ((boot_cpu_data.family != 0x17 && boot_cpu_data.family != 0x18) ||
 	    boot_cpu_data.x86_num_siblings <= 1 || opt_ssbd)
 		return true;
 
@@ -763,7 +763,7 @@ static void core_set_legacy_ssbd(bool enable)
 
 	BUG_ON(this_cpu(legacy_ssbd) == enable);
 
-	if ((c->x86 != 0x17 && c->x86 != 0x18) || c->x86_num_siblings <= 1) {
+	if ((c->family != 0x17 && c->family != 0x18) || c->x86_num_siblings <= 1) {
 		BUG_ON(!set_legacy_ssbd(c, enable));
 		return;
 	}
@@ -982,7 +982,7 @@ static void amd_check_bp_cfg(void)
 	/*
 	 * AMD Erratum #1485.  Set bit 5, as instructed.
 	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+	if (!cpu_has_hypervisor && boot_cpu_data.family == 0x19 && is_zen4_uarch())
 		new |= (1 << 5);
 
 	/*
@@ -1029,13 +1029,13 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * Errata 63 for SH-B3 steppings
 	 * Errata 122 for all steppings (F+ have it disabled by default)
 	 */
-	if (c->x86 == 15) {
+	if (c->family == 15) {
 		rdmsrl(MSR_K8_HWCR, value);
 		value |= 1 << 6;
 		wrmsrl(MSR_K8_HWCR, value);
 	}
 
-	if (c->x86 == 0xf && c->x86_model < 0x14
+	if (c->family == 0xf && c->model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
 		/*
 		 * Some BIOSes incorrectly force this feature, but only K8
@@ -1056,12 +1056,12 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	amd_init_ssbd(c);
 
-	if (c->x86 == 0x17)
+	if (c->family == 0x17)
 		amd_init_spectral_chicken();
 
 	/* Probe for NSCB on Zen2 CPUs when not virtualised */
 	if (!cpu_has_hypervisor && !cpu_has_nscb && c == &boot_cpu_data &&
-	    c->x86 == 0x17)
+	    c->family == 0x17)
 		detect_zen2_null_seg_behaviour();
 
 	/*
@@ -1083,7 +1083,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	if (c == &boot_cpu_data && !cpu_has_clflushopt)
 		setup_force_cpu_cap(X86_BUG_CLFLUSH_MFENCE);
 
-	switch(c->x86)
+	switch(c->family)
 	{
 	case 0xf ... 0x11:
 		disable_c1e(NULL);
@@ -1133,15 +1133,15 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		if (cpu_has(c, X86_FEATURE_ITSC)) {
 			__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 			__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
-			if (c->x86 != 0x11)
+			if (c->family != 0x11)
 				__set_bit(X86_FEATURE_TSC_RELIABLE,
 					  c->x86_capability);
 		}
 	}
 
 	/* re-enable TopologyExtensions if switched off by BIOS */
-	if ((c->x86 == 0x15) &&
-	    (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) &&
+	if ((c->family == 0x15) &&
+	    (c->model >= 0x10) && (c->model <= 0x1f) &&
 	    !cpu_has(c, X86_FEATURE_TOPOEXT) &&
 	    !rdmsr_safe(MSR_K8_EXT_FEATURE_MASK, &value)) {
 		value |= 1ULL << 54;
@@ -1158,14 +1158,14 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * The way access filter has a performance penalty on some workloads.
 	 * Disable it on the affected CPUs.
 	 */
-	if (c->x86 == 0x15 && c->x86_model >= 0x02 && c->x86_model < 0x20 &&
+	if (c->family == 0x15 && c->model >= 0x02 && c->model < 0x20 &&
 	    !rdmsr_safe(MSR_AMD64_IC_CFG, &value) && (value & 0x1e) != 0x1e)
 		wrmsr_safe(MSR_AMD64_IC_CFG, value | 0x1e);
 
         amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
-	if (c->x86 == 0x10)
+	if (c->family == 0x10)
 		__clear_bit(X86_FEATURE_MONITOR, c->x86_capability);
 
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
@@ -1182,7 +1182,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
-	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+	if (c->family == 0x16 && c->model <= 0xf) {
 		if (c == &boot_cpu_data) {
 			l = pci_conf_read32(PCI_SBDF(0, 0, 0x18, 3), 0x58);
 			h = pci_conf_read32(PCI_SBDF(0, 0, 0x18, 3), 0x5c);
@@ -1215,7 +1215,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
-	if (c->x86 == 0x10) {
+	if (c->family == 0x10) {
 		/* do this for boot cpu */
 		if (c == &boot_cpu_data)
 			check_enable_amd_mmconf_dmi();
@@ -1238,14 +1238,14 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * Family 0x12 and above processors have APIC timer
 	 * running in deep C states.
 	 */
-	if ( opt_arat && c->x86 > 0x11 )
+	if ( opt_arat && c->family > 0x11 )
 		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
 	 * We have to reset them manually.
 	 */
-	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->family < 0x14) {
 		wrmsrl(MSR_K7_PERFCTR0, 0);
 		wrmsrl(MSR_K7_PERFCTR1, 0);
 		wrmsrl(MSR_K7_PERFCTR2, 0);
@@ -1290,7 +1290,7 @@ static int __init cf_check amd_check_erratum_1474(void)
 	s_time_t delta;
 
 	if (cpu_has_hypervisor ||
-	    (boot_cpu_data.x86 != 0x17 && boot_cpu_data.x86 != 0x18))
+	    (boot_cpu_data.family != 0x17 && boot_cpu_data.family != 0x18))
 		return 0;
 
 	/*
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index a3c1fd1262..fba1e25c31 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -245,8 +245,8 @@ static bool pci_cfg_ok(struct domain *currd, unsigned int start,
     start |= CF8_ADDR_LO(currd->arch.pci_cf8);
     /* AMD extended configuration space access? */
     if ( CF8_ADDR_HI(currd->arch.pci_cf8) &&
-         boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
-         boot_cpu_data.x86 >= 0x10 && boot_cpu_data.x86 < 0x17 )
+         boot_cpu_data.vendor == X86_VENDOR_AMD &&
+         boot_cpu_data.family >= 0x10 && boot_cpu_data.family < 0x17 )
     {
         uint64_t msr_val;
 
@@ -870,7 +870,7 @@ static uint64_t guest_efer(const struct domain *d)
      */
     if ( is_pv_32bit_domain(d) )
         val &= ~(EFER_LME | EFER_LMA |
-                 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL
+                 (boot_cpu_data.vendor == X86_VENDOR_INTEL
                   ? EFER_SCE : 0));
     return val;
 }
@@ -959,7 +959,7 @@ static int cf_check read_msr(
     case MSR_K8_PSTATE5:
     case MSR_K8_PSTATE6:
     case MSR_K8_PSTATE7:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD )
             break;
         if ( unlikely(is_cpufreq_controller(currd)) )
             goto normal;
@@ -967,8 +967,8 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_FAM10H_MMIO_CONF_BASE:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
-             boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 >= 0x17 )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+             boot_cpu_data.family < 0x10 || boot_cpu_data.family >= 0x17 )
             break;
         /* fall through */
     case MSR_AMD64_NB_CFG:
@@ -992,13 +992,13 @@ static int cf_check read_msr(
     case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
     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.x86_vendor == X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
         {
             vpmu_msr = true;
             /* fall through */
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.x86_vendor &
+            if ( vpmu_msr || (boot_cpu_data.vendor &
                               (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             {
                 if ( vpmu_do_rdmsr(reg, val) )
@@ -1101,7 +1101,7 @@ static int cf_check write_msr(
     case MSR_K8_PSTATE6:
     case MSR_K8_PSTATE7:
     case MSR_K8_HWCR:
-        if ( !(boot_cpu_data.x86_vendor &
+        if ( !(boot_cpu_data.vendor &
                (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             break;
         if ( likely(!is_cpufreq_controller(currd)) ||
@@ -1120,8 +1120,8 @@ static int cf_check write_msr(
         break;
 
     case MSR_FAM10H_MMIO_CONF_BASE:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
-             boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 >= 0x17 )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+             boot_cpu_data.family < 0x10 || boot_cpu_data.family >= 0x17 )
             break;
         if ( !is_hwdom_pinned_vcpu(curr) )
             return X86EMUL_OKAY;
@@ -1149,7 +1149,7 @@ static int cf_check write_msr(
 
     case MSR_IA32_MPERF:
     case MSR_IA32_APERF:
-        if ( !(boot_cpu_data.x86_vendor &
+        if ( !(boot_cpu_data.vendor &
                (X86_VENDOR_INTEL | X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             break;
         if ( likely(!is_cpufreq_controller(currd)) ||
@@ -1159,7 +1159,7 @@ static int cf_check write_msr(
 
     case MSR_IA32_THERM_CONTROL:
     case MSR_IA32_ENERGY_PERF_BIAS:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor != X86_VENDOR_INTEL )
             break;
         if ( !is_hwdom_pinned_vcpu(curr) || wrmsr_safe(reg, val) == 0 )
             return X86EMUL_OKAY;
@@ -1169,12 +1169,12 @@ static int cf_check write_msr(
     case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
     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.x86_vendor == X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
         {
             vpmu_msr = true;
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.x86_vendor &
+            if ( vpmu_msr || (boot_cpu_data.vendor &
                               (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             {
                 if ( (vpmu_mode & XENPMU_MODE_ALL) &&
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 13:44:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 13:44:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241798.1542712 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvbfD-0006S8-Tp; Thu, 26 Feb 2026 13:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241798.1542712; Thu, 26 Feb 2026 13: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 1vvbfD-0006Ry-Qu; Thu, 26 Feb 2026 13:44:23 +0000
Received: by outflank-mailman (input) for mailman id 1241798;
 Thu, 26 Feb 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 1vvbfC-0006Rp-J4
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 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 1vvbfC-00BDRx-1o
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 13:44:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvbfC-006zSH-1g
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 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=LhIxOop0Vvni2jFe18JWDazQTA/ncpn7cuiPA+3XX3Y=; b=1HPJoLiD5LwQc+5IsHtKqQ5p+m
	vmuaLnAuEV/kpOGDDNRrYc5g9LIZcAFkld0x+OBibjvABK++LqOywGNL30b7H4OSLjDRZ6/J3L8T+
	9wFmTyfqLbjCr38Rjp/Q6yDfyVbr/pRsNLlDiY60eJ3HMuRtGQDg8Cl11y3JZpeQmZ3k=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen staging] x86/shadow: don't use #if in unlikely() invocation
Message-Id: <E1vvbfC-006zSH-1g@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 13:44:22 +0000

commit 79a53b6f6ec79b9beefb912d5d38c9fdc420885b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 26 13:33:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:33:36 2026 +0100

    x86/shadow: don't use #if in unlikely() invocation
    
    As per the standard this is UB, i.e. we're building on an extension in
    the compilers we use (for gcc, see "The C Preprocessor" section
    "Directives Within Macro Arguments"). Misra C:2012 rule 20.6 disallows
    this altogether, though.
    
    Combine the fix with some tidying: Fold the two level-1 checks, adjust in
    particular comment style, and move the unlikely() use to a single inner
    part of the conditional.
    
    No functional change intended.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 55 +++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 593532defc..f95da9ffd2 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -634,35 +634,36 @@ _sh_propagate(struct vcpu *v,
         sflags |= _PAGE_UC;
     }
 
-    // protect guest page tables
-    //
-    if ( unlikely((level == 1)
-                  && sh_mfn_is_a_page_table(target_mfn)
-#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC )
-                  /* Unless the page is out of sync and the guest is
-                     writing to it. */
-                  && !(mfn_oos_may_write(target_mfn)
-                       && (ft == ft_demand_write))
-#endif /* OOS */
-                  ) )
-        sflags &= ~_PAGE_RW;
-
-    /*
-     * shadow_mode_log_dirty support
-     *
-     * Only allow the guest write access to a page a) on a demand fault,
-     * or b) if the page is already marked as dirty.
-     *
-     * (We handle log-dirty entirely inside the shadow code, without using the
-     * p2m_ram_logdirty p2m type: only HAP uses that.)
-     */
-    if ( level == 1 && unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
+    if ( level == 1 )
     {
-        if ( ft & FETCH_TYPE_WRITE )
-            paging_mark_dirty(d, target_mfn);
-        else if ( (sflags & _PAGE_RW) &&
-                  !paging_mfn_is_dirty(d, target_mfn) )
+        /* Protect guest page tables. */
+        if ( unlikely(sh_mfn_is_a_page_table(target_mfn))
+#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
+             /*
+              * Unless the page is out of sync and the guest is writing to it.
+              */
+             && (ft != ft_demand_write || !mfn_oos_may_write(target_mfn))
+#endif /* OOS */
+           )
             sflags &= ~_PAGE_RW;
+
+        /*
+         * shadow_mode_log_dirty support
+         *
+         * Only allow the guest write access to a page a) on a demand fault,
+         * or b) if the page is already marked as dirty.
+         *
+         * (We handle log-dirty entirely inside the shadow code, without using
+         * the p2m_ram_logdirty p2m type: only HAP uses that.)
+         */
+        if ( unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
+        {
+            if ( ft & FETCH_TYPE_WRITE )
+                paging_mark_dirty(d, target_mfn);
+            else if ( (sflags & _PAGE_RW) &&
+                      !paging_mfn_is_dirty(d, target_mfn) )
+                sflags &= ~_PAGE_RW;
+        }
     }
 
     // PV guests in 64-bit mode use two different page tables for user vs
--
generated by git-patchbot for /home/xen/git/xen.git#staging


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 14:55:06 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 14:55:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241992.1542777 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvcla-0000zR-Ru; Thu, 26 Feb 2026 14:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241992.1542777; Thu, 26 Feb 2026 14: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 1vvcla-0000zJ-Oh; Thu, 26 Feb 2026 14:55:02 +0000
Received: by outflank-mailman (input) for mailman id 1241992;
 Thu, 26 Feb 2026 14: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 1vvcla-0000zD-4Y
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 2026 14: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 1vvcla-00BEqJ-0J
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14:55:02 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvcla-0073DU-09
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14: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=N+284a+jUceKZ/0A6q1T3bm6Ii0dtMRTynRoksu0dns=; b=JyIA0Jqpw3NalnT6oeA3Gu01fq
	CGHfVkvYN9Ouqxlftxsn2n5vpvmETPxASbnE0azTz5CgpLXMNehvo4GWLGAznf+dEGkIciqTvPIhf
	wRX48BJaZYsNk0Ysiqe/J4l5f22YmbALUyUZNcGPgLdWuIwrhHmExJUuOMi9cAp0NaWQ=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] libxl: constify some local variables for building with glibc 2.43
Message-Id: <E1vvcla-0073DU-09@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 14:55:02 +0000

commit 44da0e3b4ff7fa15ad28b628f57412a05dae653c
Author:     Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
AuthorDate: Thu Feb 26 13:31:48 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:31:48 2026 +0100

    libxl: constify some local variables for building with glibc 2.43
    
    Archlinux just updated glibc to 2.43+r5+g856c426a7534-1 and that
    causes libxl build failure:
    
        libxl_cpuid.c: In function ‘libxl_cpuid_parse_config_xend’:
        libxl_cpuid.c:447:16: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          447 |         endptr = strchr(str, '=');
              |                ^
        libxl_cpuid.c:452:16: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          452 |         endptr = strchr(str, ',');
              |                ^
        libxl_cpuid.c:454:20: error: assignment discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
          454 |             endptr = strchr(str, 0);
              |                    ^
        cc1: all warnings being treated as errors
    
    Add missing consts. Note in libxl_cpuid_parse_config_xend() non-const
    endptr still is needed, to be compatible with the second argument to
    strtoul(). Add second variable for this reason.
    
    And while at it, move semicolon to its own line
    
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_cpuid.c    | 21 ++++++++++++---------
 tools/libs/light/libxl_internal.c |  2 +-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c
index 8420b2465f..14f08df33a 100644
--- a/tools/libs/light/libxl_cpuid.c
+++ b/tools/libs/light/libxl_cpuid.c
@@ -440,29 +440,32 @@ int libxl_cpuid_parse_config_xend(libxl_cpuid_policy_list *policy,
     str = endptr + 1;
     entry = cpuid_find_match(policy, leaf, subleaf);
     for (str = endptr + 1; *str != 0;) {
+        const char *endptrc;
+
         if (str[0] != 'e' || str[2] != 'x') {
             return 4;
         }
         value = str[1] - 'a';
-        endptr = strchr(str, '=');
-        if (value > 3 || endptr == NULL) {
+        endptrc = strchr(str, '=');
+        if (value > 3 || endptrc == NULL) {
             return 4;
         }
-        str = endptr + 1;
-        endptr = strchr(str, ',');
-        if (endptr == NULL) {
-            endptr = strchr(str, 0);
+        str = endptrc + 1;
+        endptrc = strchr(str, ',');
+        if (endptrc == NULL) {
+            endptrc = strchr(str, 0);
         }
-        if (endptr - str != 32) {
+        if (endptrc - str != 32) {
             return 5;
         }
         entry->policy[value] = calloc(32 + 1, 1);
         strncpy(entry->policy[value], str, 32);
         entry->policy[value][32] = 0;
-        if (*endptr == 0) {
+        if (*endptrc == 0) {
             break;
         }
-        for (str = endptr + 1; *str == ' ' || *str == '\n'; str++);
+        for (str = endptrc + 1; *str == ' ' || *str == '\n'; str++)
+            ;
     }
     return 0;
 }
diff --git a/tools/libs/light/libxl_internal.c b/tools/libs/light/libxl_internal.c
index 2941ca0bbd..d70cfed7d8 100644
--- a/tools/libs/light/libxl_internal.c
+++ b/tools/libs/light/libxl_internal.c
@@ -204,7 +204,7 @@ char *libxl__strndup(libxl__gc *gc, const char *c, size_t n)
 
 char *libxl__dirname(libxl__gc *gc, const char *s)
 {
-    char *c = strrchr(s, '/');
+    const char *c = strrchr(s, '/');
 
     if (!c)
         return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 14:55:12 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 14:55:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241993.1542780 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvclk-000128-Uf; Thu, 26 Feb 2026 14:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241993.1542780; Thu, 26 Feb 2026 14: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 1vvclk-000120-SA; Thu, 26 Feb 2026 14:55:12 +0000
Received: by outflank-mailman (input) for mailman id 1241993;
 Thu, 26 Feb 2026 14: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 1vvclk-00011s-9l
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 2026 14: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 1vvclk-00BEqN-0h
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14:55:12 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvclk-0073Dq-0U
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14: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=9s6O+6CZjV0mB1IjNBMUUG801V047egJyb4z3yHM1as=; b=vvEgli6obybANfUsGvMATUdvyN
	jXp+Y/Vdnz7Jn/K6mXNmvRBywo8pcqDkEi+w5r5kkzbUfD28ief4WnJLXOtyxLjzw/wpLSdMMMcMF
	rN7IGlZ5KqdKr9CncyM6fmmqxdpk4t7ICuUD0D0esw7USxa6Fk3sBbqbJ3twUKFv/eHw=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86: Remove x86 prefixed names from cpuinfo for amd.c
Message-Id: <E1vvclk-0073Dq-0U@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 14:55:12 +0000

commit 481d31a679ab80cc5a993e56505ca0dec9bb4592
Author:     Kevin Lampis <kevin.lampis@citrix.com>
AuthorDate: Thu Feb 26 13:32:28 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:32:28 2026 +0100

    x86: Remove x86 prefixed names from cpuinfo for amd.c
    
    And some AMD related code in emul-priv-op.c.
    
    struct cpuinfo_x86
      .x86        => .family
      .x86_vendor => .vendor
      .x86_model  => .model
      .x86_mask   => .stepping
    
    No functional change.
    
    This work is part of making Xen safe for Intel family 18/19.
    
    Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/cpu/amd.c         | 74 +++++++++++++++++++++---------------------
 xen/arch/x86/pv/emul-priv-op.c | 30 ++++++++---------
 2 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index fc496dc43e..2b7f60aa30 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -134,7 +134,7 @@ static void __init noinline probe_masking_msrs(void)
 		cpuidmask_defaults._7ab0 =
 			_probe_mask_msr(MSR_AMD_L7S0_FEATURE_MASK, LCAP_7ab0);
 
-	if (c->x86 == 0x15 && c->cpuid_level >= 6 && cpuid_ecx(6))
+	if (c->family == 0x15 && c->cpuid_level >= 6 && cpuid_ecx(6))
 		cpuidmask_defaults._6c =
 			_probe_mask_msr(MSR_AMD_THRM_FEATURE_MASK, LCAP_6c);
 
@@ -151,7 +151,7 @@ static void __init noinline probe_masking_msrs(void)
 	       expected_levelling_cap, levelling_caps,
 	       (expected_levelling_cap ^ levelling_caps) & levelling_caps);
 	printk(XENLOG_WARNING "Fam %#x, model %#x level %#x\n",
-	       c->x86, c->x86_model, c->cpuid_level);
+	       c->family, c->model, c->cpuid_level);
 	printk(XENLOG_WARNING
 	       "If not running virtualised, please report a bug\n");
 }
@@ -327,7 +327,7 @@ int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)
 	u32 range;
 	u32 ms;
 	
-	if (cpu->x86_vendor != X86_VENDOR_AMD)
+	if (cpu->vendor != X86_VENDOR_AMD)
 		return 0;
 
 	if (osvw_id >= 0 && cpu_has(cpu, X86_FEATURE_OSVW)) {
@@ -348,9 +348,9 @@ int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)
 	/* OSVW unavailable or ID unknown, match family-model-stepping range */
 	va_start(ap, osvw_id);
 
-	ms = (cpu->x86_model << 4) | cpu->x86_mask;
+	ms = (cpu->model << 4) | cpu->stepping;
 	while ((range = va_arg(ap, int))) {
-		if ((cpu->x86 == AMD_MODEL_RANGE_FAMILY(range)) &&
+		if ((cpu->family == AMD_MODEL_RANGE_FAMILY(range)) &&
 		    (ms >= AMD_MODEL_RANGE_START(range)) &&
 		    (ms <= AMD_MODEL_RANGE_END(range))) {
 			va_end(ap);
@@ -418,8 +418,8 @@ static void check_syscfg_dram_mod_en(void)
 {
 	uint64_t syscfg;
 
-	if (!((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
-		(boot_cpu_data.x86 >= 0x0f)))
+	if (!((boot_cpu_data.vendor == X86_VENDOR_AMD) &&
+		(boot_cpu_data.family >= 0x0f)))
 		return;
 
 	rdmsrl(MSR_K8_SYSCFG, syscfg);
@@ -462,7 +462,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
                 cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
                 c->x86_num_siblings = ((ebx >> 8) & 0xff) + 1;
 
-                if (c->x86 < 0x17)
+                if (c->family < 0x17)
                         c->compute_unit_id = ebx & 0xFF;
                 else {
                         c->cpu_core_id = ebx & 0xFF;
@@ -520,10 +520,10 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	unsigned int idx = 0, h;
 	uint64_t hi, lo, val;
 
-	if (c->x86 < 0x10 || c->x86 > 0x1A)
+	if (c->family < 0x10 || c->family > 0x1A)
 		return;
 
-	if (c->x86 < 0x17) {
+	if (c->family < 0x17) {
 		unsigned int node = 0;
 		uint64_t nbcfg;
 
@@ -573,7 +573,7 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 				 * accounted for in order to correctly fetch the
 				 * nominal frequency of the processor.
 				 */
-				switch (c->x86) {
+				switch (c->family) {
 				case 0x10: idx = 1; break;
 				case 0x12: idx = 7; break;
 				case 0x14: idx = 7; break;
@@ -593,7 +593,7 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	}
 
 	lo = 0; /* gcc may not recognize the loop having at least 5 iterations */
-	for (h = c->x86 == 0x10 ? 5 : 8; h--; )
+	for (h = c->family == 0x10 ? 5 : 8; h--; )
 		if (!rdmsr_safe(0xC0010064 + h, &lo) && (lo >> 63))
 			break;
 	if (!(lo >> 63))
@@ -603,18 +603,18 @@ void amd_process_freq(const struct cpuinfo_x86 *c,
 	    !rdmsr_safe(0xC0010064 + idx, &val) && (val >> 63) &&
 	    !rdmsr_safe(0xC0010064, &hi) && (hi >> 63)) {
 		if (nom_mhz)
-			*nom_mhz = amd_parse_freq(c->x86, val);
+			*nom_mhz = amd_parse_freq(c->family, val);
 		if (low_mhz)
-			*low_mhz = amd_parse_freq(c->x86, lo);
+			*low_mhz = amd_parse_freq(c->family, lo);
 		if (hi_mhz)
-			*hi_mhz = amd_parse_freq(c->x86, hi);
+			*hi_mhz = amd_parse_freq(c->family, hi);
 	} else if (h && !rdmsr_safe(0xC0010064, &hi) && (hi >> 63)) {
 		if (low_mhz)
-			*low_mhz = amd_parse_freq(c->x86, lo);
+			*low_mhz = amd_parse_freq(c->family, lo);
 		if (hi_mhz)
-			*hi_mhz = amd_parse_freq(c->x86, hi);
+			*hi_mhz = amd_parse_freq(c->family, hi);
 	} else if (low_mhz)
-		*low_mhz = amd_parse_freq(c->x86, lo);
+		*low_mhz = amd_parse_freq(c->family, lo);
 }
 
 void cf_check early_init_amd(struct cpuinfo_x86 *c)
@@ -654,7 +654,7 @@ static bool set_legacy_ssbd(const struct cpuinfo_x86 *c, bool enable)
 {
 	int bit = -1;
 
-	switch (c->x86) {
+	switch (c->family) {
 	case 0x15: bit = 54; break;
 	case 0x16: bit = 33; break;
 	case 0x17:
@@ -716,7 +716,7 @@ bool __init amd_setup_legacy_ssbd(void)
 {
 	unsigned int i;
 
-	if ((boot_cpu_data.x86 != 0x17 && boot_cpu_data.x86 != 0x18) ||
+	if ((boot_cpu_data.family != 0x17 && boot_cpu_data.family != 0x18) ||
 	    boot_cpu_data.x86_num_siblings <= 1 || opt_ssbd)
 		return true;
 
@@ -763,7 +763,7 @@ static void core_set_legacy_ssbd(bool enable)
 
 	BUG_ON(this_cpu(legacy_ssbd) == enable);
 
-	if ((c->x86 != 0x17 && c->x86 != 0x18) || c->x86_num_siblings <= 1) {
+	if ((c->family != 0x17 && c->family != 0x18) || c->x86_num_siblings <= 1) {
 		BUG_ON(!set_legacy_ssbd(c, enable));
 		return;
 	}
@@ -982,7 +982,7 @@ static void amd_check_bp_cfg(void)
 	/*
 	 * AMD Erratum #1485.  Set bit 5, as instructed.
 	 */
-	if (!cpu_has_hypervisor && boot_cpu_data.x86 == 0x19 && is_zen4_uarch())
+	if (!cpu_has_hypervisor && boot_cpu_data.family == 0x19 && is_zen4_uarch())
 		new |= (1 << 5);
 
 	/*
@@ -1029,13 +1029,13 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * Errata 63 for SH-B3 steppings
 	 * Errata 122 for all steppings (F+ have it disabled by default)
 	 */
-	if (c->x86 == 15) {
+	if (c->family == 15) {
 		rdmsrl(MSR_K8_HWCR, value);
 		value |= 1 << 6;
 		wrmsrl(MSR_K8_HWCR, value);
 	}
 
-	if (c->x86 == 0xf && c->x86_model < 0x14
+	if (c->family == 0xf && c->model < 0x14
 	    && cpu_has(c, X86_FEATURE_LAHF_LM)) {
 		/*
 		 * Some BIOSes incorrectly force this feature, but only K8
@@ -1056,12 +1056,12 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 
 	amd_init_ssbd(c);
 
-	if (c->x86 == 0x17)
+	if (c->family == 0x17)
 		amd_init_spectral_chicken();
 
 	/* Probe for NSCB on Zen2 CPUs when not virtualised */
 	if (!cpu_has_hypervisor && !cpu_has_nscb && c == &boot_cpu_data &&
-	    c->x86 == 0x17)
+	    c->family == 0x17)
 		detect_zen2_null_seg_behaviour();
 
 	/*
@@ -1083,7 +1083,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	if (c == &boot_cpu_data && !cpu_has_clflushopt)
 		setup_force_cpu_cap(X86_BUG_CLFLUSH_MFENCE);
 
-	switch(c->x86)
+	switch(c->family)
 	{
 	case 0xf ... 0x11:
 		disable_c1e(NULL);
@@ -1133,15 +1133,15 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		if (cpu_has(c, X86_FEATURE_ITSC)) {
 			__set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
 			__set_bit(X86_FEATURE_NONSTOP_TSC, c->x86_capability);
-			if (c->x86 != 0x11)
+			if (c->family != 0x11)
 				__set_bit(X86_FEATURE_TSC_RELIABLE,
 					  c->x86_capability);
 		}
 	}
 
 	/* re-enable TopologyExtensions if switched off by BIOS */
-	if ((c->x86 == 0x15) &&
-	    (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) &&
+	if ((c->family == 0x15) &&
+	    (c->model >= 0x10) && (c->model <= 0x1f) &&
 	    !cpu_has(c, X86_FEATURE_TOPOEXT) &&
 	    !rdmsr_safe(MSR_K8_EXT_FEATURE_MASK, &value)) {
 		value |= 1ULL << 54;
@@ -1158,14 +1158,14 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * The way access filter has a performance penalty on some workloads.
 	 * Disable it on the affected CPUs.
 	 */
-	if (c->x86 == 0x15 && c->x86_model >= 0x02 && c->x86_model < 0x20 &&
+	if (c->family == 0x15 && c->model >= 0x02 && c->model < 0x20 &&
 	    !rdmsr_safe(MSR_AMD64_IC_CFG, &value) && (value & 0x1e) != 0x1e)
 		wrmsr_safe(MSR_AMD64_IC_CFG, value | 0x1e);
 
         amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
-	if (c->x86 == 0x10)
+	if (c->family == 0x10)
 		__clear_bit(X86_FEATURE_MONITOR, c->x86_capability);
 
 	if (!cpu_has_amd_erratum(c, AMD_ERRATUM_121))
@@ -1182,7 +1182,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 		       "*** Pass \"allow_unsafe\" if you're trusting"
 		       " all your (PV) guest kernels. ***\n");
 
-	if (c->x86 == 0x16 && c->x86_model <= 0xf) {
+	if (c->family == 0x16 && c->model <= 0xf) {
 		if (c == &boot_cpu_data) {
 			l = pci_conf_read32(PCI_SBDF(0, 0, 0x18, 3), 0x58);
 			h = pci_conf_read32(PCI_SBDF(0, 0, 0x18, 3), 0x5c);
@@ -1215,7 +1215,7 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	/* AMD CPUs do not support SYSENTER outside of legacy mode. */
 	__clear_bit(X86_FEATURE_SEP, c->x86_capability);
 
-	if (c->x86 == 0x10) {
+	if (c->family == 0x10) {
 		/* do this for boot cpu */
 		if (c == &boot_cpu_data)
 			check_enable_amd_mmconf_dmi();
@@ -1238,14 +1238,14 @@ static void cf_check init_amd(struct cpuinfo_x86 *c)
 	 * Family 0x12 and above processors have APIC timer
 	 * running in deep C states.
 	 */
-	if ( opt_arat && c->x86 > 0x11 )
+	if ( opt_arat && c->family > 0x11 )
 		__set_bit(X86_FEATURE_XEN_ARAT, c->x86_capability);
 
 	/*
 	 * Prior to Family 0x14, perf counters are not reset during warm reboot.
 	 * We have to reset them manually.
 	 */
-	if (nmi_watchdog != NMI_LOCAL_APIC && c->x86 < 0x14) {
+	if (nmi_watchdog != NMI_LOCAL_APIC && c->family < 0x14) {
 		wrmsrl(MSR_K7_PERFCTR0, 0);
 		wrmsrl(MSR_K7_PERFCTR1, 0);
 		wrmsrl(MSR_K7_PERFCTR2, 0);
@@ -1290,7 +1290,7 @@ static int __init cf_check amd_check_erratum_1474(void)
 	s_time_t delta;
 
 	if (cpu_has_hypervisor ||
-	    (boot_cpu_data.x86 != 0x17 && boot_cpu_data.x86 != 0x18))
+	    (boot_cpu_data.family != 0x17 && boot_cpu_data.family != 0x18))
 		return 0;
 
 	/*
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index a3c1fd1262..fba1e25c31 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -245,8 +245,8 @@ static bool pci_cfg_ok(struct domain *currd, unsigned int start,
     start |= CF8_ADDR_LO(currd->arch.pci_cf8);
     /* AMD extended configuration space access? */
     if ( CF8_ADDR_HI(currd->arch.pci_cf8) &&
-         boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
-         boot_cpu_data.x86 >= 0x10 && boot_cpu_data.x86 < 0x17 )
+         boot_cpu_data.vendor == X86_VENDOR_AMD &&
+         boot_cpu_data.family >= 0x10 && boot_cpu_data.family < 0x17 )
     {
         uint64_t msr_val;
 
@@ -870,7 +870,7 @@ static uint64_t guest_efer(const struct domain *d)
      */
     if ( is_pv_32bit_domain(d) )
         val &= ~(EFER_LME | EFER_LMA |
-                 (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL
+                 (boot_cpu_data.vendor == X86_VENDOR_INTEL
                   ? EFER_SCE : 0));
     return val;
 }
@@ -959,7 +959,7 @@ static int cf_check read_msr(
     case MSR_K8_PSTATE5:
     case MSR_K8_PSTATE6:
     case MSR_K8_PSTATE7:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD )
             break;
         if ( unlikely(is_cpufreq_controller(currd)) )
             goto normal;
@@ -967,8 +967,8 @@ static int cf_check read_msr(
         return X86EMUL_OKAY;
 
     case MSR_FAM10H_MMIO_CONF_BASE:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
-             boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 >= 0x17 )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+             boot_cpu_data.family < 0x10 || boot_cpu_data.family >= 0x17 )
             break;
         /* fall through */
     case MSR_AMD64_NB_CFG:
@@ -992,13 +992,13 @@ static int cf_check read_msr(
     case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
     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.x86_vendor == X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
         {
             vpmu_msr = true;
             /* fall through */
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.x86_vendor &
+            if ( vpmu_msr || (boot_cpu_data.vendor &
                               (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             {
                 if ( vpmu_do_rdmsr(reg, val) )
@@ -1101,7 +1101,7 @@ static int cf_check write_msr(
     case MSR_K8_PSTATE6:
     case MSR_K8_PSTATE7:
     case MSR_K8_HWCR:
-        if ( !(boot_cpu_data.x86_vendor &
+        if ( !(boot_cpu_data.vendor &
                (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             break;
         if ( likely(!is_cpufreq_controller(currd)) ||
@@ -1120,8 +1120,8 @@ static int cf_check write_msr(
         break;
 
     case MSR_FAM10H_MMIO_CONF_BASE:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_AMD ||
-             boot_cpu_data.x86 < 0x10 || boot_cpu_data.x86 >= 0x17 )
+        if ( boot_cpu_data.vendor != X86_VENDOR_AMD ||
+             boot_cpu_data.family < 0x10 || boot_cpu_data.family >= 0x17 )
             break;
         if ( !is_hwdom_pinned_vcpu(curr) )
             return X86EMUL_OKAY;
@@ -1149,7 +1149,7 @@ static int cf_check write_msr(
 
     case MSR_IA32_MPERF:
     case MSR_IA32_APERF:
-        if ( !(boot_cpu_data.x86_vendor &
+        if ( !(boot_cpu_data.vendor &
                (X86_VENDOR_INTEL | X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             break;
         if ( likely(!is_cpufreq_controller(currd)) ||
@@ -1159,7 +1159,7 @@ static int cf_check write_msr(
 
     case MSR_IA32_THERM_CONTROL:
     case MSR_IA32_ENERGY_PERF_BIAS:
-        if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor != X86_VENDOR_INTEL )
             break;
         if ( !is_hwdom_pinned_vcpu(curr) || wrmsr_safe(reg, val) == 0 )
             return X86EMUL_OKAY;
@@ -1169,12 +1169,12 @@ static int cf_check write_msr(
     case MSR_P6_EVNTSEL(0) ... MSR_P6_EVNTSEL(3):
     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.x86_vendor == X86_VENDOR_INTEL )
+        if ( boot_cpu_data.vendor == X86_VENDOR_INTEL )
         {
             vpmu_msr = true;
     case MSR_AMD_FAM15H_EVNTSEL0 ... MSR_AMD_FAM15H_PERFCTR5:
     case MSR_K7_EVNTSEL0 ... MSR_K7_PERFCTR3:
-            if ( vpmu_msr || (boot_cpu_data.x86_vendor &
+            if ( vpmu_msr || (boot_cpu_data.vendor &
                               (X86_VENDOR_AMD | X86_VENDOR_HYGON)) )
             {
                 if ( (vpmu_mode & XENPMU_MODE_ALL) &&
--
generated by git-patchbot for /home/xen/git/xen.git#master


From xen-changelog-bounces@lists.xenproject.org Thu Feb 26 14:55:23 2026
Return-path: <xen-changelog-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Feb 2026 14:55:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.1241994.1542784 (Exim 4.92)
	(envelope-from <xen-changelog-bounces@lists.xenproject.org>)
	id 1vvclv-00014N-06; Thu, 26 Feb 2026 14:55:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 1241994.1542784; Thu, 26 Feb 2026 14: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 1vvclu-00014F-Tb; Thu, 26 Feb 2026 14:55:22 +0000
Received: by outflank-mailman (input) for mailman id 1241994;
 Thu, 26 Feb 2026 14: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 1vvclu-000146-B9
 for xen-changelog@lists.xenproject.org; Thu, 26 Feb 2026 14: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 1vvclu-00BEqT-10
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14:55:22 +0000
Received: from xen by xenbits.xenproject.org with local (Exim 4.96)
 (envelope-from <infra@xenproject.org>) id 1vvclu-0073EM-0s
 for xen-changelog@lists.xenproject.org;
 Thu, 26 Feb 2026 14: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=JmxA5QwinYpt8Lf6as7flO6PiGO6XroHCIua2G05CVQ=; b=a4DERs/pEJAitt2dkzt9sNoh6S
	54W7Tp5Bcq+I8S2LasRnDwb5ELe26Xntff73XwFZXPYDSWe7KjtMzkQfp6lQTq5g6F4bYzCtplnTQ
	3ppvca34hNWMHNbxlmLBCnLSYoJEu6pENg1+Ji4G5zSjTek438W6yPHLrJnQ6H2Vw2vE=;
From: patchbot@xen.org
To: xen-changelog@lists.xenproject.org
Reply-To: xen-devel@lists.xenproject.org
Subject: [xen master] x86/shadow: don't use #if in unlikely() invocation
Message-Id: <E1vvclu-0073EM-0s@xenbits.xenproject.org>
Date: Thu, 26 Feb 2026 14:55:22 +0000

commit 79a53b6f6ec79b9beefb912d5d38c9fdc420885b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Feb 26 13:33:36 2026 +0100
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Feb 26 13:33:36 2026 +0100

    x86/shadow: don't use #if in unlikely() invocation
    
    As per the standard this is UB, i.e. we're building on an extension in
    the compilers we use (for gcc, see "The C Preprocessor" section
    "Directives Within Macro Arguments"). Misra C:2012 rule 20.6 disallows
    this altogether, though.
    
    Combine the fix with some tidying: Fold the two level-1 checks, adjust in
    particular comment style, and move the unlikely() use to a single inner
    part of the conditional.
    
    No functional change intended.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/mm/shadow/multi.c | 55 +++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/multi.c b/xen/arch/x86/mm/shadow/multi.c
index 593532defc..f95da9ffd2 100644
--- a/xen/arch/x86/mm/shadow/multi.c
+++ b/xen/arch/x86/mm/shadow/multi.c
@@ -634,35 +634,36 @@ _sh_propagate(struct vcpu *v,
         sflags |= _PAGE_UC;
     }
 
-    // protect guest page tables
-    //
-    if ( unlikely((level == 1)
-                  && sh_mfn_is_a_page_table(target_mfn)
-#if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC )
-                  /* Unless the page is out of sync and the guest is
-                     writing to it. */
-                  && !(mfn_oos_may_write(target_mfn)
-                       && (ft == ft_demand_write))
-#endif /* OOS */
-                  ) )
-        sflags &= ~_PAGE_RW;
-
-    /*
-     * shadow_mode_log_dirty support
-     *
-     * Only allow the guest write access to a page a) on a demand fault,
-     * or b) if the page is already marked as dirty.
-     *
-     * (We handle log-dirty entirely inside the shadow code, without using the
-     * p2m_ram_logdirty p2m type: only HAP uses that.)
-     */
-    if ( level == 1 && unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
+    if ( level == 1 )
     {
-        if ( ft & FETCH_TYPE_WRITE )
-            paging_mark_dirty(d, target_mfn);
-        else if ( (sflags & _PAGE_RW) &&
-                  !paging_mfn_is_dirty(d, target_mfn) )
+        /* Protect guest page tables. */
+        if ( unlikely(sh_mfn_is_a_page_table(target_mfn))
+#if SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC
+             /*
+              * Unless the page is out of sync and the guest is writing to it.
+              */
+             && (ft != ft_demand_write || !mfn_oos_may_write(target_mfn))
+#endif /* OOS */
+           )
             sflags &= ~_PAGE_RW;
+
+        /*
+         * shadow_mode_log_dirty support
+         *
+         * Only allow the guest write access to a page a) on a demand fault,
+         * or b) if the page is already marked as dirty.
+         *
+         * (We handle log-dirty entirely inside the shadow code, without using
+         * the p2m_ram_logdirty p2m type: only HAP uses that.)
+         */
+        if ( unlikely(paging_mode_log_dirty(d)) && !mmio_mfn )
+        {
+            if ( ft & FETCH_TYPE_WRITE )
+                paging_mark_dirty(d, target_mfn);
+            else if ( (sflags & _PAGE_RW) &&
+                      !paging_mfn_is_dirty(d, target_mfn) )
+                sflags &= ~_PAGE_RW;
+        }
     }
 
     // PV guests in 64-bit mode use two different page tables for user vs
--
generated by git-patchbot for /home/xen/git/xen.git#master


